:root {
  color-scheme: dark;
  --background: #080b16;
  --surface: #101527;
  --surface-raised: #171e35;
  --line: rgba(174, 190, 255, 0.18);
  --text: #f3f5ff;
  --muted: #a9b1ca;
  --cyan: #4be1de;
  --blue: #7588ff;
  --pink: #ff5ea8;
  --error: #ff7d92;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--background);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 5%, rgba(117, 136, 255, 0.16), transparent 28rem),
    var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
.game-screen:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

a {
  color: var(--cyan);
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  aspect-ratio: 1;
  background:
    linear-gradient(var(--cyan) 0 0) 0 0 / 16px 16px,
    linear-gradient(var(--blue) 0 0) 18px 0 / 16px 16px,
    linear-gradient(var(--pink) 0 0) 18px 18px / 16px 16px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 12px rgba(75, 225, 222, 0.4));
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 10px;
}

.text-button,
.close-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(16, 21, 39, 0.7);
  color: var(--text);
  cursor: pointer;
}

.text-button:hover,
.close-button:hover {
  border-color: var(--cyan);
}

.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.intro {
  max-width: 820px;
  padding: 76px 0 44px;
}

.eyebrow,
.launch-kicker,
.detail-number {
  margin: 0 0 16px;
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(2.5rem, 7vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.intro > p:last-child {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.game-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #03040a;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.36),
    0 0 80px rgba(117, 136, 255, 0.08);
}

.game-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 78vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 50%, transparent 50%) 0 0 / 100% 4px,
    #020308;
}

.game-screen:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  aspect-ratio: auto;
  background: #000;
}

.launch-panel {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle, rgba(117, 136, 255, 0.16), transparent 45%),
    transparent;
}

.launch-panel[hidden] {
  display: none;
}

.launch-panel h2 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.launch-panel > p:not(.launch-kicker) {
  max-width: 500px;
  margin-right: auto;
  margin-bottom: 26px;
  margin-left: auto;
  color: var(--muted);
  line-height: 1.6;
}

.launch-button {
  border: 0;
  border-radius: 10px;
  padding: 14px 24px;
  background: var(--cyan);
  color: #031211;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(75, 225, 222, 0.24);
}

.launch-button:hover {
  background: #76f3ef;
}

.launch-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.status-bar {
  min-height: 50px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.status-bar p {
  margin: 0;
}

#status[data-state="running"] {
  color: var(--cyan);
}

#status[data-state="error"] {
  color: var(--error);
}

.details {
  padding: 64px 0 76px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.details article {
  padding: 26px;
  background: var(--background);
}

.details h2 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.details article > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

dialog {
  width: min(560px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

dialog::backdrop {
  background: rgba(2, 3, 8, 0.78);
  backdrop-filter: blur(8px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.controls-list {
  margin: 26px 0;
}

.controls-list div {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.controls-list dt {
  color: var(--muted);
}

.controls-list dd {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.dialog-info {
  display: grid;
  gap: 18px;
}

.dialog-info section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.dialog-info h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.dialog-info p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

footer p {
  margin: 0;
}

@media (max-width: 720px) {
  .site-header {
    width: min(100% - 28px, 1180px);
  }

  .brand small {
    display: none;
  }

  .text-button {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  main {
    width: min(100% - 28px, 1180px);
  }

  .intro {
    padding-top: 52px;
  }

  .game-shell {
    border-radius: 12px;
  }

  .status-bar {
    display: block;
  }

  .status-bar p + p {
    display: none;
  }

  .details {
    grid-template-columns: 1fr;
  }

  footer {
    width: min(100% - 28px, 1180px);
  }
}

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