html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #05070b;
  overflow: hidden;
}

/* ================================================================
   Splash Screen
   ================================================================ */

#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070b;
  cursor: pointer;
  /* Fade-out triggered by JS adding .splash-dismissed */
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

#splash-screen.splash-dismissed {
  opacity: 0;
  pointer-events: none;
}

/* Subtle animated dot grid */
.splash-bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(79, 209, 232, 0.18) 1px, transparent 1px);
  background-size: 36px 36px;
  animation: splash-grid-drift 20s linear infinite;
  opacity: 0;
  animation: splash-grid-in 1.2s 0.3s ease both, splash-grid-drift 24s 1.5s linear infinite;
}

@keyframes splash-grid-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes splash-grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 36px 36px; }
}

/* Vignette over the grid */
#splash-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 70% at 50% 50%, transparent 30%, #05070b 100%);
  pointer-events: none;
}

/* Centre content sits above the grid + vignette */
.splash-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ---- Logo ---- */
.splash-logo {
  font: 800 clamp(64px, 14vw, 120px)/1 'Outfit', sans-serif;
  letter-spacing: 0.06em;
  display: flex;
  align-items: baseline;
  gap: 0;
  /* Whole logo fades + rises in */
  animation: splash-logo-in 0.8s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes splash-logo-in {
  from { opacity: 0; transform: translateY(24px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}

.splash-s1 {
  background: linear-gradient(135deg, #7fe8ff, #4fd1e8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 22px rgba(79, 209, 232, 0.55));
  animation: splash-s1-in 0.7s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes splash-s1-in {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: none; }
}

.splash-s2 {
  background: linear-gradient(135deg, #4fd1e8, #c792ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: splash-s2-in 0.7s 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes splash-s2-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}

.splash-bang {
  background: linear-gradient(135deg, #c792ff, #ff79c6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(199, 146, 255, 0.6));
  animation: splash-bang-in 0.6s 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes splash-bang-in {
  from { opacity: 0; transform: scale(0.5) rotate(-15deg); }
  to   { opacity: 1; transform: none; }
}

/* ---- Snake trail SVG ---- */
.splash-snake-line {
  width: min(320px, 70vw);
  opacity: 0;
  animation: splash-trail-in 0.8s 0.7s ease both;
}

@keyframes splash-trail-in {
  from { opacity: 0; transform: scaleX(0.6); }
  to   { opacity: 1; transform: none; }
}

.splash-trail {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: splash-trail-draw 1.2s 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards,
             splash-trail-shimmer 3s 2.2s ease-in-out infinite;
}

@keyframes splash-trail-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes splash-trail-shimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* ---- "Click anywhere" prompt ---- */
.splash-prompt {
  margin: 0;
  font: 400 14px/1 'Outfit', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4a5f74;
  animation: splash-prompt-in 0.6s 1.2s ease both,
             splash-prompt-pulse 2.2s 2s ease-in-out infinite;
}

@keyframes splash-prompt-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes splash-prompt-pulse {
  0%, 100% { color: #4a5f74; }
  50%       { color: #7fe8ff; }
}

/* Mobile: "Tap" instead of "Click" is set by JS; font scales down */
@media (max-width: 480px) {
  .splash-prompt { font-size: 12px; }
}


#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
  /* Touch drags steer the snake — never scroll/zoom the page. */
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#pause-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 280px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 32px;
  background: rgba(15, 21, 32, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(79, 209, 232, 0.25);
  border-radius: 16px;
  color: #e8f0f8;
  font: 16px/1.4 'Outfit', sans-serif;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(79, 209, 232, 0.1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#pause-menu[hidden] {
  display: none;
}

#pause-menu h2 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #7fe8ff;
  text-shadow: 0 0 10px rgba(127, 232, 255, 0.3);
}

#pause-menu label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  color: #9fb3c8;
}

#pause-menu input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

#pause-menu input[type="range"]:hover {
  background: rgba(255, 255, 255, 0.15);
}

#pause-menu input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4fd1e8;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(79, 209, 232, 0.8);
  transition: transform 0.1s, background-color 0.1s;
}

#pause-menu input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #7fe8ff;
}

#pause-menu input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: #4fd1e8;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(79, 209, 232, 0.8);
  transition: transform 0.1s, background-color 0.1s;
}

#pause-menu input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #7fe8ff;
}

#pause-menu label.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.volume-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  color: #9fb3c8;
}

.volume-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#pause-menu input[type="checkbox"] {
  accent-color: #4fd1e8;
  width: 16px;
  height: 16px;
}

#pause-menu button {
  margin-top: 4px;
  padding: 10px 0;
  background: #4fd1e8;
  color: #0f1520;
  border: none;
  border-radius: 8px;
  font: 800 16px 'Outfit', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 209, 232, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#pause-menu button:hover {
  background: #7fe8ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 209, 232, 0.5);
}

#pause-menu button:active {
  transform: translateY(0);
}

