:root {
  --bg-deep: #0b1220;
  --bg-mid: #132038;
  --accent: #ffb020;
  --accent-hot: #ff5a36;
  --panel: rgba(8, 14, 28, 0.86);
  --text: #f4f7ff;
  --muted: #9bb0d0;
  --line: rgba(255, 255, 255, 0.12);
  --ok: #3dffa8;
  --danger: #ff4d6d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Press Start 2P", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255, 90, 54, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(255, 176, 32, 0.14), transparent 50%),
    linear-gradient(180deg, var(--bg-mid), var(--bg-deep));
  color: var(--text);
  font-family: var(--font);
}

body {
  display: flex;
  justify-content: center;
}

.page {
  width: min(1200px, calc(100% - 32px));
  padding: 28px 0 40px;
}

.site-header {
  text-align: center;
  margin-bottom: 22px;
}

.logo {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(255, 176, 32, 0.35);
}

.tagline {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.7;
}

.game-shell {
  width: 100%;
}

.game-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #071018;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0a1524;
}

.hud {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 10px 12px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: blur(6px);
}

.hud-item span {
  font-size: 0.42rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hud-item strong {
  font-size: 0.72rem;
  color: var(--accent);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(10, 18, 32, 0.55), rgba(5, 8, 16, 0.88));
  transition: opacity 0.2s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  width: min(520px, 100%);
  padding: 28px 24px;
  border: 2px solid rgba(255, 176, 32, 0.35);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(18, 28, 48, 0.96), rgba(8, 12, 22, 0.96));
  box-shadow: var(--shadow);
  text-align: center;
}

.overlay-card h2 {
  margin: 0 0 14px;
  font-size: clamp(0.9rem, 2.4vw, 1.25rem);
  color: var(--accent);
  line-height: 1.4;
}

.overlay-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.55rem;
  line-height: 1.8;
}

.controls {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  text-align: left;
}

.controls li {
  font-size: 0.5rem;
  color: var(--text);
  line-height: 1.6;
}

kbd {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ok);
  font: inherit;
  font-size: 0.48rem;
}

.btn {
  margin-top: 22px;
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  background: linear-gradient(180deg, #ffc14d, var(--accent-hot));
  color: #1a1008;
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  box-shadow: 0 8px 0 #8c2a12, 0 14px 24px rgba(255, 90, 54, 0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #8c2a12, 0 8px 16px rgba(255, 90, 54, 0.28);
}

.site-footer {
  margin-top: 18px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.45rem;
  line-height: 1.8;
}

.site-footer code {
  color: var(--ok);
}

@media (max-width: 720px) {
  .page {
    width: min(100%, calc(100% - 16px));
    padding-top: 16px;
  }

  .hud-item {
    min-width: 58px;
    padding: 6px 8px;
  }

  .hud-item span {
    font-size: 0.34rem;
  }

  .hud-item strong {
    font-size: 0.58rem;
  }
}
