:root {
  --night: #07080f;
  --panel: #0d101c;
  --paper: #edf7ff;
  --muted: #8e9aad;
  --cyan: #57f3ff;
  --cyan-soft: #a5f8ff;
  --violet: #8b5cff;
  --red: #ff315c;
  --orange: #ff8c5c;
  --line: rgba(176, 225, 255, 0.14);
}

* { box-sizing: border-box; }

html {
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 15% 0%, rgba(64, 52, 127, 0.28), transparent 34rem),
    radial-gradient(circle at 85% 24%, rgba(20, 112, 129, 0.13), transparent 32rem),
    var(--night);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.site-shell { min-height: 100vh; overflow: hidden; }

.site-header,
.hero,
.game-shelf,
footer {
  width: min(1220px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--cyan), var(--violet));
  box-shadow: 0 0 28px rgba(87, 243, 255, 0.24);
  transform: rotate(30deg);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  background: var(--night);
}

.brand-mark::before {
  inset: 7px;
  border-radius: 4px;
}

.brand-mark::after {
  width: 5px;
  height: 5px;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: var(--red);
  transform: translate(-50%, -50%);
}

.header-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: rgba(237, 247, 255, 0.55);
  font-size: 12px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.hero { padding: 56px 0 92px; }

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.58fr);
  gap: 70px;
  align-items: end;
  margin-bottom: 30px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--cyan-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1,
.game-shelf h2,
.game-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(50px, 7.5vw, 98px);
  letter-spacing: -0.068em;
  line-height: 0.9;
}

.hero-intro {
  max-width: 470px;
  margin: 0 0 4px;
  color: rgba(237, 247, 255, 0.65);
  font-size: clamp(15px, 1.55vw, 18px);
  line-height: 1.7;
}

.hero-intro strong { color: var(--paper); }

.game-frame {
  position: relative;
  min-height: 630px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(133, 220, 255, 0.18);
  border-radius: 28px;
  outline: none;
  touch-action: none;
  background:
    radial-gradient(circle at 50% 34%, rgba(54, 44, 106, 0.34), transparent 42%),
    linear-gradient(180deg, #0b0e1a, #05060b);
  box-shadow:
    0 50px 120px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  isolation: isolate;
  cursor: crosshair;
}

.game-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 100px rgba(0, 0, 0, 0.55),
    inset 0 -70px 100px rgba(0, 0, 0, 0.28);
}

.game-frame:focus-visible {
  box-shadow:
    0 0 0 4px rgba(87, 243, 255, 0.42),
    0 50px 120px rgba(0, 0, 0, 0.48);
}

#game-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

.game-hud {
  position: absolute;
  z-index: 5;
  top: 24px;
  left: 26px;
  right: 26px;
  display: grid;
  grid-template-columns: 90px minmax(220px, 380px) 110px;
  justify-content: space-between;
  align-items: start;
  pointer-events: none;
}

