:root {
  color-scheme: dark;
  --ink: #f6fbff;
  --muted: #a9c8d8;
  --panel: #0b2630;
  --coral: #ff7f72;
  --gold: #ffd166;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #07191f;
  color: var(--ink);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.game-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(12px, 4vw, 40px);
  border-bottom: 3px solid rgba(119, 215, 212, 0.48);
  background: rgba(4, 18, 22, 0.9);
}

.brand {
  color: #fff8ee;
  font-weight: 800;
  letter-spacing: 0;
}

.rsvp-link {
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border: 3px solid var(--gold);
  background: #123b43;
  box-shadow: 0 4px 0 #041115;
  color: var(--ink);
  font-weight: 800;
}

.rsvp-link:hover,
.rsvp-link:focus-visible {
  background: #174f59;
}

main {
  min-height: calc(100vh - 58px);
  background:
    linear-gradient(180deg, rgba(21, 144, 165, 0.22), transparent 46%),
    radial-gradient(circle at 14% 12%, rgba(255, 209, 102, 0.12), transparent 24rem),
    #07191f;
}

.game-shell {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 34px);
}

.game-panel {
  width: min(100%, 1100px);
  display: grid;
  gap: 10px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hud > div,
.status-line,
.touch-controls button {
  border: 3px solid #2f6971;
  background: color-mix(in srgb, var(--panel) 82%, black);
  box-shadow: 0 4px 0 #041115;
}

.hud > div {
  min-height: 54px;
  padding: 8px 12px;
  display: grid;
  align-content: center;
}

.hud-label {
  color: var(--muted);
  display: block;
  font-size: clamp(0.65rem, 1.4vw, 0.82rem);
  line-height: 1.1;
  text-transform: uppercase;
}

.hud strong {
  color: var(--gold);
  font-size: clamp(1rem, 2.7vw, 1.55rem);
  line-height: 1.1;
}

canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 4px solid #77d7d4;
  background: #0f4b67;
  box-shadow:
    0 0 0 6px #0a2229,
    0 18px 45px rgba(0, 0, 0, 0.38);
}

.status-line {
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 8px 12px;
  color: var(--ink);
  text-align: center;
  font-size: clamp(0.78rem, 2vw, 1rem);
}

.touch-controls {
  display: none;
  grid-template-columns: 64px 64px 1fr 72px 72px;
  gap: 10px;
  align-items: center;
}

.touch-controls button {
  height: 58px;
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem;
  touch-action: none;
}

.touch-controls button[data-control="action"] {
  grid-column: 4;
  border-color: var(--gold);
}

.touch-controls button[data-control="jump"] {
  grid-column: 5;
  border-color: var(--coral);
}

@media (hover: none), (max-width: 760px) {
  .game-header {
    position: static;
  }

  .game-shell {
    align-items: start;
    padding: 10px;
  }

  .hud > div {
    min-height: 48px;
    padding: 7px 8px;
  }

  .touch-controls {
    display: grid;
  }
}

@media (max-width: 520px) {
  .game-header {
    min-height: 52px;
  }

  main,
  .game-shell {
    min-height: calc(100vh - 52px);
  }

  .brand,
  .rsvp-link {
    font-size: 0.86rem;
  }

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