:root {
  --frame-margin: 14px;
  --wine-950: #4e0602;
  --wine-900: #650800;
  --wine-800: #7f0c03;
  --source-burgundy: #700b06;
  --gold-500: #ffcc3d;
  --gold-300: #ffe08a;
  --cream-100: #fff6d8;
  --cream-300: #edcf80;
  --paper: #fffaf0;
  --ink: #24100c;
  --muted: #704834;
  --line: #d4a84e;
  --blue: #517fa8;
  --green: #7b9d45;
  --rose: #bb6d6b;
  --shadow: 0 18px 44px rgba(89, 43, 8, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream-100);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
}

h2,
h3,
h4,
p,
li,
dd {
  overflow-wrap: anywhere;
}

.page-header {
  margin: 8px var(--frame-margin) 0;
  min-height: 302px;
  padding: 8px;
  background: var(--source-burgundy);
  border-radius: 14px;
  overflow: hidden;
}

.image-banner {
  display: grid;
  place-items: center start;
  min-height: 286px;
  background: var(--source-burgundy);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
}

.image-banner img {
  display: block;
  width: min(1120px, 100%);
  height: auto;
  max-width: 1120px;
}

.app-layout {
  min-height: calc(100vh - 390px);
  margin: 18px var(--frame-margin) 24px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--cream-100);
  box-shadow: var(--shadow);
}

.side-panel {
  padding: 22px;
  color: var(--cream-100);
  background: linear-gradient(180deg, var(--wine-900), var(--wine-950));
  box-shadow: inset -1px 0 0 rgba(255, 231, 163, 0.18);
}

.side-title {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 224, 138, 0.25);
}

.side-title span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: var(--gold-500);
  border-radius: 6px;
  font-weight: 900;
}

.section-tabs {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.tab-button {
  padding: 12px 10px;
  color: var(--cream-100);
  text-align: left;
  background: transparent;
  border-left: 3px solid transparent;
  border-radius: 4px;
}

.tab-button:hover,
.tab-button.is-active {
  color: var(--gold-500);
  background: rgba(255, 204, 61, 0.09);
  border-left-color: var(--gold-500);
}

.content-stage {
  min-width: 0;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(112, 11, 6, 0.06), rgba(112, 11, 6, 0) 96px),
    var(--cream-100);
}

.stage-top {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--wine-800);
  font-size: 0.77rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stage-top h2 {
  margin: 0;
  color: var(--wine-950);
  font-size: clamp(1.7rem, 3vw, 2.55rem);
}

.article-subtitle {
  max-width: 980px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.35;
}

.article-authors {
  display: block;
  margin-top: 3px;
  color: var(--wine-800);
}

.article-authors strong {
  font-weight: 900;
}

.content-panel {
  display: none;
}

.content-panel.is-visible {
  display: block;
}

.paper-hero,
.game-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  min-height: 310px;
  overflow: hidden;
  color: #fff8dc;
  background:
    linear-gradient(120deg, rgba(255, 204, 61, 0.18), transparent 42%),
    linear-gradient(135deg, var(--wine-900), var(--wine-950));
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(91, 19, 6, 0.14);
}

.hero-copy,
.game-hero > div {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 30px;
}

