:root {
  --bg-top: #08111f;
  --bg-bottom: #122649;
  --panel: rgba(9, 20, 37, 0.82);
  --panel-border: rgba(156, 217, 255, 0.28);
  --cyan: #82f4ff;
  --gold: #ffd86b;
  --rose: #ff8eb6;
  --ink: #e8f3ff;
  --shadow: 0 28px 60px rgba(3, 8, 18, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgba(130, 244, 255, 0.2), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 216, 107, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 52vw;
  height: 52vw;
  max-width: 640px;
  max-height: 640px;
  right: -12vw;
  top: -14vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 184, 107, 0.26) 0%, rgba(255, 184, 107, 0) 72%);
  filter: blur(10px);
}

body::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 38vh;
  background:
    linear-gradient(180deg, rgba(9, 21, 38, 0) 0%, rgba(4, 9, 18, 0.68) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(156, 217, 255, 0.07) 0,
      rgba(156, 217, 255, 0.07) 1px,
      transparent 1px,
      transparent 90px
    );
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.hero {
  text-align: center;
  padding: 16px 8px 28px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(2.8rem, 9vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
}

.hero-copy {
  width: min(720px, 100%);
  margin: 18px auto 0;
  font-size: 1.06rem;
  line-height: 1.6;
  color: rgba(232, 243, 255, 0.84);
}

.game-panel,
.tips-card {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.game-panel {
  padding: 18px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hud-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(132, 194, 255, 0.08);
  border: 1px solid rgba(156, 217, 255, 0.16);
}

.hud-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: rgba(232, 243, 255, 0.65);
  margin-bottom: 6px;
}

.hud-item strong {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hearts {
  display: block;
  letter-spacing: 0.16em;
  color: #ff97be;
  text-shadow: 0 0 16px rgba(255, 142, 182, 0.36);
  white-space: nowrap;
}

.canvas-shell {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(156, 217, 255, 0.2);
  background: linear-gradient(180deg, #335f86 0%, #0f1830 100%);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  touch-action: none;
}

.overlay {
  position: absolute;
  left: 20px;
  top: 20px;
  width: min(360px, calc(100% - 40px));
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(5, 10, 19, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

.overlay.hidden {
  display: none;
}

.overlay-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: var(--gold);
}

.overlay h2 {
  margin: 0 0 10px;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.overlay p {
  margin: 0;
  line-height: 1.55;
  color: rgba(232, 243, 255, 0.84);
}

kbd {
  display: inline-block;
  padding: 0.15rem 0.42rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: inherit;
  font-size: 0.92em;
}

.action-row,
.touch-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #07111d;
  background: linear-gradient(135deg, var(--gold), #ffbf69);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover,
button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

button.secondary {
  background: linear-gradient(135deg, rgba(130, 244, 255, 0.92), rgba(94, 173, 255, 0.95));
}

button.accent {
  background: linear-gradient(135deg, rgba(255, 142, 182, 0.94), rgba(255, 216, 107, 0.96));
}

.touch-controls button {
  min-width: 112px;
}

.tips-card {
  margin-top: 22px;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tips-card h3 {
  margin: 0 0 8px;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.05rem;
}

.tips-card p {
  margin: 0;
  color: rgba(232, 243, 255, 0.82);
  line-height: 1.58;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100vw - 20px, 1120px);
    padding-top: 24px;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tips-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .game-panel {
    padding: 12px;
  }

  .overlay {
    left: 12px;
    top: 12px;
    width: calc(100% - 24px);
    padding: 14px 16px;
  }

  .touch-controls {
    justify-content: stretch;
  }

  .touch-controls button {
    flex: 1 1 30%;
    min-width: 90px;
  }
}
