:root {
  --font-display: "Baskerville Old Face", "Book Antiqua", "Palatino Linotype", "Times New Roman", serif;
  --font-ui: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
  --bg-deep: #120f17;
  --bg-mid: #1a1821;
  --paper: #f6efdf;
  --paper-soft: #efe4cf;
  --ink: #251b16;
  --ink-soft: #4c3b32;
  --ink-muted: #6e5b4f;
  --text-bright: #f7f1e6;
  --text-soft: rgba(242, 232, 214, 0.8);
  --line-light: rgba(255, 244, 229, 0.14);
  --line-dark: rgba(98, 76, 54, 0.18);
  --accent: #d3a35d;
  --accent-strong: #f0bf72;
  --success-bg: rgba(33, 103, 70, 0.14);
  --success-text: #183f2d;
  --error-bg: rgba(126, 36, 35, 0.12);
  --error-text: #5d2321;
  --shadow-hero: 0 40px 90px rgba(4, 2, 6, 0.42);
  --shadow-panel: 0 24px 60px rgba(9, 7, 12, 0.28);
  --shadow-card: 0 18px 36px rgba(17, 11, 17, 0.18);
  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 22px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text-bright);
  background:
    radial-gradient(circle at top left, rgba(176, 120, 88, 0.18), transparent 32%),
    radial-gradient(circle at 85% 14%, rgba(128, 86, 69, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(88, 56, 96, 0.18), transparent 30%),
    linear-gradient(140deg, #0f0d14 0%, #17131d 42%, #100e15 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(circle at center, black 28%, transparent 88%);
  opacity: 0.22;
}

body::after {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 212, 163, 0.08), transparent 20%),
    radial-gradient(circle at 80% 76%, rgba(224, 169, 110, 0.07), transparent 18%);
  filter: blur(40px);
  opacity: 0.8;
}

body.modal-open {
  overflow: hidden;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2vw, 28px);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(242, 232, 214, 0.66);
}

.selection-page .eyebrow {
  color: rgba(245, 239, 230, 0.65);
}

.selection-page #story-selection-container {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 4vw, 58px);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(25, 20, 28, 0.92), rgba(18, 15, 22, 0.96)),
    radial-gradient(circle at top right, rgba(229, 180, 117, 0.08), transparent 26%);
  border: 1px solid var(--line-light);
  box-shadow: var(--shadow-hero);
}

.selection-page #story-selection-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 28%),
    radial-gradient(circle at 80% 18%, rgba(228, 185, 125, 0.1), transparent 18%);
  pointer-events: none;
}

.selection-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 8vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.hero-subtitle {
  margin: 22px 0 0;
  max-width: 32rem;
  font-size: clamp(1.06rem, 2vw, 1.3rem);
  line-height: 1.7;
  color: var(--text-soft);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 640px;
  margin-top: 32px;
}

.metric {
  padding-top: 14px;
  border-top: 1px solid rgba(245, 233, 215, 0.14);
}

.metric-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--paper);
}

.metric-label {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(242, 232, 214, 0.66);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin-top: 34px;
  padding: 0 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: #271a10;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 18px 38px rgba(211, 163, 93, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-link:hover,
.primary-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(211, 163, 93, 0.3);
  filter: saturate(1.05);
}

.hero-visual {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.evidence-board {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 5 / 6;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(251, 242, 225, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 240, 221, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 28px 70px rgba(3, 2, 6, 0.38);
  animation: float-board 8s ease-in-out infinite;
}

.evidence-board::before,
.evidence-board::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 239, 219, 0.06);
  border-radius: 24px;
}

.evidence-board::after {
  inset: auto 16% 24%;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 239, 219, 0.14), transparent);
}

.evidence-card {
  position: absolute;
  width: 58%;
  border-radius: 22px;
  box-shadow: 0 18px 46px rgba(4, 3, 5, 0.35);
  border: 1px solid rgba(255, 243, 227, 0.22);
}

.evidence-card-main {
  top: 12%;
  left: 8%;
  transform: rotate(-8deg);
}

.evidence-card-secondary {
  right: 7%;
  bottom: 12%;
  transform: rotate(7deg);
}

.evidence-note {
  position: absolute;
  right: 11%;
  top: 15%;
  width: min(46%, 220px);
  padding: 18px 18px 20px;
  border-radius: 18px;
  color: #241b18;
  background: linear-gradient(180deg, rgba(244, 227, 197, 0.96), rgba(233, 211, 177, 0.94));
  box-shadow: 0 16px 30px rgba(7, 4, 2, 0.22);
  transform: rotate(3deg);
}

.note-label {
  display: inline-flex;
  margin-bottom: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(45, 31, 21, 0.58);
}

.evidence-note p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: rgba(34, 24, 18, 0.84);
}

