:root {
  --bg: #071827;
  --panel: rgba(7, 24, 39, 0.9);
  --panel-solid: #0b1724;
  --panel-bright: #101f2e;
  --text: #f7fbff;
  --muted: #b8c5d3;
  --blue: #4779ad;
  --cyan: #6fc0dc;
  --red: #e51d2a;
  --yellow: #ffd637;
  --green: #72d94d;
  --line: rgba(111, 192, 220, 0.2);
  --game-offset-x: 0px;
  --game-offset-y: 0px;
  --game-scale: 1;
  --keyboard-inset-bottom: 0px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(111, 192, 220, 0.18), transparent 30%),
    linear-gradient(135deg, #071827, #0b1724 48%, #08111b);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.game-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

.game-scale-root {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  transform: translate(var(--game-offset-x), var(--game-offset-y)) scale(var(--game-scale));
  transform-origin: 0 0;
}

.rotate-prompt {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 28px;
  background:
    repeating-linear-gradient(180deg, rgba(247, 251, 255, 0.045) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 50% 18%, rgba(111, 192, 220, 0.2), transparent 30%),
    rgba(7, 24, 39, 0.92);
}

.is-portrait .game-scale-root {
  opacity: 0.18;
  pointer-events: none;
}

.is-portrait .rotate-prompt {
  display: grid;
}

.rotate-prompt-panel {
  width: min(360px, 100%);
  border: 1px solid rgba(111, 192, 220, 0.34);
  border-radius: 8px;
  padding: 26px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(16, 31, 46, 0.98), rgba(7, 24, 39, 0.98)),
    radial-gradient(circle at 50% 0, rgba(111, 192, 220, 0.18), transparent 38%);
  box-shadow:
    inset 0 1px 0 rgba(247, 251, 255, 0.14),
    0 28px 80px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(111, 192, 220, 0.2);
}

.rotate-prompt-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  margin: 0 auto 22px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(247, 251, 255, 0.96);
}

.rotate-prompt strong {
  display: block;
  color: white;
  font-size: 34px;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.rotate-prompt p {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 800;
}

button,
input {
  font: inherit;
}

button,
.touch-controls,
.touch-stick,
.touch-stick * {
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.turnstile-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: min(320px, calc(100vw - 32px));
  min-height: 70px;
}

.shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #071827;
}

.shell:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #071827;
}

.shell.is-score-entry-sheet::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 24, 39, 0.08), rgba(7, 24, 39, 0.68)),
    rgba(7, 24, 39, 0.32);
}

.fullscreen-button {
  position: fixed;
  top: max(14px, calc(env(safe-area-inset-top) + 14px));
  right: max(14px, calc(env(safe-area-inset-right) + 14px));
  z-index: 22;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(111, 192, 220, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.14), transparent 46%),
    linear-gradient(180deg, rgba(16, 31, 46, 0.86), rgba(7, 24, 39, 0.78));
  color: white;
  box-shadow:
    inset 0 1px 0 rgba(247, 251, 255, 0.18),
    0 12px 30px rgba(0, 0, 0, 0.32),
    0 0 22px rgba(111, 192, 220, 0.16);
  cursor: pointer;
  touch-action: manipulation;
}

.fullscreen-button:hover,
.fullscreen-button:focus-visible {
  border-color: rgba(111, 192, 220, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(247, 251, 255, 0.24),
    0 0 0 3px rgba(111, 192, 220, 0.18),
    0 14px 34px rgba(0, 0, 0, 0.38),
    0 0 28px rgba(111, 192, 220, 0.22);
}

.fullscreen-button:active {
  transform: translateY(1px);
}

.fullscreen-button.is-unavailable {
  cursor: not-allowed;
  opacity: 0.58;
}

.is-portrait .fullscreen-button {
  display: none;
}

.fullscreen-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  background:
    linear-gradient(currentColor, currentColor) left top / 9px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 2px 9px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 9px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 2px 9px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 9px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 9px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 9px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 9px no-repeat;
  filter: drop-shadow(0 0 8px rgba(111, 192, 220, 0.46));
}

