:root,
:root[data-theme="light"] {
  --bg: #FBF7EE;
  --bg-card: #FFFFFF;
  --bg-sunken: #F4EDDD;
  --text: #3A2E2C;
  --text-muted: #8A7A77;
  --primary: #FF6B6B;
  --primary-hover: #E85959;
  --primary-soft: #FFE3DF;
  --accent: #4FAD7D;
  --accent-hover: #3F9166;
  --accent-soft: #DCEFE3;
  --warn: #E89B3C;
  --border: #E8DFCE;
  --border-strong: #C9BDA5;
  --shadow-sm: 0 1px 2px rgba(58,46,44,0.06);
  --shadow-md: 0 4px 12px rgba(58,46,44,0.08), 0 1px 2px rgba(58,46,44,0.04);
  --shadow-lg: 0 12px 32px rgba(58,46,44,0.12);
  --bg-grad-1: rgba(255,107,107,0.06);
  --bg-grad-2: rgba(79,173,125,0.06);
  --header-bg: rgba(251,247,238,0.85);
  --backdrop-bg: rgba(251,247,238,0.92);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1a1614;
  --bg-card: #251f1c;
  --bg-sunken: #1f1815;
  --text: #ede4d3;
  --text-muted: #a89687;
  --primary: #FF8585;
  --primary-hover: #FF6B6B;
  --primary-soft: #3a2624;
  --accent: #6CC295;
  --accent-hover: #4FAD7D;
  --accent-soft: #1f2f28;
  --warn: #E8B05C;
  --border: #3a2e28;
  --border-strong: #5c4d42;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.6);
  --bg-grad-1: rgba(255,107,107,0.10);
  --bg-grad-2: rgba(79,173,125,0.10);
  --header-bg: rgba(26,22,20,0.85);
  --backdrop-bg: rgba(26,22,20,0.92);
  color-scheme: dark;
}

:root {
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --font-display: "Fraunces", Georgia, serif;
  --font-letter: "Bitter", "Lucida Bright", Georgia, serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { scroll-padding-top: 6rem; }
body { min-height: 100dvh; overflow-x: clip; }
.category-row__input { scroll-margin-top: 6rem; }

body {
  background-image:
    radial-gradient(circle at 20% 10%, var(--bg-grad-1), transparent 40%),
    radial-gradient(circle at 85% 80%, var(--bg-grad-2), transparent 40%);
  background-attachment: fixed;
  min-height: 100dvh;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
}

input:focus-visible, textarea:focus-visible, button:focus-visible, select:focus-visible {
  outline: 3px solid rgba(255,107,107,0.4);
  outline-offset: 2px;
}

a { color: var(--primary); }

/* ===== Layout primitives ===== */

.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100dvh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  gap: var(--space-3);
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 0;
}

.app-header__right {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container--narrow { max-width: 480px; }
.container--wide { max-width: none; padding-left: var(--space-6); padding-right: var(--space-6); }
.container--flush { max-width: none; }

@media (max-width: 720px) {
  .container--wide { padding-left: var(--space-4); padding-right: var(--space-4); }
}

.center-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  text-align: center;
}

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--lg { gap: var(--space-5); }
.row { display: flex; gap: var(--space-3); align-items: center; }

/* ===== Typography ===== */

.title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}

.title__dot { color: var(--primary); }

.subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 var(--space-3);
}

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }

/* ===== Buttons ===== */

.btn {
  appearance: none;
  border: none;
  background: var(--bg-card);
  color: var(--text);
  font-weight: 700;
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform 80ms ease, box-shadow 120ms ease, background 120ms ease;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-align: center;
  text-decoration: none;
  min-height: 48px;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }

.btn--primary { background: var(--primary); color: white; }
.btn--primary:hover { background: var(--primary-hover); }

.btn--accent { background: var(--accent); color: white; }
.btn--accent:hover { background: var(--accent-hover); }

.btn--ghost {
  background: transparent;
  box-shadow: none;
  border: 1.5px solid var(--border-strong);
}
.btn--ghost:hover { background: var(--bg-sunken); box-shadow: none; }

.btn--lg { padding: 18px 32px; font-size: 1.125rem; min-height: 56px; }
.btn--xl { padding: 22px 40px; font-size: 1.25rem; min-height: 64px; border-radius: var(--radius-xl); }
.btn--block { width: 100%; }

.icon-btn {
  appearance: none;
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 120ms ease;
}
.icon-btn:hover { background: var(--bg-sunken); }
.icon-btn svg { width: 22px; height: 22px; }

/* ===== Cards ===== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.card--soft { background: var(--bg-sunken); border-color: var(--border); }

/* ===== Forms ===== */

.text-input {
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  width: 100%;
  transition: border-color 120ms ease, background 120ms ease;
}
.text-input:focus { border-color: var(--primary); }
.text-input--lg { font-size: 1.5rem; font-weight: 700; text-align: center; letter-spacing: 0.2em; text-transform: uppercase; }

