/* =============================================
   Live Games Dashboard — Styles
   ============================================= */

/* ==================== PAGE BASE ==================== */
.live-page {
    background: linear-gradient(180deg, #0d0a06 0%, #1a1408 40%, #0f0c07 100%);
    color: #e8dcc8;
    min-height: 100vh;
}

/* Hide footer on live dashboard page */
.live-page .site-footer {
    display: none;
}

/* ==================== AUTH GATE ==================== */
.live-auth-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 60px 24px;
    position: relative;
    overflow: hidden;
}

.live-auth-gate::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.live-gate-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    animation: liveGatePulse 2s ease-in-out infinite;
}

@keyframes liveGatePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.live-gate-title {
    font-family: var(--font-hero);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: #c9a84c;
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.live-gate-desc {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: rgba(232, 220, 200, 0.7);
    max-width: 480px;
    line-height: 1.7;
    margin-bottom: 32px;
}

.live-gate-btn {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 40px;
    background: linear-gradient(135deg, #c9a84c, #8a6d1b);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
}

.live-gate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(201, 168, 76, 0.45);
}

.live-gate-features {
    display: flex;
    gap: 32px;
    margin-top: 48px;
    flex-wrap: wrap;
    justify-content: center;
}

.live-gate-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
}

.live-gate-feature-icon {
    font-size: 1.8rem;
}

.live-gate-feature-text {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: rgba(232, 220, 200, 0.5);
}

/* ==================== DASHBOARD LAYOUT ==================== */
.live-dashboard {
    display: none;
    padding: 80px 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.live-dashboard.active {
    display: block;
    animation: liveFadeIn 0.5s ease;
}

@keyframes liveFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard header */
.live-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.live-dash-title {
    font-family: var(--font-hero);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #c9a84c;
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-dash-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(232, 220, 200, 0.6);
}

.live-pulse {
    width: 10px;
    height: 10px;
    background: var(--color-success);
    border-radius: 50%;
    animation: livePulseAnim 1.5s ease-in-out infinite;
}

@keyframes livePulseAnim {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(46, 204, 113, 0);
    }
}

/* Stats strip */
.live-stats-strip {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.live-stat-card {
    flex: 1;
    min-width: 140px;
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    backdrop-filter: blur(8px);
    transition: transform 0.2s;
}

.live-stat-card:hover {
    transform: translateY(-2px);
}

.live-stat-icon {
    font-size: 1.6rem;
}

.live-stat-info {
    display: flex;
    flex-direction: column;
}

.live-stat-value {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: #c9a84c;
}

.live-stat-label {
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: rgba(232, 220, 200, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Main layout: games + sidebar */
.live-main-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

/* ==================== GAME CARDS ==================== */
.live-games-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.live-game-card {
    background: rgba(26, 20, 8, 0.8);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.live-game-card:hover {
    border-color: rgba(201, 168, 76, 0.3);
    box-shadow: 0 4px 24px rgba(201, 168, 76, 0.08);
}

.live-game-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: rgba(201, 168, 76, 0.04);
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
    flex-wrap: wrap;
    gap: 12px;
}

.live-game-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-game-dot {
    width: 10px;
    height: 10px;
    background: var(--color-success);
    border-radius: 50%;
    animation: livePulseAnim 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

.live-game-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: #e8dcc8;
    margin: 0;
}

.live-game-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.live-game-location {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: rgba(232, 220, 200, 0.6);
}

.live-game-timer {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: #c9a84c;
    background: rgba(201, 168, 76, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(201, 168, 76, 0.2);
}

.live-game-badge {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
    color: #fff;
}

/* Game Body */
.live-game-body {
    padding: 20px;
}

/* Progress Section */
.live-progress-section {
    margin-bottom: 20px;
}

.live-progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-family: var(--font-body);
    font-size: 0.82rem;
}

.live-progress-title {
    color: rgba(232, 220, 200, 0.7);
}

.live-progress-count {
    color: #c9a84c;
    font-weight: 600;
}

.live-progress-bar {
    position: relative;
    height: 8px;
    background: rgba(201, 168, 76, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.live-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c9a84c, #e8c65a);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.live-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: progressShimmer 1.5s ease-in-out infinite;
}

@keyframes progressShimmer {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

.live-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 2px;
}

.live-progress-step {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.15);
    border: 2px solid rgba(201, 168, 76, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: rgba(232, 220, 200, 0.4);
    font-family: var(--font-body);
    font-weight: 600;
    transition: all 0.3s;
}

.live-progress-step.completed {
    background: linear-gradient(135deg, #c9a84c, #8a6d1b);
    border-color: #c9a84c;
    color: #fff;
}

.live-progress-step.active {
    border-color: #c9a84c;
    color: #c9a84c;
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.15);
}

/* Team Section */
.live-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.live-team-avatars {
    display: flex;
    align-items: center;
}

.live-team-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    border: 2px solid #1a1408;
    margin-left: -8px;
    position: relative;
    z-index: 1;
    transition: transform 0.2s;
}

.live-team-avatar:first-child {
    margin-left: 0;
}

.live-team-avatar:hover {
    transform: scale(1.15);
    z-index: 10;
}

.live-team-label {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: rgba(232, 220, 200, 0.5);
}

.live-game-actions {
    display: flex;
    gap: 8px;
}

.live-action-btn {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    background: rgba(201, 168, 76, 0.06);
    color: #c9a84c;
    cursor: pointer;
    transition: all 0.2s;
}

.live-action-btn:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: rgba(201, 168, 76, 0.35);
}

/* Chat Section */
.live-chat-section {
    border-top: 1px solid rgba(201, 168, 76, 0.08);
    padding-top: 16px;
}

.live-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.live-chat-title {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(232, 220, 200, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-chat-count {
    font-size: 0.68rem;
    background: rgba(201, 168, 76, 0.15);
    color: #c9a84c;
    padding: 2px 8px;
    border-radius: 10px;
}

.live-messages {
    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 168, 76, 0.2) transparent;
}

.live-messages::-webkit-scrollbar {
    width: 4px;
}

.live-messages::-webkit-scrollbar-track {
    background: transparent;
}

.live-messages::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.2);
    border-radius: 4px;
}

.live-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    animation: liveMsgIn 0.3s ease;
}

