/* Game styles using native CSS nesting scoped to #game-root */
#game-root {
  /* Container */ 
  position: relative;
  display: block;
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  --game-height: min(100svh, 600px);
  height: var(--game-height);
  min-height: 300px;
  border-radius: 16px;
  overflow: hidden; /* clip children (canvas/overlays) to rounded area */
  border: 2px solid #fff; /* border on container for perfect rounded corners */
  background: #000; /* fallback for letterboxing */
  
  /* Global minimalist scrollbar styling within the game root */
  --scroll-size: 8px;
  --scroll-thumb: rgba(255, 255, 255, 0.35);
  --scroll-thumb-hover: rgba(255, 255, 255, 0.55);
  /* Shared multi-radial aura gradient for consistent subtle glow */
  --ui-aura: 
    radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(147, 51, 234, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 60% 80%, rgba(236, 72, 153, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(251, 191, 36, 0.15) 0%, transparent 50%);
  *::-webkit-scrollbar { width: var(--scroll-size); height: var(--scroll-size); }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb { background-color: var(--scroll-thumb); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
  *::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
  *::-webkit-scrollbar-corner { background: transparent; }

  /* Canvas */
  #gameCanvas {
    max-width: 1024px;
    width: 100%;
    display: block;
    margin: 0 auto;
    background: transparent;
    border-radius: 16px; /* Match container border-radius */
  }

  /* Compact invite mode (mobile pre-start) */
  &.compact { 
    --game-height: min(60svh, 420px); 
  }
  /* Compact mode also applies to loading screen */
  &.compact .loading-content {
    h1 { font-size: 1.6rem; margin-bottom: 1.5rem; font-family: 'Silkscreen', sans-serif; }
    .loading-text { font-size: 1rem; }
    .loading-subtitle { font-size: 0.85rem; }
  }
  /* Fullscreen mode - expand to fit content but don't exceed canvas max size */
  &.is-fullscreen { 
    --game-height: min(100svh, 600px); 
    max-width: min(100vw, 1024px); 
    border-radius: 16px; /* Consistent with container */
    margin: 0 auto;
  }
  &.is-fullscreen canvas { border-radius: 16px; /* Match container */ }

  /* ==================== LOADING SCREEN ==================== */
  .loading-screen {
    position: absolute;
    inset: 0;
    background: #1e293b;
  background-image: var(--ui-aura);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    font-family: Arial, sans-serif;
    color: #fff;
    border-radius: 16px;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
  }

  .loading-content {
    max-width: 400px;
    width: 100%;
    h1 {
      font-size: 2rem;
      margin-bottom: 2rem;
      color: #e2e8f0;
      filter: drop-shadow(0 2px 4px rgba(79,209,199,0.3));
      letter-spacing: 1px;
    }
  }

  .loading-bar-container {
    width: 100%;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 2px solid rgba(79,209,199,0.3);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  }

  .loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 16px rgba(79,209,199,0.4);
    border-radius: 14px;
  }

  .loading-text {
    font-size: 1.1em;
    margin: 0 0 12px 0;
    color: #e2e8f0;
    font-weight: 600;
  }

  .loading-subtitle {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.7;
    color: #a0aec0;
    animation: fadeInOut 3s ease-in-out infinite;
  }

  @keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.9; }
  }

  /* ==================== GAME OVER OVERLAY (HTML) ==================== */
  .hidden { display: none !important; }

  .go-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 30, 0.98);
  background-image: var(--ui-aura);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
  padding: 24px; /* edge-to-edge overlay; padding controls panel breathing room */
  overflow: hidden; /* prevent nested scrollbars; inner areas handle scrolling on desktop */
  overscroll-behavior: contain; /* don't scroll parent/page while overlay is open */
  }

  .go-panel {
  width: min(720px, 92%);
  max-height: -webkit-fill-available;
  display: grid;
  grid-template-rows: auto auto 1fr; /* stats, form, leaderboard (fills) */
  gap: .5rem;
  background: rgba(10, 20, 30, 0.98);
  background-image: var(--ui-aura);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
    border: 2px solid rgba(79,209,199,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 
                0 8px 32px rgba(0,0,0,0.6),
                inset 0 1px 0 rgba(79,209,199,0.2);
    border-radius: 16px; /* Match container border-radius */
    padding: 32px 36px;
    color: #fff;
    font-family: Arial, sans-serif;
  box-sizing: border-box;
  /* Avoid double scrollbars: panel does not scroll by default; inner sections manage their own scrolling or overlay scrolls on mobile */
  overflow: hidden;
    h1 {
      margin: 0 0 20px 0;
      color: #fdfdfd;
      font-size: clamp(24px, 6vw, 32px);
      letter-spacing: 3px; font-family: 'Silkscreen', sans-serif;
      text-align: center;
      text-shadow: 0 3px 6px rgba(239,68,68,0.4);
      font-weight: 900;
    }
  }

  .go-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
    margin-bottom: 1rem;
    padding: 0;
    /* background: rgba(79,209,199,0.08);
    border-radius: 16px;
    border: 1px solid rgba(79,209,199,0.2); */
  }
  .go-stat {
    font-size: clamp(12px, 2.4vw, 16px);
    text-align: center;
    padding: .5rem;
    background: rgba(79,209,199,0.06);
    border-radius: 12px;
    border: 1px solid rgba(79,209,199,0.15);
    span { 
      color: #a0d2db; 
      margin-right: 8px; 
      font-weight: 500;
      display: block;
      font-size: 0.7em;
      margin-bottom: 4px;
    }
    strong {
      color: #e0f7fa;
      font-weight: 700;
      font-size: 1.1em;
    }
  }

  .go-form {
    margin: 16px 0 24px 0;
    label { 
      display: block; 
      color: #e2e8f0; 
      margin-bottom: 12px; 
      text-align: center;
      font-weight: 600;
      font-size: 16px;
    }
    .go-input-row { display: flex; gap: 12px; justify-content: center; align-items: center; }
    #go-name-input {
      flex: 0 1 480px;
      max-width: 480px;
      padding: 14px 16px;
      font-size: 18px;
      color: #fff;
      background: rgba(79,209,199,0.12);
      border: 2px solid rgba(79,209,199,0.3);
      border-radius: 16px; /* Match container border-radius */
      outline: none;
      transition: all 0.3s ease;
  height: auto; /* avoid unexpected tall inputs on mobile */
  max-height: 56px;
      &:focus { 
        border-color: #4fd1c7; 
        box-shadow: 0 0 0 3px rgba(79,209,199,0.2);
        background: rgba(79,209,199,0.18);
      }
    }
    .go-send-btn {
      padding: 12px 18px;
      border-radius: 12px;
      border: 2px solid #475569;
      background: #cbd5e0;
      color: #000;
      font-weight: 800;
      font-size: 16px;
      cursor: pointer;
      transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
      box-shadow: 0 3px 0 #334155, 0 4px 8px rgba(0,0,0,0.3);
      text-shadow: none;
      &:hover { background: #e2e8f0; transform: translateY(-1px); box-shadow: 0 4px 0 #334155, 0 6px 10px rgba(0,0,0,0.3); }
      &:active { transform: translateY(2px); box-shadow: 0 1px 0 #334155, 0 2px 4px rgba(0,0,0,0.3); }
    }
    .go-hint { 
      text-align: center; 
      color: #a0d2db; 
      margin-top: 8px; 
      font-size: 14px;
      opacity: 0.8;
    }
  }

  .go-leaderboard {
  min-height: 0; /* allow shrinking inside grid */
  height: auto; /* grow to available space */
  overflow-y: auto; /* single inner scroll on desktop */
  /* keep track space stable in supporting browsers, harmless elsewhere */
    padding: 16px;
    margin-bottom: 16px;
    background: rgba(79,209,199,0.08);
    border-radius: 16px;
    border: 1px solid rgba(79,209,199,0.2);
    h2 { 
      text-align: center; 
      margin: 0 0 16px 0; 
      color: #e0f7fa;
      font-weight: 700;
      font-size: 20px;
    }
    ol { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; }
    li {
      display: grid;
      grid-template-columns: auto 2fr 1fr 1fr 1fr 1.3fr;
      gap: 8px;
      padding: 10px 12px;
      align-items: center;
      margin-bottom: 6px;
      background: rgba(79,209,199,0.06);
      border-radius: 12px;
      border: 1px solid rgba(79,209,199,0.12);
      transition: all 0.2s ease;
      &:hover {
        background: rgba(79,209,199,0.12);
        border-color: rgba(79,209,199,0.25);
      }
      &.current {
        background: rgba(79,209,199,0.12);
        border: 1px solid rgba(79,209,199,0.5);
        box-shadow: 0 0 0 1px rgba(79,209,199,0.3);
        .col-name {
          background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
          -webkit-background-clip: text;
          background-clip: text;
          -webkit-text-fill-color: transparent;
        }
      }
    }
    .col-rank { width: 2.4ch; text-align: right; color: #a0d2db; font-weight: 600; }
    .col-score { text-align: right; font-weight: 700; color: #e0f7fa; }
    .col-name { 
      font-weight: 700; 
      color: #e2e8f0;
      &.editable { 
        cursor: text; 
        text-decoration: underline dotted rgba(79,209,199,0.6); 
        background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
      } 
    }
    input.name-input { 
      font: inherit; 
      padding: 6px 8px; 
      color: #fff; 
      background: rgba(79,209,199,0.15); 
      border: 1px solid rgba(79,209,199,0.4); 
      border-radius: 8px; 
      width: 100%; 
    }
  }

  /* Restart hint/action shown only on leaderboard view */
  .go-actions { 
    text-align: center; 
    margin-top: 8px; 
    color: #000;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
    border: 1px solid rgba(103,232,249,0.35);
    transition: all 0.2s ease;
    font-weight: 600;
    p { margin: 0; font-size: 15px; color: #000; text-shadow: none; }
  }

  @media (max-width: 560px) {
    .go-stats { 
      grid-template-columns: 1fr 1fr; /* Keep two columns on mobile */
      gap: 12px;
      padding: 16px;
    }
    .go-stat {
      padding: 16px 12px;
    }
    /* On small screens: full-width modal and panel, stack input/button */
    .go-overlay { 
      padding: 0; 
      overflow: auto; 
      border-radius: 0; /* Remove border radius for full screen */
      background: rgba(5, 10, 15, 0.99);
    }
    .go-panel { 
      width: 100%; 
      height: 100%;
      max-height: none; 
      overflow: visible; 
      border-radius: 0; /* Remove border radius for full screen */
      border: none; /* Remove border for full screen */
      padding: 24px 20px;
      background: transparent;
    }
    .go-form {
      .go-input-row { 
  flex-direction: column; 
  gap: 16px; 
  align-items: stretch; 
  width: 100%;
      }
      #go-name-input { 
  max-width: none; 
  width: 100%; 
  box-sizing: border-box;
  padding: 16px;
      }
  .go-send-btn { width: 100%; border-width: 3px; padding: 14px 18px; font-size: 18px; }
    }
    .go-leaderboard {
      padding: 12px;
      max-height: calc(100svh - 350px);
      min-height: 180px;
      li {
        padding: 12px 8px;
        font-size: 14px;
      }
    }
  /* .go-actions removed on mobile */
    .go-leaderboard {
      padding: 12px;
      li {
        padding: 12px 8px;
        font-size: 14px;
      }
    }
  /* .go-actions removed on mobile */
  }

  /* Game Over Overlay Scrollable */
  .gameover-overlay-scrollable {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
  background-image: var(--ui-aura);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
    color: #fff;
    z-index: 2000;
  overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 32px 0 32px 0;
    box-sizing: border-box;
  }

  /* Ultra-compact adjustments for very small viewports */
  @media (max-width: 400px), (max-height: 480px) {
    .go-panel { padding: 16px 18px; }
    .go-stat { font-size: clamp(12px, 3.6vw, 18px); }
    .go-leaderboard { max-height: calc(100svh - 320px); min-height: 160px; }
    .hud-controls { margin: 12px; padding: 8px 12px; }
  .go-leaderboard h2 { display: none; }
  /* .go-actions removed */
  }

  @media (max-width: 600px), (max-height: 500px) {
    .hud-controls {
      transform: scale(0.5);
      transform-origin: left bottom;
      margin: 0 0 0 4px;
      left: 0;
      bottom: 0;
      position: absolute;
      padding: 0;
      background: rgba(0,0,0,0.85);
      border-radius: 16px; /* Match container border-radius */
      z-index: 20;
      display: none;
    }
    #hud-controls-container {
      align-items: flex-end;
      justify-content: flex-start;
      width: auto;
      height: auto;
      min-width: 0;
      min-height: 0;
      pointer-events: none;
    }
  }

  @media (max-width: 600px) {
    .hud-controls { margin: 8px; padding: 6px 8px; border-radius: 16px; font-size: 12px; gap: 4px; display: none; }
    .hud-row { gap: 6px; }
    .hud-label { font-size: 12px; margin-right: 2px; }
    .keycap, .start-screen .keycap { min-width: 20px; padding: 1px 5px; font-size: 12px; border-width: 1.5px; }
    .start-screen {
      h1 { font-size: 1.3rem; margin-bottom: 0.7rem; font-family: 'Silkscreen', sans-serif; }
      .hint, .controls-hint { font-size: 0.9rem; margin-top: 0.7rem; }
    }
  }

  .start-screen {
    position: absolute;
    inset: 0;
    background: #1e293b;
  background-image: var(--ui-aura);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    display: flex;
    flex-direction: column;
    border-radius: 16px; /* Match container border-radius */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-family: 'Arial', sans-serif;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
  }
  /* Smaller typography in compact invite mode */
  &.compact .start-screen {
    padding: 12px;
    h1 { font-size: 1.6rem; }
    .mobile-only { font-size: 0.95rem; font-family: 'Silkscreen', sans-serif;}
  }
  .start-screen {
    h1 { 
      font-size: 2.5rem; 
      margin-bottom: 1.5rem; 
      letter-spacing: 2px;
      color: #e2e8f0; font-family: 'Silkscreen', sans-serif;
      text-shadow: 0 4px 8px rgba(0,0,0,0.3);
      filter: drop-shadow(0 2px 4px rgba(79,209,199,0.3));
    }
    .keycap { 
      display: inline-block; 
      min-width: 32px; 
      padding: 2px 10px; 
      margin: 0 2px; 
      background: #334155; 
      color: #e2e8f0; 
      border: 2px solid #4fd1c7; 
      border-radius: 6px; /* More pixel-like */
      font-weight: bold; 
      font-size: 18px; 
      text-align: center; 
      box-shadow: 0 3px 0 #1e293b, 
                  0 4px 8px rgba(0,0,0,0.4); 
      -webkit-user-select: none; 
      user-select: none; 
      transition: all 0.1s ease;
      &:hover {
        background: #475569;
        transform: translateY(-1px);
        box-shadow: 0 4px 0 #1e293b, 
                    0 5px 10px rgba(0,0,0,0.4);
      }
    }
    .hint { 
      margin-top: 1.5rem; 
      color: #67e8f9; 
      font-size: 1.1rem;
      text-shadow: 0 1px 2px rgba(0,0,0,0.5);
      background: rgba(103,232,249,0.1);
      padding: 8px 16px;
      border-radius: 16px;
      border: 1px solid rgba(103,232,249,0.3);
    }
    .controls-hint { 
      margin-top: 2rem; 
      color: #cbd5e0; 
      font-size: 1rem;
      opacity: 0.9;
    }
    > * { max-width: 92%; }
  }

  canvas { border: none; image-rendering: pixelated; border-radius: inherit; }
  @media (max-width: 400px), (max-height: 480px) {
    /* Thinner border on tiny viewports */
    & { border-width: 1px; }
  }

  #hud-controls-container {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    pointer-events: none;
    z-index: 10;
  }

  .hud-controls {
    margin: 24px;
    background: rgba(10, 20, 30, 0.9);
    background-image: var(--ui-aura);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    border: 1px solid rgba(79,209,199,0.25);
    padding: 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
  .hud-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .hud-label { color: #cbd5e0; font-size: 16px; margin-right: 4px; font-weight: 600; }
  .keycap {
    display: inline-block;
    min-width: 32px;
    padding: 2px 10px;
    margin: 0 2px;
    background: #334155;
    color: #e2e8f0;
    border: 2px solid #4fd1c7;
    border-radius: 6px; /* pixel-like */
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    box-shadow: 0 3px 0 #1e293b, 0 4px 8px rgba(0,0,0,0.4);
    -webkit-user-select: none; user-select: none;
    transition: all 0.1s ease;
  }
  .keycap:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #1e293b, 0 5px 10px rgba(0,0,0,0.4);
  }

  /* ==================== MOBILE CONTROLS ==================== */
  .mobile-controls-simple {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    width: 100%; height: 120px;
    display: none;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px 30px;
    box-sizing: border-box;
    z-index: 1000;
    pointer-events: none;
  }

  .mobile-controls-left,
  .mobile-controls-right { display: flex; align-items: center; gap: 20px; pointer-events: auto; }

  /* Simplified Control Buttons */
  .control-btn {
    border: none; 
    border-radius: 8px; /* More pixel-like */
    background: rgba(79, 209, 199, 0.2);
    color: white; 
    font-size: 16px; 
    font-weight: bold;
    cursor: pointer; 
    transition: all 0.1s ease;
    border: 3px solid rgba(79, 209, 199, 0.5);
    -webkit-user-select: none; 
    user-select: none;
    -webkit-tap-highlight-color: transparent;  
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 3px 0 rgba(79, 209, 199, 0.3);
    &:active, &.active { 
      transform: translateY(2px); 
      box-shadow: 0 1px 0 rgba(79, 209, 199, 0.3);
      background: rgba(79, 209, 199, 0.3);
    }
  }

  /* Jump */
  .jump-btn { 
    width: 100px; 
    height: 80px; 
    background: rgba(79, 209, 199, 0.25); 
    font-size: 18px;
    border-color: #4fd1c7;
    &:active, &.active { 
      background: rgba(79, 209, 199, 0.4); 
    }
  }

  /* Shoot */
  .shoot-btn { 
    width: 100px; 
    height: 80px; 
    background: rgba(239, 68, 68, 0.25); 
    font-size: 18px;
    border-color: #ef4444;
    box-shadow: 0 3px 0 rgba(239, 68, 68, 0.3);
    &:active, &.active { 
      background: rgba(239, 68, 68, 0.4);
      box-shadow: 0 1px 0 rgba(239, 68, 68, 0.3);
    }
  }

  /* Weapon */
  .weapon-btn { 
    width: 60px; 
    height: 60px; 
    background: rgba(245, 158, 11, 0.25); 
    font-size: 14px; 
    border-radius: 50%;
    border-color: #f59e0b;
    box-shadow: 0 3px 0 rgba(245, 158, 11, 0.3);
    &:active, &.active { 
      background: rgba(245, 158, 11, 0.4);
      box-shadow: 0 1px 0 rgba(245, 158, 11, 0.3);
    }
  }

  /* Mobile Responsive Adjustments */
  @media (max-width: 600px) and (orientation: portrait) {
    .mobile-controls-simple { height: 100px; padding: 15px 20px; }
    .jump-btn, .shoot-btn { width: 80px; height: 65px; font-size: 16px; }
    .weapon-btn { width: 50px; height: 50px; font-size: 12px; }
  }

  @media (max-width: 480px) {
  .mobile-controls-simple { height: 90px; padding: 8px 12px; }
    .jump-btn, .shoot-btn { width: 70px; height: 55px; font-size: 14px; }
    .weapon-btn { width: 45px; height: 45px; font-size: 11px; }
  }

  /* Landscape mode adjustments */
  @media (max-height: 500px) and (orientation: landscape) {
    .mobile-controls-simple { height: 80px; padding: 8px 20px; }
    .jump-btn, .shoot-btn { width: 80px; height: 50px; font-size: 14px; }
    .weapon-btn { width: 45px; height: 45px; font-size: 12px; }
  }

  /* Hide mobile controls on desktop */
  @media (min-width: 769px) and (min-height: 601px) {
    .mobile-controls-simple { display: none !important; }
  }

  /* Ensure touch targets are accessible */
  @media (pointer: coarse) {
    .control-btn { min-width: 44px; min-height: 44px; }
  }

  /* Mobile/Desktop visibility classes */
  .mobile-only { display: none; }
  .desktop-only { display: block; }

  /* Show mobile-only elements on mobile devices */
  @media (hover: none) and (pointer: coarse), (max-width: 768px) {
    .mobile-only { display: block; }
    .desktop-only { display: none; }
  }

  /* Additional mobile detection for touch devices */
  @media (any-hover: none) {
    .mobile-only { display: block; }
    .desktop-only { display: none; }
  }

  /* Exit Fullscreen button (positioned outside game area) */
  .fs-exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px; /* small, clean */
    border: 3px solid #475569;
    background: #cbd5e0;
  color: #000; /* plain black */
    font-weight: 800;
  font-size: 18px;
    cursor: pointer;
    display: none;
    box-shadow: 0 4px 0 #334155, 
                0 6px 8px rgba(0,0,0,0.3);
  text-shadow: none;
    transition: all 0.1s ease;
  line-height: 32px;
  text-align: center;
    &:hover {
      background: #e2e8f0;
      transform: translateY(-1px);
      box-shadow: 0 5px 0 #334155, 
                  0 7px 10px rgba(0,0,0,0.3);
    }
    &:active {
      transform: translateY(3px);
      box-shadow: 0 1px 0 #334155, 
                  0 2px 4px rgba(0,0,0,0.3);
    }
  }
  &.is-fullscreen .fs-exit-btn { display: inline-block; }
  .fs-enter-btn {
    margin-top: 12px;
    padding: 12px 24px;
    border-radius: 8px; /* More pixel-like, less rounded */
  border: 3px solid #475569;
    background: #cbd5e0;
  color: #000; /* plain black */
    font-weight: 800;
  font-size: 16px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 4px 0 #334155, 
                0 6px 8px rgba(0,0,0,0.3);
  text-shadow: none;
    position: relative;
    &:hover {
      background: #e2e8f0;
      transform: translateY(-1px);
      box-shadow: 0 5px 0 #334155, 
                  0 7px 10px rgba(0,0,0,0.3);
    }
    &:active {
      transform: translateY(3px);
      box-shadow: 0 1px 0 #334155, 
                  0 2px 4px rgba(0,0,0,0.3);
    }
  }

  @media (max-width: 400px) {
    .go-stats {
      grid-template-columns: 1fr 1fr; /* Still two columns even on very small screens */
      gap: 8px;
      padding: 12px;
    }
    .go-stat {
      padding: 12px 8px;
      font-size: clamp(13px, 2.2vw, 20px);
      span {
        font-size: 0.85em;
        margin-bottom: 3px;
      }
  /* no-op */
      strong {
        font-size: 1.05em;
      }
    }
    .loading-content h1 {
      font-size: 1.5rem;
      margin-bottom: 1.5rem;
    }
    .loading-bar-container {
      height: 20px;
    }
  }
}