.fullscreen-button.is-active .fullscreen-icon {
  transform: scale(0.78);
}

.screen {
  width: 1280px;
  height: 720px;
}

.screen {
  position: relative;
  overflow: hidden;
}

.is-hidden {
  display: none !important;
}

.screen-start {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 380px;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 38px;
  background:
    linear-gradient(90deg, rgba(7, 24, 39, 0.92), rgba(7, 24, 39, 0.78) 34%, rgba(7, 24, 39, 0.28) 62%, rgba(7, 24, 39, 0.08)),
    linear-gradient(180deg, rgba(7, 24, 39, 0.32), rgba(7, 24, 39, 0.1) 42%, rgba(7, 24, 39, 0.66)),
    url("assets/images/main-screen-arcade-v1.png");
  background-position: center center;
  background-size: cover;
}

.screen-start::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(247, 251, 255, 0.045) 0 1px, transparent 1px 5px),
    linear-gradient(105deg, transparent 0 28%, rgba(111, 192, 220, 0.22) 41%, transparent 54%),
    radial-gradient(circle at 64% 20%, rgba(111, 192, 220, 0.34), transparent 18%),
    radial-gradient(circle at 91% 88%, rgba(255, 214, 55, 0.2), transparent 12%);
  mix-blend-mode: screen;
  opacity: 0.42;
  animation: arcadeSweep 9s linear infinite, scanlineDrift 1.8s linear infinite;
}

.screen-start::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 188px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(7, 24, 39, 0.84));
  z-index: 1;
}

.brand-lockup {
  position: relative;
  z-index: 2;
  width: fit-content;
}

.assist-logo-frame {
  position: relative;
  width: fit-content;
  padding: 10px 12px 12px 10px;
  overflow: hidden;
  border: 1px solid rgba(111, 192, 220, 0.48);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 214, 55, 0.34) 0 8px, transparent 8px 100%) right 12px bottom 8px / 76px 12px no-repeat,
    repeating-linear-gradient(135deg, rgba(255, 214, 55, 0.48) 0 8px, rgba(7, 24, 39, 0.42) 8px 16px) right 15px bottom 9px / 90px 10px no-repeat,
    radial-gradient(circle at 12% 12%, rgba(111, 192, 220, 0.28), transparent 24%),
    linear-gradient(180deg, rgba(247, 251, 255, 0.1), transparent 36%),
    linear-gradient(180deg, rgba(16, 31, 46, 0.86), rgba(7, 24, 39, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(247, 251, 255, 0.18),
    inset 0 0 24px rgba(111, 192, 220, 0.12),
    0 18px 44px rgba(0, 0, 0, 0.42),
    0 0 26px rgba(111, 192, 220, 0.28);
  backdrop-filter: blur(12px);
  transform: rotate(-1deg);
  transform-origin: left top;
}

.scoreboard-reset-trigger {
  cursor: pointer;
}

.scoreboard-reset-trigger:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 5px;
}

.scoreboard-reset-trigger:hover {
  filter: brightness(1.08);
}

.assist-logo-frame::before,
.assist-logo-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.assist-logo-frame::before {
  inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(247, 251, 255, 0.055) 0 1px, transparent 1px 5px),
    linear-gradient(108deg, transparent 0 36%, rgba(255, 255, 255, 0.72) 43%, rgba(111, 192, 220, 0.34) 48%, transparent 58%),
    radial-gradient(circle at 34px 23px, rgba(53, 189, 223, 0.75) 0 3px, transparent 4px),
    radial-gradient(circle at 50px 23px, rgba(255, 214, 55, 0.78) 0 3px, transparent 4px),
    radial-gradient(circle at 66px 23px, rgba(229, 29, 42, 0.62) 0 3px, transparent 4px);
  mix-blend-mode: screen;
  opacity: 0.62;
  animation: logoShine 3.2s ease-in-out infinite;
}