.kicker,
.keyword-row span,
.evidence-copy span,
.finding-card > span {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  padding: 7px 10px;
  color: var(--wine-950);
  background: var(--gold-300);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-copy h3,
.game-hero h3 {
  max-width: 820px;
  margin: 0;
  color: #fff8dc;
  font-size: clamp(1.8rem, 3.1vw, 2.75rem);
  line-height: 1.08;
}

.hero-copy p,
.game-hero p {
  max-width: 780px;
  margin: 0;
  color: #f5d9a0;
  font-size: 1.04rem;
  line-height: 1.48;
}

.article-source-button {
  display: inline-flex;
  width: max-content;
  min-height: 42px;
  align-items: center;
  padding: 10px 14px;
  color: var(--wine-950);
  background: var(--gold-500);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 9px 20px rgba(91, 19, 6, 0.1);
}

.article-source-button:hover {
  background: var(--gold-300);
}

.hero-facts,
.game-hero aside {
  padding: 22px;
  background: rgba(255, 246, 216, 0.09);
  border-left: 1px solid rgba(255, 224, 138, 0.22);
}

.hero-facts dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.hero-facts div,
.game-hero aside {
  padding: 13px;
  background: rgba(255, 246, 216, 0.13);
  border: 1px solid rgba(255, 224, 138, 0.24);
  border-radius: 7px;
}

.hero-facts dt,
.game-hero aside strong {
  color: var(--gold-300);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 5px 0 0;
  color: #fff8dc;
  line-height: 1.35;
}

.insight-strip,
.game-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

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

.insight-strip article,
.game-progress div,
.lens-card,
.section-card,
.finding-card,
.evidence-card,
.scenario-card,
.challenge-card,
.review-card {
  background: var(--paper);
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 9px 20px rgba(91, 19, 6, 0.08);
}

.insight-strip article,
.game-progress div {
  min-height: 106px;
  padding: 14px;
}

.insight-strip span,
.game-progress span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-strip strong,
.game-progress strong {
  display: block;
  margin-top: 6px;
  color: var(--wine-900);
  font-size: 1.5rem;
  line-height: 1;
}

.insight-strip p,
.game-progress p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.28;
}

.overview-section {
  margin-top: 22px;
}

.compact-section,
.visual-section {
  padding: 18px;
  background: rgba(255, 241, 197, 0.55);
  border: 1px solid rgba(212, 168, 78, 0.72);
  border-radius: 8px;
}

.section-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.section-heading span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--wine-950);
  background: var(--gold-500);
  border-radius: 6px;
  font-weight: 900;
}

.section-heading h3 {
  margin: 0;
  color: var(--wine-950);
  font-size: 1.35rem;
}

.small-heading {
  margin-bottom: 10px;
}

.small-heading span {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

.lens-grid,
.finding-grid,
.scenario-grid {
  display: grid;
  gap: 14px;
}

.lens-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(330px, 1.1fr);
}

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

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

.lens-card,
.section-card,
.finding-card,
.scenario-card {
  padding: 16px;
}

.lens-card h4,
.finding-card h4,
.scenario-card h4 {
  margin: 0 0 9px;
  color: var(--wine-900);
  font-size: 1.08rem;
}

.lens-card p,
.lens-card li,
.section-card li,
.finding-card p,
.evidence-copy p,
.scenario-card dd {
  color: var(--muted);
  line-height: 1.43;
}

.lens-card p,
.finding-card p {
  margin: 0;
}

.lens-card ul,
.section-card ul {
  margin: 0;
  padding-left: 18px;
}

.lens-card li + li,
.section-card li + li {
  margin-top: 7px;
}

.keyword-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.keyword-row span {
  background: #fff6d8;
}

.finding-card {
  position: relative;
  min-height: 235px;
  border-top: 6px solid var(--gold-500);
}

.finding-card.rose {
  border-top-color: var(--rose);
}

.finding-card.blue {
  border-top-color: var(--blue);
}

.finding-card.green {
  border-top-color: var(--green);
}

.finding-card > span {
  margin-bottom: 12px;
  background: #fff6d8;
}

.finding-card h4 {
  font-size: 1.22rem;
}

.evidence-stack {
  display: grid;
  gap: 16px;
}

.evidence-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  overflow: hidden;
}

