:root {
  --frame-margin: 14px;
  --wine-900: #650800;
  --wine-800: #7f0c03;
  --wine-700: #9b1508;
  --source-burgundy: #700b06;
  --source-burgundy-dark: #5a0805;
  --gold-500: #ffcc3d;
  --gold-300: #ffe08a;
  --cream-100: #fff6d8;
  --cream-200: #fff3cf;
  --cream-300: #f1d48a;
  --shell-line: #d0a54b;
  --ink: #24100c;
  --muted: #704834;
  --ok: #1f7a45;
  --bad: #9b1d13;
  --shadow: 0 18px 46px rgba(91, 19, 6, 0.16);
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

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

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

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

.app-layout {
  min-height: calc(100vh - 390px);
  margin: 18px var(--frame-margin) 24px;
  display: grid;
  grid-template-columns: 230px 1fr;
  border: 1px solid var(--shell-line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff6d8;
  box-shadow: 0 18px 44px rgba(89, 43, 8, 0.12);
}

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

.site-footer p {
  margin: 0;
}

.side-panel {
  padding: 22px;
  color: var(--cream-100);
  background: linear-gradient(180deg, var(--source-burgundy), var(--source-burgundy-dark));
  border-radius: 13px 0 0 13px;
  box-shadow: inset -1px 0 0 rgba(255, 231, 163, 0.16);
}

.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;
}

.side-title strong,
.side-title small {
  display: block;
}

.side-title small {
  margin-top: 3px;
  color: var(--gold-300);
}

.game-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-color: var(--gold-500);
}

.source-card {
  margin-top: 28px;
  padding: 14px;
  color: var(--ink);
  background: var(--gold-300);
  border-radius: 7px;
}

.source-card p {
  margin: 6px 0 0;
  line-height: 1.4;
}

.game-stage {
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(112, 11, 6, 0.06), rgba(112, 11, 6, 0) 90px),
    #fff6d8;
}

.stage-top,
.score-strip,
.mini-actions,
.quiz-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

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

.stage-top h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}

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

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

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

.score-strip span {
  padding: 10px 14px;
  color: var(--wine-900);
  background: var(--gold-300);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-weight: 800;
}

.score-strip.is-hidden {
  display: none;
}

.primary-action,
.mini-actions button,
.clue-box button,
.option-grid button {
  padding: 11px 15px;
  color: var(--cream-100);
  background: var(--wine-800);
  border-radius: 6px;
  font-weight: 800;
}

.mini-actions button:nth-child(2),
.clue-box button {
  color: var(--ink);
  background: var(--gold-500);
}

.game-panel {
  display: none;
}

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

.overview-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.overview-hero,
.overview-card,
.overview-facts {
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(91, 19, 6, 0.08);
}

.overview-hero {
  grid-column: 1 / 2;
  padding: 24px;
  color: var(--cream-100);
  background: linear-gradient(135deg, var(--source-burgundy), var(--source-burgundy-dark));
}

.overview-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 7px 10px;
  color: var(--wine-900);
  background: var(--gold-300);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-hero h3 {
  max-width: 820px;
  margin: 0;
  color: #fff8dc;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.08;
}

.overview-hero p {
  max-width: 820px;
  margin: 16px 0 0;
  color: #f5d9a0;
  font-size: 1.05rem;
  line-height: 1.5;
}

.overview-hero button {
  margin-top: 20px;
  padding: 12px 16px;
  color: var(--wine-900);
  background: var(--gold-500);
  border-radius: 8px;
  font-weight: 900;
}

.overview-grid {
  grid-column: 1 / 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.overview-card {
  padding: 16px;
  background: rgba(255, 251, 238, 0.82);
}

.overview-card span {
  color: var(--wine-800);
  font-size: 0.78rem;
  font-weight: 900;
}

.overview-card h4 {
  margin: 7px 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
}

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

.overview-facts {
  grid-column: 2 / 3;
  grid-row: 1 / span 2;
  padding: 18px;
  background: rgba(255, 251, 238, 0.82);
}

.overview-facts h3 {
  margin: 0 0 14px;
  color: var(--wine-900);
  font-size: 1.35rem;
}

.overview-facts dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.overview-facts div {
  padding: 11px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--cream-300);
  border-radius: 7px;
}