.assist-logo-frame::after {
  inset: 6px;
  border: 1px solid rgba(111, 192, 220, 0.3);
  border-left-color: rgba(111, 192, 220, 0.58);
  border-top-color: rgba(247, 251, 255, 0.26);
  border-right-color: rgba(111, 192, 220, 0.12);
  border-radius: 6px;
  box-shadow:
    -8px -8px 0 -7px rgba(111, 192, 220, 0.86),
    8px 8px 0 -7px rgba(255, 214, 55, 0.66),
    0 0 16px rgba(111, 192, 220, 0.16);
}

.assist-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 250px;
  height: auto;
  padding: 10px 13px;
  border-radius: 6px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.96), rgba(219, 235, 247, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 0 18px rgba(111, 192, 220, 0.2);
  filter: saturate(1.05) contrast(1.04);
}

.logo-sparkle {
  position: absolute;
  z-index: 3;
  width: var(--sparkle-size, 13px);
  height: var(--sparkle-size, 13px);
  left: var(--sparkle-x);
  top: var(--sparkle-y);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  animation: logoSparkle 2.6s ease-in-out infinite;
  animation-delay: var(--sparkle-delay, 0s);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.86)) drop-shadow(0 0 14px rgba(111, 192, 220, 0.7));
}

.logo-sparkle::before,
.logo-sparkle::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.96), transparent);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.logo-sparkle::before {
  width: 100%;
  height: 22%;
}

.logo-sparkle::after {
  width: 22%;
  height: 100%;
}

.logo-sparkle:nth-of-type(1) {
  --sparkle-x: 7%;
  --sparkle-y: 20%;
  --sparkle-size: 16px;
  --sparkle-delay: 0.2s;
}

.logo-sparkle:nth-of-type(2) {
  --sparkle-x: 32%;
  --sparkle-y: 8%;
  --sparkle-size: 10px;
  --sparkle-delay: 1.05s;
}

.logo-sparkle:nth-of-type(3) {
  --sparkle-x: 66%;
  --sparkle-y: 30%;
  --sparkle-size: 14px;
  --sparkle-delay: 1.75s;
}

.logo-sparkle:nth-of-type(4) {
  --sparkle-x: 90%;
  --sparkle-y: 18%;
  --sparkle-size: 10px;
  --sparkle-delay: 0.7s;
}

.logo-sparkle:nth-of-type(5) {
  --sparkle-x: 83%;
  --sparkle-y: 78%;
  --sparkle-size: 12px;
  --sparkle-delay: 2.25s;
}

.brand-line {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 720px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 780px;
  color: white;
  font-size: 148px;
  line-height: 0.8;
  font-style: italic;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
  -webkit-text-stroke: 2px rgba(247, 251, 255, 0.08);
  text-shadow:
    8px 8px 0 #244b75,
    0 0 18px rgba(111, 192, 220, 0.72),
    0 0 42px rgba(71, 121, 173, 0.8),
    0 20px 46px rgba(0, 0, 0, 0.72);
  animation: titlePulse 2.4s ease-in-out infinite;
}

.hero-copy p {
  margin: 26px 0 0;
  color: var(--cyan);
  font-size: 30px;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(111, 192, 220, 0.72), 0 8px 24px rgba(0, 0, 0, 0.56);
}

.entry-card,
.score-entry-card,
.leaderboard-card,
.result-panel,
.dispatch-card,
.hud > div {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(111, 192, 220, 0.08);
  backdrop-filter: blur(16px);
}

.is-performance-mode .entry-card,
.is-performance-mode .score-entry-card,
.is-performance-mode .leaderboard-card,
.is-performance-mode .result-panel,
.is-performance-mode .dispatch-card,
.is-performance-mode .hud > div {
  backdrop-filter: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(111, 192, 220, 0.08);
}

.is-performance-mode .screen-start::after,
.is-performance-mode .screen-result::after,
.is-performance-mode .logo-sparkle,
.is-performance-mode .button-sparkle,
.is-performance-mode .start-card button::after {
  animation: none;
}