.selection-library {
  position: relative;
  z-index: 1;
  margin-top: clamp(36px, 6vw, 72px);
  padding-top: 30px;
  border-top: 1px solid rgba(245, 233, 215, 0.12);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.section-copy {
  max-width: 26rem;
  margin: 0;
  line-height: 1.7;
  color: rgba(242, 232, 214, 0.72);
}

#story-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.story-item {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 18px;
  min-height: 260px;
  padding: 24px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(160deg, rgba(55, 46, 58, 0.82), rgba(27, 22, 31, 0.92));
  border: 1px solid rgba(255, 243, 227, 0.12);
  box-shadow: var(--shadow-card);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.story-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(233, 196, 143, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 32%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.story-item:hover,
.story-item:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(232, 194, 137, 0.32);
  box-shadow: 0 24px 52px rgba(6, 4, 8, 0.32);
}

.story-item:hover::before,
.story-item:focus-visible::before {
  opacity: 1;
}

.story-item-topline,
.story-item-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-item-topline {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 239, 230, 0.64);
}

.story-item h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: #fbf3e6;
}

.story-item p {
  position: relative;
  z-index: 1;
  margin: 0;
  line-height: 1.65;
  color: rgba(242, 232, 214, 0.76);
}

.story-item-meta {
  padding-top: 16px;
  border-top: 1px solid rgba(245, 239, 230, 0.1);
  font-size: 0.86rem;
  color: rgba(242, 232, 214, 0.8);
}

.story-item-meta span:last-child {
  color: var(--accent-strong);
}

.game-page #game-container {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: clamp(18px, 2vw, 28px);
  align-items: start;
}

.game-sidebar {
  position: sticky;
  top: clamp(18px, 2vw, 28px);
  padding: clamp(24px, 2.5vw, 32px);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(30, 24, 35, 0.9), rgba(21, 17, 25, 0.95)),
    radial-gradient(circle at top right, rgba(231, 186, 124, 0.08), transparent 24%);
  border: 1px solid rgba(255, 243, 227, 0.1);
  box-shadow: var(--shadow-hero);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 239, 230, 0.8);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 243, 227, 0.18);
}

.game-header {
  margin-top: 28px;
}

.game-header h1 {
  margin: 0;
  font-family: var(--font-display);
  max-width: 100%;
  font-size: clamp(1.95rem, 2vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--paper);
  text-wrap: pretty;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.game-summary {
  margin: 18px 0 0;
  max-width: 26rem;
  line-height: 1.7;
  color: var(--text-soft);
}

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

.status-block,
.sidebar-panel {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 243, 227, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.status-block {
  padding: 18px;
}

.status-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 239, 230, 0.56);
}

.status-value-wrap {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-top: 10px;
}

.status-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--paper);
}

.status-suffix {
  padding-bottom: 4px;
  font-size: 0.84rem;
  color: rgba(245, 239, 230, 0.58);
}

.sidebar-panel {
  margin-top: 14px;
  padding: 20px 18px 18px;
}

.progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 0.94rem;
  color: rgba(245, 239, 230, 0.78);
}

#progress-bar-container {
  position: relative;
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 243, 227, 0.1);
}

#progress-bar {
  position: relative;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ae7338, var(--accent), #f0c98f);
  transition: width 420ms ease;
}

#progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  animation: progress-sheen 2.4s linear infinite;
}

.sidebar-note {
  margin: 16px 0 0;
  line-height: 1.7;
  color: rgba(245, 239, 230, 0.66);
}

.game-stage {
  display: grid;
  gap: 18px;
}

.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3vw, 34px);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(251, 245, 235, 0.96), rgba(242, 232, 214, 0.93)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 36%);
  border: 1px solid var(--line-dark);
  box-shadow: var(--shadow-panel);
  color: var(--ink);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, rgba(211, 163, 93, 0.8), rgba(211, 163, 93, 0.12));
}

.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.panel .eyebrow {
  margin-bottom: 0;
  color: rgba(84, 61, 44, 0.6);
}

.panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.scene-content {
  opacity: 0;
  transform: translateY(14px);
}

.scene-content.scene-live {
  animation: rise-in 520ms cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
  animation-delay: var(--enter-delay, 0ms);
}

.story-prose {
  display: grid;
  gap: 1rem;
  max-width: 72ch;
  font-size: 1.04rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.story-prose p {
  margin: 0;
}

.story-prose strong {
  color: var(--ink);
}

.question-panel {
  background:
    linear-gradient(180deg, rgba(248, 240, 228, 0.98), rgba(238, 226, 203, 0.95)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 36%);
}

.question-text {
  max-width: 26ch;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.question-text.is-complete {
  color: var(--ink-soft);
}

.cards-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.cards-helper {
  max-width: 24rem;
  margin: 0;
  line-height: 1.65;
  color: var(--ink-muted);
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(107, 81, 58, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 236, 222, 0.92));
  box-shadow: 0 16px 32px rgba(30, 20, 16, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 38px rgba(30, 20, 16, 0.16);
}

.card.selected {
  border-color: rgba(211, 163, 93, 0.52);
  box-shadow: 0 24px 42px rgba(52, 34, 23, 0.18), 0 0 0 1px rgba(211, 163, 93, 0.26);
}

.card.selected::after {
  content: "Selected";
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper);
  background: rgba(25, 19, 18, 0.82);
  backdrop-filter: blur(8px);
}

.card-preview,
.card-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
}

