:root {
  color-scheme: dark;
  --bg-ink: #08111d;
  --bg-deep: #0e1828;
  --frame-1: rgba(157, 221, 255, 0.24);
  --frame-2: rgba(246, 176, 86, 0.2);
  --panel: rgba(7, 17, 30, 0.78);
  --panel-strong: rgba(6, 16, 26, 0.92);
  --line-soft: rgba(172, 226, 255, 0.18);
  --line-hot: rgba(255, 210, 133, 0.48);
  --text: #e8f4ff;
  --text-dim: rgba(232, 244, 255, 0.72);
  --accent-cool: #88e2ff;
  --accent-hot: #ffb36b;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 180, 92, 0.18), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(113, 209, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #060d16 0%, #0b1522 38%, #070d15 100%);
  color: var(--text);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.page-shell {
  width: min(100%, 1800px);
  padding: 20px 22px 26px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-mark {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.brand-subtitle {
  color: var(--text-dim);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.play-stage {
  display: flex;
  justify-content: center;
}

.frame-stack {
  position: relative;
  width: 100%;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, rgba(112, 213, 255, 0.1), rgba(255, 179, 112, 0.08));
  border: 1px solid var(--line-soft);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.frame-stack::before,
.frame-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.frame-stack::before {
  border-radius: 28px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 160px rgba(112, 213, 255, 0.06);
}

.frame-stack::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 14%, transparent 86%, rgba(255, 255, 255, 0.03));
}

#game-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050d17;
}

.frame-stack:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: 0;
  background: #02060b;
}

.frame-stack:fullscreen #game-canvas {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

.frame-stack:fullscreen .overlay {
  padding: 32px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(5, 10, 18, 0.1), rgba(5, 10, 18, 0.56)),
    radial-gradient(circle at center, rgba(255, 197, 106, 0.16), rgba(0, 0, 0, 0.2));
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.overlay.visible {
  opacity: 1;
  visibility: visible;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.overlay-card {
  width: min(540px, 100%);
  padding: 28px 30px 30px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow:
    0 24px 80px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.hero-card {
  width: min(620px, 100%);
}

.compact-card {
  width: min(460px, 100%);
}

.overlay-card h1,
.overlay-card h2,
.overlay-card p {
  margin: 0;
}

.overlay-card h1 {
  margin-top: 10px;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overlay-card h2 {
  margin-top: 10px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent-hot);
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.lede {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.6;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px 18px;
  margin-top: 22px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.controls-grid span {
  color: var(--text-dim);
}

.controls-grid strong {
  justify-self: end;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.primary-btn,
.chrome-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-btn {
  background:
    linear-gradient(135deg, rgba(255, 185, 110, 0.94), rgba(252, 140, 80, 0.92));
  color: #111b27;
  box-shadow:
    0 12px 28px rgba(255, 153, 92, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.chrome-btn {
  background:
    linear-gradient(135deg, rgba(99, 180, 255, 0.22), rgba(80, 114, 255, 0.14));
  border: 1px solid rgba(133, 214, 255, 0.24);
}

.primary-btn:hover,
.primary-btn:focus-visible,
.chrome-btn:hover,
.chrome-btn:focus-visible {
  transform: translateY(-1px);
}

.primary-btn:focus-visible,
.chrome-btn:focus-visible {
  outline: 2px solid rgba(255, 205, 118, 0.55);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .page-shell {
    padding: 14px 14px 18px;
  }

  .topline {
    flex-direction: column;
    align-items: stretch;
  }

  .frame-stack {
    border-radius: 20px;
  }

  .overlay {
    padding: 16px;
  }

  .overlay-card {
    padding: 22px 20px 20px;
  }

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

  .controls-grid strong {
    justify-self: start;
  }
}