.lang-select {
  appearance: none;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 28px 6px 12px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233A2E2C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

/* ===== Home ===== */

.home-actions { display: flex; flex-direction: column; gap: var(--space-3); width: 100%; max-width: 320px; }

/* ===== Setup screen ===== */

.code-display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 12vw, 5rem);
  letter-spacing: 0.15em;
  color: var(--primary);
  text-align: center;
  padding: var(--space-5) var(--space-6);
  background: var(--bg-card);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
  user-select: all;
}
.code-display:hover { transform: scale(1.02); border-color: var(--primary); }
.code-display:active { transform: scale(0.98); }

.qr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.qr-card svg { display: block; }

/* ===== Play screen ===== */

.play-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.code-pill {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.2em;
  background: var(--primary-soft);
  color: var(--primary-hover);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
}

.timer {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.timer--warn { color: var(--warn); }
.timer--danger { color: var(--primary); animation: pulse 1s ease infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.letter-card {
  text-align: center;
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-2);
}

.letter-card__upper {
  font-family: var(--font-letter);
  font-weight: 800;
  font-size: clamp(5rem, 18vw, 8rem);
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
  text-shadow: 2px 3px 0 rgba(255,107,107,0.22);
}

.letter-card__lower {
  font-family: var(--font-letter);
  font-weight: 600;
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  color: var(--text-muted);
}

.round-pill {
  display: inline-block;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.category-list > * { min-width: 0; }

.category-row {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 120ms ease, background 120ms ease;
  min-width: 0;
  overflow: hidden;
}

.category-row:focus-within { border-color: var(--primary); }
.category-row[data-filled="true"] { border-color: var(--accent); background: var(--accent-soft); }

.category-row__label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  word-break: break-word;
}

.category-row__label > span:last-child { flex: 1; min-width: 0; }

.category-row__num {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  background: var(--bg-sunken);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text);
}

.category-row__input {
  border: none;
  background: transparent;
  padding: 4px 0;
  font-size: 1.0625rem;
  font-weight: 600;
  width: 100%;
}
.category-row__input:focus { outline: none; }

.timer-bar {
  height: 6px;
  background: var(--bg-sunken);
  position: sticky;
  top: 0;
  width: 100%;
}
.timer-bar__fill {
  height: 100%;
  background: var(--accent);
  transition: width 1s linear, background 200ms ease;
  width: 100%;
}
.timer-bar__fill--warn { background: var(--warn); }
.timer-bar__fill--danger { background: var(--primary); }

/* ===== Countdown overlay ===== */

.countdown {
  position: fixed;
  inset: 0;
  background: var(--backdrop-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.countdown__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(8rem, 30vw, 14rem);
  color: var(--primary);
  animation: pop 1s ease;
}

@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  30% { transform: scale(1.1); opacity: 1; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0; }
}

/* ===== Time-up flash ===== */

.timeup {
  position: fixed;
  inset: 0;
  background: rgba(58,46,44,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeOut 2s ease forwards;
  pointer-events: none;
}

.timeup__inner {
  background: var(--primary);
  color: white;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 8vw, 4rem);
  padding: var(--space-5) var(--space-7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: pop 1.6s ease forwards;
}

@keyframes fadeOut {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== Results ===== */

.result-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  overflow: hidden;
}

.result-row__main { flex: 1; min-width: 0; word-break: break-word; }
.result-row__cat {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.result-row__ans {
  font-size: 1.0625rem;
  font-weight: 600;
  word-break: break-word;
}
.result-row__ans--empty { color: var(--text-muted); font-style: italic; font-weight: 400; }

.unique-toggle {
  appearance: none;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  transition: all 120ms ease;
  flex-shrink: 0;
}

.unique-toggle[aria-pressed="true"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.unique-toggle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.unique-toggle svg { width: 16px; height: 16px; }

.score-bar {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  position: sticky;
  bottom: 0;
  box-shadow: 0 -4px 12px rgba(58,46,44,0.06);
}

.score-bar__stats { display: flex; flex-direction: column; }
.score-bar__round { font-size: 0.8125rem; color: var(--text-muted); font-weight: 700; }
.score-bar__total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
}

.score-bar__actions { display: flex; gap: var(--space-2); }

/* ===== Help ===== */

.help-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  text-align: center;
}

.help-step__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  margin: 0 0 var(--space-4);
}

.help-step__body {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0;
  white-space: pre-line;
}

.help-step__demo {
  margin: var(--space-5) auto var(--space-4);
  padding: var(--space-4);
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  max-width: 280px;
}

.help-step__demo-code {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--primary);
  letter-spacing: 0.15em;
}

.help-dots {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
}

.help-dots__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 120ms ease, transform 120ms ease;
}

.help-dots__dot--active { background: var(--primary); transform: scale(1.2); }

/* ===== Dialog ===== */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(58,46,44,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--space-5);
}

.dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dialog__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0;
}

