@import url('https://fonts.googleapis.com/css2?family=DotGothic16&family=Press+Start+2P&display=swap');

:root {
  --pink: #ff3e9d;
  --cyan: #31e8ff;
  --yellow: #ffe15a;
  --ink: #120b2e;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #09051c;
  color: white;
  font-family: "DotGothic16", monospace;
  touch-action: none;
}

.game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #302078, #09051c 70%);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* Final defeat fades the live battlefield fully to black before the story and
   result layers appear. Kept below .screen so the crash illustration remains. */
.gameover-blackout {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .45s ease, visibility .45s;
}
.gameover-blackout.is-visible { opacity: 1; visibility: visible; }
.game-shell.is-game-over .result-screen { background: #000; }

.screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
  background: radial-gradient(circle, rgba(34, 20, 83, .5), rgba(8, 4, 27, .82));
}

.screen.is-visible { opacity: 1; visibility: visible; transform: scale(1); }

/* Title screen: the logo + attract demo are drawn on the canvas, so the HTML
   layer is only a click-catcher with a start hint and the high score. */
#titleScreen {
  justify-content: flex-end;
  padding-bottom: 6vh;
  background: linear-gradient(180deg, rgba(9,5,28,0) 55%, rgba(9,5,28,.7) 100%);
  cursor: pointer;
}
#titleScreen .highscore { margin-top: 18px; }

