@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=Press+Start+2P&display=swap');

:root {
  color-scheme: dark;
  --ink: #e4edf2;
  --muted: #8ea6b5;
  --green: #8dff58;
  --green-hot: #b7ff74;
  --blue: #42d9ff;
  --orange: #ff941f;
  --panel: rgba(6, 15, 22, .92);
  --line: rgba(66, 217, 255, .28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow: hidden; background: #03070a; }
body {
  font-family: "Chakra Petch", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 70% 15%, rgba(20, 107, 142, .2), transparent 35%),
    linear-gradient(135deg, #03070a, #07111a 55%, #090b0c);
}
button { font: inherit; }

.game-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.hud {
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 11, 16, .94);
  backdrop-filter: blur(16px);
}
.brand-kicker, .eyebrow {
  display: block;
  color: var(--orange);
  font-family: "Press Start 2P", monospace;
  font-size: .7rem;
  letter-spacing: .12em;
}
.brand { display: flex; align-items: center; min-width: 0; }
.brand-sign {
  position: relative; display: grid; align-content: center; width: clamp(15rem, 18vw, 17rem); height: 3.75rem;
  padding: .28rem 1rem .32rem 1.15rem; overflow: hidden;
  background: linear-gradient(105deg, rgba(8, 38, 68, .92), rgba(5, 17, 28, .58) 72%, transparent);
  border-left: 4px solid #16d9ff; border-bottom: 2px solid #ff9418;
  clip-path: polygon(0 0, 94% 0, 100% 28%, 95% 100%, 0 100%);
  filter: drop-shadow(0 0 8px rgba(0, 199, 255, .22));
}
.brand-sign::after {
  content: ""; position: absolute; right: 4%; top: 0; width: 2.4rem; height: 100%; opacity: .6;
  background: repeating-linear-gradient(125deg, transparent 0 .45rem, #0ed7ff .5rem .65rem, transparent .7rem 1rem);
}
.brand-overline, .brand-subline {
  position: relative; z-index: 1; width: max-content; font-family: "Chakra Petch", sans-serif;
  font-weight: 700; font-style: italic; line-height: 1; letter-spacing: .12em; text-transform: uppercase;
}
.brand-overline { color: #4ee7ff; font-size: .5rem; }
.brand-title {
  position: relative; z-index: 1; color: #fff5df; font-family: "Chakra Petch", sans-serif;
  font-size: clamp(1.22rem, 1.65vw, 1.55rem); font-style: italic; font-weight: 700; line-height: 1.02;
  letter-spacing: -.035em; text-shadow: 3px 3px 0 #061529, 0 0 12px rgba(61, 217, 255, .35);
}
.brand-title em { color: #fff5df; font-style: inherit; }
.brand-subline {
  margin-top: .12rem; padding: .12rem .55rem .1rem; color: #07121e; background: #ff9418;
  font-size: .48rem; letter-spacing: .09em; transform: skewX(-12deg);
}
.hud-stats { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 2rem); }
.hud-stats div { display: grid; gap: .1rem; text-align: right; }
.hud-stats span { color: var(--muted); font-size: .78rem; letter-spacing: .12em; }
.hud-stats strong { color: var(--green-hot); font-family: "Press Start 2P", monospace; font-size: .9rem; }
.icon-button, .primary-button {
  border: 1px solid var(--orange);
  color: #ffd29e;
  background: rgba(165, 77, 14, .2);
  padding: .7rem 1rem;
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: inset 0 0 20px rgba(255, 148, 31, .08);
}
.icon-button:hover, .primary-button:hover { background: var(--orange); color: #071018; }

.stage { position: relative; min-height: 0; overflow: hidden; }
#game { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.11) 3px 4px);
  mix-blend-mode: multiply;
}
.red-alert {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, transparent 20%, rgba(255,0,0,.48) 100%), rgba(255,0,0,.12);
  mix-blend-mode: screen;
}
.red-alert.active { animation: red-alarm .44s steps(2, end) 8; }
@keyframes red-alarm { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.primary-button { margin-top: .8rem; font-weight: 700; }
.message {
  position: absolute; left: 50%; top: 12%; transform: translateX(-50%);
  color: #ffd29e; font-family: "Press Start 2P", monospace; font-size: clamp(.7rem, 2vw, 1rem);
  text-shadow: 0 0 18px var(--orange); opacity: 0; transition: opacity .18s;
}
.message.show { opacity: 1; }

.touch-controls { display: none; position: fixed; inset: auto 1rem 1rem; z-index: 4; grid-template-columns: 3.5rem 1fr 1fr 3.5rem; gap: .55rem; }
.touch-controls button { min-height: 3.6rem; border: 1px solid var(--line); color: var(--ink); background: rgba(4, 17, 11, .84); border-radius: .3rem; }
.touch-controls .jump { color: var(--green-hot); }
.touch-controls .interact { color: #67c8ff; border-color: rgba(54,169,255,.45); }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem clamp(1rem, 3vw, 3rem); color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }
footer p { margin: 0; }
.signal { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

dialog {
  width: min(40rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem); overflow: auto;
  color: var(--ink); border: 1px solid var(--green); padding: clamp(1.4rem, 4vw, 3rem);
  background: #07111a; box-shadow: 0 30px 100px #000; line-height: 1.55;
}
dialog::backdrop { background: rgba(0, 4, 2, .78); backdrop-filter: blur(8px); }
dialog h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin: .6rem 0 1rem; }
.dialog-close { position: absolute; right: 1rem; top: .7rem; color: var(--orange); border: 0; background: none; font-size: 2rem; cursor: pointer; }
.quote { color: #ffd29e; font-size: 1.15rem; border-left: 2px solid var(--orange); padding-left: 1rem; }
.file-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.file-meta span { border: 1px solid var(--line); padding: .35rem .6rem; color: var(--muted); font-size: .8rem; }
.story-beats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; margin: 1.4rem 0 .4rem; }
.story-beats span { padding: .55rem .4rem; color: #ffd29e; border: 1px solid rgba(255,148,31,.45); background: rgba(128,54,8,.14); text-align: center; font-size: .82rem; letter-spacing: .06em; }

.interact-prompt {
  position: absolute; left: 50%; bottom: 3rem; transform: translateX(-50%) translateY(.5rem);
  min-width: min(31rem, calc(100% - 2rem)); padding: .7rem 1rem; text-align: center;
  color: #dff5ff; background: rgba(4, 18, 26, .9); border: 1px solid rgba(54, 169, 255, .55);
  box-shadow: 0 0 30px rgba(54,169,255,.14); opacity: 0; transition: .2s; pointer-events: none;
}
.interact-prompt.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.interact-prompt strong { color: #67c8ff; }
.wide-dialog { width: min(64rem, calc(100% - 2rem)); }
.trailer-frame { margin: 1rem 0; border: 1px solid var(--line); background: #020705; aspect-ratio: 16/8.3; overflow: hidden; }
#gameTrailer { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.dialog-note { color: var(--muted); font-size: .9rem; }
.steam-card { display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0; padding: 1rem; background: #081923; border: 1px solid #1a526d; }
.steam-mark { font-family: "Press Start 2P", monospace; color: #89d5ff; font-size: 1.1rem; }
.steam-card div { display: grid; gap: .2rem; }
.steam-card small, .track-list small { color: var(--muted); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.track-list { list-style: none; padding: 0; margin: 1.4rem 0; border-top: 1px solid var(--line); }
.track-list li { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.track-list li > span { color: var(--green); font-family: "Press Start 2P", monospace; font-size: .65rem; }
.track-list div { display: grid; }
.track-list em { color: var(--muted); font-style: normal; }
.sound-button[aria-pressed="true"] { color: #061008; background: var(--green); }

@media (pointer: coarse), (max-width: 760px) {
  .hud { align-items: flex-start; }
  .brand-sign { width: clamp(10.5rem, 40vw, 13rem); height: 3rem; padding-left: .7rem; }
  .brand-overline { font-size: .39rem; }
  .brand-title { font-size: clamp(.88rem, 4vw, 1.15rem); }
  .brand-subline { font-size: .38rem; padding-inline: .35rem; }
  .hud-stats { gap: .7rem; }
  .icon-button { padding: .55rem .65rem; }
  .touch-controls { display: grid; }
  footer { display: none; }
  .story-beats { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .scanlines { display: none; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

[hidden] { display: none !important; }
:where(button, a):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
#game:focus { outline: none; }
.game-shell { height: 100dvh; min-height: 0; grid-template-rows: auto auto 1fr auto; }
.stations-nav {
  display: flex;
  gap: .35rem;
  padding: .45rem clamp(.6rem, 3vw, 3rem);
  overflow-x: auto;
  background: #06111a;
  border-bottom: 1px solid var(--line);
}
.stations-nav button {
  flex: 0 0 auto;
  padding: .45rem .75rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: .9rem;
}
.stations-nav button:hover { color: var(--blue); border-color: var(--line); }

.boot-screen {
  position: fixed;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 1rem;
  background: radial-gradient(ellipse at center, #112532, #03070a 75%);
}
.boot-content { width: min(100%, 72rem); text-align: center; }
.boot-logo-stage {
  position: relative; width: min(100%, 68rem); max-height: 68dvh; aspect-ratio: 1673 / 941;
  margin: 0 auto .7rem; overflow: hidden; isolation: isolate;
  border: 1px solid rgba(48, 206, 255, .3); background: #02050a;
  box-shadow: 0 0 2.4rem rgba(0, 156, 255, .2), 0 0 3.6rem rgba(255, 75, 0, .14);
}
.boot-logo-stage img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  animation: boot-logo-breathe 4.6s ease-in-out infinite;
}
.boot-logo-stage::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, rgba(255, 67, 0, .14), transparent 43%, rgba(0, 142, 255, .18));
  mix-blend-mode: screen; animation: boot-lightning 3.2s steps(1, end) infinite;
}
.boot-energy {
  position: absolute; z-index: 2; inset: 5%; pointer-events: none; border: 1px solid rgba(86, 220, 255, .22);
  box-shadow: inset 0 0 2rem rgba(34, 175, 255, .13), 0 0 2rem rgba(255, 100, 0, .12);
  animation: boot-energy-pulse 1.8s ease-in-out infinite;
}
.boot-scan {
  position: absolute; z-index: 3; left: 0; right: 0; top: -16%; height: 14%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(155, 239, 255, .24), transparent);
  mix-blend-mode: screen; animation: boot-scan 2.4s linear infinite;
}
.boot-sparks { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.boot-sparks i {
  position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #ffb128;
  box-shadow: 0 0 8px #ff5b00; animation: boot-spark 1.8s ease-in infinite;
}
.boot-sparks i:nth-child(1) { left: 8%; top: 78%; animation-delay: -.2s; }
.boot-sparks i:nth-child(2) { left: 17%; top: 65%; animation-delay: -1.1s; }
.boot-sparks i:nth-child(3) { left: 27%; top: 88%; animation-delay: -.7s; }
.boot-sparks i:nth-child(4) { left: 38%; top: 72%; animation-delay: -1.5s; }
.boot-sparks i:nth-child(5) { left: 48%; top: 91%; animation-delay: -.4s; }
.boot-sparks i:nth-child(6) { left: 57%; top: 76%; animation-delay: -1.25s; }
.boot-sparks i:nth-child(7) { left: 67%; top: 86%; animation-delay: -.85s; background: #58cfff; box-shadow: 0 0 8px #168dff; }
.boot-sparks i:nth-child(8) { left: 75%; top: 69%; animation-delay: -1.6s; background: #58cfff; box-shadow: 0 0 8px #168dff; }
.boot-sparks i:nth-child(9) { left: 84%; top: 82%; animation-delay: -.55s; background: #58cfff; box-shadow: 0 0 8px #168dff; }
.boot-sparks i:nth-child(10) { left: 92%; top: 62%; animation-delay: -1.35s; background: #58cfff; box-shadow: 0 0 8px #168dff; }
.boot-sparks i:nth-child(11) { left: 32%; top: 61%; animation-delay: -1.75s; }
.boot-sparks i:nth-child(12) { left: 71%; top: 93%; animation-delay: -.95s; background: #58cfff; box-shadow: 0 0 8px #168dff; }
.boot-hint { color: #b9cbd6; margin: .65rem 0; font-size: .95rem; }
.boot-loading { display: grid; justify-items: center; gap: .55rem; color: var(--blue); font-weight: 700; letter-spacing: .14em; }
.boot-meter { width: min(70%, 20rem); height: .45rem; overflow: hidden; border: 1px solid rgba(62, 216, 255, .65); background: #06121e; }
.boot-meter i { display: block; width: 42%; height: 100%; background: linear-gradient(90deg, transparent, #38dfff, #ff9a18, transparent); animation: boot-meter 1.35s ease-in-out infinite; }
.boot-loading.ready { color: #77ff9d; }
.boot-loading.ready .boot-meter { border-color: rgba(91, 255, 137, .72); }
.boot-loading.ready .boot-meter i { width: 100%; transform: none; animation: none; background: linear-gradient(90deg, #24c75a, #8bffac); }

@keyframes boot-logo-breathe { 0%, 100% { transform: scale(1); filter: saturate(1); } 50% { transform: scale(1.025); filter: saturate(1.18) brightness(1.08); } }
@keyframes boot-lightning { 0%, 88%, 92%, 100% { opacity: .28; } 89%, 91% { opacity: 1; } 90% { opacity: .1; } }
@keyframes boot-energy-pulse { 0%, 100% { opacity: .35; transform: scale(.99); } 50% { opacity: .9; transform: scale(1.01); } }
@keyframes boot-scan { to { transform: translateY(820%); } }
@keyframes boot-spark { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(18px, -90px) scale(1.8); } }
@keyframes boot-meter { 0% { transform: translateX(-115%); } 100% { transform: translateX(240%); } }

@media (max-height: 650px) {
  .boot-logo-stage { max-height: 58dvh; width: min(82%, 52rem); }
}

@media (prefers-reduced-motion: reduce) {
  .boot-logo-stage img, .boot-logo-stage::before, .boot-energy, .boot-scan, .boot-sparks i, .boot-meter i { animation: none; }
}

.story-page { min-height: 7rem; }
.story-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.icon-button:disabled { opacity: .45; cursor: default; }
.icon-button:disabled:hover { background: rgba(165, 77, 14, .2); color: #ffd29e; }

.steam-dialog { padding: 0; }
.steam-dialog .dialog-close { z-index: 2; background: #07111a; padding: 0 .6rem; border: 1px solid var(--line); line-height: 1.15; }
.demo-banner { display: grid; justify-items: center; gap: 1rem; padding: 1rem; background: #03070a; }
.demo-banner img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(72dvh, 52rem); object-fit: contain; border: 1px solid rgba(66,217,255,.35); box-shadow: 0 0 34px rgba(21,157,255,.2); }
.steam-link { width: min(100%, 28rem); text-align: center; }
.action-link { display: inline-block; text-decoration: none; overflow-wrap: anywhere; }
.studio-art { display: block; width: min(100%, 27rem); margin: 0 auto; }
.credits-list { margin: 0; }
.credits-list div { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.credits-list dt { color: #a8c1ce; }
.credits-list dd { margin: 0; font-weight: 700; }
.social-poster-dialog {
  width: min(96vw, calc(94dvh * 1.332), 68rem); max-width: none; max-height: 96dvh;
  padding: 0; overflow: visible; border: 0; background: transparent; box-shadow: none;
}
.social-poster-dialog::backdrop { background: rgba(0, 5, 12, .9); backdrop-filter: blur(5px); }
.social-poster-wrap { position: relative; width: 100%; }
.social-poster-wrap > img { display: block; width: 100%; height: auto; user-select: none; }
.social-poster-close, .social-hotspot {
  position: absolute; z-index: 2; display: block; border: 0; background: transparent; cursor: pointer;
}
.social-poster-close { left: 80.7%; top: 14.5%; width: 6.1%; height: 8.7%; }
.social-hotspot { left: 21.2%; width: 63%; height: 9.5%; border-radius: .35rem; }
.social-hotspot.instagram { top: 42.45%; }
.social-hotspot.youtube { top: 53.45%; }
.social-hotspot.tiktok { top: 64.35%; }
.social-hotspot span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.social-hotspot:hover, .social-hotspot:focus-visible {
  outline: 3px solid rgba(255, 111, 24, .9); outline-offset: -3px;
  background: linear-gradient(90deg, rgba(255, 40, 24, .14), rgba(255, 132, 20, .08));
  box-shadow: 0 0 1.2rem rgba(255, 71, 30, .55), inset 0 0 1rem rgba(255, 94, 30, .18);
}
.social-poster-close:hover, .social-poster-close:focus-visible {
  outline: 2px solid #ff9a1a; outline-offset: -2px; background: rgba(255, 106, 0, .14);
}
.book-dialog {
  width: min(94vw, 36rem); max-height: 96dvh; padding: .75rem;
  border-color: rgba(255, 107, 25, .72); background: linear-gradient(180deg, #180906, #05080d);
  box-shadow: 0 0 3rem rgba(255, 70, 0, .28), inset 0 0 2rem rgba(255, 104, 20, .08);
}
.book-dialog h2 { margin: .2rem 2.5rem .55rem 0; color: #ffb15b; font-size: clamp(1.2rem, 3vw, 1.7rem); }
.book-dialog .eyebrow { color: #ff7b23; }
.book-poster-link { display: grid; place-items: center; color: inherit; text-decoration: none; }
.book-poster-link img {
  display: block; width: auto; max-width: 100%; max-height: 58dvh; object-fit: contain;
  border: 1px solid rgba(255, 132, 44, .45); box-shadow: 0 0 1.4rem rgba(255, 61, 0, .22);
}
.book-poster-link:hover img, .book-poster-link:focus-visible img { border-color: #ff9a32; box-shadow: 0 0 2rem rgba(255, 78, 0, .52); }
.book-site-button { display: block; width: max-content; max-width: 100%; margin: .75rem auto 0; text-align: center; }
.downloads-dialog { width: min(94vw, 68rem); max-height: 94dvh; }
.downloads-dialog h2 { color: #8dff58; }
.wallpaper-grid { display: grid; grid-template-columns: minmax(13rem, .72fr) minmax(18rem, 1.28fr); gap: 1rem; align-items: stretch; }
.wallpaper-card {
  display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: .7rem; min-width: 0; padding: .75rem;
  border: 1px solid rgba(76, 209, 255, .42); background: linear-gradient(180deg, rgba(9, 36, 61, .94), rgba(3, 12, 22, .98));
  box-shadow: inset 0 0 1.8rem rgba(32, 172, 255, .08);
}
.wallpaper-card img { display: block; width: 100%; height: min(42dvh, 23rem); object-fit: cover; object-position: center; border: 1px solid rgba(107, 234, 255, .35); }
.mobile-wallpaper img { object-position: center top; }
.wallpaper-card > div { display: grid; gap: .15rem; }
.wallpaper-card strong { color: #ecfaff; font-size: 1.05rem; }
.wallpaper-card span { color: var(--muted); font-size: .86rem; }
.wallpaper-card .action-link { margin: 0; text-align: center; }

@media (max-width: 700px) {
  .wallpaper-grid { grid-template-columns: 1fr; }
  .wallpaper-card img { height: 34dvh; }
}

@media (pointer: coarse), (max-width: 760px) {
  .game-shell { grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .touch-controls { position: static; padding: .4rem max(.35rem, env(safe-area-inset-right)) max(.4rem, env(safe-area-inset-bottom)) max(.35rem, env(safe-area-inset-left)); grid-template-columns: 2.5rem repeat(2, minmax(0, 1fr)) 2.5rem; gap: .3rem; }
  .touch-controls button { min-height: 2.8rem; padding: .1rem; font-size: .82rem; touch-action: none; }
}
@media (max-width: 540px) {
  .demo-banner { padding: .75rem; }
  .demo-banner img { max-height: 68dvh; }
  .hud { padding: .65rem .55rem; gap: .35rem; }
  .hud-stats { gap: .35rem; }
  .hud-stats .icon-button { padding: .4rem; font-size: .78rem; letter-spacing: 0; }
  .hud-stats span { letter-spacing: 0; }
}

.cabinet-controls { position: absolute; inset: 0; pointer-events: none; }
.cabinet-hit-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 208px;
  height: 264px;
  transform-origin: top left;
  border: 0;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
}
.cabinet-hit-area:hover { box-shadow: inset 0 0 0 2px #b9efff, 0 0 18px #42d9ff70; }
dialog::backdrop { background: #020911a8; backdrop-filter: none; }
