/*
  theme-crimson-dark.css — the same Swiss-poster identity flipped to a
  crimson-tinted near-black background, chalk text, and a brightened
  crimson glow (the native accent becomes --accent-dark here — a
  deliberate callback, not a coincidence).

  Scoped under `body[data-theme="crimson"].theme-dark` (compound
  selector, beats theme-crimson.css's single-attribute rules on
  specificity). Toggled at runtime by js/color_scheme.js. Radius/font/
  heading transform stay the same as the native file.
*/

body[data-theme="crimson"].theme-dark {
  --accent:      #ff3b57;
  --accent-dark: #c61236;
  --accent-soft: #ff8c9e;
  --success:     #4ade80;
  --danger:      #ff3b57;
  --warning:     #fbbf24;

  --gradient-brand: linear-gradient(135deg, #c61236 0%, #ff3b57 100%);

  --bg:        #160507;
  --bg-alt:    #100305;
  --bg-card:   #1d0709;
  --bg-card2:  #240a0c;
  --surface:   rgba(242,239,231,.05);
  --surface-hover: rgba(242,239,231,.09);
  --border:    rgba(242,239,231,.12);
  --border-strong: rgba(242,239,231,.22);

  --text:      #f2efe7;
  --text-muted: rgba(242,239,231,.62);
  --text-dim:  rgba(242,239,231,.42);

  --shadow: 0 10px 34px rgba(0,0,0,.6), 0 0 22px rgba(255,59,87,.16);
}

/* ---- Header / hero-stats glass — dark, not light ---- */
body[data-theme="crimson"].theme-dark header {
  background: rgba(22,5,7,.85);
}
body[data-theme="crimson"].theme-dark .hero-stats-panel {
  background: rgba(22,5,7,.55);
}

/* ---- Primary button — glow, not hard offset shadow ---- */
body[data-theme="crimson"].theme-dark .btn-primary {
  color: #fff;
  box-shadow: 0 0 20px rgba(255,59,87,.45);
}
body[data-theme="crimson"].theme-dark .btn-primary:hover {
  box-shadow: 0 0 28px rgba(255,59,87,.6);
}

/* ---- Hero: glow wash, light-tinted grain ---- */
body[data-theme="crimson"].theme-dark .hero-canvas-wrap {
  background:
    radial-gradient(900px 500px at 78% 20%, rgba(255,59,87,.18), transparent 60%),
    radial-gradient(700px 420px at 10% 100%, rgba(255,59,87,.09), transparent 55%),
    var(--bg);
}
body[data-theme="crimson"].theme-dark .hero-grain {
  background-image:
    linear-gradient(rgba(242,239,231,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242,239,231,.045) 1px, transparent 1px);
}

/* ---- Level-tab indicator — glow again, not a plain border ---- */
body[data-theme="crimson"].theme-dark .level-tab-indicator {
  box-shadow: 0 0 16px rgba(255,59,87,.4);
  border: none;
}

/* ---- Badges/chips/progress bars/toast — light-tinted, not ink-tinted ---- */
body[data-theme="crimson"].theme-dark .topic-progress-bar,
body[data-theme="crimson"].theme-dark .quiz-progress-bar,
body[data-theme="crimson"].theme-dark .mini-bar-track {
  background: rgba(242,239,231,.09);
}
body[data-theme="crimson"].theme-dark .score-circle-bg {
  stroke: rgba(242,239,231,.09);
}
body[data-theme="crimson"].theme-dark .topic-progress-table th {
  background: rgba(242,239,231,.035);
}
body[data-theme="crimson"].theme-dark .topic-progress-table tr:hover td {
  background: rgba(242,239,231,.04);
}
body[data-theme="crimson"].theme-dark .answer-chip {
  background: rgba(242,239,231,.07);
  border-color: var(--border);
}
body[data-theme="crimson"].theme-dark .answer-chip-remove {
  background: rgba(242,239,231,.12);
}
body[data-theme="crimson"].theme-dark .format-help-panel code {
  background: rgba(242,239,231,.08);
}
body[data-theme="crimson"].theme-dark .topic-chip {
  background: rgba(242,239,231,.07);
}
body[data-theme="crimson"].theme-dark .ai-points {
  border-top-color: rgba(242,239,231,.12);
}
body[data-theme="crimson"].theme-dark .toast {
  background: rgba(22,5,7,.92);
  border-color: var(--border-strong);
}

/* ---- Accent-tinted glows/focus-rings ---- */
body[data-theme="crimson"].theme-dark .marks-badge,
body[data-theme="crimson"].theme-dark .option-btn:hover:not(:disabled),
body[data-theme="crimson"].theme-dark .setup-option:hover,
body[data-theme="crimson"].theme-dark .setup-option.selected,
body[data-theme="crimson"].theme-dark .symbol-btn:hover,
body[data-theme="crimson"].theme-dark .explanation-box.feedback-reveal {
  background: rgba(255,59,87,.14);
}
body[data-theme="crimson"].theme-dark .quiz-timer {
  border-color: rgba(255,59,87,.35);
}
body[data-theme="crimson"].theme-dark .explanation-box {
  background: rgba(255,59,87,.08);
  border-color: rgba(255,59,87,.32);
}
body[data-theme="crimson"].theme-dark .explanation-box.feedback-reveal {
  border-color: rgba(255,59,87,.42);
}
body[data-theme="crimson"].theme-dark .answer-input:focus {
  box-shadow: 0 0 0 3px rgba(255,59,87,.22);
}
body[data-theme="crimson"].theme-dark .quiz-progress-fill {
  box-shadow: 0 4px 16px rgba(255,59,87,.4);
}

/* ---- Difficulty badges — generic dark-tuned triple, reused verbatim ---- */
body[data-theme="crimson"].theme-dark .diff-easy   { background: rgba(34,197,94,.18);  color: #4ade80; }
body[data-theme="crimson"].theme-dark .diff-medium { background: rgba(242,194,24,.18); color: #fadb5f; }
body[data-theme="crimson"].theme-dark .diff-hard   { background: rgba(244,65,95,.18);  color: #fb7185; }