.entry-card {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  grid-column: 1 / -1;
  align-items: end;
  padding: 18px;
  border-radius: 8px;
}

.start-card {
  grid-column: 1;
  grid-template-columns: minmax(260px, 360px);
  width: min(360px, 100%);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.start-card button {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
}

.start-card button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0 32%, rgba(255, 255, 255, 0.76) 45%, rgba(111, 192, 220, 0.42) 50%, transparent 62%);
  mix-blend-mode: screen;
  transform: translateX(-135%);
  animation: startButtonShine 2.7s ease-in-out infinite;
}

.start-card button:hover::after,
.start-card button:focus-visible::after {
  animation-duration: 1.45s;
}

.button-sparkle {
  position: absolute;
  z-index: 2;
  width: var(--button-sparkle-size, 14px);
  height: var(--button-sparkle-size, 14px);
  left: var(--button-sparkle-x);
  top: var(--button-sparkle-y);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  animation: logoSparkle 2.2s ease-in-out infinite;
  animation-delay: var(--button-sparkle-delay, 0s);
  filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 15px rgba(255, 214, 55, 0.5));
}

.button-sparkle::before,
.button-sparkle::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.96), transparent);
  transform: translate(-50%, -50%);
}

.button-sparkle::before {
  width: 100%;
  height: 22%;
}

.button-sparkle::after {
  width: 22%;
  height: 100%;
}

.button-sparkle:nth-of-type(1) {
  --button-sparkle-x: 8%;
  --button-sparkle-y: 20%;
  --button-sparkle-size: 18px;
  --button-sparkle-delay: 0.2s;
}

.button-sparkle:nth-of-type(2) {
  --button-sparkle-x: 38%;
  --button-sparkle-y: 5%;
  --button-sparkle-size: 12px;
  --button-sparkle-delay: 0.9s;
}

.button-sparkle:nth-of-type(3) {
  --button-sparkle-x: 76%;
  --button-sparkle-y: 18%;
  --button-sparkle-size: 15px;
  --button-sparkle-delay: 1.45s;
}

.button-sparkle:nth-of-type(4) {
  --button-sparkle-x: 93%;
  --button-sparkle-y: 72%;
  --button-sparkle-size: 13px;
  --button-sparkle-delay: 0.55s;
}

.arcade-control-strip {
  align-self: end;
  min-height: 88px;
  padding: 20px 26px;
  border-color: rgba(111, 192, 220, 0.34);
  background:
    linear-gradient(180deg, rgba(16, 31, 46, 0.92), rgba(7, 24, 39, 0.94)),
    repeating-linear-gradient(90deg, rgba(111, 192, 220, 0.08) 0 1px, transparent 1px 18px);
  box-shadow:
    inset 0 1px 0 rgba(247, 251, 255, 0.18),
    inset 0 -8px 18px rgba(0, 0, 0, 0.24),
    0 18px 46px rgba(0, 0, 0, 0.52),
    0 0 24px rgba(111, 192, 220, 0.16);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

input {
  height: 50px;
  border: 1px solid rgba(111, 192, 220, 0.24);
  border-radius: 6px;
  background: rgba(247, 251, 255, 0.08);
  color: white;
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(111, 192, 220, 0.22);
}

button {
  height: 56px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.24), transparent 45%),
    linear-gradient(180deg, #79a8d5, #4779ad 55%, #2e608e);
  color: white;
  cursor: pointer;
  font-weight: 1000;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(7, 24, 39, 0.5);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.34),
    inset 0 -5px 0 rgba(7, 24, 39, 0.22),
    0 12px 0 rgba(7, 24, 39, 0.54),
    0 0 28px rgba(111, 192, 220, 0.38);
}

button:hover {
  filter: brightness(1.06);
}

.start-card button {
  animation: buttonPulse 1.7s ease-in-out infinite;
}