.pause-hint {
  margin: 2px 0 0;
  font-size: 13px;
  color: #9fb3c8;
}

#track-name {
  margin: 0;
  font-size: 13px;
  color: #4fd1e8;
}

#dev-section {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #3a4a63;
  text-align: left;
}

#dev-section summary {
  cursor: pointer;
  color: #9fb3c8;
  font-size: 14px;
  font-weight: bold;
  user-select: none;
}

#dev-section label {
  margin-top: 12px;
}

.dev-val {
  color: #4fd1e8;
  font-weight: normal;
}

.dev-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.dev-row label {
  margin: 0 !important;
  font-size: 14px;
}

.dev-row select {
  background: #121d30;
  color: #e8f0f8;
  border: 1px solid #3a4a63;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.dev-row button {
  background: #4fd1e8;
  color: #0b0f19;
  border: none;
  border-radius: 4px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s;
}

.dev-row button:hover {
  opacity: 0.9;
}

#leaderboard-container {
  position: fixed;
  top: 50%;
  right: 3vw;
  transform: translateY(-50%);
  z-index: 5;
  width: 200px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 18px 20px;
  background: rgba(15, 21, 32, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(79, 209, 232, 0.15);
  border-radius: 16px;
  color: #e8f0f8;
  font: 14px/1.4 'Outfit', sans-serif;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

#leaderboard-container[hidden] {
  display: none;
}

/* Phone portrait: the panel's vertically-centered right-side position
   collides with the horizontally-and-vertically-centered start/game-over
   canvas text (title, subtitle, hint). Dock it to the bottom instead so
   the two never overlap. Height is capped in dvh, not vh: vh resolves
   against the browser's large (address-bar-hidden) viewport, which is
   taller than what's actually visible when the address bar is showing —
   that mismatch was making the panel taller on-screen than intended and
   pushing its top edge into the hint text above it. dvh tracks the real
   visible viewport instead. */
@media (max-width: 700px) and (orientation: portrait) {
  #leaderboard-container {
    top: auto;
    right: auto;
    bottom: max(14px, env(safe-area-inset-bottom) + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: min(90vw, 320px);
    max-height: 22dvh;
    padding: 14px 16px;
    font-size: 13px;
  }
}

#leaderboard-container h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9fb3c8;
  text-align: center;
}

.menu-section-header, .lb-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  margin-bottom: 8px;
}

.lb-tabs {
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(79, 209, 232, 0.15);
}

.lb-tab-btn {
  padding: 3px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #7a96b0;
  font: 600 11px 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-tab-btn:hover {
  color: #e8f0f8;
  background: rgba(79, 209, 232, 0.08);
}

.lb-tab-btn.lb-tab-active {
  background: rgba(79, 209, 232, 0.22);
  color: #7fe8ff;
  box-shadow: 0 0 8px rgba(79, 209, 232, 0.2);
}

.hs-platform-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(79, 209, 232, 0.18);
  color: #7fe8ff;
  font: 600 12px 'Outfit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

#leaderboard-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rank;
}

#leaderboard-list li {
  counter-increment: rank;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
}

#leaderboard-list li::before {
  content: counter(rank) ".";
  width: 18px;
  flex: none;
  color: #9fb3c8;
  font-size: 13px;
}

#leaderboard-list .lb-name {
  flex: 1;
  letter-spacing: 0.06em;
  color: #4fd1e8;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(79, 209, 232, 0.2);
}

#leaderboard-list .lb-score {
  color: #ffd257;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 210, 87, 0.25);
}

#leaderboard-container .lb-empty {
  color: #9fb3c8;
  text-align: center;
  font-size: 13px;
}

