/* ==========================================================================
   trevs-theme.css — shared look for every Trev's Games page

   Load it AFTER the page's own <style> block so it wins:
       <link rel="stylesheet" href="trevs-theme.css">

   It only changes appearance (fonts, colours, shapes). No layout logic,
   IDs or JavaScript hooks are touched, so games keep working as before.
   Games stay dark, but now share the menu's type, buttons and header.
   ========================================================================== */

:root {
    /* Palette: same navy + gold as the menu, calmer teal, neutral borders */
    --navy:       #0d1b2a;
    --navy-mid:   #14263a;
    --navy-light: #1d3350;
    --gold:       #f0a500;
    --gold-light: #ffc740;
    --teal:       #5cc8b6;
    --teal-dark:  #3fa896;
    --red:        #e26a6a;
    --red-dark:   #c84f4f;
    --white:      #eef2f6;
    --muted:      #93a7ba;
    --card-bg:    #14263a;
    --border:     rgba(255, 255, 255, 0.11);

    --serif: 'Playfair Display', Georgia, serif;
    --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --radius: 6px;
}

/* ── Type: Inter for everything, Playfair Display for titles ─────────────── */
html body,
html body * { font-family: var(--sans) !important; }

html body .site-bar .brand,
html body .site-header h1,
html body .modal-card h2,
html body #scoreText { font-family: var(--serif) !important; }

/* ── Background: calm navy, no starry glow ───────────────────────────────── */
body { background: var(--navy); }
body::before {
    background: radial-gradient(ellipse at 50% -10%, rgba(240, 165, 0, 0.07), transparent 55%);
}

/* ── Site bar (matches the menu header) ──────────────────────────────────── */
.site-bar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(13, 27, 42, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.site-bar .brand {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
    text-decoration: none;
}
.site-bar .brand span { color: var(--gold); }
.site-bar ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.site-bar .nav-link {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.site-bar .nav-link:hover { color: var(--gold-light); border-color: var(--gold); }

/* ── Game title block ────────────────────────────────────────────────────── */
.site-header h1 {
    font-size: clamp(1.9rem, 4vw, 2.4rem);
    font-weight: 600;
    letter-spacing: 0;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: #fff;
    color: #fff;
}
.site-header .tagline {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--gold-light);
    margin-top: 6px;
}
.header-nav { gap: 22px; }
.feedback-link {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.btn-auth {
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 14px;
}

/* ── Cards, panels, modals ───────────────────────────────────────────────── */
#filters,
.results-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.65);
}
#filters h2 {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--gold-light);
}
#filters h2::after {
    content: "";
    display: block;
    width: 36px;
    height: 2px;
    background: var(--gold);
    margin: 10px auto 0;
}

.modal-card {
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.modal-card h2 { font-weight: 600; color: #fff; }
.modal-overlay { backdrop-filter: blur(3px); }
.how-step-num { background: var(--gold); border-radius: 50%; }
.how-note {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
}
.how-note strong { color: var(--gold-light); }
.how-divider { border-top-color: var(--border); }
/* Bold words inside a step's sentence were being forced onto their own lines
   (the step title rule matched them too). Keep them inline. */
.how-step-text p strong {
    display: inline;
    margin: 0;
    font-size: inherit;
    font-weight: 600;
}

.book-promo,
.book-promo-endgame {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* ── Form controls ───────────────────────────────────────────────────────── */
select,
input[type="text"] {
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: 4px;
}
select:focus,
input[type="text"]:focus { border-color: var(--gold); }
#latPlayerName {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 4px;
}
#latPlayerName:focus { border-color: var(--gold); }
#playerDropdown { background: var(--navy-mid); border-color: var(--border); border-radius: 4px; }
.player-dropdown-item:hover { background: rgba(240, 165, 0, 0.1); color: var(--gold-light); }

.dropdowns label.block,
#countrySection label.block { letter-spacing: 0.1em; }

/* Mode toggle: selected = solid gold */
.mode-selection label {
    border: 1px solid var(--border);
    border-radius: 3px;
    letter-spacing: 0.02em;
}
.mode-selection input[type="radio"]:checked + label {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy);
    box-shadow: none;
}
.mode-selection label:hover { border-color: var(--gold); color: var(--gold-light); }

/* Region chips: selected = gold outline + tint */
.chip-grid label {
    border: 1px solid var(--border);
    border-radius: 3px;
}
.chip-grid input[type="checkbox"]:checked + label {
    background: rgba(240, 165, 0, 0.14);
    border-color: var(--gold);
    color: var(--gold-light);
    box-shadow: none;
}
.chip-grid label:hover { border-color: var(--gold); color: var(--gold-light); }

/* ── Buttons: same flat, uppercase style as the menu ─────────────────────── */
#startGameBtn,
#submitBtn,
#tryAgainBtn,
#newGameBtn,
.modal-got-it,
.book-promo-btn,
.book-promo-endgame-btn.solid,
#quitBtn,
#acceptBtn,
#verifyMapBtn,
.book-promo-btn-outline,
.book-promo-endgame-btn:not(.solid) {
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: none;
    background-image: none;
}

/* Primary: solid gold */
#startGameBtn,
#submitBtn,
#tryAgainBtn,
#newGameBtn,
.modal-got-it,
.book-promo-btn,
.book-promo-endgame-btn.solid {
    background: var(--gold);
    color: var(--navy);
    border: 1px solid var(--gold);
}
#startGameBtn:hover,
#submitBtn:hover,
#tryAgainBtn:hover,
#newGameBtn:hover,
.modal-got-it:hover,
.book-promo-btn:hover,
.book-promo-endgame-btn.solid:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
    box-shadow: none;
    transform: translateY(-1px);
}
#startGameBtn { font-size: 0.8rem; padding-top: 12px; padding-bottom: 12px; }

