:root {
  --bg: #f4ead6;
  --bg-deep: #e3d0a5;
  --surface: rgba(255, 249, 238, 0.78);
  --surface-strong: rgba(255, 249, 238, 0.94);
  --surface-dark: #2d261d;
  --ink: #281f16;
  --muted: #6f604f;
  --gold: #ac7a1f;
  --gold-soft: #dbc28a;
  --sage: #546c4d;
  --rose: #8f5f56;
  --shadow: 0 22px 70px rgba(78, 51, 16, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 245, 212, 0.95), transparent 30%),
    radial-gradient(circle at bottom right, rgba(190, 147, 81, 0.22), transparent 28%),
    linear-gradient(145deg, var(--bg) 0%, #efe1c4 55%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

.background-glow {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.3;
}

.background-glow-left {
  top: -10rem;
  left: -10rem;
  background: rgba(207, 149, 53, 0.45);
}

.background-glow-right {
  right: -12rem;
  bottom: -12rem;
  background: rgba(100, 129, 93, 0.38);
}

.app-shell {
  width: min(1160px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero-card,
.panel {
  backdrop-filter: blur(18px);
  background: var(--surface);
  border: 1px solid rgba(112, 87, 48, 0.12);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 2rem;
  border-radius: 28px;
  margin-bottom: 1.25rem;
}

.eyebrow,
.legend-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", serif;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  line-height: 0.95;
  margin-top: 0.4rem;
}

.hero-copy {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.legend div {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: var(--surface-strong);
}

.legend-value {
  display: block;
  margin-top: 0.4rem;
  font-weight: 700;
}

.game-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.45fr 1fr;
  gap: 1.25rem;
}

.panel {
  border-radius: 24px;
  padding: 1.25rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ghost-button {
  border: 1px solid rgba(112, 87, 48, 0.22);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  cursor: pointer;
}

.ghost-button:hover,
.choice-card:hover {
  transform: translateY(-2px);
}

.turn-pill,
.phase-badge,
.insight-box,
.scene-card,
.choice-card,
.event-log li {
  border-radius: 18px;
}

.turn-pill,
.insight-box,
.scene-card,
.event-log li {
  background: var(--surface-strong);
}

.turn-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.turn-pill strong {
  font-size: 1.15rem;
}

.meter-list {
  display: grid;
  gap: 0.85rem;
}

.meter-row {
  display: grid;
  gap: 0.45rem;
}

.meter-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meter-value {
  font-size: 0.92rem;
}

.meter-track {
  position: relative;
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(77, 56, 23, 0.08);
  overflow: hidden;
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 10%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold) 0%, #d8b463 100%);
  transition: width 260ms ease;
}

.insight-box {
  margin-top: 1rem;
  padding: 1rem;
}

.insight-box p {
  margin: 0.45rem 0 0;
  line-height: 1.65;
  color: var(--muted);
}

.phase-badge {
  padding: 0.35rem 0.7rem;
  background: rgba(84, 108, 77, 0.12);
  color: var(--sage);
  font-weight: 700;
}

.scene-card {
  padding: 1.2rem;
  min-height: 11rem;
  margin-bottom: 1rem;
}

.scene-card h3 {
  font-size: 2rem;
  margin-bottom: 0.7rem;
}

.scene-card p {
  margin: 0;
  line-height: 1.75;
  color: var(--muted);
}

.choice-list {
  display: grid;
  gap: 0.9rem;
}

.choice-card {
  border: 1px solid rgba(112, 87, 48, 0.14);
  background: linear-gradient(180deg, rgba(255, 249, 238, 0.96), rgba(249, 239, 216, 0.98));
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 0.35rem;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.choice-card:hover {
  box-shadow: 0 16px 30px rgba(78, 51, 16, 0.12);
  border-color: rgba(172, 122, 31, 0.35);
}

.choice-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.55rem;
}

.choice-body,
.choice-impact {
  color: var(--muted);
  line-height: 1.6;
}

.choice-impact {
  font-size: 0.9rem;
  color: var(--rose);
}

.event-log {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.event-log li {
  padding: 0.95rem 1rem;
  line-height: 1.6;
  color: var(--muted);
}

.event-log strong {
  display: block;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.game-over .choice-card {
  opacity: 0.78;
}

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

  .hero-card,
  .panel {
    padding: 1.1rem;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100vw - 1rem, 100%);
    padding-top: 0.5rem;
  }

  .hero-card {
    padding-top: 1.5rem;
  }

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

  .scene-card h3 {
    font-size: 1.65rem;
  }
}