#highscore-submit-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 11, 0.55);
}

#highscore-submit-modal[hidden] {
  display: none;
}

.modal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  padding: 32px 36px;
  background: rgba(15, 21, 32, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(79, 209, 232, 0.35);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(79, 209, 232, 0.25);
  color: #e8f0f8;
  font: 16px/1.4 'Outfit', sans-serif;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.modal-card h2 span {
  color: #ffd257;
  text-shadow: 0 0 8px rgba(255, 210, 87, 0.3);
}

.modal-card p {
  margin: 0;
  color: #9fb3c8;
  font-size: 14px;
}

#hs-nickname-input {
  width: 150px;
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(79, 209, 232, 0.2);
  border-radius: 8px;
  color: #e8f0f8;
  font: bold 22px 'Share Tech Mono', monospace;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

#hs-nickname-input:focus {
  outline: none;
  border-color: #4fd1e8;
  box-shadow: 0 0 0 2px rgba(79, 209, 232, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.hs-error {
  color: #ff6b4a !important;
  font-size: 13px;
}

.hs-error[hidden] {
  display: none;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.modal-actions button {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  font: 800 15px 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#hs-submit-btn {
  background: #4fd1e8;
  color: #0f1520;
  box-shadow: 0 4px 12px rgba(79, 209, 232, 0.3);
}

#hs-submit-btn:hover:not(:disabled) {
  background: #7fe8ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(79, 209, 232, 0.5);
}

#hs-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

#hs-submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

#hs-cancel-btn {
  background: transparent;
  color: #9fb3c8;
  border: 1px solid #3a4a63;
}

#hs-cancel-btn:hover {
  color: #e8f0f8;
  border-color: #4fd1e8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 209, 232, 0.1);
}

#hs-cancel-btn:active {
  transform: translateY(0);
}

.version-tag {
  position: absolute;
  bottom: 20px;
  left: 24px;
  font: 600 13px/1 'Share Tech Mono', monospace;
  color: rgba(127, 232, 255, 0.45);
  letter-spacing: 0.12em;
  z-index: 40;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(79, 209, 232, 0.25);
  user-select: none;
}

/* ================================================================
   Start Menu — two-column panel
   ================================================================ */

#start-menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#start-menu[hidden] {
  display: none;
}

/* The panel itself */
.menu-panel {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  width: min(820px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(79, 209, 232, 0.22);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(79, 209, 232, 0.06),
    0 20px 60px rgba(0, 0, 0, 0.75),
    0 0 80px rgba(79, 209, 232, 0.06);
  animation: menu-panel-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes menu-panel-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* Columns */
.menu-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 40px 36px;
  min-height: 0;
}

/* Section label — "Controls" / "Top Scores" */
.menu-section-label {
  font: 600 11px/1 'Outfit', sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #4a5f74;
  align-self: flex-start;
}

/* Thin gradient vertical divider */
.menu-divider {
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(79, 209, 232, 0.18) 20%,
    rgba(79, 209, 232, 0.25) 50%,
    rgba(79, 209, 232, 0.18) 80%,
    transparent 100%);
}