/* Secondary: outlined */
#acceptBtn,
#verifyMapBtn,
.book-promo-btn-outline,
.book-promo-endgame-btn:not(.solid) {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}
#acceptBtn:hover,
#verifyMapBtn:hover,
.book-promo-btn-outline:hover,
.book-promo-endgame-btn:not(.solid):hover {
    background: rgba(240, 165, 0, 0.08);
    border-color: var(--gold);
    color: var(--gold-light);
}
#quitBtn { border: 1px solid var(--border); }

/* Text-style links */
#howToPlayBtn {
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 1;
}
#howToPlayBtn:hover { color: var(--gold-light); }
.globe-enlarge-link { color: var(--gold-light); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* ── Game screen ─────────────────────────────────────────────────────────── */
#instruction { color: var(--white); font-weight: 500; }
.cities {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--navy-mid);
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.65);
}
.city { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.city:hover { background: rgba(240, 165, 0, 0.06); }
.city:active { background: rgba(240, 165, 0, 0.1); }
.city.drag-over { background: rgba(240, 165, 0, 0.14); }

#scoreText { font-weight: 600; }

/* ── Globe: drop the teal glow ───────────────────────────────────────────── */
#interactiveGlobe,
#interactiveGlobe:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
#globeOverlayInner { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7); }

/* ── Scoreboard + stats ──────────────────────────────────────────────────── */
#scoreboardPanel .stats-label.sb-toggle {
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.03);
}
#setupStats .stat-pill span { color: var(--gold-light); }
#mapContainer { border-radius: var(--radius); }
#premiumToast { border-radius: 4px; }

/* ── Footer (matches the menu footer) ────────────────────────────────────── */
.site-footer {
    position: relative;
    z-index: 1;
    margin-top: 24px;
    padding: 28px 20px 24px;
    background: var(--navy);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
}
.site-footer .links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
}
.site-footer a {
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}
.site-footer a:hover { color: var(--gold-light); }
.site-footer .legal {
    margin-top: 12px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    opacity: 0.7;
}

/* ── Small screens: keep the header compact so the game still fits ───────── */
@media (max-width: 768px) {
    .site-bar-inner { padding: 9px 14px; }
    .site-bar .brand { font-size: 1.05rem; }
    .site-bar li:nth-child(n+2) { display: none; }   /* keep just "All Games" */
    .site-header { padding: 8px 10px 2px; }
    .site-header h1 { font-size: 1.5rem; }
    .site-header .tagline { font-size: 0.62rem; letter-spacing: 0.16em; margin-top: 3px; }
    .header-nav { gap: 14px; }
    /* Hide the footer while a round is on screen so it can't push the buttons down */
    body:has(#gameArea[style*="block"]) .site-footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