.hud-cluster {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-right { align-items: flex-end; }

.hud-label,
.stage-copy span,
.health-copy span,
.shield-copy span,
.boss-status span {
  color: rgba(215, 240, 255, 0.52);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hud-cluster strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.stage-progress {
  padding: 10px 13px;
  border: 1px solid rgba(129, 218, 255, 0.12);
  border-radius: 12px;
  background: rgba(5, 8, 16, 0.48);
  backdrop-filter: blur(10px);
}

.stage-copy,
.health-copy,
.shield-copy,
.boss-status > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.stage-copy strong,
.health-copy strong,
.shield-copy strong,
.boss-status strong {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.progress-track,
.health-track,
.shield-track,
.boss-track {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.progress-track span,
.health-track span,
.shield-track span,
.boss-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 14px rgba(87, 243, 255, 0.6);
  transition: width 180ms ease;
}

.player-status {
  position: absolute;
  z-index: 5;
  left: 27px;
  bottom: 25px;
  width: 170px;
  padding: 11px 13px;
  border: 1px solid rgba(129, 218, 255, 0.13);
  border-radius: 12px;
  background: rgba(5, 8, 16, 0.56);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.health-track span {
  width: 100%;
  background: linear-gradient(90deg, #2fe5b8, var(--cyan));
}

.shield-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 6px;
}

.shield-copy span { color: rgba(140, 212, 255, 0.68); }
.shield-copy strong {
  color: #9de8ff;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.shield-track span {
  width: 100%;
  background: linear-gradient(90deg, #416cff, #57f3ff);
  box-shadow: 0 0 15px rgba(87, 195, 255, 0.72);
}

.boss-status {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 26px;
  width: min(420px, 42%);
  padding: 11px 14px;
  border: 1px solid rgba(255, 49, 92, 0.25);
  border-radius: 12px;
  background: rgba(19, 5, 14, 0.66);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.boss-status span { color: rgba(255, 174, 192, 0.8); }
.boss-track span {
  width: 100%;
  background: linear-gradient(90deg, #ff315c, #ff7a45);
  box-shadow: 0 0 16px rgba(255, 49, 92, 0.6);
}

.hidden { display: none !important; }

.game-overlay,
.upgrade-overlay {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 44%, rgba(44, 47, 95, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(4, 6, 13, 0.3), rgba(4, 5, 11, 0.88));
  backdrop-filter: blur(3px);
}

.overlay-glow {
  position: absolute;
  width: 370px;
  height: 370px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(87, 243, 255, 0.11), transparent 68%);
  pointer-events: none;
}

.game-kicker {
  position: relative;
  margin: 0 0 12px;
  color: var(--cyan-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}

.game-overlay h2,
.upgrade-overlay h2 {
  position: relative;
  margin: 0;
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.9;
  text-shadow: 0 0 34px rgba(87, 243, 255, 0.18);
}

.game-overlay > p:not(.game-kicker) {
  position: relative;
  max-width: 520px;
  margin: 19px 0 25px;
  color: rgba(233, 244, 255, 0.68);
  font-size: 14px;
  line-height: 1.6;
}

.play-button {
  position: relative;
  min-height: 50px;
  padding: 0 25px;
  border: 1px solid rgba(191, 248, 255, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan-soft), #7cc9ff);
  color: #080b15;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 0 14px 38px rgba(52, 200, 231, 0.2);
  transition: transform 160ms ease, filter 160ms ease;
}

.play-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.play-button:disabled { cursor: wait; filter: saturate(0.2); opacity: 0.6; }
.play-button:focus-visible,
.upgrade-card:focus-visible { outline: 3px solid white; outline-offset: 3px; }

.desktop-controls {
  position: relative;
  display: flex;
  gap: 18px;
  margin-top: 22px;
  color: rgba(223, 238, 249, 0.48);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

kbd {
  margin-right: 4px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(237, 247, 255, 0.8);
  font-family: inherit;
  font-size: 8px;
}

.mobile-controls { display: none; }

.stage-banner {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--cyan-soft);
  transform: translate(-50%, -50%);
  text-shadow: 0 0 30px rgba(87, 243, 255, 0.5);
  pointer-events: none;
  animation: stage-in 1.45s ease both;
}

.stage-banner span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.32em;
}

.stage-banner strong {
  margin-top: 7px;
  color: white;
  font-size: clamp(44px, 6vw, 78px);
  letter-spacing: -0.05em;
}

@keyframes stage-in {
  0% { opacity: 0; transform: translate(-50%, -42%) scale(0.94); }
  20%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(1.04); }
}

.upgrade-overlay {
  z-index: 9;
  background: rgba(5, 7, 14, 0.9);
}

.upgrade-overlay h2 {
  font-size: clamp(32px, 4vw, 52px);
}

.upgrade-grid {
  width: min(780px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-top: 28px;
}

.upgrade-card {
  position: relative;
  min-height: 164px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid rgba(130, 218, 255, 0.16);
  border-radius: 15px;
  background:
    linear-gradient(145deg, rgba(87, 243, 255, 0.08), transparent 50%),
    rgba(14, 18, 31, 0.9);
  color: var(--paper);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.upgrade-number {
  position: absolute;
  top: 14px;
  right: 15px;
  color: rgba(192, 230, 246, 0.28);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.upgrade-card:hover {
  transform: translateY(-5px);
  border-color: rgba(87, 243, 255, 0.55);
  background:
    linear-gradient(145deg, rgba(87, 243, 255, 0.15), transparent 55%),
    rgba(17, 22, 39, 0.96);
}

.upgrade-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 19px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(87, 243, 255, 0.2), rgba(139, 92, 255, 0.24));
  color: var(--cyan-soft);
  font-size: 18px;
}

.upgrade-card strong { font-size: 15px; }
.upgrade-card small {
  margin-top: 8px;
  color: rgba(230, 242, 255, 0.54);
  font-size: 11px;
  line-height: 1.45;
}

.run-stats {
  display: flex;
  gap: 42px;
  margin: 26px 0;
}

.run-stats span { display: flex; flex-direction: column; gap: 4px; }
.run-stats small {
  color: rgba(229, 242, 255, 0.45);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.run-stats strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.best-run {
  margin-top: 14px;
  color: rgba(227, 242, 255, 0.48);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.touch-stick {
  position: absolute;
  z-index: 6;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(207, 244, 255, 0.16);
  border-radius: 50%;
  background: rgba(11, 17, 28, 0.25);
  pointer-events: none;
}

.touch-stick span {
  position: absolute;
  left: 29px;
  top: 29px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(158, 240, 255, 0.34);
  box-shadow: 0 0 22px rgba(87, 243, 255, 0.25);
}

.game-corner-label {
  position: absolute;
  z-index: 5;
  right: 27px;
  bottom: 27px;
  color: rgba(210, 235, 249, 0.35);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.18em;
  pointer-events: none;
}

.control-strip {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding-top: 16px;
  color: rgba(223, 238, 249, 0.38);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-strip span + span::before {
  content: "•";
  margin-right: 28px;
  color: rgba(87, 243, 255, 0.3);
}

.game-shelf {
  padding: 88px 0;
  border-top: 1px solid var(--line);
}

.shelf-heading { margin-bottom: 36px; }

.game-shelf h2 {
  max-width: 620px;
  font-size: clamp(36px, 5vw, 60px);
  letter-spacing: -0.055em;
  line-height: 1;
}

.game-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: 290px 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 16px 28px 16px 16px;
  border: 1px solid rgba(143, 220, 255, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.025);
}

.game-card-art {
  position: relative;
  height: 158px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 58% 42%, rgba(87, 243, 255, 0.2), transparent 33%),
    linear-gradient(145deg, #161c32, #080a12);
}

.game-card-art img {
  position: absolute;
  z-index: 2;
  width: 145px;
  right: 42px;
  bottom: -62px;
  filter: drop-shadow(0 0 22px rgba(87, 243, 255, 0.24));
  image-rendering: pixelated;
}

.card-rift {
  position: absolute;
  z-index: 1;
  width: 180px;
  height: 3px;
  left: 30px;
  top: 78px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
  box-shadow: 0 0 18px var(--cyan);
  transform: rotate(-18deg);
}

.game-card h3 {
  margin: 11px 0 7px;
  font-size: 33px;
  letter-spacing: -0.04em;
}

.game-card-copy p {
  margin: 0;
  color: rgba(229, 242, 255, 0.5);
  font-size: 13px;
}

.live-pill,
.coming-soon {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border: 1px solid rgba(87, 243, 255, 0.18);
  border-radius: 99px;
  background: rgba(87, 243, 255, 0.07);
  color: var(--cyan-soft);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gamepad { color: var(--cyan); font-size: 36px; }

.next-worlds {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding: 23px 27px;
  border: 1px dashed rgba(155, 222, 255, 0.13);
  border-radius: 20px;
  color: rgba(229, 242, 255, 0.44);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.coming-soon {
  color: #c4b5ff;
  border-color: rgba(139, 92, 255, 0.2);
  background: rgba(139, 92, 255, 0.08);
  font-family: Arial, Helvetica, sans-serif;
}

footer {
  min-height: 112px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  border-top: 1px solid var(--line);
  color: rgba(229, 242, 255, 0.36);
  font-size: 11px;
}

footer p:last-child { text-align: right; }
.footer-brand { color: var(--paper); font-size: 14px; }
.brand-mark-small { width: 24px; height: 24px; border-radius: 7px; }

@media (max-width: 760px) {
  .site-header,
  .hero,
  .game-shelf,
  footer { width: min(100% - 28px, 1220px); }

  .site-header { height: 68px; }
  .header-note { display: none; }
  .hero { padding: 40px 0 62px; }
  .hero-copy { display: block; margin-bottom: 24px; }
  .hero-intro { margin-top: 20px; }

  .game-frame {
    width: calc(100% + 28px);
    min-height: 590px;
    margin-left: -14px;
    aspect-ratio: 10 / 15;
    border-right: 0;
    border-left: 0;
    border-radius: 22px;
  }

  .game-hud {
    top: 17px;
    left: 17px;
    right: 17px;
    grid-template-columns: 55px minmax(150px, 1fr) 72px;
    gap: 7px;
  }

  .stage-progress { padding: 8px 10px; }
  .hud-cluster strong { font-size: 14px; }
  .player-status { left: 17px; bottom: 17px; width: 142px; }
  .boss-status { bottom: 72px; width: calc(100% - 34px); }
  .game-corner-label { display: none; }

  .game-overlay,
  .upgrade-overlay {
    justify-content: flex-end;
    padding: 0 23px 58px;
  }

  .game-overlay h2 { font-size: 53px; }
  .game-overlay > p:not(.game-kicker) { max-width: 330px; margin: 15px 0 21px; font-size: 13px; }
  .desktop-controls { display: none; }
  .mobile-controls {
    display: block;
    margin-top: 17px;
    color: rgba(225, 241, 251, 0.48);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .upgrade-overlay { justify-content: center; padding: 22px; }
  .upgrade-grid { grid-template-columns: 1fr; gap: 8px; margin-top: 20px; }
  .upgrade-card { min-height: 90px; display: grid; grid-template-columns: 42px 1fr; column-gap: 12px; padding: 13px; }
  .upgrade-icon { grid-row: 1 / 3; margin: 0; }
  .upgrade-card small { margin-top: 4px; }
  .run-stats { gap: 24px; }

  .control-strip {
    gap: 8px;
    flex-wrap: wrap;
    padding-inline: 10px;
    line-height: 1.5;
  }

  .control-strip span + span::before { margin-right: 8px; }
  .game-shelf { padding: 62px 0; }
  .game-card { grid-template-columns: 112px 1fr; min-height: auto; gap: 17px; padding: 12px; }
  .game-card-art { height: 112px; }
  .game-card-art img { width: 100px; right: 10px; bottom: -36px; }
  .game-card h3 { font-size: 25px; }
  .game-card-copy p { font-size: 11px; line-height: 1.45; }
  .gamepad { display: none; }
  .next-worlds { padding: 20px; font-size: 14px; }
  .next-worlds > span:first-child { max-width: 175px; }
  footer { grid-template-columns: 1fr auto; padding: 28px 0; }
  footer p:nth-of-type(1) { display: none; }
}

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