/* SSNAKE wordmark inside the panel */
.menu-wordmark {
  font: 800 42px/1 'Outfit', sans-serif;
  letter-spacing: 0.07em;
  background: linear-gradient(135deg, #7fe8ff 0%, #4fd1e8 45%, #c792ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(79, 209, 232, 0.4));
  margin-bottom: 4px;
  align-self: flex-start;
}

/* ---- Control-type pill buttons ---- */

.control-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.control-options--compact {
  gap: 7px;
  justify-content: center;
}

.ctrl-btn {
  padding: 9px 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(79, 209, 232, 0.18);
  border-radius: 999px;
  color: #7a96b0;
  font: 600 14px 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.control-options--compact .ctrl-btn {
  padding: 6px 14px;
  font-size: 13px;
}

.ctrl-btn:hover {
  border-color: rgba(79, 209, 232, 0.5);
  color: #e8f0f8;
  background: rgba(79, 209, 232, 0.07);
  transform: translateY(-1px);
}

.ctrl-btn.ctrl-active {
  background: rgba(79, 209, 232, 0.15);
  border-color: #4fd1e8;
  color: #7fe8ff;
  box-shadow: 0 0 12px rgba(79, 209, 232, 0.22);
}

/* ---- Hint text under the control buttons ---- */

.ctrl-hint {
  margin: -4px 0 0;
  min-height: 1.4em;
  font: 400 12px/1.4 'Outfit', sans-serif;
  color: #4a5f74;
  letter-spacing: 0.02em;
  align-self: flex-start;
}

/* ---- PLAY button ---- */

.start-play-btn {
  margin-top: 8px;
  padding: 14px 64px;
  background: linear-gradient(135deg, #4fd1e8, #6fb8ff);
  border: none;
  border-radius: 999px;
  color: #070d18;
  font: 800 17px/1 'Outfit', sans-serif;
  letter-spacing: 0.16em;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(79, 209, 232, 0.38);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation: play-pulse 2.4s ease-in-out infinite;
  align-self: flex-start;
}

@keyframes play-pulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(79, 209, 232, 0.38), 0 0 0 0 rgba(79, 209, 232, 0.3); }
  50%       { box-shadow: 0 8px 32px rgba(79, 209, 232, 0.55), 0 0 0 7px rgba(79, 209, 232, 0.0); }
}

.start-play-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 36px rgba(79, 209, 232, 0.55);
  animation: none;
}

.start-play-btn:active {
  transform: translateY(-1px) scale(1.01);
}

.start-footer {
  margin-top: auto;
  padding-top: 16px;
  font: 400 11px 'Outfit', sans-serif;
  color: #3a4f62;
  letter-spacing: 0.05em;
  align-self: flex-start;
}

/* ---- Embedded top-scores list ---- */

.menu-col--scores {
  overflow-y: auto;
}

.menu-lb-list {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rank;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-lb-list li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.028);
  transition: background 0.15s;
}

.menu-lb-list li:hover {
  background: rgba(79, 209, 232, 0.06);
}

/* Gold highlight for #1 */
.menu-lb-list li:first-child {
  background: rgba(255, 210, 87, 0.07);
  border: 1px solid rgba(255, 210, 87, 0.15);
}

.menu-lb-list li::before {
  content: counter(rank);
  width: 20px;
  flex: none;
  font: 600 12px 'Share Tech Mono', monospace;
  color: #3a4f62;
  text-align: right;
}

.menu-lb-list li:first-child::before {
  color: #ffd257;
}

.menu-lb-list .lb-name {
  flex: 1;
  font: 700 14px 'Share Tech Mono', monospace;
  letter-spacing: 0.06em;
  color: #4fd1e8;
  text-shadow: 0 0 6px rgba(79, 209, 232, 0.2);
}

.menu-lb-list li:first-child .lb-name {
  color: #ffd257;
  text-shadow: 0 0 8px rgba(255, 210, 87, 0.25);
}

.menu-lb-list .lb-score {
  font: 700 13px 'Share Tech Mono', monospace;
  color: #6b8096;
}

.menu-lb-list li:first-child .lb-score {
  color: #ffd257;
}

.menu-lb-list .lb-empty {
  font: 400 13px 'Outfit', sans-serif;
  color: #3a4f62;
  text-align: center;
  padding: 24px 0;
  margin: 0;
}

/* ---- Pause menu: hide control row on touch devices ---- */
#pause-ctrl-row[hidden] {
  display: none;
}

/* Responsive: stack columns vertically on narrow screens */
@media (max-width: 600px) {
  .menu-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1px auto;
    max-height: 88dvh;
    overflow-y: auto;
    border-radius: 18px;
  }
  .menu-col {
    padding: 28px 24px;
    align-items: center;
  }
  .menu-wordmark { align-self: center; font-size: 32px; }
  .menu-section-label { align-self: center; }
  .ctrl-hint { align-self: center; text-align: center; }
  .start-play-btn { align-self: center; }
  .start-footer { align-self: center; text-align: center; }
  .menu-divider {
    background: linear-gradient(to right,
      transparent 0%,
      rgba(79, 209, 232, 0.2) 20%,
      rgba(79, 209, 232, 0.25) 50%,
      rgba(79, 209, 232, 0.2) 80%,
      transparent 100%);
    height: 1px;
    margin: 0 24px;
  }
  .start-play-btn {
    padding: 12px 48px;
    font-size: 16px;
  }
}