.overview-facts dt {
  color: var(--wine-800);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-facts dd {
  margin: 4px 0 0;
  color: var(--ink);
  line-height: 1.35;
}

.source-link,
.article-source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  margin-top: 14px;
  padding: 9px 12px;
  color: var(--cream-100);
  background: var(--wine-800);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(91, 19, 6, 0.14);
}

.article-source-link {
  display: flex;
  margin-top: 8px;
}

.source-link:hover,
.article-source-link:hover {
  background: var(--wine-900);
}

.split-view {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) 380px;
  gap: 18px;
}

.crossword-view {
  grid-template-columns: minmax(660px, 1.45fr) minmax(410px, 0.75fr);
  gap: 18px;
  max-width: none;
  margin: 0 auto;
  align-items: stretch;
}

.board-card {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10px 12px 12px;
  background: #fff0b8;
  border: 1px solid #e0b84e;
  border-radius: 18px;
  box-shadow: 0 14px 35px rgba(91, 19, 6, 0.12);
}

.board-wrap {
  overflow: visible;
  padding-bottom: 2px;
}

.crossword-view .board-wrap {
  display: flex;
  justify-content: center;
}

#crossword {
  display: grid;
  --cw-cell: 38px;
  grid-template-columns: repeat(var(--cols), var(--cw-cell));
  grid-template-rows: repeat(var(--rows), var(--cw-cell));
  gap: 2px;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.cell {
  position: relative;
  width: var(--cw-cell);
  height: var(--cw-cell);
}

.block {
  background: transparent;
}

.letter {
  width: 100%;
  height: 100%;
  border: 2px solid var(--source-burgundy);
  border-radius: 6px;
  color: #111827;
  background: #ffffff;
  text-align: center;
  text-transform: uppercase;
  caret-color: transparent;
  outline: none;
  font-weight: 700;
  font-size: clamp(11px, calc(var(--cw-cell) * 0.5), 19px);
}

.letter:focus {
  border-color: var(--wine-900);
  box-shadow: 0 0 0 3px rgba(102, 8, 0, 0.18);
}

.letter.highlight {
  background: #dbeafe !important;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.letter.active {
  background: #bfdbfe !important;
  border-color: #2563eb;
  box-shadow:
    inset 0 0 0 2px rgba(37, 99, 235, 0.28),
    0 0 0 3px rgba(37, 99, 235, 0.16);
}

.letter.is-correct {
  background: #bbf7d0 !important;
  border-color: #15803d;
}

.letter.is-wrong {
  background: #fecaca !important;
  border-color: #b91c1c;
}

