:root {
  --bg-deep: #0b0b1c;
  --bg-accent: #1e1b3a;
  --card-bg: #fdfaf7;
  --card-border: #f4b000;
  --card-shadow: rgba(5, 5, 15, 0.65);
  --stripe-left: #44216b;
  --stripe-mid: #f4b000;
  --stripe-right: #1f9aaa;
  --text-main: #26151f;
  --text-soft: #5f4c57;
  --muted: #a39aa5;
  --accent-ink: #44216b;
  --pill-bg: #fff5dc;
  --pill-border: #f4b000;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, #44216b 0, transparent 55%),
    radial-gradient(circle at top right, #1f9aaa 0, transparent 60%),
    linear-gradient(160deg, #0b0b1c, #05040d);
  color: var(--text-main);
}

#game-root {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 24px 12px;
}

/* Outer shell mimics a deck of cards container */

.game-shell {
  max-width: 920px;
  width: 100%;
  margin: auto;
  background: rgba(12, 10, 32, 0.9);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px var(--card-shadow);
  padding: 18px;
  display: flex;
}

/* Card itself */

.game-card {
  flex: 1;
  background: var(--card-bg);
  border-radius: 24px;
  border: 3px solid var(--card-border);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Card top stripe, like printed playing cards */

.card-top-stripe {
  height: 10px;
  background: linear-gradient(
    90deg,
    var(--stripe-left),
    var(--stripe-mid),
    var(--stripe-right)
  );
}

/* Card header area */

.game-header {
  padding: 18px 22px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.header-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.game-subtitle {
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* General layout inside the card */

.card-body {
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.scene-layout,
.impact-layout,
.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(0, 1.75fr);
  gap: 20px;
}

.scene-layout {
  align-items: stretch; /* ensure right column fills full height */
}

@media (max-width: 800px) {
  .game-shell {
    padding: 10px;
  }

  .game-card {
    border-width: 2px;
  }

  .card-body {
    padding: 14px 14px 16px;
  }

  .scene-layout,
  .impact-layout,
  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Story / text block */

.story-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.story-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.story-text {
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text-soft);
}

/* Intro hero */

.intro-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro-hero-image {
  width: 100%;
  display: block;
  border-radius: 18px;
  margin: 8px 0 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.intro-main-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--accent-ink);
}

.intro-tagline {
  font-size: 0.96rem;
  color: var(--text-soft);
}

/* Email opt-in box */

.email-optin {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 18px;
  background: #fff5dc;
  border: 1px solid #f4d67a;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-optin header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-optin-title {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #5b3d0a;
}

.email-optin small {
  font-size: 0.75rem;
  color: #7e6731;
}

.email-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.email-row input[type="email"] {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #f1d48f;
  padding: 8px 12px;
  font-size: 0.86rem;
  outline: none;
}

.email-row input[type="email"]:focus {
  border-color: #f4b000;
}

.email-row button {
  border-radius: 999px;
  padding: 8px 14px;
  border: none;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: #44216b;
  color: #ffffff;
  white-space: nowrap;
}

/* Choices */

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.choice-button {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #e5dad1;
  padding: 9px 14px;
  font-size: 0.9rem;
  background: #fffdf8;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    background 0.12s ease,
    border-color 0.12s ease;
}

.choice-button:hover {
  background: #fff5e5;
  border-color: #f4b000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.choice-label-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.choice-emoji {
  font-size: 1.1rem;
}

.choice-meta {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* Resource bank (bottom left of scenes) */

.resource-bank {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px dashed #e3d0f5;
  background: #fbf7ff;
}

.resource-bank-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #7a5aa6;
  margin-bottom: 4px;
}

.resource-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resource-chip {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.74rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #e2d1f5;
  background: #ffffff;
}

.resource-chip span:first-child {
  font-size: 0.95rem;
}

.resource-chip.used {
  opacity: 0.4;
  background: #f1e9ff;
}

/* Avatar side card – full photo */

.avatar-card {
  border-radius: 22px;
  padding: 0;
  background: #000;
  border: 1px solid #f4b000;
  box-shadow: 0 6px 18px rgba(105, 79, 130, 0.3);
  overflow: hidden;
  height: 100%;
}

.avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0;
  border: none;
}

.avatar-name,
.avatar-meta {
  display: none;
}

/* Impact layout */

.impact-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.impact-title {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 4px 0 8px;
  color: var(--accent-ink);
}

.impact-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.impact-body p {
  margin: 0 0 8px;
}

.impact-donate-card {
  border-radius: 20px;
  padding: 14px 14px 12px;
  background: radial-gradient(circle at top, #1f9aaa 0, #0b0b1c 65%);
  color: #f7fbff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.impact-donate-card h3 {
  font-size: 0.98rem;
  margin: 0;
}

.impact-donate-card p {
  font-size: 0.84rem;
  margin: 0;
  opacity: 0.95;
}

.impact-donate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.btn {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.btn-primary {
  background: #f4b000;
  color: #29170e;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: #ffffff;
}

/* Summary */

.summary-heading {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-ink);
  margin-bottom: 6px;
}

.summary-role {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.summary-role-tagline {
  font-size: 0.96rem;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.summary-copy {
  font-size: 0.93rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.summary-copy p {
  margin: 0 0 8px;
}

/* Summary metrics card */

.summary-metrics-card {
  border-radius: 20px;
  padding: 12px 14px;
  background: #fff5dc;
  border: 1px solid #f4d67a;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.metric-row span:first-child {
  color: var(--text-soft);
}

.metric-row strong {
  font-weight: 800;
}

.metric-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metric-pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metric-pill span:first-child {
  font-size: 0.95rem;
}

/* Links / small text */

.muted {
  color: var(--muted);
  font-size: 0.78rem;
}

a.text-link {
  color: #1f3ea7;
  text-decoration: underline;
}

/* Card-style elevated choice buttons override */
.choice-button {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #d8c7b8;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transition:
    box-shadow 0.2s ease,
    transform 0.12s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.choice-button:hover {
  background: #fff3dc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: #f4b000;
  transform: translateY(-3px);
}

.choice-meta {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.75;
}


/* Disabled state for choices whose resource is already used */
.choice-button.choice-disabled,
.choice-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  background: #f3ece4;
  border-color: #e0d1c4;
}


.intro-big-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-ink);
  margin-bottom: 8px;
}

.game-header .back-btn {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 4px 10px;
}

.summary-share {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff7ec;
  border: 1px solid #f1c87a;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-share-image {
  width: 100%;
  max-width: 260px;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.summary-share-hint {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.summary-share-caption {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Ensure summary buttons look consistent */
.summary-metrics-card .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
  width: 100%;
}

/* Mobile-focused refinements */
@media (max-width: 600px) {
  .game-shell {
    padding: 6px;
  }

  .game-card {
    border-width: 2px;
    border-radius: 18px;
  }

  .card-body {
    padding: 12px 12px 16px;
  }

  .game-title {
    font-size: 0.95rem;
  }

  .game-subtitle {
    font-size: 0.7rem;
  }

  .intro-big-title {
    font-size: 1rem;
  }

  .choice-button {
    padding: 12px 12px;
  }

  .summary-share-image {
    max-width: 100%;
  }

  .summary-metrics-card .btn {
    font-size: 0.85rem;
  }
}

/* --- POLISHED TYPOGRAPHY & SPACING --- */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.55;
}

.game-card {
  border-radius: 20px;
  border-width: 2px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  transition: box-shadow .25s ease;
}
.game-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
}

.choice-button {
  border-radius: 14px;
  border: 2px solid #e3d3f9;
  background: #faf8ff;
  transition: transform .12s ease, box-shadow .2s ease;
}
.choice-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Release better readability */
.story-text {
  font-size: 1rem;
  color: #3b2f4a;
}

/* CTA button polish */
.btn {
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  transition: background-color .2s ease, transform .15s ease;
}
.btn:hover {
  transform: translateY(-2px);
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 600px) {
  .game-card {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    border-width: 0;
  }
  .card-body {
    padding: 12px;
  }
  .choice-button {
    padding: 14px;
    font-size: .95rem;
  }
  .summary-share-image {
    max-width: 100%;
  }
  .btn {
    font-size: .9rem;
  }
}

/* Fade-in transition */
.card-body, .scene-layout, .impact-layout, .summary-grid {
  animation: fadein .45s ease;
}
@keyframes fadein {
  from {opacity:0; transform: translateY(4px);}
  to {opacity:1; transform:translateY(0);}
}

.impact-nav {
  margin-top: 18px;
  display: flex;
  justify-content: flex-start;
}
.impact-nav .btn {
  min-width: 0;
}