/* How-to-play screen: readable centered panel between title and launch. */
#startScreen { background: radial-gradient(circle at 50% 40%, rgba(26, 15, 62, .94), rgba(8, 4, 27, .97)); }
#startScreen .lead { margin: 16px 0 6px; }
#startScreen .controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 30px;
  text-align: left;
  margin: 18px 0 22px;
  padding: 18px 28px;
  background: rgba(9,5,28,.5);
}
#startScreen .difficulty { margin: 0 0 22px; }
.howto-hint { margin: 16px 0 0; color: #837aa7; font: 8px "Press Start 2P", monospace; letter-spacing: .1em; }

.opening-screen {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7,4,28,.3), rgba(8,3,28,.92)),
    radial-gradient(circle at 50% 42%, rgba(255,62,157,.25), transparent 48%);
}
.opening-screen::before {
  content: ""; position: absolute; inset: 0; opacity: .22;
  background: linear-gradient(115deg, transparent 30%, rgba(49,232,255,.28) 49%, transparent 52%);
  transform: translateX(-100%);
}
.opening-screen.is-visible::before { animation: openingSweep 2.4s ease-out .25s both; }
.opening-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; max-width: 760px; }
.opening-alert {
  margin: 0 0 12px; padding: 7px 13px; border: 1px solid var(--pink); color: #ffd7ea;
  background: rgba(255,62,157,.12); font: 9px "Press Start 2P", monospace; letter-spacing: .18em;
}
.opening-title { color: white; font-size: clamp(34px, 6vw, 68px); line-height: 1.15; }
.opening-title span { color: var(--pink); text-shadow: 3px 3px 0 #fff; }
.opening-story { margin: 20px 0 17px; color: #e8e3ff; font-size: clamp(15px, 1.8vw, 21px); letter-spacing: .07em; }
.opening-story p { margin: 4px 0; }
.mission-card {
  display: grid; gap: 7px; min-width: min(520px, 82vw); margin-bottom: 23px; padding: 14px 24px;
  border-left: 4px solid var(--cyan); border-right: 4px solid var(--pink);
  background: linear-gradient(90deg, rgba(49,232,255,.08), rgba(255,62,157,.1));
}
.mission-card span { color: var(--cyan); font: 8px "Press Start 2P", monospace; letter-spacing: .2em; }
.mission-card strong { color: white; font: 15px "Press Start 2P", monospace; }
.mission-card small { color: #bdb5e0; font-size: 14px; }
.opening-skip { margin: 14px 0 0; color: #837aa7; font: 7px "Press Start 2P", monospace; letter-spacing: .12em; }
.ending-cameo {
  display: flex; align-items: center; gap: 15px; margin: 4px 0 22px; padding: 13px 20px;
  max-width: min(560px, 88vw);
  border: 2px solid rgba(49,232,255,.5); border-radius: 14px;
  background: rgba(10,7,30,.55); box-shadow: 4px 4px 0 rgba(255,62,157,.28);
}
.cameo-face { font-size: 40px; line-height: 1; white-space: nowrap; filter: drop-shadow(0 0 8px rgba(49,232,255,.5)); }
.cameo-face img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; image-rendering: pixelated; border: 2px solid rgba(255,255,255,.7); }

/* Story cutscenes: a framed illustration window over a black backdrop with a
   text box below — like an old JRPG event scene. Click / ENTER to advance. */
.story-screen {
  padding: 24px; cursor: pointer; justify-content: center; overflow: hidden;
  background:
    radial-gradient(circle at 50% 12%, rgba(49, 232, 255, .14), transparent 55%),
    radial-gradient(circle at 18% 80%, rgba(255, 62, 157, .12), transparent 45%),
    #05030f;
}
/* Cyber backdrop: a neon wireframe floor scrolling toward the viewer... */
.story-screen::before {
  content: ""; position: absolute; left: -40%; right: -40%; bottom: -12%; height: 58%;
  background:
    repeating-linear-gradient(90deg, rgba(49, 232, 255, .3) 0 2px, transparent 2px 90px),
    repeating-linear-gradient(0deg, rgba(255, 62, 157, .28) 0 2px, transparent 2px 46px);
  transform: perspective(430px) rotateX(62deg);
  animation: storyGrid 2.6s linear infinite;
  mask-image: linear-gradient(180deg, transparent, black 45%);
}
@keyframes storyGrid { to { background-position: 0 0, 0 46px; } }
/* ...plus drifting data streaks + CRT scanlines over the whole backdrop. */
.story-screen::after {
  content: ""; position: absolute; inset: -60% -10% 0; pointer-events: none;
  background:
    linear-gradient(105deg, transparent 12%, rgba(49, 232, 255, .09) 13%, transparent 15%,
      transparent 38%, rgba(255, 62, 157, .08) 39%, transparent 41%,
      transparent 70%, rgba(114, 255, 104, .07) 71%, transparent 73%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 5px);
  animation: storyStreaks 7s linear infinite;
}
@keyframes storyStreaks { to { transform: translateX(-18%); } }
.story-frame {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 18px;
  /* Wide enough to feel like the main event, but the 16:9 art + text box must
     always fit the window height. */
  width: min(880px, 92vw, calc((100vh - 250px) * 16 / 9));
}
.story-image {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; image-rendering: pixelated; background: #000;
  border: 2px solid #fff; outline: 2px solid #fff; outline-offset: 4px;
}
.story-caption {
  padding: 16px 22px 12px; text-align: left;
  background: rgba(8, 4, 27, .92); border: 2px solid #fff; outline: 2px solid #fff; outline-offset: 4px;
}
.story-caption p { min-height: 3.8em; }
.story-caption p { margin: 0; color: #fff; font-size: 17px; line-height: 1.9; text-shadow: 0 2px 0 rgba(0,0,0,.6); }
.story-advance { display: block; margin-top: 8px; text-align: right; color: #837aa7; font: 7px "Press Start 2P", monospace; letter-spacing: .12em; animation: storyBlink 1.2s steps(2) infinite; }
@keyframes storyBlink { 50% { opacity: .25; } }
/* While a line is typing out: hide the page-turn hint, show a blinking cursor.
   The untyped tail stays in the layout (just invisible) so the box never grows. */
.story-screen.is-typing .story-advance { visibility: hidden; }
.story-untyped { visibility: hidden; }
.story-screen.is-typing .story-caption p span:first-child::after { content: "▌"; display: inline-block; width: 0; animation: storyBlink .7s steps(2) infinite; }
@media (max-width: 640px) { .story-caption p { font-size: 14px; } }
.cameo-body { text-align: left; }
.cameo-line { margin: 0 0 5px; color: #fff; font-size: clamp(14px, 1.7vw, 19px); letter-spacing: .04em; }
.cameo-name { color: var(--cyan); font: 8px "Press Start 2P", monospace; letter-spacing: .12em; }
@media (max-width: 640px) { .cameo-face { font-size: 30px; } .cameo-line { font-size: 13px; } }
.opening-line { opacity: 0; transform: translateY(14px); }
.opening-screen.is-visible .opening-line { animation: openingLine .55s ease-out both; }
.opening-screen.is-visible .opening-line-1 { animation-delay: .25s; }
.opening-screen.is-visible .opening-line-2 { animation-delay: .8s; }
.opening-screen.is-visible .opening-line-3 { animation-delay: 1.25s; }
.opening-screen.is-visible .opening-line-4 { animation-delay: 2.15s; }
.opening-screen.is-visible .opening-line-5 { animation-delay: 3.05s; }
.opening-screen.is-visible .opening-line-6 { animation-delay: 3.75s; }
.opening-skyline { position: absolute; z-index: 1; inset: auto 0 0; height: 48%; opacity: .34; }
.opening-skyline::after { content: ""; position: absolute; inset: auto 0 0; height: 5px; background: var(--cyan); box-shadow: 0 0 22px var(--cyan); }
.opening-skyline i { position: absolute; bottom: 4px; width: 11%; background: #09051c; border-top: 2px solid rgba(49,232,255,.5); box-shadow: inset 8px 0 rgba(255,62,157,.08); }
.opening-skyline i:nth-child(1) { left: -2%; height: 38%; }
.opening-skyline i:nth-child(2) { left: 12%; height: 66%; }
.opening-skyline i:nth-child(3) { left: 28%; height: 48%; }
.opening-skyline i:nth-child(4) { left: 43%; height: 82%; }
.opening-skyline i:nth-child(5) { left: 59%; height: 54%; }
.opening-skyline i:nth-child(6) { left: 75%; height: 72%; }
.opening-skyline i:nth-child(7) { left: 90%; height: 42%; }
.opening-scan { position: absolute; z-index: 3; left: 0; right: 0; top: -4px; height: 2px; opacity: 0; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); pointer-events: none; }
.opening-screen.is-visible .opening-scan { animation: openingScan 2.5s linear .3s both; }
.opening-progress { display: none; position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.08); }
.opening-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink), var(--yellow)); box-shadow: 0 0 12px var(--pink); }
.opening-screen.is-visible .opening-progress i { animation: openingProgress 9s linear both; }

/* Staff roll: classic bottom-to-top scrolling credits over a plain starfield-
   black backdrop. The scroll runs once, then holds on a static FIN card
   instead of continuing anywhere — click / ENTER still moves on to RESULT
   at any point, but nothing happens automatically once it lands on FIN. */
.staffroll-screen {
  overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 20%, rgba(49,232,255,.1), transparent 55%), #05030f;
}
.staffroll-viewport { position: relative; width: min(640px, 88vw); height: 100%; overflow: hidden; }
.staffroll-track {
  position: absolute; left: 0; right: 0; top: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.staffroll-screen.is-rolling .staffroll-track { animation: staffRollScroll 26s linear forwards; }
@keyframes staffRollScroll { to { transform: translateY(-100%); } }
.staffroll-game { margin: 0 0 6px; color: var(--cyan); font: 13px "Press Start 2P", monospace; letter-spacing: .1em; text-shadow: 2px 2px #5b2f9e; }
.staffroll-role { margin: 34px 0 14px; color: var(--yellow); font: 11px "Press Start 2P", monospace; letter-spacing: .18em; }
.staffroll-name { margin: 0; color: #fff; font-size: 20px; letter-spacing: .06em; }
.staffroll-name small { margin-left: 8px; color: #837aa7; font-size: 13px; letter-spacing: .04em; }
.staffroll-job { margin: 3px 0 16px; color: #bdb5e0; font-size: 14px; letter-spacing: .05em; }
.staffroll-job small { margin-left: 6px; color: #837aa7; font-size: 12px; }
/* Secondary entries (stage/boss lineup, track list, voice cast). Deliberately a
   step down from .staffroll-name/.staffroll-job so the four crew credits stay
   the visual peak of the roll and these read as supporting lists. */
.staffroll-entry { margin: 0; color: #efeaff; font-size: 16px; letter-spacing: .05em; text-align: center; }
.staffroll-sub { margin: 2px 0 13px; color: #8f86b6; font-size: 12px; letter-spacing: .04em; text-align: center; }
.staffroll-note { max-width: 480px; margin: 26px 0 0; color: #6b628f; font-size: 11px; line-height: 1.7; letter-spacing: .03em; }
.staffroll-track > :last-child { margin-bottom: 70px; }
/* FIN card: a separate full-bleed overlay (not part of the scroll) that fades
   in once the track finishes, and simply holds there. pointer-events stay
   off so a click still reaches .staffroll-screen's own skip/continue handler.
   It carries its own opaque backdrop (matching the screen) because the CSS
   scroll only ever travels 100% of the TRACK's own height — the track's tail
   end always lands exactly at the viewport's bottom edge, never fully clear
   of it — so the fade-in doubles as a dissolve that hides that leftover tail
   instead of relying on a huge (and slow) trailing blank-scroll buffer. */
.staffroll-fin {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
  background: radial-gradient(circle at 50% 20%, rgba(49,232,255,.1), transparent 55%), #05030f;
  opacity: 0; transition: opacity 1.1s ease;
}
.staffroll-fin.is-shown { opacity: 1; }
.staffroll-heart { margin: 0 0 10px; color: var(--pink); font-size: 34px; text-shadow: 0 0 14px var(--pink); }
.staffroll-end { margin: 0; color: #fff; font: 16px "Press Start 2P", monospace; letter-spacing: .3em; }
.staffroll-skip { position: absolute; left: 0; right: 0; bottom: 20px; z-index: 3; }

.eyebrow {
  margin-bottom: 20px;
  color: var(--cyan);
  font: 11px/1 "Press Start 2P", monospace;
  letter-spacing: .2em;
  text-shadow: 2px 2px #5b2f9e;
}

h1, h2 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  line-height: 1.22;
  letter-spacing: -.07em;
  filter: drop-shadow(5px 6px 0 #411c73);
}

h1 { font-size: clamp(34px, 7vw, 82px); color: white; }
h1 span { color: var(--pink); text-shadow: 3px 3px 0 white; }
h2 { color: var(--pink); font-size: clamp(34px, 6vw, 72px); }

.lead { margin: 22px 0 24px; font-size: clamp(16px, 2vw, 23px); letter-spacing: .08em; }

.difficulty { margin: -5px 0 22px; }
.difficulty > span { display: block; margin-bottom: 10px; color: var(--cyan); font: 9px "Press Start 2P", monospace; letter-spacing: .15em; }
.difficulty > span small { color: rgba(255,255,255,.5); font-size: 8px; letter-spacing: .1em; margin-left: 8px; }
.difficulty div { display: flex; gap: 8px; }
.difficulty button {
  border: 1px solid #655d95; padding: 10px 14px; background: rgba(15, 9, 48, .8); color: #a9a2ce;
  font: 9px "Press Start 2P", monospace; cursor: pointer;
}
.difficulty button:hover { border-color: var(--cyan); color: white; }
.difficulty button.is-active { border-color: var(--pink); background: var(--pink); color: white; box-shadow: 3px 3px 0 #71326a; }

.controls {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 27px;
  padding: 14px 18px;
  border-top: 1px solid rgba(49, 232, 255, .35);
  border-bottom: 1px solid rgba(49, 232, 255, .35);
  color: #d8d2ff;
}

.controls div { display: flex; align-items: center; gap: 8px; }
kbd {
  min-width: 40px;
  padding: 7px 8px;
  border: 1px solid var(--cyan);
  border-radius: 3px;
  background: rgba(49, 232, 255, .08);
  color: white;
  font: 9px "Press Start 2P", monospace;
  box-shadow: 0 3px 0 #15758b;
}
.touch-note { display: none !important; }

.main-button {
  border: 0;
  min-width: 230px;
  padding: 18px 25px;
  color: #1c0a30;
  background: var(--yellow);
  font: 14px "Press Start 2P", monospace;
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--pink);
  transition: transform .12s, box-shadow .12s;
}
.main-button:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--pink); }
.main-button i { margin-left: 14px; font-style: normal; }
.ghost-button {
  border: 1px solid rgba(49, 232, 255, .5);
  background: transparent;
  color: #aaa1d1;
  font: 10px "Press Start 2P", monospace;
  padding: 12px 18px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ghost-button:hover { color: var(--cyan); border-color: var(--cyan); }
.highscore { margin-top: 23px; color: #aaa1d1; font: 10px "Press Start 2P", monospace; }
.highscore strong { margin-left: 12px; color: white; }

/* Between-stage rest stop & shop. */
.shop-screen { background: radial-gradient(circle at 50% 38%, rgba(26, 15, 62, .95), rgba(8, 4, 27, .97)); }
.shop-title { color: white; font-size: clamp(24px, 4vw, 40px); text-shadow: 4px 4px 0 var(--pink); }
.shop-lead { margin: 10px 0 4px; font-size: clamp(14px, 1.8vw, 19px); }
.shop-lead strong { margin-left: 8px; color: var(--yellow); font: 15px "Press Start 2P", monospace; }
.shop-items {
  display: grid;
  /* 4 across. There are 9 items, so the last row carries the odd one out —
     `justify-items: center` on the trailing item keeps that centred under the
     row above instead of stranded at the left edge. */
  grid-template-columns: repeat(4, minmax(140px, 190px));
  gap: 8px;
  margin: 12px 0 6px;
  justify-content: center;
}
.shop-items > :last-child:nth-child(4n + 1) { grid-column: 2 / span 2; justify-self: center; width: 100%; max-width: 190px; }
.shop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 8px 8px;
  border: 1px solid #655d95;
  background: rgba(15, 9, 48, .85);
  color: #d8d2ff;
  font-family: "DotGothic16", monospace;
  cursor: pointer;
  transition: transform .1s, border-color .15s;
}
.shop-item:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--pink); }
.shop-item:disabled { opacity: .42; cursor: default; }
.shop-item i { font-style: normal; font-size: 32px; line-height: 1; }
.shop-name { color: white; font-size: 15px; }
.shop-desc { color: #bdb5e0; font-size: 12px; }
.shop-price { color: var(--yellow); font: 10px "Press Start 2P", monospace; }
.shop-status { color: var(--cyan); font-size: 12px; min-height: 15px; }
.shop-next { margin: 6px 0 10px; color: #bdb5e0; font: 9px "Press Start 2P", monospace; letter-spacing: .1em; }
.shop-next span { color: var(--cyan); }

.result-screen { gap: 24px; }
.result-stats {
  display: flex;
  gap: 30px;
  padding: 12px 22px;
  border-top: 1px solid rgba(49, 232, 255, .35);
  border-bottom: 1px solid rgba(49, 232, 255, .35);
}
.result-stats div { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.result-stats span { color: var(--cyan); font: 9px "Press Start 2P", monospace; }
.result-stats strong { color: white; font: 15px "Press Start 2P", monospace; }
.result-score span { display: block; color: var(--cyan); font: 10px "Press Start 2P", monospace; }
.result-score strong { display: block; margin-top: 12px; font: 30px "Press Start 2P", monospace; }
.new-record { color: var(--yellow); font: 13px "Press Start 2P", monospace; animation: blink .7s steps(1) infinite; }
.new-record.is-hidden { visibility: hidden; }

/* Secret soundtrack reward: hidden until the hard-clear flag unlocks it. */
.soundtrack-link.is-hidden, .soundtrack-note.is-hidden { display: none; }
#titleSoundtrackLink {
  position: absolute;
  right: 26px;
  bottom: 70px;   /* clear of the corner sound toggle */
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--yellow, #ffe15a);
  text-decoration: none;
  padding: 8px 12px;
  border: 2px solid rgba(255, 225, 90, .55);
  background: rgba(10, 6, 31, .78);
  text-shadow: 0 0 8px rgba(255, 225, 90, .6);
  pointer-events: auto;
}
#titleSoundtrackLink:hover { color: #fff; border-color: #fff; }
#resultSoundtrackLink { text-decoration: none; display: inline-block; }
.soundtrack-note {
  margin-top: 10px;
  color: #ffe15a;
  text-shadow: 0 0 10px rgba(255, 225, 90, .55);
}

.pause-label {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(34, 20, 83, .55), rgba(5, 3, 18, .86));
  backdrop-filter: blur(2px);
}
.pause-label.is-visible { display: flex; }
.pause-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 34px 46px;
  border: 1px solid rgba(49, 232, 255, .4);
  background: rgba(9, 5, 28, .7);
  box-shadow: 0 0 40px rgba(49, 232, 255, .18), 8px 8px 0 rgba(255, 62, 157, .25);
}
.pause-title { color: white; font: 30px "Press Start 2P", monospace; text-shadow: 5px 5px #ff3e9d; letter-spacing: .04em; }
.pause-hint { margin: 0; color: #a9a2ce; font: 9px "Press Start 2P", monospace; letter-spacing: .1em; }
.pause-panel .main-button { min-width: 190px; padding: 15px 22px; font-size: 12px; }

.corner-button {
  position: absolute; z-index: 7; bottom: 14px; border: 1px solid rgba(49,232,255,.7);
  min-width: 46px; padding: 9px 11px; background: rgba(9,5,28,.75); color: white;
  font: 9px "Press Start 2P", monospace; cursor: pointer; transition: transform .1s, border-color .15s, color .15s;
}
.corner-button:hover { transform: translateY(-2px); border-color: var(--pink); }
.sound-button { right: 14px; }
.sound-button.is-muted { color: #81799e; border-color: #514a70; }
.pause-toggle { right: 70px; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s, transform .1s, border-color .15s; }
.pause-toggle.is-visible { opacity: 1; visibility: visible; }
.pause-toggle.is-paused { color: var(--yellow); border-color: var(--yellow); }
.special-button {
  left: 14px; min-width: 112px; color: var(--yellow); border-color: var(--yellow);
  opacity: 0; visibility: hidden; box-shadow: 0 0 18px rgba(255,225,90,.12);
}
.special-button.is-visible { opacity: 1; visibility: visible; }
.special-button.is-ready { color: #120b2e; background: var(--yellow); box-shadow: 4px 4px 0 var(--pink), 0 0 24px rgba(255,225,90,.4); animation: blink .8s steps(2) infinite; }
.special-button:disabled { color: #71698f; border-color: #4b4567; cursor: default; }
.bomb-button {
  left: 136px; min-width: 96px; color: var(--cyan); border-color: var(--cyan);
  opacity: 0; visibility: hidden; box-shadow: 0 0 18px rgba(49,232,255,.12);
}
.bomb-button.is-visible { opacity: 1; visibility: visible; }
.bomb-button.is-ready { color: #120b2e; background: var(--cyan); box-shadow: 4px 4px 0 var(--pink), 0 0 24px rgba(49,232,255,.4); }
.bomb-button:disabled { color: #71698f; border-color: #4b4567; cursor: default; }

.controller-status {
  position: absolute; z-index: 7; left: 50%; bottom: 20px; transform: translate(-50%, 25px);
  padding: 10px 14px; border: 1px solid var(--cyan); background: rgba(9,5,28,.9); color: var(--cyan);
  font: 9px "Press Start 2P", monospace; opacity: 0; transition: .25s; pointer-events: none;
}
.controller-status.is-visible { opacity: 1; transform: translate(-50%, 0); }

.scanlines {
  pointer-events: none;
  position: absolute;
  z-index: 8;
  inset: 0;
  opacity: .09;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #000 4px);
  mix-blend-mode: multiply;
}

@keyframes blink { 50% { opacity: .25; } }
@keyframes openingLine { to { opacity: 1; transform: translateY(0); } }
@keyframes openingSweep { to { transform: translateX(100%); } }
@keyframes openingScan { 0% { opacity: 0; top: 0; } 10%, 90% { opacity: .65; } 100% { opacity: 0; top: 100%; } }
@keyframes openingProgress { to { width: 100%; } }

@media (max-width: 700px) {
  .controls > div:not(.touch-note) { display: none; }
  .touch-note { display: block !important; }
  .lead { max-width: 310px; }
  .screen { justify-content: center; }
  .difficulty button { padding: 9px 10px; font-size: 8px; }
  .shop-items { grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px; }
  .opening-title { font-size: 34px; }
  .opening-story { font-size: 14px; }
  .mission-card strong { font-size: 11px; }
  .mission-card small { font-size: 12px; }
}