.secondary-button {
  background: linear-gradient(180deg, #172c42, #0b1724);
  border: 1px solid var(--line);
}

.danger-button {
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.2), transparent 45%),
    linear-gradient(180deg, #f05a62, #e51d2a 58%, #9d1720);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.3),
    inset 0 -5px 0 rgba(7, 24, 39, 0.22),
    0 12px 0 rgba(7, 24, 39, 0.54),
    0 0 28px rgba(229, 29, 42, 0.34);
}

.reset-dialog {
  max-width: 440px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.reset-dialog::backdrop {
  background:
    repeating-linear-gradient(180deg, rgba(247, 251, 255, 0.045) 0 1px, transparent 1px 5px),
    rgba(7, 24, 39, 0.76);
  backdrop-filter: blur(7px);
}

.reset-dialog-panel {
  border: 1px solid rgba(111, 192, 220, 0.36);
  border-radius: 8px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(16, 31, 46, 0.98), rgba(7, 24, 39, 0.98)),
    radial-gradient(circle at 18% 0, rgba(229, 29, 42, 0.18), transparent 36%);
  box-shadow:
    inset 0 1px 0 rgba(247, 251, 255, 0.14),
    0 28px 80px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(111, 192, 220, 0.2);
}

.reset-dialog-kicker {
  display: block;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.reset-dialog h2 {
  margin: 8px 0 0;
  font-size: 32px;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.reset-dialog p {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.reset-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}

.leaderboard-card {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: start;
  width: 100%;
  border-color: rgba(111, 192, 220, 0.28);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(16, 31, 46, 0.94), rgba(7, 24, 39, 0.94)),
    radial-gradient(circle at 18% 0, rgba(111, 192, 220, 0.16), transparent 34%);
  box-shadow:
    inset 0 1px 0 rgba(247, 251, 255, 0.12),
    0 22px 55px rgba(0, 0, 0, 0.52),
    0 0 26px rgba(71, 121, 173, 0.18);
}

.leaderboard-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 1000;
  text-transform: uppercase;
  color: #f7fbff;
  text-shadow: 0 0 18px rgba(111, 192, 220, 0.48);
}

ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

ol li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid rgba(111, 192, 220, 0.08);
  background: rgba(247, 251, 255, 0.075);
  color: white;
  font-weight: 800;
}