.letter.is-correct.highlight,
.letter.is-wrong.highlight {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.letter.is-correct.active,
.letter.is-wrong.active {
  box-shadow:
    inset 0 0 0 2px rgba(37, 99, 235, 0.28),
    0 0 0 3px rgba(37, 99, 235, 0.16);
}

.letter.hinted {
  background: #fef3c7 !important;
  border-color: #f59e0b;
  color: #78350f;
}

.num {
  position: absolute;
  left: 3px;
  top: 2px;
  color: #475569;
  font-size: clamp(6px, calc(var(--cw-cell) * 0.2), 9px);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.controls button {
  padding: 10px 16px;
  color: #ffffff;
  background: #2457d6;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(36, 87, 214, 0.2);
  transition: transform 0.12s ease, opacity 0.12s ease, filter 0.12s ease;
}

.controls button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.controls button.secondary {
  color: #ffffff;
  background: #7f8794;
  box-shadow: 0 6px 14px rgba(75, 85, 99, 0.18);
}

.controls button.light {
  color: #111827;
  background: #d9dee7;
  box-shadow: 0 6px 14px rgba(75, 85, 99, 0.14);
}

.controls button.hint-btn {
  color: #ffffff;
  background: #660000;
  box-shadow: 0 6px 14px rgba(102, 0, 0, 0.22);
}

.controls button:disabled {
  cursor: not-allowed;
  opacity: 0.78;
  filter: saturate(1.1);
}

.status,
#result {
  min-height: 24px;
  margin-top: 10px;
  text-align: center;
  font-weight: 800;
}

.status {
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.success-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 18px;
}

.success-modal {
  max-width: 680px;
  width: 100%;
}

.success-message {
  padding: 20px;
  color: #660000;
  background: #f7eaea;
  border: 2px solid #660000;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  line-height: 1.45;
}

.success-message button {
  margin-top: 14px;
  padding: 10px 18px;
  color: #ffffff;
  background: #660000;
  border-radius: 8px;
}

.clue-box,
.hangman-card,
.quiz-shell,
.sort-shell {
  padding: 18px;
  background: rgba(255, 251, 238, 0.78);
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(91, 19, 6, 0.08);
}

.original-crossword .clue-box {
  height: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
  padding: 18px;
  color: #1f2937;
}

.original-crossword .clue-box h3 {
  margin: 0 0 14px;
  color: #0f172a;
  font-size: 24px;
  font-weight: 700;
}

.clue-box h3,
.quiz-shell h3,
.dropzone h3 {
  margin: 0 0 12px;
}

.clue-list {
  display: grid;
  gap: 10px;
  max-height: 570px;
  overflow: auto;
}

.clue-section {
  margin-bottom: 12px;
}

.clue-section h4 {
  margin: 0 0 6px;
  padding-bottom: 5px;
  color: #0f172a;
  border-bottom: 2px solid #660000;
  font-size: 16px;
  font-weight: 700;
}

.clue-section ol {
  margin: 0;
  padding-left: 20px;
}

.clue-section li {
  margin: 0 0 5px;
  line-height: 1.22;
  color: #0f172a;
  font-size: 0.86rem;
}

.original-crossword .clue-btn {
  display: block;
  width: 100%;
  padding: 4px 6px;
  color: #1f2937;
  background: transparent;
  border-radius: 7px;
  text-align: left;
  font-weight: 400;
  line-height: 1.15;
  box-shadow: none;
  transform: none;
  font-size: 0.86rem;
}

.original-crossword .clue-btn:hover {
  background: #f1f5f9;
  transform: none;
  opacity: 1;
}

.clue-section li.selected .clue-btn {
  background: #dbeafe;
  outline: 2px solid rgba(37, 99, 235, 0.24);
}

.original-crossword .answer-label {
  display: inline;
  margin-top: 0;
  color: #6b7280;
  font-size: 11px;
  white-space: nowrap;
}

.original-crossword .note {
  margin-top: 10px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.3;
}

.clue-item {
  padding: 10px;
  border-left: 4px solid var(--gold-500);
  background: var(--cream-100);
  border-radius: 5px;
}

.clue-item strong {
  color: var(--wine-900);
}

.clue-item p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.hangman-card {
  display: grid;
  gap: 14px;
}

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

.category-badge,
.streak-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 30px;
  padding: 6px 10px;
  color: var(--wine-900);
  background: var(--gold-300);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 900;
}

.difficulty-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.difficulty-wrap select {
  padding: 8px 10px;
  color: var(--wine-900);
  background: #ffffff;
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-weight: 900;
}

.lives-meter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--wine-900);
  font-weight: 900;
}

.lives-meter span {
  display: inline-flex;
  gap: 5px;
}

.life-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cream-300);
}

.life-dot.is-live {
  background: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(255, 199, 68, 0.2);
}

.life-dot.is-lost {
  background: rgba(102, 0, 0, 0.34);
}

.gallows {
  position: relative;
  width: min(100%, 360px);
  height: 260px;
  margin: 0 auto 6px;
}

.beam,
.rope,
.person {
  position: absolute;
  display: block;
  opacity: 0;
}

