:root {
  --ink: #1f2b1d;
  --prairie: #d8b46a;
  --prairie-dark: #b9914b;
  --sky: #8ac0d9;
  --sunset: #f4a070;
  --river: #2f6b88;
  --pine: #3a5d46;
  --cream: #f7efe2;
  --accent: #d35334;
  --shadow: rgba(26, 40, 25, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #fff6d6 0%, transparent 45%),
    radial-gradient(circle at 88% 12%, #ffe2bf 0%, transparent 45%),
    linear-gradient(135deg, #f8e5c1 0%, #9fc8db 45%, #6aa0bd 100%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.15) 0,
      rgba(255, 255, 255, 0.15) 8px,
      rgba(255, 255, 255, 0.05) 8px,
      rgba(255, 255, 255, 0.05) 16px
    );
  font-family: "Trebuchet MS", "Gill Sans", "Verdana", sans-serif;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.hero {
  text-align: center;
  margin-bottom: 24px;
  animation: slideDown 800ms ease-out both;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--pine);
  color: #fff7e6;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.hero h1 {
  margin: 14px 0 8px;
  font-family: "Cooper Black", "Copperplate", "Impact", serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  text-shadow: 0 12px 30px rgba(38, 54, 36, 0.2);
}

.hero-sub {
  margin: 0 auto;
  max-width: 720px;
  font-size: 1.1rem;
  line-height: 1.5;
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.game-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: #1f2b1d;
  box-shadow: 0 18px 40px var(--shadow);
}

#game {
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: #fdf6ea;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  font-size: 0.95rem;
  pointer-events: none;
}

.hud-block {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 29, 22, 0.55);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hud-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  opacity: 0.8;
}

.hud-button {
  pointer-events: auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid #fdf6ea;
  background: rgba(18, 29, 22, 0.7);
  color: #fdf6ea;
  font-weight: 700;
  cursor: pointer;
}

.hud-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.meter {
  width: 90px;
  height: 10px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffcf6e, #d35334);
  transition: width 120ms ease-out;
}

.zone-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 246, 231, 0.95);
  border: 2px solid var(--ink);
  font-family: "Cooper Black", "Copperplate", "Impact", serif;
  font-size: 1.2rem;
  opacity: 0;
  pointer-events: none;
}

.zone-banner.show {
  animation: bannerPop 2.4s ease-out both;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 17, 0.6);
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  background: var(--cream);
  padding: 28px 24px;
  border-radius: 18px;
  max-width: 420px;
  border: 3px solid var(--ink);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.overlay-card h2 {
  margin-top: 0;
  font-family: "Cooper Black", "Copperplate", "Impact", serif;
}

.controls {
  margin: 16px 0;
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.primary {
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--accent);
  color: #fff7e6;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.primary:hover {
  filter: brightness(1.05);
}

.touch-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: none;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.touch-controls.show {
  display: flex;
}

.touch-button {
  pointer-events: auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid #fff7e6;
  background: rgba(18, 29, 22, 0.7);
  color: #fff7e6;
  font-size: 1.2rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.flavor {
  background: rgba(255, 247, 229, 0.85);
  padding: 18px 18px 20px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  box-shadow: 0 12px 28px rgba(23, 35, 26, 0.2);
}

.flavor h2 {
  margin-top: 0;
  font-family: "Cooper Black", "Copperplate", "Impact", serif;
}

.flavor ul {
  padding-left: 20px;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.95rem;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bannerPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.98);
  }
}

@media (max-width: 980px) {
  .content {
    grid-template-columns: 1fr;
  }

  .hud {
    font-size: 0.85rem;
  }
}

@media (max-width: 640px) {
  .hero-sub {
    font-size: 1rem;
  }

  .hud {
    gap: 8px;
  }

  .hud-block {
    padding: 4px 8px;
  }

  .game-shell {
    border-radius: 18px;
  }
}