ol li:nth-child(1),
ol li:nth-child(2),
ol li:nth-child(3) {
  background: linear-gradient(90deg, rgba(111, 192, 220, 0.16), rgba(247, 251, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(111, 192, 220, 0.1), 0 0 20px rgba(111, 192, 220, 0.08);
}

ol li b {
  color: #f7fbff;
  text-shadow: 0 0 12px rgba(111, 192, 220, 0.58);
}

ol li span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.screen-game {
  overflow: hidden;
  background: #071827;
}

.game-stage {
  position: relative;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  background: #071827;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  z-index: 3;
  display: flex;
  gap: 12px;
  pointer-events: none;
}

.hud-top {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.hud > div {
  min-width: 128px;
  padding: 12px 18px;
  border-radius: 8px;
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.hud span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  margin-top: 2px;
  font-size: 34px;
  font-weight: 1000;
  line-height: 1;
}

.hud > div.hud-pop {
  animation: hudPop 420ms ease-out;
}

.hud > div.hud-bonus {
  border-color: rgba(114, 217, 77, 0.8) !important;
  box-shadow:
    0 0 0 2px rgba(114, 217, 77, 0.24),
    0 0 30px rgba(114, 217, 77, 0.28),
    0 22px 55px rgba(0, 0, 0, 0.38) !important;
}

.hud > div.hud-penalty {
  border-color: rgba(229, 29, 42, 0.78) !important;
  box-shadow:
    0 0 0 2px rgba(229, 29, 42, 0.22),
    0 0 28px rgba(229, 29, 42, 0.25),
    0 22px 55px rgba(0, 0, 0, 0.38) !important;
}

.hud > div.hud-time {
  border-color: rgba(111, 192, 220, 0.9) !important;
  box-shadow:
    0 0 0 2px rgba(111, 192, 220, 0.3),
    0 0 34px rgba(111, 192, 220, 0.34),
    0 22px 55px rgba(0, 0, 0, 0.38) !important;
}

.timer-panel {
  border-color: rgba(111, 192, 220, 0.58) !important;
  box-shadow: 0 0 0 2px rgba(111, 192, 220, 0.2), 0 22px 55px rgba(0, 0, 0, 0.38) !important;
}

.damage-panel {
  min-width: 150px !important;
}

.damage-panel i {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.damage-panel i::before {
  content: "";
  display: block;
  width: var(--damage, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--damage-color, var(--green));
  transition: width 120ms ease, background-color 120ms ease;
}

.dispatch-card {
  position: absolute;
  z-index: 3;
  left: 18px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 430px;
  border-radius: 8px;
  padding: 12px;
  pointer-events: none;
}

.dispatch-card {
  bottom: 18px;
}

.dispatch-portrait {
  width: 88px;
  aspect-ratio: 1;
  border: 2px solid rgba(111, 192, 220, 0.72);
  border-radius: 8px;
  object-fit: cover;
  object-position: 50% 18%;
  background: rgba(7, 24, 39, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(247, 251, 255, 0.16),
    0 0 18px rgba(111, 192, 220, 0.24);
}

.dispatch-copy {
  min-width: 0;
}

.dispatch-card span {
  display: block;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

.dispatch-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-weight: 1000;
  text-transform: uppercase;
}

.dispatch-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.touch-controls {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: none;
  pointer-events: none;
}

.has-touch.is-game-screen .touch-controls {
  display: block;
}

.is-portrait .touch-controls {
  display: none;
}

.touch-stick {
  --stick-thumb-x: 0px;
  --stick-thumb-y: 0px;
  position: absolute;
  display: grid;
  place-items: center;
  pointer-events: auto;
  touch-action: none;
}

.touch-stick-steer {
  left: max(18px, calc(env(safe-area-inset-left) + 18px));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 20px));
  width: clamp(150px, 25vmin, 210px);
  height: clamp(104px, 18vmin, 148px);
}

.touch-stick-throttle {
  right: max(18px, calc(env(safe-area-inset-right) + 18px));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 20px));
  width: clamp(116px, 18vmin, 156px);
  height: clamp(166px, 28vmin, 224px);
}

.touch-stick-track {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(111, 192, 220, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.12), transparent 44%),
    radial-gradient(circle at 50% 50%, rgba(111, 192, 220, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(16, 31, 46, 0.54), rgba(7, 24, 39, 0.6));
  color: white;
  box-shadow:
    inset 0 1px 0 rgba(247, 251, 255, 0.16),
    inset 0 -5px 0 rgba(7, 24, 39, 0.2),
    0 12px 30px rgba(0, 0, 0, 0.22),
    0 0 22px rgba(111, 192, 220, 0.12);
  opacity: 0.68;
}

.touch-stick-track::before,
.touch-stick-track::after {
  content: "";
  position: absolute;
  background: rgba(247, 251, 255, 0.18);
  opacity: 0.32;
}

.touch-stick-steer .touch-stick-track::before {
  left: 22px;
  right: 22px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
}

.touch-stick-throttle .touch-stick-track::before {
  top: 22px;
  bottom: 22px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
}

.touch-stick-track::after {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(247, 251, 255, 0.34);
}

.touch-stick-guide {
  position: absolute;
  z-index: 1;
  color: rgba(247, 251, 255, 0.72);
  font-size: 15px;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}

.touch-stick-guide-left {
  left: 18px;
  font-size: 32px;
}

.touch-stick-guide-right {
  right: 18px;
  font-size: 32px;
}

.touch-stick-guide-forward {
  top: 17px;
  color: rgba(171, 240, 139, 0.82);
}

.touch-stick-guide-back {
  bottom: 17px;
  color: rgba(255, 148, 154, 0.82);
}

.touch-stick-thumb {
  position: relative;
  z-index: 2;
  width: 58px;
  aspect-ratio: 1;
  border: 1px solid rgba(247, 251, 255, 0.34);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.35), rgba(247, 251, 255, 0.08) 44%),
    linear-gradient(180deg, rgba(111, 192, 220, 0.78), rgba(71, 121, 173, 0.78));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.24),
    inset 0 -6px 0 rgba(7, 24, 39, 0.24),
    0 7px 0 rgba(7, 24, 39, 0.34),
    0 0 18px rgba(111, 192, 220, 0.3);
  transform: translate(var(--stick-thumb-x), var(--stick-thumb-y));
  transition: transform 120ms ease, box-shadow 120ms ease;
  pointer-events: none;
}

