:root {
  --bg-top: #9fd6ea;
  --bg-bottom: #031a33;
  --panel: rgba(3, 16, 31, 0.7);
  --panel-border: rgba(186, 230, 253, 0.25);
  --foam: #e7fbff;
  --accent: #ffd166;
  --danger: #ff6b6b;
  --success: #6ef3b0;
  --text: #f3fbff;
  --muted: #a4c6d9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.35), transparent 28%),
    linear-gradient(180deg, #8fd3e8 0%, #236b93 28%, #06355f 58%, #03111f 100%);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.hud {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-bottom: 14px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(3, 16, 31, 0.52);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

h1, h2 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.instructions {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

kbd {
  padding: 0.18rem 0.42rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat {
  min-width: 110px;
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.stat span {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.game-panel {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(2, 10, 20, 0.45), rgba(2, 10, 20, 0.72));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--bg-top) 0 28%, #1784b9 28.5%, #0d5277 44%, var(--bg-bottom) 100%);
}

.overlay {
  position: absolute;
  inset: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(1, 15, 30, 0.18), rgba(1, 15, 30, 0.72));
  border-radius: 18px;
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  width: min(520px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  background: rgba(3, 16, 31, 0.78);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.overlay-card p {
  line-height: 1.55;
  color: var(--muted);
}

button {
  margin-top: 12px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #072338;
  background: linear-gradient(135deg, #ffe29a, #ffd166);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 12px 30px rgba(255, 209, 102, 0.24);
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 18px, 1120px);
    padding-top: 18px;
  }

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

  .stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat {
    min-width: 0;
  }

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