:root {
  color-scheme: dark;
  --bg: #140f0b;
  --panel: rgba(25, 18, 11, 0.88);
  --panel-border: rgba(255, 214, 140, 0.28);
  --text: #f8e7c3;
  --muted: #c7ad7c;
  --accent: #ff8a34;
  --accent-2: #ffd15a;
  --danger: #e35b45;
  --button: #2b1d12;
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 209, 90, 0.14), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(255, 138, 52, 0.10), transparent 28%),
    linear-gradient(180deg, #17100c 0%, #110b08 34%, #080605 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.page {
  position: relative;
  width: 100%;
}

.hero, .story-section, .team-section, .feature-section, .play-section {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 28px 0 18px;
  align-items: stretch;
}

.hero-copy, .hero-card, .story-card, .team-card, .feature-card, .panel, .game-frame {
  background: linear-gradient(180deg, rgba(27, 19, 13, 0.94), rgba(17, 12, 9, 0.92));
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.hero-copy {
  border-radius: 32px;
  padding: 32px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 11px;
  color: var(--accent-2);
}

.hero h1, .section-heading h2 {
  margin: 0;
  color: #fff4cf;
  font-size: clamp(34px, 4vw, 66px);
  line-height: 0.98;
}

.lead {
  margin: 18px 0 0;
  max-width: 58ch;
  font-size: 18px;
  line-height: 1.6;
  color: #f2dcc0;
}

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.primary-link, .secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.primary-link {
  color: #fff5e2;
  background: linear-gradient(180deg, #ff9b47 0%, #d96511 100%);
  box-shadow: 0 14px 28px rgba(217, 101, 17, 0.34);
}

.secondary-link {
  color: #f5d8aa;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 209, 90, 0.18);
}

.hero-card {
  border-radius: 32px;
  padding: 24px;
  display: grid;
  gap: 14px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 209, 90, 0.14);
  color: #ffe7a8;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-metric {
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-metric span {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: #fff4cf;
}

.hero-metric small {
  display: block;
  margin-top: 6px;
  color: #d9c2a1;
}

.story-section, .team-section, .feature-section, .play-section {
  padding: 18px 0 24px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(28px, 3vw, 44px);
}

.story-grid, .team-grid, .feature-grid {
  display: grid;
  gap: 14px;
}

.story-grid {
  grid-template-columns: 1.3fr 0.85fr 0.85fr;
}

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

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

.story-card, .team-card, .feature-card {
  border-radius: 24px;
  padding: 20px;
}

.story-card.wide {
  grid-column: span 1;
}

.story-card h3, .team-card h3, .feature-card h3 {
  margin: 0 0 10px;
  color: #fff4cf;
}

.story-card p, .team-card p, .feature-card p {
  margin: 0;
  color: #e7d0ab;
  line-height: 1.6;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  color: #29190f;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(180deg, #ffe17a, #ff9a3d);
}

.play-section {
  padding-bottom: 40px;
}

.game-frame {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  min-height: 980px;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  pointer-events: none;
}

.hud-card, .panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.hud-card {
  border-radius: 14px;
  padding: 7px 9px;
  text-align: center;
}

.label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 2px;
}

.hud-card div:last-child {
  font-size: 14px;
  font-weight: 700;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.34);
}

.overlay.visible {
  display: flex;
}

.panel {
  width: min(440px, 100%);
  border-radius: 20px;
  padding: 18px;
  text-align: center;
}

h1, h2, p {
  margin: 0 0 14px;
}

h1, h2 {
  color: #fff1c6;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

p {
  color: #f1d9b1;
  line-height: 1.5;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #fff8ec;
  background: linear-gradient(180deg, #ff9b47 0%, #d96511 100%);
  box-shadow: 0 14px 28px rgba(217, 101, 17, 0.34);
}

button.secondary {
  background: linear-gradient(180deg, #4a3424 0%, #2d2016 100%);
  box-shadow: none;
}

.shop-panel {
  max-width: 560px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.shop-grid button {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.shop-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.controls button {
  padding: 14px 0;
  border-radius: 18px;
  background: rgba(43, 29, 18, 0.86);
  border: 1px solid rgba(255, 209, 90, 0.16);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.dig-button {
  background: linear-gradient(180deg, #8a5a2d 0%, #5d3b1d 100%);
}

@media (max-width: 640px) {
  .hero, .story-section, .team-section, .feature-section, .play-section {
    width: min(1160px, calc(100vw - 20px));
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .story-grid, .team-grid, .feature-grid {
    grid-template-columns: 1fr;
  }

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

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .game-frame {
    min-height: 860px;
  }
}