.touch-stick.is-active .touch-stick-track {
  opacity: 0.9;
}

.touch-stick.is-active .touch-stick-thumb {
  transition: none;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.24),
    inset 0 -4px 0 rgba(7, 24, 39, 0.3),
    0 4px 0 rgba(7, 24, 39, 0.42),
    0 0 28px rgba(111, 192, 220, 0.36);
}

.touch-stick-throttle .touch-stick-thumb {
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.35), rgba(247, 251, 255, 0.08) 44%),
    linear-gradient(180deg, rgba(127, 212, 103, 0.72), rgba(71, 121, 173, 0.76) 54%, rgba(240, 90, 98, 0.7));
}

@media (max-height: 430px) {
  .touch-stick-steer {
    width: 142px;
    height: 94px;
  }

  .touch-stick-throttle {
    width: 108px;
    height: 152px;
  }

  .touch-stick-thumb {
    width: 50px;
  }

  .touch-stick-guide-forward,
  .touch-stick-guide-back {
    font-size: 13px;
  }
}

.screen-result {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 420px;
  gap: 28px;
  align-items: center;
  padding: 38px;
  background:
    linear-gradient(90deg, rgba(7, 24, 39, 0.95), rgba(7, 24, 39, 0.82) 48%, rgba(7, 24, 39, 0.68)),
    repeating-linear-gradient(180deg, rgba(247, 251, 255, 0.035) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 25% 30%, rgba(111, 192, 220, 0.18), transparent 28%),
    radial-gradient(circle at 75% 60%, rgba(71, 121, 173, 0.28), transparent 25%),
    linear-gradient(135deg, #071827, #101f2e);
}

.screen-result::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 24%, rgba(111, 192, 220, 0.16) 38%, transparent 52%),
    radial-gradient(circle at 82% 20%, rgba(111, 192, 220, 0.18), transparent 18%);
  mix-blend-mode: screen;
  opacity: 0.35;
  animation: arcadeSweep 10s linear infinite;
}

.result-panel {
  border-radius: 8px;
  padding: 34px;
  position: relative;
  z-index: 2;
}

.result-logo-frame {
  transform: rotate(-1deg) scale(0.88);
  transform-origin: left top;
}

.result-logo-frame .assist-logo {
  width: 230px;
}

.result-panel h2 {
  margin: 28px 0 8px;
  font-size: 74px;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 5px 5px 0 #244b75, 0 0 28px rgba(111, 192, 220, 0.52);
}

.result-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}

.score-entry-card {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  margin: 0 0 20px;
  padding: 16px;
  border-radius: 8px;
  align-items: end;
}

.score-entry-card.score-entry-sheet {
  position: fixed;
  left: max(12px, calc(env(safe-area-inset-left) + 12px));
  right: max(12px, calc(env(safe-area-inset-right) + 12px));
  bottom: max(10px, calc(var(--keyboard-inset-bottom) + env(safe-area-inset-bottom) + 10px));
  z-index: 24;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: calc(100dvh - var(--keyboard-inset-bottom) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
  margin: 0 auto;
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(111, 192, 220, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 31, 46, 0.98), rgba(7, 24, 39, 0.98)),
    radial-gradient(circle at 20% 0, rgba(111, 192, 220, 0.18), transparent 36%);
  box-shadow:
    inset 0 1px 0 rgba(247, 251, 255, 0.14),
    0 18px 52px rgba(0, 0, 0, 0.58),
    0 0 30px rgba(111, 192, 220, 0.16);
  -webkit-overflow-scrolling: touch;
}

