:root {
  --bg-top: #fff6d8;
  --bg-bottom: #ffd6a8;
  --panel: rgba(255, 248, 232, 0.8);
  --panel-border: rgba(188, 123, 65, 0.16);
  --text: #5b3f27;
  --muted: rgba(91, 63, 39, 0.72);
  --gold: #f3ba5a;
  --peach: #ff9e7a;
  --leaf: #77b777;
  --shadow: 0 24px 50px rgba(160, 103, 51, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at 82% 8%, rgba(255, 241, 199, 0.65), transparent 20%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 188, 90, 0.1), transparent 24%),
    radial-gradient(circle at 85% 72%, rgba(119, 183, 119, 0.12), transparent 22%);
}

.youtube-audio {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}

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

.hero-panel,
.game-panel,
.info-grid article {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-panel {
  border-radius: 30px;
  padding: 28px 22px 24px;
  text-align: center;
}

.eyebrow,
.hud-label,
.overlay-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: #c07e29;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
}

h1 {
  font-size: clamp(3rem, 9vw, 5.8rem);
  line-height: 0.94;
}

.intro {
  width: min(760px, 100%);
  margin: 16px auto 0;
  line-height: 1.7;
  color: var(--muted);
  font-size: 1.04rem;
}

.game-panel {
  margin-top: 18px;
  border-radius: 30px;
  padding: 18px;
}

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

.hud-card {
  border-radius: 20px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(188, 123, 65, 0.12);
}

.hud-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.68rem;
  color: var(--muted);
}

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

.canvas-frame {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(188, 123, 65, 0.16);
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 245, 220, 0.85), transparent 18%),
    linear-gradient(180deg, #f7c77a, #f4a87b 52%, #ef8ea2 100%);
}

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

.overlay {
  position: absolute;
  left: 20px;
  top: 20px;
  width: min(390px, calc(100% - 40px));
  padding: 20px 20px 18px;
  border-radius: 24px;
  background: rgba(255, 251, 242, 0.84);
  border: 1px solid rgba(188, 123, 65, 0.18);
}

.overlay.hidden {
  display: none;
}

.overlay-kicker {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: #cb7f35;
}

.overlay h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.overlay p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.overlay-actions,
.touch-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.overlay-actions {
  margin-top: 18px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: #5b351e;
  background: linear-gradient(135deg, #ffe28e, #f7b96a);
  box-shadow: 0 12px 24px rgba(169, 110, 56, 0.18);
  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, #fdd0b2, #f5a98b);
}

.touch-grid {
  margin-top: 18px;
}

.touch-grid button {
  min-width: 96px;
}

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

.info-grid article {
  border-radius: 24px;
  padding: 18px;
}

.info-grid h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
}

.info-grid p {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.8rem;
  margin-right: 0.18rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(188, 123, 65, 0.14);
  font-size: 0.9em;
}

@media (max-width: 900px) {
  .hud,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 18px, 1120px);
    padding-top: 14px;
    padding-bottom: 26px;
  }

  .hero-panel,
  .game-panel,
  .info-grid article {
    border-radius: 22px;
  }

  .hud,
  .info-grid {
    grid-template-columns: 1fr;
  }

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

  .touch-grid button,
  .overlay-actions button {
    width: 100%;
  }
}
