:root {
    --bg-main: #0A0E1A;
    --bg-card: #151A28;
    --bg-card-hover: #1A2235;
    --text-primary: #FFFFFF;
    --text-secondary: #7A8A9A;
    --accent: #00E676;
    --danger: #FF1744;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.lobby-header {
    background: linear-gradient(180deg, rgba(0,230,118,0.1) 0%, transparent 100%);
    padding: 60px 20px 40px;
    text-align: center;
}

.header-content h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #FFFFFF, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Main Container */
.lobby-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
    width: 100%;
}

/* States */
.hidden {
    display: none !important;
}

.loading-state, .empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 230, 118, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h2 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-family: 'Outfit', sans-serif;
}

/* Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Card */
.game-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: rgba(0, 230, 118, 0.2);
}

.game-card:hover::before {
    opacity: 1;
}

/* Card Header */
.card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.badge.live {
    background: rgba(255, 23, 68, 0.15);
    color: var(--danger);
}

.badge.viewers {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.game-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.game-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Score Area */
.card-score-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.2);
    padding: 16px;
    border-radius: 12px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    width: 0; /* for text truncation */
}

.team-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.team-name {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 2rem;
    background: var(--bg-main);
    padding: 8px 16px;
    border-radius: 8px;
    line-height: 1;
}

.score-sep {
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 400;
}

.chrono {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.chrono.running {
    color: #FFAB00;
}

.chrono.paused {
    color: var(--text-secondary);
}

/* Footer */
.card-footer {
    margin-top: auto;
}

.watch-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: rgba(0, 230, 118, 0.1);
    color: var(--accent);
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.watch-btn:hover {
    background: var(--accent);
    color: var(--bg-main);
}

.lobby-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lobby-footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.lobby-footer a:hover {
    color: var(--accent);
}

/* Header Actions & Search */
.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
}

.primary-btn {
    background: var(--accent);
    color: var(--bg-main);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 230, 118, 0.5);
    background: #00C853;
}

.search-container {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.search-box {
    position: relative;
    max-width: 584px;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0a6;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #dfe1e5;
    color: #202124;
    padding: 14px 20px 14px 52px;
    border-radius: 24px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.search-box input:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    border-color: rgba(223,225,229,0);
}

.search-box input:focus {
    outline: none;
    background: #ffffff;
    border-color: rgba(223,225,229,0);
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.search-box input::placeholder {
    color: #9aa0a6;
}

@media (max-width: 600px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .score-display {
        font-size: 1.5rem;
        padding: 6px 12px;
    }
}
