/* ========================================
   Lobby & Home Page Styles v2
   MOBILE-FIRST
======================================== */

/* ========== HOME PAGE ========== */
.home-hero {
    text-align: center;
    padding: 32px 16px;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
}

.gradient-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.hero-subtitle strong {
    color: var(--accent-green);
}

.hero-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.btn-glow {
    background: var(--gradient-green);
    color: white;
    animation: btn-pulse 2s infinite;
    width: 100%;
}

@keyframes btn-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.7);
    }
}

.home-features {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    text-align: center;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.feature-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.home-colors {
    text-align: center;
}

.colors-preview {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.color-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
            color-mix(in srgb, var(--color) 70%, white),
            var(--color));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-fast);
}

.color-ball:hover {
    transform: scale(1.2);
}

/* ========== LOBBY PAGE ========== */
.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Room/Game Cards */
.room-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.room-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-green);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

/* Status Colors */
.room-card.waiting {
    border-top: 3px solid var(--accent-green);
}

.room-card.countdown {
    border-top: 3px solid var(--accent-gold);
}

.room-card.racing {
    border-top: 3px solid var(--accent-red);
}

.room-card.finished {
    border-top: 3px solid var(--text-muted);
}

/* Card Header with Bet Amount */
.room-bet-amount {
    background: linear-gradient(135deg, var(--bg-sidebar), var(--bg-card));
    padding: 20px 16px;
    text-align: center;
    position: relative;
}

.room-coin-icon {
    width: 34px;
    height: 34px;
    margin-right: 10px;
    vertical-align: -7px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.room-bet-amount .currency {
    font-size: 0.85rem;
    color: var(--text-muted);
    vertical-align: super;
}

.room-bet-amount .amount {
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 800;
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Card Body */
.room-card-body {
    padding: 14px 16px;
}

.room-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.room-card.waiting .room-status {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.room-card.countdown .room-status {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    animation: pulse 1s infinite;
}

.room-card.racing .room-status {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.room-card.finished .room-status {
    background: rgba(110, 118, 129, 0.15);
    color: var(--text-muted);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Card Meta Info */
.room-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

.room-players {
    color: var(--text-secondary);
}

.room-pot {
    color: var(--accent-gold);
    font-weight: 600;
}

.room-round {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Enter Button */
.room-card .btn-enter {
    width: 100%;
    background: var(--gradient-green);
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
}

.room-card .btn-enter:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-green);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    grid-column: 1 / -1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

.loading-state p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-icon svg {
    width: 3rem;
    height: 3rem;
    stroke: var(--text-muted);
}

/* Status Dots */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
}

.status-dot.waiting {
    background-color: var(--accent-green);
}

.status-dot.countdown {
    background-color: var(--accent-gold);
    animation: pulse 1s infinite;
}

.status-dot.racing {
    background-color: var(--accent-red);
}

.status-dot.finished {
    background-color: var(--text-muted);
}

/* Room card inline icons */
.room-players svg,
.room-pot svg,
.btn-enter svg {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

/* Menu Toggle Button */
.btn-menu {
    display: block;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
}

/* ========== TABLET+ (min-width: 769px) ========== */
@media (min-width: 769px) {
    .home-hero {
        padding: 60px 24px;
        margin-bottom: 40px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 32px;
    }

    .hero-cta {
        flex-direction: row;
        justify-content: center;
    }

    .btn-glow {
        width: auto;
    }

    .home-features {
        margin-bottom: 40px;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 24px;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    .feature-icon {
        font-size: 2rem;
    }

    .feature-card h3 {
        font-size: 0.95rem;
    }

    .feature-card p {
        font-size: 0.8rem;
    }

    .color-ball {
        width: 40px;
        height: 40px;
    }

    .page-header {
        margin-bottom: 32px;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .room-bet-amount {
        padding: 32px 24px;
    }

    .room-bet-amount .amount {
        font-size: clamp(1.55rem, 2.35vw, 2.35rem);
    }

    .room-card-body {
        padding: 20px 24px;
    }

    .room-status {
        font-size: 0.75rem;
        padding: 6px 14px;
        margin-bottom: 16px;
    }

    .room-meta {
        font-size: 0.875rem;
        margin-bottom: 12px;
    }

    .room-card .btn-enter {
        padding: 12px;
    }

    .loading-state {
        padding: 60px;
    }

    .spinner {
        width: 48px;
        height: 48px;
    }

    .empty-state {
        padding: 60px;
    }

    .empty-icon {
        font-size: 4rem;
    }

    .empty-icon svg {
        width: 4rem;
        height: 4rem;
    }

    .btn-menu {
        display: none;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}