.card-preview {
  position: relative;
  cursor: zoom-in;
}

.card-preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(180deg, transparent, rgba(15, 11, 12, 0.42));
  pointer-events: none;
}

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.card-preview-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff7ec;
  background: rgba(20, 16, 17, 0.68);
  backdrop-filter: blur(8px);
}

.card-toggle {
  padding: 14px 16px 18px;
  cursor: pointer;
  text-align: left;
}

.card-toggle:focus-visible,
.card-preview:focus-visible,
#controls-area button:focus-visible,
.primary-link:focus-visible,
.story-item:focus-visible,
.back-link:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid rgba(211, 163, 93, 0.7);
  outline-offset: 3px;
}

.card-name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.card-prompt {
  display: block;
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.card.selected .card-prompt {
  color: #8b5d20;
}

.feedback {
  display: none;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 1.02rem;
  line-height: 1.7;
}

.feedback strong {
  font-family: var(--font-display);
  font-size: 1.16em;
  letter-spacing: -0.03em;
}

.feedback.correct {
  background: linear-gradient(180deg, rgba(225, 244, 233, 0.98), rgba(206, 232, 216, 0.94));
  border-color: rgba(25, 111, 76, 0.24);
  color: #143727;
  box-shadow: 0 16px 30px rgba(18, 68, 49, 0.12);
}

.feedback.incorrect {
  background: linear-gradient(180deg, rgba(251, 229, 226, 0.98), rgba(244, 213, 209, 0.94));
  border-color: rgba(134, 42, 39, 0.22);
  color: #5a201e;
  box-shadow: 0 16px 30px rgba(101, 33, 31, 0.1);
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#controls-area button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease, filter 180ms ease;
}

#controls-area button:hover:not(:disabled) {
  transform: translateY(-2px);
}

#controls-area button:active:not(:disabled) {
  transform: translateY(0);
}

#controls-area button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  box-shadow: none;
}

#submit-btn {
  color: #251a11;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 18px 32px rgba(211, 163, 93, 0.18);
}

#next-btn {
  color: var(--text-bright);
  background: linear-gradient(135deg, #2b2531, #17131d);
  box-shadow: 0 16px 28px rgba(9, 6, 11, 0.18);
}

#restart-btn {
  color: var(--ink);
  background: linear-gradient(135deg, #f3e7d2, #e9d7b7);
  box-shadow: 0 14px 26px rgba(92, 72, 40, 0.14);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(11, 9, 13, 0.82);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: min(92vw, 760px);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 24px;
  border: 1px solid rgba(255, 243, 227, 0.16);
  box-shadow: 0 36px 70px rgba(0, 0, 0, 0.35);
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
}

.modal.open .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 243, 227, 0.12);
  background: rgba(20, 15, 17, 0.66);
  color: #f6eee0;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

@keyframes float-board {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progress-sheen {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(220%);
  }
}

.selection-hero > * {
  animation: rise-in 620ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.selection-hero > *:last-child {
  animation-delay: 100ms;
}

.story-item {
  animation: rise-in 500ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.story-item:nth-child(2) {
  animation-delay: 90ms;
}

.story-item:nth-child(3) {
  animation-delay: 180ms;
}

.game-sidebar,
.panel,
.feedback,
.controls-bar {
  animation: rise-in 520ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.question-panel {
  animation-delay: 80ms;
}

.cards-panel {
  animation-delay: 160ms;
}

.controls-bar {
  animation-delay: 220ms;
}

@media (max-width: 1180px) {
  .selection-hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 420px;
  }

  #story-list {
    grid-template-columns: 1fr;
  }

  .game-page #game-container {
    grid-template-columns: 1fr;
  }

  .game-sidebar {
    position: relative;
    top: auto;
  }
}

@media (max-width: 860px) {
  .section-heading,
  .cards-panel-head {
    align-items: start;
    flex-direction: column;
  }

  .section-heading h2 {
    max-width: none;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

@media (max-width: 640px) {
  .page-shell {
    padding: 12px;
  }

  .selection-page #story-selection-container,
  .game-sidebar,
  .panel {
    border-radius: 26px;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 16vw, 4.6rem);
  }

  .hero-visual {
    min-height: 360px;
  }

  .evidence-note {
    width: 46%;
    padding: 14px;
  }

  .game-header h1 {
    font-size: clamp(2.4rem, 12vw, 3.5rem);
  }

  .panel h2,
  .section-heading h2 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .question-text {
    max-width: none;
    font-size: 1.35rem;
  }

  .cards-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .status-grid,
  .cards-container {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 320px;
  }

  .evidence-board {
    aspect-ratio: 1 / 1.08;
  }

  .evidence-note {
    display: none;
  }

  .card.selected::after {
    top: 12px;
    right: 12px;
  }

  #controls-area button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    animation: none !important;
    transition-duration: 0ms !important;
  }
}