.dialog__body { color: var(--text-muted); margin: 0; }

.dialog__actions { display: flex; gap: var(--space-2); justify-content: flex-end; }

/* ===== Toast ===== */

.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9375rem;
  z-index: 300;
  animation: toastIn 240ms ease, toastOut 240ms ease 1.6s forwards;
  box-shadow: var(--shadow-lg);
}

@keyframes toastIn {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translate(-50%, 20px); opacity: 0; }
}

/* ===== Responsive ===== */

/* ===== Mobile sticky play header ===== */

.play-sticky {
  position: sticky;
  top: 0;
  z-index: 9;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.play-sticky .app-header { position: static; border-bottom: none; background: transparent; backdrop-filter: none; }
.play-sticky .timer-bar { position: static; }

/* Letter badge in the play header */
.play-right {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.letter-badge {
  display: inline-flex;
  font-family: var(--font-letter);
  font-weight: 800;
  font-size: 1.625rem;
  line-height: 1;
  color: var(--primary-hover);
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  width: 2.5rem;
  height: 2.5rem;
  text-align: center;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 80ms linear;
}

/* Letter hero (top of play screen, shrinks into badge as you scroll) */
.letter-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-4) 0 var(--space-5);
  transform-origin: center top;
  will-change: transform, opacity;
}
.letter-hero__caption {
  margin: 0 0 var(--space-2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1rem;
}
.letter-hero__big {
  font-family: var(--font-letter);
  font-weight: 800;
  font-size: clamp(5rem, 22vw, 9rem);
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
  text-shadow: 3px 4px 0 rgba(255,107,107,0.22);
  display: inline-flex;
  align-items: baseline;
  gap: 0.15em;
}
.letter-hero__small {
  font-weight: 600;
  font-size: 0.4em;
  color: var(--text-muted);
  text-shadow: none;
}

.play-main {
  gap: var(--space-4);
  padding-top: var(--space-4);
}
.play-main > .category-list { flex: 1; align-content: start; }

/* Mobile: fixed header so Android keyboard can't push it offscreen */
@media (max-width: 599px) {
  .play-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
  }
  .play-main {
    padding-top: calc(6rem + var(--space-3));
  }
  .letter-hero {
    padding: var(--space-3) 0 var(--space-4);
  }
}

/* ===== Zoom + theme controls ===== */

.controls {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle {
  appearance: none;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease;
}
.theme-toggle:hover { background: var(--bg-sunken); }
.theme-toggle svg { width: 18px; height: 18px; }

.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}

.zoom-control__btn {
  appearance: none;
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.zoom-control__btn:hover { background: var(--bg-sunken); }
.zoom-control__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.zoom-control__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 2.5em;
  text-align: center;
}

@media (max-width: 599px) {
  .zoom-control { display: none; }
}

@media (max-width: 480px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  .score-bar { padding: var(--space-3) var(--space-4); }
  .score-bar__total { font-size: 1.25rem; }
  .score-bar__actions .btn { padding: 12px 16px; font-size: 0.9375rem; }
}

/* ===== Tutorial (new) ===== */

.help-page { padding-bottom: var(--space-7); }

.help-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.help-section--tip {
  background: var(--accent-soft);
  border-color: transparent;
}

.help-section__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  margin: 0;
}

.help-section__body {
  margin: 0;
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.demo-banner {
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.demo-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  color: var(--primary-hover);
  font-family: var(--font-letter);
  font-weight: 800;
  font-size: 1.75rem;
  vertical-align: middle;
}

.demo-timer {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.demo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-2);
}

.demo-card {
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  border: 1.5px solid transparent;
}
.demo-card[data-filled="true"] { background: var(--accent-soft); border-color: var(--accent); }
.demo-card__cat { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; margin-bottom: 2px; }
.demo-card__ans { font-weight: 700; }
.demo-card__placeholder { font-style: italic; }

.demo-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  justify-content: center;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  border: 1px solid var(--border);
}
.demo-pill--accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.demo-pill svg { width: 16px; height: 16px; }

.demo-arrow { color: var(--text-muted); font-weight: 700; }

.demo-code {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--primary);
  letter-spacing: 0.15em;
  padding: 4px 12px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.demo-score-row {
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 1.5px solid transparent;
}
.demo-score-row--unique { background: var(--accent-soft); border-color: var(--accent); }
.demo-score-row__main { flex: 1; min-width: 0; }
.demo-score-row__cat { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }
.demo-score-row__ans { font-weight: 700; }
.demo-score-row__verdict { display: inline-flex; align-items: center; gap: 6px; }
.demo-score-row__check { color: var(--accent); display: inline-flex; }
.demo-score-row__points { font-family: var(--font-display); font-weight: 800; min-width: 1.5rem; text-align: center; }

.help-tips-list {
  margin: 0;
  padding-left: var(--space-5);
  color: var(--text);
}
.help-tips-list li { margin: var(--space-2) 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
