:root {
  --void: #05080a;
  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.18);
  --amber: #ffb347;
  --ink: #e8fbff;
  --muted: #7aa0aa;
  --shell: #0d161c;
  --font-display: "Chakra Petch", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-mono);
  background: var(--void);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hex-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-color: var(--void);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath fill='none' stroke='%2300e5ff' stroke-opacity='0.12' stroke-width='1' d='M28 2 L54 17 L54 47 L28 62 L2 47 L2 17 Z M28 62 L54 77 L54 107 L28 122 L2 107 L2 77 Z M-26 17 L0 32 L0 62 L-26 77 L-52 62 L-52 32 Z M82 17 L108 32 L108 62 L82 77 L56 62 L56 32 Z'/%3E%3C/svg%3E");
  background-size: 56px 98px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 20%, transparent 80%);
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(0, 229, 255, 0.08), transparent 58%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.72) 100%);
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}

.scanlines::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 229, 255, 0.04),
    transparent
  );
  animation: sweep 9s linear infinite;
}

@keyframes sweep {
  from {
    transform: translateY(-120%);
  }
  to {
    transform: translateY(520%);
  }
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 2.5rem;
  background: var(--void);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-log {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
  letter-spacing: 0.28em;
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  color: var(--cyan);
}

.boot-log li {
  opacity: 0;
  transform: translateY(8px);
  animation: boot-line 0.5s ease forwards;
}

.boot-log li:nth-child(1) {
  opacity: 1;
  transform: none;
  animation: none;
}

.boot-log li:nth-child(2) {
  animation-delay: 0.7s;
}

.boot-log li:nth-child(3) {
  animation-delay: 1.25s;
  color: var(--ink);
  text-shadow: 0 0 18px var(--cyan-dim);
}

@keyframes boot-line {
  to {
    opacity: 1;
    transform: none;
  }
}

.boot-hint {
  margin: 0;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: boot-line 0.4s ease 1.7s forwards;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vh, 1.4rem);
  padding: 2.5rem 1.25rem 3rem;
  text-align: center;
}

.visor {
  width: min(42vw, 280px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  filter: drop-shadow(0 0 18px rgba(0, 229, 255, 0.18));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.visor:hover,
.visor:focus-visible {
  transform: scale(1.03);
  filter: drop-shadow(0 0 28px rgba(0, 229, 255, 0.38));
  outline: none;
}

.visor svg {
  display: block;
  width: 100%;
  height: auto;
}

.helmet {
  fill: url(#shell);
  stroke: url(#edge);
  stroke-width: 1.6;
}

.helmet-ridge {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.4;
  opacity: 0.55;
}

.side-piece {
  fill: #0a1216;
  stroke: url(#edge);
  stroke-width: 1.4;
}

.visor-well {
  fill: #021014;
}

.visor-glass {
  fill: url(#glass);
  opacity: 0.55;
  animation: visor-pulse 3.4s ease-in-out infinite;
}

.visor-shine {
  fill: rgba(232, 251, 255, 0.22);
}

.pupil {
  fill: var(--cyan);
  transition: transform 0.08s linear;
}

.lids {
  opacity: 0;
}

.lid {
  fill: #021014;
}

.visor.is-blink .lids {
  opacity: 1;
}

.visor.is-blink #pupils .pupil {
  opacity: 0;
}

@keyframes visor-pulse {
  0%,
  100% {
    opacity: 0.42;
  }
  50% {
    opacity: 0.72;
  }
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 10vw, 6.4rem);
  letter-spacing: 0.14em;
  line-height: 0.95;
  text-indent: 0.14em;
  text-shadow:
    0 0 18px rgba(0, 229, 255, 0.45),
    0 0 48px rgba(0, 229, 255, 0.18);
}

.tagline {
  margin: 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: clamp(0.8rem, 1.6vw, 1rem);
  letter-spacing: 0.08em;
}

.channels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.75rem;
  margin-top: clamp(0.8rem, 3vh, 2rem);
}

.channels a {
  display: grid;
  gap: 0.28rem;
  min-width: 8.5rem;
  padding: 0.7rem 0.4rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.channels a:hover,
.channels a:focus-visible {
  border-bottom-color: var(--cyan);
  outline: none;
}

.ch-id {
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  color: var(--amber);
}

.ch-val {
  font-size: 0.82rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.egg {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  margin: 0;
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 4.5rem);
  letter-spacing: 0.22em;
  color: var(--amber);
  text-shadow:
    0 0 18px rgba(255, 179, 71, 0.7),
    0 0 60px rgba(0, 229, 255, 0.35);
  background: rgba(5, 8, 10, 0.42);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.egg.is-on {
  opacity: 1;
  transform: none;
}

.game {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--void);
  touch-action: none;
}

.game[hidden] {
  display: none;
}

.game-hud {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
}

.game-stat {
  margin: 0;
  color: var(--muted);
}

.game-stat span {
  color: var(--amber);
  margin-left: 0.4em;
}

.game-close {
  border: 1px solid var(--cyan-dim);
  background: transparent;
  color: var(--cyan);
  font: inherit;
  letter-spacing: 0.22em;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.game-close:hover,
.game-close:focus-visible {
  border-color: var(--cyan);
  outline: none;
}

.game-field {
  position: relative;
  overflow: hidden;
}

.game-player {
  position: absolute;
  width: min(38vw, 168px);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.28));
  pointer-events: none;
  will-change: left, top;
}

.game-player.is-hit {
  filter: drop-shadow(0 0 22px rgba(255, 179, 71, 0.85));
}

.game-player svg {
  display: block;
  width: 100%;
  height: auto;
}

.packet {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  transform: rotate(45deg);
  pointer-events: none;
}

.packet.is-amber {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

.game-banner {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  margin: 0;
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 6vw, 3.4rem);
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--ink);
  text-shadow: 0 0 22px rgba(0, 229, 255, 0.45);
}

.game-banner.is-win {
  color: var(--amber);
  text-shadow:
    0 0 18px rgba(255, 179, 71, 0.7),
    0 0 60px rgba(0, 229, 255, 0.35);
}

.game-banner.is-lose {
  color: var(--muted);
}

.game-banner[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .stage {
    min-height: auto;
    padding-top: 3.5rem;
  }

  .visor {
    width: min(68vw, 240px);
  }

  .game-player {
    width: min(46vw, 140px);
  }

  .channels {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.35rem;
  }

  .channels a {
    width: min(100%, 18rem);
    border-bottom-color: var(--cyan-dim);
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot,
  .boot-log li,
  .boot-hint,
  .visor-glass,
  .scanlines::after,
  .egg,
  .pupil,
  .lids {
    animation: none !important;
    transition: none !important;
  }

  .boot {
    display: none;
  }

  .scanlines::after {
    content: none;
  }
}