@keyframes liveMsgIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.live-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.live-msg-content {
    flex: 1;
    min-width: 0;
}

.live-msg-user {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    margin-right: 6px;
}

.live-msg-text {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: rgba(232, 220, 200, 0.85);
    line-height: 1.4;
}

.live-msg-time {
    font-family: var(--font-body);
    font-size: 0.65rem;
    color: rgba(232, 220, 200, 0.35);
    margin-top: 2px;
}

/* System message */
.live-msg.system {
    justify-content: center;
    padding: 4px 0;
}

.live-msg.system .live-msg-text {
    font-size: 0.72rem;
    color: rgba(201, 168, 76, 0.5);
    font-style: italic;
    text-align: center;
}

/* Typing indicator */
.live-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0 8px;
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: rgba(232, 220, 200, 0.4);
}

.live-typing-dots {
    display: flex;
    gap: 3px;
}

.live-typing-dot {
    width: 4px;
    height: 4px;
    background: rgba(201, 168, 76, 0.5);
    border-radius: 50%;
    animation: typingBounce 1.2s ease-in-out infinite;
}

.live-typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.live-typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-4px);
    }
}

/* Chat input */
.live-chat-input-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.live-chat-input {
    flex: 1;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 10px;
    color: #e8dcc8;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.live-chat-input:focus {
    border-color: rgba(201, 168, 76, 0.4);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

.live-chat-input::placeholder {
    color: rgba(232, 220, 200, 0.3);
}

.live-chat-send {
    padding: 10px 18px;
    background: linear-gradient(135deg, #c9a84c, #8a6d1b);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(201, 168, 76, 0.3);
}

/* ==================== SIDEBAR ==================== */
.live-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 88px;
    align-self: start;
}

.live-sidebar-card {
    background: rgba(26, 20, 8, 0.8);
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.live-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.08);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: #c9a84c;
}

.live-sidebar-header span:first-child {
    font-size: 1.2rem;
}

.live-sidebar-body {
    padding: 14px 18px;
}

/* ==================== LEADERBOARD ==================== */
.live-lb-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.live-lb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.06);
    transition: background 0.2s;
}

.live-lb-item:last-child {
    border-bottom: none;
}