.evidence-visual {
  min-width: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.evidence-copy {
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 22px;
  background: linear-gradient(180deg, #fff7df, #fff1c5);
  border-left: 1px solid var(--cream-300);
}

.evidence-copy h4 {
  margin: 0;
  color: var(--wine-950);
  font-size: 1.18rem;
  line-height: 1.22;
}

.article-figure {
  display: grid;
  place-items: center;
  min-height: 260px;
  margin: 0;
}

.article-figure img {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(212, 168, 78, 0.62);
  border-radius: 6px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 14px;
}

.conclusion-card {
  background: linear-gradient(180deg, #fffaf0, #fff1c5);
}

.game-hero {
  min-height: 230px;
}

.game-hero aside {
  display: grid;
  align-content: center;
}

.game-hero b {
  color: #fff8dc;
}

.evidence-game-shell {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.challenge-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.challenge-topline {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.challenge-topline span,
.challenge-topline strong {
  color: var(--wine-900);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

#claimText {
  margin: 0;
  color: var(--wine-950);
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  font-weight: 900;
  line-height: 1.22;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.game-reset-button,
.answer-grid button {
  min-height: 42px;
  padding: 9px 11px;
  color: var(--wine-900);
  background: #fff6d8;
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-weight: 900;
}

.answer-grid button.is-answer-correct {
  color: #ffffff;
  background: #2f8f46;
  border-color: #2f8f46;
}

.answer-grid button.is-answer-wrong {
  color: #ffffff;
  background: #b91f16;
  border-color: #b91f16;
}

.answer-grid button.is-answer-muted {
  color: var(--muted);
  background: rgba(255, 246, 216, 0.58);
}

.feedback-box,
.source-box {
  padding: 12px;
  background: #fff6d8;
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.feedback-box.is-correct {
  color: #285c26;
  background: #eff9ec;
  border-color: #9ccc8b;
}

.feedback-box.is-wrong {
  color: #8a160b;
  background: #fff0ee;
  border-color: #d9948f;
}

.source-box {
  display: grid;
  gap: 5px;
  font-weight: 400;
}

.source-box[hidden] {
  display: none;
}

.source-box span {
  color: var(--wine-900);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-box p {
  margin: 0;
  color: var(--wine-950);
  line-height: 1.4;
}

.scenario-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.scenario-actions button:disabled,
.answer-grid button:disabled {
  cursor: default;
}

.scenario-actions button:disabled {
  opacity: 0.48;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border-left: 6px solid var(--green);
}

.review-card.is-wrong {
  border-left-color: var(--rose);
}

.review-card span {
  color: var(--wine-900);
  font-size: 0.76rem;
  font-weight: 900;
}

.review-card h4 {
  margin: 0;
  color: var(--wine-900);
}

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

.review-card strong {
  color: var(--wine-900);
}

.scenario-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.scenario-card-top span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--wine-950);
  background: var(--gold-500);
  border-radius: 6px;
  font-weight: 900;
}

.scenario-card-top strong {
  color: var(--wine-900);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.scenario-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.scenario-card dt {
  color: var(--wine-900);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scenario-card dd {
  margin: 4px 0 0;
}

.site-footer {
  margin: 0 var(--frame-margin) 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--wine-900), var(--wine-950));
  color: #fff8dc;
  text-align: center;
  padding: 14px 18px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1120px) {
  .paper-hero,
  .game-hero,
  .lens-grid,
  .finding-grid,
  .evidence-card,
  .bottom-grid,
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .evidence-copy {
    border-left: 0;
    border-top: 1px solid var(--cream-300);
  }
}

@media (max-width: 980px) {
  .app-layout,
  .insight-strip,
  .game-progress,
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    border-radius: 12px 12px 0 0;
  }
}

@media (max-width: 620px) {
  :root {
    --frame-margin: 8px;
  }

  .content-stage,
  .side-panel {
    padding: 16px;
  }

  .page-header {
    min-height: 0;
    padding: 4px;
    border-radius: 12px;
  }

  .image-banner {
    min-height: 0;
    border-radius: 12px;
  }

  .hero-copy,
  .game-hero > div,
  .hero-facts,
  .game-hero aside,
  .compact-section,
  .visual-section,
  .evidence-visual,
  .evidence-copy,
  .section-card,
  .finding-card,
  .scenario-card {
    padding: 14px;
  }

  .hero-copy h3,
  .game-hero h3 {
    font-size: 1.78rem;
  }
}