.beam,
.rope {
  background: var(--wine-800);
  opacity: 1;
}

.beam.top { width: 170px; height: 10px; left: 84px; top: 24px; }
.beam.side { width: 10px; height: 210px; left: 84px; top: 24px; }
.beam.base { width: 230px; height: 10px; left: 34px; bottom: 16px; }
.rope { width: 5px; height: 48px; left: 248px; top: 28px; }

.person {
  background: var(--gold-500);
}

.person.is-shown {
  opacity: 1;
}

.head {
  width: 46px;
  height: 46px;
  left: 227px;
  top: 74px;
  border-radius: 50%;
}

.gallows.is-lost .head::before,
.gallows.is-lost .head::after {
  content: "X";
  position: absolute;
  top: 11px;
  color: var(--wine-900);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.gallows.is-lost .head::before {
  left: 10px;
}

.gallows.is-lost .head::after {
  right: 10px;
}

.body { width: 8px; height: 62px; left: 246px; top: 118px; }
.arm {
  width: 46px;
  height: 8px;
  left: 250px;
  top: 136px;
  transform-origin: left center;
}

.a1 { transform: rotate(35deg); }
.a2 { transform: rotate(145deg); }

.leg {
  width: 50px;
  height: 8px;
  left: 250px;
  top: 180px;
  transform-origin: left center;
}

.l1 { transform: rotate(55deg); }
.l2 { transform: rotate(125deg); }

.masked-word {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0;
  color: var(--wine-900);
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 900;
}

.masked-word span {
  min-width: 26px;
  padding-bottom: 5px;
  border-bottom: 3px solid var(--wine-800);
  text-align: center;
}

.hint-text,
.result-text {
  color: var(--muted);
  line-height: 1.45;
}

.wrong-bank,
.explanation-box {
  padding: 10px 12px;
  color: var(--wine-900);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  line-height: 1.35;
}

.wrong-bank {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.wrong-bank span {
  color: var(--muted);
  letter-spacing: 0.08em;
  font-weight: 900;
}

.hangman-actions {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.hangman-actions button {
  justify-content: center;
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
}

.hangman-actions button:nth-child(2) {
  background: var(--gold-500);
  color: var(--wine-900);
}

.hangman-actions button:disabled {
  cursor: default;
  opacity: 0.48;
}

.explanation-box:empty {
  display: none;
}

.keyboard {
  display: grid;
  grid-template-columns: repeat(13, minmax(34px, 1fr));
  gap: 8px;
}

.keyboard button,
.term-card {
  padding: 10px;
  color: var(--wine-900);
  background: var(--gold-300);
  border: 1px solid var(--cream-300);
  border-radius: 6px;
  font-weight: 900;
}

.keyboard button:disabled {
  cursor: default;
  opacity: 0.42;
}

.quiz-shell {
  position: relative;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 24px;
}

.quiz-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  color: var(--cream-100);
  background: linear-gradient(135deg, var(--wine-900), var(--wine-800));
  border: 1px solid rgba(255, 199, 68, 0.4);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(91, 19, 6, 0.16);
}

.quiz-intro.is-hidden {
  display: none;
}

.quiz-intro span {
  color: var(--gold-500);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quiz-shell .quiz-intro h3 {
  min-height: 0;
  margin: 4px 0 0;
  padding: 0;
  color: var(--cream-100);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: clamp(1.3rem, 2.1vw, 1.85rem);
}

.quiz-intro button {
  flex: 0 0 auto;
  padding: 13px 18px;
  color: var(--wine-900);
  background: var(--gold-500);
  border-radius: 8px;
  font-weight: 900;
}

.quiz-head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.quiz-stat {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 74px;
  padding: 12px 14px;
  color: var(--wine-900);
  background: linear-gradient(180deg, var(--gold-300), rgba(255, 251, 238, 0.88));
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(91, 19, 6, 0.08);
}

.quiz-stat small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quiz-stat b {
  color: var(--wine-900);
  font-size: 1.8rem;
  line-height: 1;
}

.timer-stat b {
  color: var(--bad);
}

.timer-ring {
  --timer-progress: 100%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  background:
    radial-gradient(circle at center, var(--cream-100) 58%, transparent 59%),
    conic-gradient(var(--bad) var(--timer-progress), rgba(102, 0, 0, 0.16) 0);
  border-radius: 50%;
}

.timer-ring b {
  font-size: 1.2rem;
}

.quiz-progress-track {
  height: 13px;
  margin: 0 0 22px;
  overflow: hidden;
  background: rgba(102, 0, 0, 0.12);
  border: 1px solid var(--cream-300);
  border-radius: 999px;
}

.quiz-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), var(--wine-800));
  transition: width 240ms ease;
}

