:root {
      --bg: #0b1020;
      --panel: rgba(8,12,26,0.72);
      --chip: rgba(255,255,255,0.10);
      --accent: #7c5cff; /* primary */
      --accent-2: #3aa6ff; /* light-blue accent — matches the logo mark */
      --ok: #2ecc71;
      --bad: #ff5c7c;
      --text: #ffffff;
      --muted: #ced3e6;
    }
    * { box-sizing: border-box; }
    html, body { 
      height: 100%; 
      overscroll-behavior: none; /* Prevent browser swipe navigation */
    }
    body {
      touch-action: pan-x pan-y; /* Allow normal touch but prevent browser gestures */
      margin: 0; background: radial-gradient(1200px 800px at 20% -10%, #13254e 0%, var(--bg) 45%),
                  radial-gradient(1400px 900px at 120% 120%, #1a2d66 0%, var(--bg) 40%);
      color: var(--text); font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
      overflow: hidden;
    }
    #app { position: relative; height: 100%; width: 100%; }
    #pano { position: absolute; inset: 0; z-index: 0; touch-action: manipulation; }
    #shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to bottom, rgba(0,0,0,.12), rgba(0,0,0,.35)); }

    .hud { position: absolute; inset: 0; pointer-events: none; display: grid; grid-template-rows: auto 1fr auto; padding: 16px; gap: 16px; z-index: 2; }
    .hud, .hud * { text-shadow: 0 1px 2px rgba(0,0,0,.45); }
    .topbar, .bottombar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .topbar { flex-wrap: wrap; }

    .badge { pointer-events: auto; user-select: none; backdrop-filter: blur(10px); background: var(--panel);
      border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; padding: 10px 14px; display:flex; gap:10px; align-items:center;
      box-shadow: 0 6px 20px rgba(0,0,0,.25); }

    .brand { font-weight: 800; letter-spacing: 0.3px; display:flex; align-items:center; gap:8px; }
    .brand .logo { width: auto; height: 26px; display:block; } /* width follows the trimmed aspect */
    .brand .wordmark { display:flex; gap:0; align-items:baseline; font-size: 16px; }
    .brand .wordmark .name { letter-spacing: 0.2px; }
    .brand .wordmark .accent { color: var(--accent-2); }
    .brand .wordmark em { font-style: normal; opacity: 0.85; font-weight: 600; font-size: 12px; letter-spacing: 0.1px; margin-left: 0; }

    .stats { gap: 0; padding: 7px 6px; }
    .stat { display:flex; flex-direction:column; gap:3px; align-items:center; justify-content:center; color: var(--muted); font-weight:600; padding: 0 14px; position: relative; min-width: 56px; }
    .stat + .stat::before { content:''; position:absolute; left:0; top:50%; transform:translateY(-50%); width:1px; height:20px; background:rgba(255,255,255,.12); }
    .stat .label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
    .stat strong { color: var(--text); font-size: 15px; line-height: 1.1; }
    .stat .dim { color: var(--muted); font-size: 12px; font-weight: 700; }
    .hearts { font-size: 13px; letter-spacing: 1px; white-space: nowrap; line-height: 1.3; }

    .card { pointer-events: auto; user-select: none; backdrop-filter: blur(10px); background: var(--panel);
      border: 1px solid rgba(255,255,255,0.14); border-radius: 18px; padding: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }

    .options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
    .option { background: var(--chip); border: 1px solid rgba(255,255,255,0.2);
      border-radius: 14px; padding: 12px; text-align:center; cursor: pointer; font-weight:800;
      transition: transform .08s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
      box-shadow: 0 8px 22px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.12); color: var(--text); }
    .option:hover { transform: translateY(-1px); }
    .option:active { transform: translateY(1px) scale(.99); }
    .option.correct { background: rgba(46, 204, 113, 0.3); border-color: var(--ok); }
    .option.wrong { background: rgba(255, 92, 124, 0.3); border-color: var(--bad); }

    .controls { display:flex; gap: 10px; align-items:center; pointer-events: auto; }
    .btn { background: linear-gradient(180deg, #ffffff22, #ffffff10); border: 1px solid rgba(255,255,255,0.24); color: var(--text);
      border-radius: 12px; padding: 10px 14px; font-weight:800; cursor: pointer; transition: transform .08s ease, box-shadow .2s ease;
      box-shadow: 0 10px 28px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.18); text-decoration:none; display:inline-flex; align-items:center; }
    .btn:hover { transform: translateY(-1px); }
    .btn:active { transform: translateY(1px) scale(.99); }
    .btn.primary { background: linear-gradient(180deg, var(--accent), #5b36ff); border-color: #7c5cff; }
    #next:disabled { display: none; }
    .btn.ghost { background: rgba(255,255,255,0.08); }

    /* Compact control buttons in the top bar */
    .topbar .controls { gap: 8px; }
    .topbar .controls .btn { padding: 7px 12px; font-weight: 600; font-size: 13px; border-radius: 10px; box-shadow: none; white-space: nowrap; }
    .topbar .controls select.btn { font-family: inherit; font-size: 13px; font-weight: 600; }

    /* Desktop: no ⋯ menu — the wrapper is layout-invisible and children flow inline,
       ordered to match the classic bar (Daily · World · Timer · Remove 2 · 🔊 · ?) */
    .menu-toggle { display: none; }
    .menu-items { display: contents; }
    #timerBadge { order: 0; }
    #dailyBtn { order: 1; }
    #regionFilter { order: 2; }
    #modeBtn { order: 3; }
    #lifeline { order: 4; }
    #soundBtn { order: 5; }
    #keyboardHelp { order: 6; }
    .menu-toggle { order: 7; }

    .toast { position: absolute; left: 50%; transform: translateX(-50%); padding: 12px 16px; border-radius: 12px; font-weight:800; display:none; z-index: 9; max-width: min(440px, 92vw);
      text-align: center; white-space: pre-line; /* pre-line honors \n as a line break */
      backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
    /* Green is reserved for actual success (a correct guess), red for failure.
       Neutral/informational toasts use the site blue so green keeps its meaning. */
    .toast.info { background: rgba(21,94,168,.92); border:1px solid var(--accent-2); }
    .toast.ok { background: rgba(33,150,83,.92); border:1px solid var(--ok); }
    .toast.bad { background: rgba(196,54,80,.92); border:1px solid var(--bad); }
    /* The toast sits inside .hud (pointer-events:none); the close button must opt back in */
    .toast.has-close { width: min(420px, 92vw); padding-bottom: 40px; } /* fixed width so each sentence gets its own line */
    .toast-close { pointer-events: auto; position: absolute; right: 8px; bottom: 8px; margin: 0; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.3); color: var(--text);
      border-radius: 8px; width: 28px; height: 28px; font-weight: 800; cursor: pointer; line-height: 1; padding: 0; }
    .toast-close:hover { background: rgba(0,0,0,.5); }
    
    /* Quick floating points indicator */
    .points-flash {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(1);
      font-size: 48px;
      font-weight: 900;
      color: #ff5c7c;
      text-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 40px rgba(255,92,124,0.5);
      z-index: 99999;
      pointer-events: none;
      opacity: 0;
      transition: all 0.4s ease-out;
    }
    .points-flash.show {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1.2);
    }
    .points-flash.fade {
      opacity: 0;
      transform: translate(-50%, -80%) scale(0.8);
    }

    /* Round progress: thin line pinned to the top edge of the screen */
    .progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: rgba(255,255,255,0.08); overflow: hidden; z-index: 30; pointer-events: none; }
    .progress > span { display:block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width .3s ease; }

    /* High score display */
    .high-score-display { cursor: pointer; border-radius: 8px; transition: background 0.2s ease; }
    .high-score-display:hover { background: rgba(255,255,255,0.08); }
    .high-score-display strong { color: var(--accent-2); }

    /* Timer */
    .timerBadge { font-weight: 700; font-size: 13px; background: rgba(32,227,178,.12); border:1px solid rgba(32,227,178,.4); color:#8df0d8; padding:6px 10px; border-radius: 10px; white-space: nowrap; }
    .timerBar { height: 8px; width: 240px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.24); border-radius: 999px; overflow: hidden; margin-top: 10px; }
    .timerBar > span { display:block; height: 100%; background: linear-gradient(90deg, #20e3b2, #00d4ff); width: 100%; transition: width .2s linear; }

    /* Mini map card */
    .minimap-card { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); width: 340px; z-index: 3; }
    /* Retired: the corner ✕ overlapped the map and clipped. The ✕ beside Open is the close control. */
    .minimap-card .mini-close { display: none; }
    #miniMap { width: 100%; height: 220px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); }
    .mini-map-meta { display:flex; align-items:center; justify-content:space-between; gap: 8px; margin-top: 10px; }
    .mini-map-meta .coords { font-weight: 800; letter-spacing: .2px; color: var(--text); }

    /* Floating HUD toggle — subtle until hovered; the only UI show/hide control */
    /* right:64px clears Google's Street View zoom control (bottom-right); mobile moves it to the left instead */
    .fab { position: fixed; right: 64px; bottom: 16px; z-index: 5; border-radius: 999px; padding: 12px 14px; font-weight: 800; cursor: pointer;
      border: 1px solid rgba(255,255,255,.22); background: rgba(8,12,26,.85); color: var(--text); box-shadow: 0 10px 28px rgba(0,0,0,.4);
      opacity: .7; transition: opacity .2s ease; }
    .fab:hover { opacity: 1; }

    /* Mobile-only helpers (hidden on desktop) */
    .sheet-grip{display:none;}
    .sheet-handle{display:none;}
    #closeMiniMapRow{display:inline-flex;} /* close control on both desktop and mobile */

    /* Modal */
    /* Modals sit above everything — mobile's sheet/toggle/fab use very high z-indexes */
    .modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); display:none; align-items:center; justify-content:center; padding: 20px; z-index: 100000; }
    .modal { width: min(820px, 92vw); background: rgba(18,24,48,.92); border:1px solid rgba(255,255,255,.15); border-radius: 18px; padding: 22px; box-shadow: 0 40px 120px rgba(0,0,0,.55); }
    .modal h2 { margin: 0 0 8px; font-size: 26px; }
    .modal p { margin: 0 0 16px; color: var(--muted); }
    .field { display:flex; gap:10px; }
    .field input { flex:1; padding:12px 14px; border-radius: 12px; border:1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: var(--text); font-size: 15px; }
    .mini { font-size: 12px; color: var(--muted); }

    @media (max-width: 980px) {
      .options { grid-template-columns: 1fr 1fr; }
      .minimap-card { width: min(320px, 42vw); top:auto; bottom: 92px; transform: none; }
    }

    @media (max-width: 680px) {
      .hud { 
        padding: 10px; 
        padding-top: max(50px, calc(env(safe-area-inset-top, 44px) + 10px));
        gap: 10px; 
      }
      /* One slim top row: stats + (Remove 2 · ⋯); everything else lives in the ⋯ menu */
      .topbar { flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 6px; }
      .bottombar { flex-direction: column; align-items: stretch; gap: 8px; }
      .badge { padding: 6px 8px; }
      .topbar .stats { flex: 1; min-width: 0; }
      .topbar .controls { flex: 0 0 auto; flex-wrap: nowrap; gap: 6px; }
      .bottombar .controls { flex-wrap: wrap; gap: 8px; }
      .bottombar .controls .btn { flex: 1 0 auto; }
      .bottombar .controls .btn.primary { width: 100%; justify-content: center; }
      .options { grid-template-columns: 1fr; }
      
      /* Smaller answer options on mobile */
      .options .option {
        padding: 8px 10px; /* Reduced padding */
        font-size: 14px; /* Smaller font */
      }
      
      .options .option div {
        font-size: 16px !important; /* Smaller flag and country name */
      }
      
      /* Hide prompt by default on mobile, show only when answers are visible */
      .bottombar #prompt {
        display: none; /* Hidden by default on mobile */
      }
      
      .bottombar.answers-visible #prompt {
        display: block; /* Show when answers are visible */
      }
      
      /* Lower the answers box to not show partial answers */
      .bottombar.answers-visible {
        --sheet-offset: 0px !important;
      }
      
      /* Ensure bottom sheet shows grip handle by default on mobile only */
      .bottombar.mobile-sheet-enabled {
        --sheet-offset: calc(100vh - 60px) !important; /* Show 60px for the grip */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
      }
      
      /* Ensure desktop NEVER gets mobile sheet behavior */
      .bottombar:not(.mobile-sheet-enabled) {
        --sheet-offset: 0px !important;
        --sheet-height: auto !important;
        position: relative !important;
        transform: none !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: rgba(18,24,48,.94) !important;
        border-top: 1px solid rgba(255,255,255,.15) !important;
        border-radius: 0 !important;
        padding: 12px !important;
        margin: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10 !important;
        transition: none !important;
        overflow: visible !important;
      }
      
      /* Hide MapGuess.co logo and text on mobile */
      .topbar .brand {
        display: none !important;
      }
      
      /* Best lives in the end modal — drop it from the cramped mobile stats row */
      #highScoreDisplay { display: none !important; }

      /* ⋯ menu: toggle visible, items become a dropdown under the controls */
      .topbar .controls { position: relative; }
      .menu-toggle { display: inline-flex !important; min-width: 40px; justify-content: center; }
      .menu-items {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        min-width: 190px;
        padding: 10px;
        background: rgba(10, 14, 30, .96);
        border: 1px solid rgba(255,255,255,.15);
        border-radius: 14px;
        box-shadow: 0 14px 36px rgba(0,0,0,.55);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 60;
      }
      .controls.menu-open .menu-items { display: flex; }
      .menu-items .btn { width: 100%; justify-content: center; }
      /* Native selects left-align their label — center it to match the buttons */
      .menu-items select.btn { text-align: center; text-align-last: center; }
      
      /* Hide the separate Show Answers button since we're using the slider */
      .answers-toggle {
        display: none !important;
      }
      
      /* Sheet grip retired — the floating Show/Hide Answers button is the toggle */
      .sheet-grip { display: none !important; }

      /* Pulse animation for Guess the Country text */
      @keyframes pulse {
        0% {
          text-shadow: 0 0 5px rgba(46,204,113,0.5);
          transform: scale(1);
        }
        50% {
          text-shadow: 0 0 20px rgba(46,204,113,0.8), 0 0 30px rgba(46,204,113,0.6);
          transform: scale(1.05);
        }
        100% {
          text-shadow: 0 0 5px rgba(46,204,113,0.5);
          transform: scale(1);
        }
      }
      
      /* Move UI button to bottom left on mobile */
      #hudFab {
        left: 16px !important;
        right: auto !important;
      }
      /* Hide the UI fab while the answer sheet is open — it overlaps Next Round */
      body:has(.bottombar.answers-visible) #hudFab {
        display: none;
      }
      /* While the end/daily modal is up, hide the mobile sheet + its bottom New Game
         bar — the modal has its own New Game button, so the bar is redundant here */
      body.end-modal-open #mobileSheet,
      body.end-modal-open #answersToggle {
        display: none !important;
      }
      
      /* Position toast just under the (now single-row) header */
      .toast {
        top: 120px !important;
        bottom: auto !important;
      }

      /* Keep stats tidy on small screens — everything must fit one 375px row */
      .stats { display:flex; flex-wrap:nowrap; justify-content:space-between; overflow: hidden; }
      .stats .stat { padding: 0 3px; min-width: 0; flex: 1; }
      .stat .label { font-size: 8px; letter-spacing: .05em; }
      .stat strong { font-size: 13px; }
      .stat .dim { font-size: 10px; }
      .hearts { font-size: 11px; letter-spacing: 0; }
      .topbar .controls .btn { padding: 6px 8px; }
      .menu-toggle { min-width: 34px !important; }

      /* Transparent brand header on mobile */
      .topbar .brand {
        background: transparent;
        border-color: transparent;
        box-shadow: none;
        backdrop-filter: none;
      }
      
      /* Sleek, minimal controls section on mobile */
      .topbar .controls {
        background: rgba(0,0,0,0.3);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 12px;
        backdrop-filter: blur(10px);
        padding: 8px 12px;
        gap: 6px;
      }
      
      /* Minimal button styling */
      .topbar .controls .btn {
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 8px;
        padding: 6px 10px;
        font-size: 13px;
        font-weight: 500;
        transition: all 0.2s ease;
      }
      
      .topbar .controls .btn:hover {
        background: rgba(255,255,255,0.15);
        border-color: rgba(255,255,255,0.3);
      }
      
      .topbar .controls .btn:disabled {
        background: rgba(255,255,255,0.05);
        border-color: rgba(255,255,255,0.1);
        opacity: 0.5;
      }
      
      /* Timer badge styling */
      .topbar .controls .timerBadge {
        background: rgba(46,204,113,0.2);
        border: 1px solid rgba(46,204,113,0.3);
        border-radius: 6px;
        padding: 4px 8px;
        font-size: 12px;
        font-weight: 600;
      }

      /* Bottom sheet (mobile only) */
      .bottombar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998;
        background: rgba(18,24,48,.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(255,255,255,.15);
        border-radius: 14px 14px 0 0;
        max-height: 55vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform .3s ease;
        padding: 12px;
        padding-bottom: 20px;
      }
      .bottombar.answers-visible {
        transform: translateY(0) !important;
      }
      .bottombar .controls {
        position: sticky;
        bottom: 0;
        background: rgba(18,24,48,.98);
        padding: 12px 0 0;
        margin: 12px -12px -20px;
        padding-bottom: env(safe-area-inset-bottom, 12px);
      }
      .bottombar.dragging { transition: none; }
      .sheet-grip { display: none; } /* Hidden - using button toggle instead */
      .sheet-grip span { width: 44px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.45); }
      .bottombar .card { max-height: calc(100% - 64px); overflow:auto; }

      /* Mobile: mini-map floats over the panorama, just above the answer sheet —
         the pano is dead space once the round is answered */
      .minimap-card {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: calc(55vh + 12px); /* sheet is max-height 55vh */
        width: auto;
        transform: none;
        margin: 0;
        padding: 10px;
        z-index: 9999;
      }
      #miniMap { height: 140px; }
      /* Mobile close lives in the button row next to Open — bigger tap target
         than the corner ✕, which stays desktop-only */
      .minimap-card .mini-close { display: none; }
      #closeMiniMapRow { display: inline-flex; }
      /* Leaflet's own attribution covers it — skip the duplicate line on small screens */
      .minimap-card > .mini { display: none; }
      /* Copying raw coords is a desktop niche — Open covers it on phones */
      #copyCoords { display: none; }
      
      /* Show Answers Button - mobile only */
      .answers-toggle {
        display: block !important;
        position: fixed !important;
        bottom: 60px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background: rgba(15, 23, 42, 0.9) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        border: 1px solid rgba(255,255,255,0.15) !important;
        border-radius: 20px !important;
        padding: 10px 20px !important;
        color: white !important;
        font-weight: 600 !important;
        font-size: 14px !important;
        box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
        z-index: 99999 !important;
        cursor: pointer !important;
        transition: bottom 0.3s ease !important;
      }
      
      .answers-toggle:active {
        transform: translateX(-50%) scale(0.95) !important;
      }

      /* Sheet open → the floating pill disappears; the sheet's own handle closes it.
         Two stable affordances instead of one button that jumps across the screen. */
      .answers-toggle.expanded {
        display: none !important;
      }

      .bottombar.answers-visible .sheet-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 30px;      /* generous tap/drag zone; only the pill is visible */
        border: none;
        background: transparent;
        padding: 0;
        cursor: grab;
        touch-action: none;    /* claim the vertical drag instead of letting it scroll */
        pointer-events: auto;  /* .hud is pointer-events:none; the handle must opt back in */
      }
      .sheet-handle::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255,255,255,.4);
      }
      
      /* (Legacy control-nudging hacks removed — they shoved the whole Street View
         canvas 20px left, leaving a gray gutter. Mobile has no edge controls now.) */
    }
      
    /* Desktop: Keep original modal behavior */
    @media (min-width: 681px) {
        /* Leave room at the top-right for Google's Street View fullscreen button */
        .topbar .controls { margin-right: 52px; }

        .minimap-card {
          position: fixed;
          right: 16px;
          top: 50%; 
          transform: translateY(-50%); 
          width: 340px; 
          z-index: 3; 
          margin-top: 0;
          /* no border-top/padding-top overrides (mobile-sheet leftovers) — the card's
             own 1px border + 14px padding now apply evenly on all sides */
        }
        #miniMap { height: 220px; }
        
        /* Desktop: Show full bottom bar with countries always visible */
        .bottombar {
          --sheet-offset: 0px !important; /* Show full bottom bar on desktop */
          --sheet-height: auto !important;
          position: relative !important;
          transform: none !important;
          height: auto !important;
          min-height: auto !important;
          max-height: none !important;
          background: transparent !important;
          border: none !important;
          border-radius: 0 !important;
          padding: 12px !important;
          margin: 0 !important;
          bottom: 0 !important;
          left: 0 !important;
          right: 0 !important;
          z-index: 10 !important;
          display: flex !important;
          flex-direction: column !important;
          align-items: center !important;
          visibility: visible !important;
          opacity: 1 !important;
          transition: none !important;
          overflow: visible !important;
        }
        
        /* Hide the sheet grip on desktop */
        .sheet-grip {
          display: none !important;
          visibility: hidden !important;
          opacity: 0 !important;
          pointer-events: none !important;
          height: 0 !important;
          width: 0 !important;
          overflow: hidden !important;
        }
        
        /* Hide any grip text on desktop */
        .grip-text {
          display: none !important;
          visibility: hidden !important;
          opacity: 0 !important;
        }
        
        /* Hide ALL grip-related content on desktop */
        .bottombar .sheet-grip,
        .bottombar .sheet-grip *,
        .bottombar [id*="grip"],
        .bottombar [class*="grip"] {
          display: none !important;
          visibility: hidden !important;
          opacity: 0 !important;
          pointer-events: none !important;
          height: 0 !important;
          width: 0 !important;
          overflow: hidden !important;
          position: absolute !important;
          top: -9999px !important;
          left: -9999px !important;
        }
        
        /* Ensure countries are always visible on desktop */
        .bottombar .card {
          display: block !important;
          max-height: none !important;
          min-height: auto !important;
          height: auto !important;
          overflow: visible !important;
          opacity: 1 !important;
          visibility: visible !important;
          position: relative !important;
          transform: none !important;
        }
        
        /* Ensure options are always visible on desktop */
        .bottombar .options {
          display: flex !important;
          flex-wrap: wrap !important;
          justify-content: center !important;
          gap: 10px !important;
          opacity: 1 !important;
          visibility: visible !important;
          max-width: 900px !important;
          width: 100% !important;
        }
        
        /* Show the prompt on desktop */
        .bottombar #prompt {
          display: block !important;
        }
        
        /* Force hearts to stay in one line on desktop */
        .hearts {
          flex-wrap: nowrap !important;
          white-space: nowrap !important;
          overflow: hidden !important;
        }
        
        .stats {
          flex-wrap: nowrap !important;
          white-space: nowrap !important;
        }
        
        .stat {
          flex-wrap: nowrap !important;
          white-space: nowrap !important;
        }
        
        /* Hide Show Answers button on desktop */
        .answers-toggle { display: none !important; }
        
        /* Toast position on desktop */
        .toast { top: 300px !important; bottom: auto !important; }
        
        /* Center prompt text */
        .bottombar #prompt { text-align: center !important; }
        
        /* Transparent card background */
        .bottombar .card { 
          background: transparent !important; 
          backdrop-filter: none !important; 
          border: none !important;
          box-shadow: none !important;
          padding: 0 !important;
        }
        
        /* Country option buttons styling */
        .bottombar .options .option {
          background: rgba(8,12,26,0.72) !important;
          backdrop-filter: blur(10px) !important;
          border: 1px solid rgba(255,255,255,0.2) !important;
          flex: 0 1 auto !important;
          min-width: 120px !important;
          max-width: 180px !important;
        }
        
        /* Correct/wrong answer states */
        .bottombar .options .option.correct {
          background: rgba(46, 204, 113, 0.3) !important;
          border-color: var(--ok) !important;
        }
        .bottombar .options .option.wrong {
          background: rgba(255, 92, 124, 0.3) !important;
          border-color: var(--bad) !important;
        }
    }

    /* End-of-game modal */
    .congrats-modal { position: relative; width: min(500px, 90vw); text-align: center; }
    /* Close ✕ — lets players dismiss the summary to see the last round's reveal map */
    .congrats-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 10px;
      border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.3); color: var(--text); font-weight: 800;
      cursor: pointer; line-height: 1; padding: 0; }
    .congrats-close:hover { background: rgba(0,0,0,.5); }
    .congrats-modal #recapMap { height: 200px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); margin: 14px 0 6px; }
    .congrats-modal .challenge-result { font-size: 16px; font-weight: 700; margin: 10px 0; color: var(--text); }
    .congrats-modal h2 { font-size: 32px; margin-bottom: 16px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
    .congrats-modal .score-display { font-size: 48px; font-weight: 800; margin: 20px 0; color: var(--ok); }
    .congrats-modal .high-score { font-size: 18px; color: var(--accent-2); margin: 10px 0; font-weight: 600; }
    .congrats-modal .new-record { font-size: 20px; color: var(--ok); margin: 10px 0; font-weight: 800; animation: pulse 2s ease-in-out infinite; }
    .congrats-modal .round-info { font-size: 16px; color: var(--muted); margin: 16px 0; }
    .congrats-modal .btn { margin-top: 20px; }
    
    /* Keyboard shortcuts */
    kbd { display: inline-block; padding: 4px 8px; font-family: monospace; font-size: 13px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; color: var(--text); min-width: 28px; text-align: center; white-space: nowrap; }

    /* How to Play sections */
    .help-section { margin: 0 0 16px; padding: 12px 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; }
    .help-section h3 { margin: 0 0 6px; font-size: 15px; color: var(--accent-2); }
    .help-section p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
    .help-section ul { color: var(--muted); font-size: 14px; line-height: 1.6; }
    .help-section strong { color: var(--text); }
    /* Keyboard section is desktop-only */
    @media (max-width: 680px) { #helpKeyboard { display: none; } }
    #loadError { text-align:center; padding:8px; }
    #loadError[hidden] { display:none; }
    #loadError p { max-width:440px; margin:0 auto 10px; }
    .option[hidden] { display:none !important; }
    button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline:3px solid var(--accent-2); outline-offset:3px; }

    .round-notes { margin-top:8px; font-size:12px; color:var(--muted); }
    .round-notes summary { cursor:pointer; }
    .modal { max-height:calc(100dvh - 40px); overflow-y:auto; }
    @media (max-width:680px) {
      #mobileSheet:not(.answers-visible) { visibility:hidden !important; pointer-events:none; }
      #mobileSheet.answers-visible { visibility:visible !important; pointer-events:auto; }
      .round-notes p { max-height:4.5em; overflow-y:auto; }
    }