.score-entry-card.score-entry-sheet label {
  gap: 7px;
  font-size: 11px;
}

.score-entry-card.score-entry-sheet input {
  width: 100%;
  height: 54px;
  font-size: 18px;
}

.score-entry-card.score-entry-sheet button {
  width: 100%;
  height: 54px;
  margin-top: 2px;
  font-size: 14px;
}

.result-stats div {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(111, 192, 220, 0.12);
  background: rgba(247, 251, 255, 0.08);
}

.result-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 34px;
}

.final-score-stat {
  position: relative;
  overflow: visible;
}

.final-score-stat.score-finished::before,
.final-score-stat.score-finished::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  width: 18px;
  height: 18px;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 42%, rgba(255, 255, 255, 0.95) 42% 58%, transparent 58%),
    linear-gradient(0deg, transparent 42%, rgba(255, 255, 255, 0.95) 42% 58%, transparent 58%);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 14px rgba(255, 214, 55, 0.55));
  transform: translate(var(--result-spark-x), -50%) rotate(45deg) scale(0);
  animation: resultSpark 700ms ease-out both;
}

.final-score-stat.score-finished::before {
  --result-spark-x: -76px;
}

.final-score-stat.score-finished::after {
  --result-spark-x: 58px;
  animation-delay: 90ms;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.result-actions button {
  min-width: 160px;
}

.result-board {
  grid-column: auto;
  grid-row: auto;
  position: relative;
  z-index: 2;
}

@keyframes titlePulse {
  0%, 100% {
    filter: brightness(1);
    transform: translateY(0);
  }
  50% {
    filter: brightness(1.08);
    transform: translateY(-2px);
  }
}

@keyframes buttonPulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,0.34),
      inset 0 -5px 0 rgba(7, 24, 39, 0.22),
      0 12px 0 rgba(7, 24, 39, 0.54),
      0 0 24px rgba(111, 192, 220, 0.32);
  }
  50% {
    transform: translateY(-2px);
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,0.42),
      inset 0 -5px 0 rgba(7, 24, 39, 0.2),
      0 14px 0 rgba(7, 24, 39, 0.48),
      0 0 38px rgba(111, 192, 220, 0.62);
  }
}

@keyframes startButtonShine {
  0%,
  36% {
    transform: translateX(-135%);
  }
  68%,
  100% {
    transform: translateX(135%);
  }
}

@keyframes hudPop {
  0% {
    transform: translateY(0) scale(1);
  }
  36% {
    transform: translateY(-4px) scale(1.06);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes resultSpark {
  0% {
    opacity: 0;
    transform: translate(var(--result-spark-x), -50%) rotate(45deg) scale(0);
  }
  42% {
    opacity: 1;
    transform: translate(var(--result-spark-x), -50%) rotate(45deg) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(var(--result-spark-x), -50%) rotate(45deg) scale(0.2);
  }
}

@keyframes arcadeSweep {
  0% {
    background-position: 0 0, -1024px 0, 0 0, 0 0;
  }
  100% {
    background-position: 0 12px, 1536px 0, 0 0, 0 0;
  }
}

@keyframes scanlineDrift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(5px);
  }
}

@keyframes logoShine {
  0% {
    background-position: 0 0, -220px 0, 0 0, 0 0, 0 0;
  }
  42%,
  100% {
    background-position: 0 8px, 280px 0, 0 0, 0 0, 0 0;
  }
}

@keyframes logoSparkle {
  0%,
  64%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(45deg) scale(0);
  }
  73% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
  }
  82% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
