/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
    --bg-main: #070b10;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-elevated: rgba(31, 41, 55, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --blue: #3b82f6;
    --purple: #a855f7;
    --red: #ef4444;
    --green: #10b981;
    --gold: #fbbf24;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 80px;
    /* Space for bottom nav */
    overflow-x: hidden;
}

/* =========================================================
   TOP HEADER
   ========================================================= */
.top-header {
    background: rgba(7, 11, 16, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.9rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.08rem;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
}

.lang-icon {
    font-size: 0.9rem;
}

.lang-dropdown {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    padding-right: 0.25rem;
}

.lang-dropdown option {
    background: var(--bg-main);
    color: var(--text-primary);
}

/* =========================================================
   MAIN CONTAINER
   ========================================================= */
.main-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1rem;
}

/* =========================================================
   WATCHDOG AUTO-HIDE
   ========================================================= */
.state-monitor-node {
    transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
    max-height: 800px;
    opacity: 1;
}

.stale-hidden {
    opacity: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* =========================================================
   SECTION HEADERS
   ========================================================= */
.section-header {
    margin-bottom: 0.8rem;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.03rem;
}

/* =========================================================
   LIVE 10 ROUNDS (no boxes, old style)
   ========================================================= */
.live10-section {
    margin-bottom: 1.5rem;
    padding-top: 0.5rem;
}

.live10-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-start;
}

.live10-cell {
    background: transparent;
    border: none;
    padding: 0.35rem 0.55rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 55px;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.04);
}

.live10-val {
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.live10-under {
    display: none;
    /* Hides WON/LOST badge on home page */
}

.v-blue {
    color: var(--blue);
}

.v-purple {
    color: var(--purple);
}

.v-red {
    color: var(--red);
}

/* =========================================================
   BOTTOM NAVIGATION (Mobile-First)
   ========================================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(7, 11, 16, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 100;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.4rem 0;
    transition: color 0.2s;
}

.bottom-nav-item.active {
    color: var(--blue);
}

.bottom-nav-icon {
    font-size: 1.3rem;
    filter: grayscale(1);
    transition: filter 0.2s;
}

.bottom-nav-item.active .bottom-nav-icon {
    filter: grayscale(0);
}

.bottom-nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03rem;
}

/* =========================================================
   RESPONSIVE — PC/TABLET
   ========================================================= */
@media (min-width: 900px) {
    .main-container {
        max-width: 800px;
    }
}

/* =========================================================
   HEADER RIGHT SIDE (used on signal page)
   ========================================================= */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.logout-btn:hover {
    background: var(--red);
    color: white;
}