/* Line Hopper rank 18 — unified void arcade identity, mobile canvas and menus. */
:root {
  --lh-ink: #effaff;
  --lh-cyan: #88ebff;
  --lh-pink: #ff82c3;
  --lh-violet: #bd9dff;
  --lh-yellow: #ffe78a;
  --lh-safe-t: env(safe-area-inset-top, 0px);
  --lh-safe-r: env(safe-area-inset-right, 0px);
  --lh-safe-b: env(safe-area-inset-bottom, 0px);
  --lh-safe-l: env(safe-area-inset-left, 0px);
}
html, body, #game-root { height: 100dvh; min-height: 0; }
body {
  background: #020610;
  overflow: hidden;
}
#game-root {
  background:
    radial-gradient(ellipse 75% 75% at 45% 36%,rgba(13,72,111,.28),transparent),
    linear-gradient(145deg,#030d20,#020510 70%,#0c0924);
}
#game-root::before {
  content: ''; pointer-events: none; position: absolute; inset: 0;
  background: linear-gradient(rgba(86,215,249,.032) 1px,transparent 1px),
              linear-gradient(90deg,rgba(86,215,249,.032) 1px,transparent 1px);
  background-size: 48px 48px;
}
#game-canvas {
  max-height: 83dvh;
  border-radius: 15px;
  border: 1px solid rgba(91,211,246,.5);
  box-shadow: 0 0 0 5px rgba(70,206,247,.04),0 10px 45px rgba(0,0,0,.68),0 0 28px rgba(60,208,250,.14);
}
.hud {
  padding: calc(8px + var(--lh-safe-t)) calc(8px + var(--lh-safe-r)) 0 calc(8px + var(--lh-safe-l));
}
.hud-top { width: min(98vw,calc(83dvh * 16 / 9)); }
.hud-chip {
  max-width: min(65vw,420px);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border-radius: 11px;
  padding: 8px 12px;
  background: rgba(5,19,38,.93);
  border: 1px solid rgba(103,220,249,.35);
  color: #bcefff;
  font-size: 12px;
  box-shadow: inset 0 1px rgba(255,255,255,.12);
}
.hud-chip.combo { color: var(--lh-yellow); }
.icon-btn {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border-radius: 12px; border: 1px solid rgba(110,219,246,.4);
  background: rgba(5,19,38,.92);
  color: #f1fbff;
}
.grade-flash { color: var(--lh-yellow); font-size: clamp(10px,2.7vw,14px); }
.screen {
  overflow-y: auto;
  padding: max(13px,var(--lh-safe-t)) max(13px,var(--lh-safe-r)) max(13px,var(--lh-safe-b)) max(13px,var(--lh-safe-l));
  overscroll-behavior: contain;
}
#screen-title, .overlay-screen, #screen-howto, #screen-levels {
  background:
    radial-gradient(ellipse at 50% 22%,rgba(21,110,155,.25),transparent 66%),
    rgba(2,7,20,.91);
  backdrop-filter: blur(8px);
}
.title-card, .panel-card {
  position: relative;
  flex: 0 0 auto;
  width: min(92vw,440px);
  max-height: calc(100dvh - 28px);
  padding: clamp(19px, 4vh, 33px) clamp(16px, 4vw, 29px);
  gap: 13px;
  margin: auto;
  border: 1px solid rgba(102,222,252,.5);
  border-radius: 23px;
  background: linear-gradient(145deg,rgba(29,76,115,.28),rgba(7,21,42,.98) 46%,rgba(7,11,31,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12),0 20px 65px rgba(0,0,0,.6),0 0 0 5px rgba(63,200,249,.04);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.title-card::before, .panel-card::before {
  content: ''; position: absolute; height: 2px; top: 0; left: 21%; right: 21%;
  background: linear-gradient(90deg,transparent,#6de6ff,transparent);
}
.menu-kicker {
  color: #9cecff; font-size: 9px; font-weight: 900; letter-spacing: .19em;
}
.title-runner {
  width: 39px; height: 39px; border: 1px solid #bbf5ff;
  border-radius: 8px; transform: rotate(12deg);
  background: linear-gradient(135deg,#fafdff,#89ecff);
  box-shadow: 0 0 23px rgba(125,226,255,.35);
}
.game-title {
  color: #f4faff; font-size: clamp(17px,4.8vw,26px);
  line-height: 1.25; letter-spacing: -.07em;
  text-shadow: 0 0 17px rgba(86,208,251,.35);
}
.subtitle { font-size: 13px; line-height: 1.5; margin: 0; color: #bdcee8; opacity: 1; text-align: center; }
.menu-highlights { width: 100%; display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; }
.menu-highlights span {
  padding: 5px 7px; font: 800 10px 'Nunito',sans-serif;
  background: rgba(85,168,210,.12); color: #b7d9ee;
  border: 1px solid rgba(103,215,242,.2); border-radius: 8px;
}
.menu-buttons { gap: 8px; }
.btn-pixel {
  min-height: 46px; border-radius: 12px;
  border: 1px solid rgba(124,211,247,.18);
  box-shadow: none;
  font-size: 13px; font-weight: 900;
  letter-spacing: .07em;
}
.btn-primary { color: #042238; background: linear-gradient(120deg,#b8f8ff,#4fd6fa); border-color: #c4faff; box-shadow: 0 7px 21px rgba(38,190,235,.22); }
.btn-secondary { background: rgba(83,95,169,.23); color: #dfdafa; border-color: rgba(191,162,247,.3); }
.btn-text { background: rgba(12,32,53,.3); color: #b7d9ed; }
.btn-pixel:hover { filter: brightness(1.13); }
.title-footer { opacity: 1; color: #a5bacd; padding-top: 4px; border-top: 1px solid rgba(115,217,247,.12); }
.title-footer .btn-pixel { min-width: 44px; min-height: 44px; }
.panel-card h2 { color: #c0f2ff; font-size: clamp(13px,3.1vw,17px); line-height: 1.5; }
.howto-list { color: #ccdfeb; }
.howto-list strong { color: #9cecff; }
.chapter-tabs { width: 100%; flex-wrap: nowrap; justify-content: start; overflow-x: auto; padding-bottom: 4px; }
.chapter-tab {
  flex: 0 0 auto;
  min-height: 44px; border-radius: 9px; border: 1px solid rgba(131,194,238,.3);
  color: #d9eaff; background: rgba(34,58,91,.55); font: 800 11px 'Nunito',sans-serif;
}
.chapter-tab.active { color: #06233b; background: #8be7ff; border-color: #b7f5ff; }
.levels-card { max-width: 580px; }
.level-grid { max-height: min(50vh,420px); gap: 7px; }
.level-tile {
  min-width: 0; min-height: 48px; padding: 4px;
  background: rgba(22,54,88,.66); color: #e7f7ff;
  border-color: rgba(114,214,250,.35);
  border-radius: 10px; font: 800 13px 'Nunito',sans-serif;
}
.level-tile.locked, .level-tile:disabled { opacity: .36; cursor: not-allowed; }
.level-tile:not(:disabled):hover { background: rgba(46,111,149,.7); }
.results-score-val { color: #f2e79b; font-size: clamp(19px,4.8vw,27px); }
.result-detail { text-align: center; color: #bbd0df; line-height: 1.4; }
.nn-score-nudge { border: 1px solid rgba(103,219,246,.25); background: rgba(10,43,72,.37); color: #d8ecf6; }
.nn-nudge-btns { flex-wrap: wrap; }
.nn-nudge-signup, .nn-nudge-later { min-height: 44px; display: inline-flex; align-items: center; }
:focus-visible { outline: 3px solid #ffe381; outline-offset: 3px; }
@media(max-width: 680px) and (orientation: portrait) {
  /* Taller undistorted window into the fixed 960x540 world: crop horizontally. */
  #game-canvas {
    width: calc(100vw - var(--lh-safe-l) - var(--lh-safe-r) - 10px);
    height: calc(100dvh - var(--lh-safe-t) - var(--lh-safe-b) - 112px);
    max-height: calc(100dvh - var(--lh-safe-t) - var(--lh-safe-b) - 112px);
    aspect-ratio: auto;
  }
  #hud .hud-top { width: calc(100vw - var(--lh-safe-l) - var(--lh-safe-r) - 16px); }
  .title-card, .panel-card { width: min(95vw,440px); padding: 18px 16px; }
  .game-title { font-size: clamp(16px,5vw,24px); }
}
@media(max-height: 560px) {
  .title-card, .panel-card { padding: 12px 14px; gap: 8px; max-height: calc(100dvh - 14px); }
  .title-runner { display: none; }
  .menu-kicker { font-size: 8px; }
  .level-grid { max-height: 46dvh; }
  .screen { align-items: flex-start; }
}
@media(prefers-reduced-motion: reduce) {
  .title-runner, .btn-pixel, .screen { animation: none !important; transition: none !important; }
}