.quiz-play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
  align-items: start;
}

.quiz-main {
  min-width: 0;
}

.quiz-category {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 7px 11px;
  color: var(--wine-900);
  background: var(--gold-300);
  border: 1px solid var(--cream-300);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quiz-shell h3 {
  min-height: 116px;
  margin: 0 0 18px;
  padding: 24px;
  color: var(--cream-100);
  background: linear-gradient(135deg, var(--wine-900), var(--wine-800));
  border: 1px solid rgba(255, 199, 68, 0.34);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(91, 19, 6, 0.18);
  font-size: clamp(1.45rem, 2.5vw, 2.2rem);
  line-height: 1.18;
}

.quiz-side {
  display: grid;
  gap: 14px;
}

.streak-meter,
.review-panel {
  padding: 14px;
  background: rgba(255, 251, 238, 0.74);
  border: 1px solid var(--cream-300);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(91, 19, 6, 0.08);
}

.streak-meter {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.streak-segment {
  height: 36px;
  background: rgba(102, 0, 0, 0.13);
  border: 1px solid rgba(102, 0, 0, 0.14);
  border-radius: 6px;
}

.streak-segment.is-active {
  background: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(255, 199, 68, 0.2);
}

.review-panel h4 {
  margin: 0 0 12px;
  color: var(--wine-900);
  font-size: 1.1rem;
}

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

.review-list > p {
  margin: 0;
  color: var(--muted);
}

.review-item {
  padding: 10px;
  background: rgba(255, 255, 255, 0.62);
  border-left: 5px solid var(--gold-500);
  border-radius: 6px;
}

.review-item.correct {
  border-left-color: var(--ok);
}

.review-item.wrong,
.review-item.time {
  border-left-color: var(--bad);
}

.review-item strong,
.review-item span {
  display: block;
}

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

.review-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.review-item p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
}

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

.option-grid button {
  min-height: 96px;
  padding: 18px;
  text-align: left;
  background: rgba(102, 0, 0, 0.94);
  border: 1px solid rgba(255, 199, 68, 0.25);
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(91, 19, 6, 0.12);
  font-size: 1.03rem;
  line-height: 1.25;
}

.option-grid button:not(:disabled):hover {
  transform: translateY(-1px);
}

.option-grid button.is-right {
  background: var(--ok);
}

.option-grid button.is-wrong {
  background: var(--bad);
}

#quizFeedback {
  min-height: 58px;
  margin: 16px 0;
  padding: 14px 16px;
  color: var(--wine-900);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--cream-300);
  border-radius: 8px;
}