.live-lb-item:hover {
    background: rgba(201, 168, 76, 0.04);
    margin: 0 -18px;
    padding-left: 18px;
    padding-right: 18px;
}

.live-lb-rank {
    width: 24px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(232, 220, 200, 0.4);
    text-align: center;
    flex-shrink: 0;
}

.live-lb-item:nth-child(1) .live-lb-rank {
    color: #f1c40f;
    font-size: 1.1rem;
}

.live-lb-item:nth-child(2) .live-lb-rank {
    color: #bdc3c7;
    font-size: 1rem;
}

.live-lb-item:nth-child(3) .live-lb-rank {
    color: #cd7f32;
    font-size: 1rem;
}

.live-lb-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.live-lb-info {
    flex: 1;
    min-width: 0;
}

.live-lb-name {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    color: #e8dcc8;
}

.live-lb-games {
    font-family: var(--font-body);
    font-size: 0.68rem;
    color: rgba(232, 220, 200, 0.4);
}

.live-lb-score {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: #c9a84c;
    text-align: right;
    flex-shrink: 0;
}

.live-lb-like {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    color: rgba(232, 220, 200, 0.4);
    padding: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.live-lb-like:hover,
.live-lb-like.liked {
    color: var(--color-error);
    transform: scale(1.2);
}

/* ==================== ACTIVITY FEED ==================== */
.live-feed-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 168, 76, 0.15) transparent;
}

.live-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.05);
    animation: liveMsgIn 0.3s ease;
}

.live-feed-item:last-child {
    border-bottom: none;
}

.live-feed-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.live-feed-text {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: rgba(232, 220, 200, 0.7);
    line-height: 1.4;
}

.live-feed-text strong {
    color: #e8dcc8;
}

.live-feed-time {
    display: block;
    font-size: 0.65rem;
    color: rgba(232, 220, 200, 0.3);
    margin-top: 2px;
}

.live-feed-empty {
    text-align: center;
    padding: 20px;
    color: rgba(232, 220, 200, 0.3);
    font-size: 0.82rem;
}

/* ==================== USER BAR ==================== */
.live-user-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid rgba(201, 168, 76, 0.08);
}

.live-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.live-user-info {
    flex: 1;
}

.live-user-name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: #e8dcc8;
}

.live-user-role {
    font-family: var(--font-body);
    font-size: 0.68rem;
    color: rgba(232, 220, 200, 0.4);
}

.live-logout-btn {
    font-family: var(--font-body);
    font-size: 0.72rem;
    padding: 5px 12px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: var(--color-error);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.live-logout-btn:hover {
    background: rgba(231, 76, 60, 0.2);
}

/* ==================== NO GAMES STATE ==================== */
.live-no-games {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.live-no-games-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.live-no-games-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #c9a84c;
    margin-bottom: 8px;
}

.live-no-games-desc {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: rgba(232, 220, 200, 0.5);
    max-width: 400px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .live-main-layout {
        grid-template-columns: 1fr;
    }

    .live-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .live-dashboard {
        padding: 72px 16px 32px;
    }

    .live-stats-strip {
        gap: 10px;
    }

    .live-stat-card {
        min-width: 120px;
        padding: 12px 14px;
    }

    .live-game-card-header {
        padding: 14px 16px;
    }

    .live-game-body {
        padding: 16px;
    }

    .live-messages {
        max-height: 160px;
    }

    .live-gate-features {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .live-stats-strip {
        flex-direction: column;
    }

    .live-game-meta {
        width: 100%;
    }

    .live-team-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==================== DARK MODE (inherently dark, but some overrides) ==================== */
[data-theme="dark"] .live-page {
    background: linear-gradient(180deg, #0a0810 0%, #111827 40%, #0a0810 100%);
}

[data-theme="dark"] .live-game-card {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(201, 168, 76, 0.1);
}

[data-theme="dark"] .live-game-card-header {
    background: rgba(201, 168, 76, 0.03);
}

[data-theme="dark"] .live-sidebar-card {
    background: rgba(17, 24, 39, 0.8);
}

[data-theme="dark"] .live-stat-card {
    background: rgba(17, 24, 39, 0.6);
}

[data-theme="dark"] .live-chat-input {
    background: rgba(17, 24, 39, 0.6);
    border-color: rgba(201, 168, 76, 0.12);
}