@media (max-width: 980px) {
  .quiz-play-layout {
    grid-template-columns: 1fr;
  }

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

.sort-shell {
  display: grid;
  gap: 18px;
}

.term-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.term-card {
  touch-action: none;
}

.term-card.is-selected {
  outline: 3px solid var(--wine-800);
}

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

.dropzone {
  min-height: 260px;
  padding: 16px;
  border: 2px dashed var(--cream-300);
  border-radius: 8px;
  background: rgba(255, 246, 221, 0.66);
}

.dropzone.is-over {
  border-color: var(--wine-800);
  background: rgba(255, 224, 138, 0.3);
}

.drop-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 980px) {
  .app-layout,
  .overview-shell,
  .split-view,
  .dropzones {
    grid-template-columns: 1fr;
  }

  .crossword-view {
    grid-template-columns: 1fr;
  }

  .overview-hero,
  .overview-grid,
  .overview-facts {
    grid-column: auto;
    grid-row: auto;
  }

  :root {
    --frame-margin: 10px;
  }

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

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

  .side-panel {
    display: grid;
    gap: 16px;
    border-radius: 12px 12px 0 0;
  }

  .game-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  body {
    padding: 6px;
  }

  .game-stage {
    padding: 10px;
  }

  .page-header {
    margin-top: 4px;
    padding: 4px;
  }

  .option-grid,
  .overview-grid,
  .game-tabs {
    grid-template-columns: 1fr;
  }

  .app-layout {
    gap: 10px;
    margin-top: 10px;
    border-radius: 12px;
  }

  .stage-top {
    gap: 8px;
    margin-bottom: 10px;
  }

  .stage-top h2 {
    font-size: 1.7rem;
  }

  .score-strip {
    gap: 8px;
  }

  .score-strip span,
  .score-strip button {
    padding: 8px 10px;
    font-size: 0.86rem;
  }

  .crossword-view.original-crossword {
    gap: 10px;
  }

  .board-card {
    width: 100%;
    min-height: auto;
    height: auto;
    padding: 8px 2px 10px;
    border-radius: 12px;
  }

  .board-wrap {
    width: 100%;
    overflow: hidden;
  }

  #crossword {
    gap: 1px;
  }

  .letter {
    border-radius: 5px;
  }

  .num {
    left: 2px;
    top: 1px;
  }

  .controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(96px, 132px));
    justify-content: center;
    gap: 7px;
    margin-top: 10px;
  }

  .controls button {
    padding: 8px 9px;
    font-size: 0.78rem;
    line-height: 1.1;
  }

  .status {
    margin-top: 8px;
    font-size: 13px;
  }

  .original-crossword .clue-box {
    padding: 14px;
  }

  .hangman-card,
  .clue-box {
    min-width: 0;
    padding: 14px;
    overflow: hidden;
  }

  .hangman-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .lives-meter {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    font-size: 0.88rem;
  }

  .life-dot {
    width: 10px;
    height: 10px;
  }

  .gallows {
    width: 260px;
    height: 190px;
    margin: 0 auto;
    transform: none;
  }

  .masked-word {
    gap: 5px;
    margin: 8px 0 10px;
    font-size: 1.45rem;
  }

  .beam.top { width: 120px; height: 8px; left: 58px; top: 16px; }
  .beam.side { width: 8px; height: 150px; left: 58px; top: 16px; }
  .beam.base { width: 178px; height: 8px; left: 18px; bottom: 14px; }
  .rope { width: 4px; height: 34px; left: 174px; top: 22px; }

  .head {
    width: 34px;
    height: 34px;
    left: 159px;
    top: 55px;
  }

  .gallows.is-lost .head::before,
  .gallows.is-lost .head::after {
    top: 8px;
    font-size: 13px;
  }

  .gallows.is-lost .head::before {
    left: 7px;
  }

  .gallows.is-lost .head::after {
    right: 7px;
  }

  .body {
    width: 6px;
    height: 46px;
    left: 173px;
    top: 88px;
  }

  .arm {
    width: 36px;
    height: 6px;
    left: 176px;
    top: 102px;
  }

  .leg {
    width: 38px;
    height: 6px;
    left: 176px;
    top: 132px;
  }

  .masked-word span {
    min-width: 18px;
    border-bottom-width: 2px;
  }

  .hint-text {
    overflow-wrap: anywhere;
    font-size: 0.9rem;
  }

  .wrong-bank {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
  }

  .keyboard {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }

  .keyboard button {
    min-width: 0;
    padding: 8px 0;
    font-size: 0.88rem;
  }

  .hangman-actions {
    grid-template-columns: 1fr;
  }

}
