/* ── Drill session — sub-brand identity ───────────────────────────
   Distinct from the calm cream/serif Baygush base. The session is
   "focus mode": dark backdrop, sans-serif chrome, kinetic micros.

   Palette:
     --ds-bg     #0e1117  near-black w/ slight blue tilt
     --ds-bg-2   #1a1f2a  raised surface
     --ds-text   #f4ecdc  off-cream (slightly warmer than home cream)
     --ds-muted  #8b8f9a  secondary text
     --ds-accent #e8a652  vivid gold (brighter than home accent)
     --ds-yes    #5dd4a8  fresh mint for "I knew it"
     --ds-no     #6b6f78  neutral gray for "I forgot" (no red — not punishing)
*/

.drill-session {
  /* Page (parchment) */
  --ds-page-bg:   #f0e3c4;       /* warm aged cream */
  --ds-ink:       #2a1f15;       /* warm dark ink (text on parchment) */
  --ds-ink-soft:  #7a6754;       /* warm muted ink */
  --ds-line:      rgba(42, 31, 21, 0.12);

  /* Card (cocoa) */
  --ds-bg-2:      #2a1c12;       /* deep warm cocoa */
  --ds-text:      #f4ecdc;       /* cream text on cocoa */
  --ds-muted:     #b0a08c;       /* warm cream-muted */

  /* Accents */
  --ds-accent:    #c8923f;       /* warm gold */
  --ds-yes:       #7ba887;       /* warm sage */
  --ds-no:        #9a8a78;       /* warm grey (no red) */

  /* Legacy alias kept for older selectors */
  --ds-bg: var(--ds-page-bg);

  position: fixed;
  inset: 0;
  z-index: 1000;
  background:
    /* Subtle warm halo at top */
    radial-gradient(ellipse at 50% -10%, rgba(200, 146, 63, 0.15) 0%, transparent 55%),
    /* Aged corner shadows (parchment vignette) */
    radial-gradient(ellipse at 0% 100%, rgba(74, 50, 30, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 100% 100%, rgba(74, 50, 30, 0.08) 0%, transparent 45%),
    /* Fine grain (parchment texture via SVG fractal noise) */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.10  0 0 0 0 0.06  0 0 0 0.07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    var(--ds-page-bg);
  color: var(--ds-ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  animation: dsPortalIn .3s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes dsPortalIn {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: scale(1); }
}

body.drill-session-open { overflow: hidden; }

/* ── Top bar ── */
.ds-topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem .35rem;
  flex-shrink: 0;
}
.ds-close {
  background: transparent;
  border: 1px solid var(--ds-line);
  color: var(--ds-ink);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, background .15s;
  flex-shrink: 0;
}
.ds-close:hover { border-color: var(--ds-ink); background: rgba(42, 31, 21, 0.04); }
.ds-progress {
  flex: 1;
  height: 5px;
  background: rgba(42, 31, 21, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.ds-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--ds-accent);
  border-radius: 999px;
  transition: width .35s cubic-bezier(.2,.8,.2,1);
}
.ds-counter-row {
  flex-shrink: 0;
  text-align: center;
  padding: .35rem 1.5rem .25rem;
}
.ds-counter {
  font-size: .82rem;
  color: var(--ds-ink-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: .04em;
}

/* ── Stage ── */
.ds-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem 1.5rem;
  min-height: 0;
  overflow: hidden;
}
.ds-loading,
.ds-error {
  text-align: center;
  color: var(--ds-ink-soft);
  max-width: 36ch;
}
.ds-error h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ds-ink);
  margin: 0 0 .5rem;
}
.ds-error p { margin: 0 0 1.5rem; line-height: 1.5; }

/* ── Flashcard ── */
.ds-flashcard-shell {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2rem;
  animation: dsCardIn .35s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes dsCardIn {
  from { opacity: 0; transform: scale(.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.ds-flashcard-shell.is-leaving-yes {
  animation: dsCardOutYes .32s cubic-bezier(.4,.2,.4,1) forwards;
}
.ds-flashcard-shell.is-leaving-no {
  animation: dsCardOutNo .32s cubic-bezier(.4,.2,.4,1) forwards;
}
@keyframes dsCardOutYes {
  to { opacity: 0; transform: translateX(80px) translateY(-8px) rotate(2deg); }
}
@keyframes dsCardOutNo {
  to { opacity: 0; transform: translateX(-80px) translateY(8px) rotate(-2deg); }
}

.ds-flashcard {
  perspective: 1400px;
  width: 100%;
  aspect-ratio: 1.42 / 1;
  cursor: pointer;
  user-select: none;
}
.ds-flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.2,.8,.2,1);
}
.ds-flashcard-inner.is-flipped { transform: rotateY(180deg); }

.ds-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 22px;
  background: var(--ds-bg-2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(74, 50, 30, 0.4),
    0 30px 60px rgba(58, 38, 22, 0.28),
    0 4px 12px rgba(58, 38, 22, 0.12);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(200, 146, 63, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(200, 146, 63, 0.05) 0%, transparent 50%);
}
.ds-card-back {
  transform: rotateY(180deg);
  justify-content: flex-start;
  padding: 1.85rem 2rem 1.5rem;
  align-items: stretch;
  text-align: left;
  gap: 1rem;
}

.ds-card-pos {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ds-accent);
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.ds-card-headword {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 5.5vw, 3.8rem);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ds-text);
  margin-bottom: .9rem;
  /* Allow long compound headwords (e.g. "work-life balance") to wrap */
  word-break: break-word;
}
.ds-card-ipa {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 1rem;
  color: var(--ds-muted);
  margin-bottom: 2.2rem;
}
.ds-card-hint {
  font-size: .78rem;
  color: var(--ds-muted);
  letter-spacing: .04em;
  position: absolute;
  bottom: 1.4rem;
  left: 0;
  right: 0;
  text-align: center;
  opacity: .7;
}

/* Front-face corner marks — viewfinder L-brackets, very subtle.
   Just enough to add personality without crowding. */
.ds-card-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border: 0 solid rgba(244, 236, 220, 0.22);
}
.ds-card-corner.is-tl { top: 18px;    left: 18px;   border-top-width: 1px;    border-left-width: 1px;   }
.ds-card-corner.is-tr { top: 18px;    right: 18px;  border-top-width: 1px;    border-right-width: 1px;  }
.ds-card-corner.is-bl { bottom: 18px; left: 18px;   border-bottom-width: 1px; border-left-width: 1px;   }
.ds-card-corner.is-br { bottom: 18px; right: 18px;  border-bottom-width: 1px; border-right-width: 1px;  }

/* Back face — head row (word + IPA on left, chips on right) */
.ds-card-back-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.ds-card-back-headword {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ds-text);
  letter-spacing: -.015em;
  line-height: 1.1;
  word-break: break-word;
}
.ds-card-back-ipa {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: .82rem;
  color: var(--ds-muted);
  margin-top: .25rem;
}
.ds-card-chips {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}
.ds-card-chip {
  display: inline-flex;
  align-items: center;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: rgba(244, 236, 220, 0.07);
  color: var(--ds-muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: lowercase;
  border: 1px solid rgba(244, 236, 220, 0.05);
  white-space: nowrap;
}
.ds-card-chip.is-accent {
  color: var(--ds-accent);
  background: rgba(232, 166, 82, 0.1);
  border-color: rgba(232, 166, 82, 0.2);
  text-transform: uppercase;
  font-size: .65rem;
  letter-spacing: .08em;
}

.ds-card-rule {
  height: 1px;
  background: rgba(244, 236, 220, 0.1);
  margin: 0;
}

.ds-card-defs {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.ds-card-def-en {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ds-text);
  line-height: 1.45;
}
.ds-card-def-az {
  font-size: .92rem;
  font-weight: 400;
  color: var(--ds-muted);
  line-height: 1.5;
  font-style: italic;
}

.ds-card-example-block {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(244, 236, 220, 0.08);
}
.ds-card-example-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ds-muted);
  opacity: .7;
  margin-bottom: .35rem;
}
.ds-card-example {
  font-size: .98rem;
  font-weight: 400;
  color: var(--ds-text);
  line-height: 1.5;
  font-style: italic;
}
.ds-card-example em {
  color: var(--ds-accent);
  font-style: normal;
  font-weight: 700;
}

.ds-card-topic {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ds-muted);
  opacity: .55;
  text-align: right;
  margin-top: .5rem;
}

/* ─────────────────────────────────────────────────────────────────
   Mode shell — unified for non-flashcard modes (type / cloze / distinguish).
   Shares the dark panel aesthetic; no flip animation, just enter/exit.
   ───────────────────────────────────────────────────────────────── */
.ds-mode-shell:not(.ds-flashcard-shell) {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: dsCardIn .35s cubic-bezier(.2,.8,.2,1) both;
}
.ds-mode-panel {
  background: var(--ds-bg-2);
  border-radius: 22px;
  padding: 1.85rem 2rem 1.65rem;
  box-shadow:
    0 0 0 1px rgba(74, 50, 30, 0.4),
    0 30px 60px rgba(58, 38, 22, 0.28),
    0 4px 12px rgba(58, 38, 22, 0.12);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(200, 146, 63, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(200, 146, 63, 0.05) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}
.ds-mode-panel-wide { max-width: none; }
.ds-mode-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.ds-mode-head-chips {
  display: flex;
  gap: .35rem;
}
.ds-mode-head-topic {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ds-muted);
  opacity: .55;
}

.ds-prompt-eyebrow {
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ds-accent);
  font-weight: 600;
  margin-top: .25rem;
}
.ds-prompt-def {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ds-text);
  letter-spacing: -.005em;
}
.ds-prompt-def-az {
  font-size: 1rem;
  font-style: italic;
  color: var(--ds-muted);
  line-height: 1.5;
  margin-top: -.4rem;
}

/* Cloze sentence */
.ds-cloze-sentence {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ds-text);
  letter-spacing: -.005em;
}
.ds-cloze-blank {
  display: inline-block;
  min-width: 5em;
  border-bottom: 2px solid var(--ds-accent);
  margin: 0 .15em;
  color: transparent;
  user-select: none;
}
.ds-cloze-hint {
  font-size: .9rem;
  font-style: italic;
  color: var(--ds-muted);
  line-height: 1.5;
  padding-top: .25rem;
  border-top: 1px solid rgba(244, 236, 220, 0.08);
}

/* Input */
.ds-input-wrap {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-top: .5rem;
}
.ds-input {
  width: 100%;
  background: rgba(244, 236, 220, 0.04);
  border: 1px solid rgba(244, 236, 220, 0.12);
  color: var(--ds-text);
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -.005em;
  padding: .9rem 1.1rem;
  border-radius: 12px;
  outline: none;
  transition: border-color .18s, background .18s;
  box-sizing: border-box;
}
.ds-input::placeholder { color: var(--ds-muted); opacity: .5; }
.ds-input:focus { border-color: var(--ds-accent); background: rgba(232, 166, 82, 0.06); }
.ds-input.is-correct {
  border-color: var(--ds-yes);
  background: rgba(93, 212, 168, 0.1);
  color: var(--ds-yes);
}
.ds-input.is-revealed {
  border-color: var(--ds-muted);
  background: rgba(244, 236, 220, 0.05);
  color: var(--ds-muted);
  font-style: italic;
}
.ds-input-shake { animation: dsShake .35s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes dsShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
.ds-input-feedback {
  font-size: .82rem;
  color: var(--ds-muted);
  min-height: 1.2em;
}

.ds-mode-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  min-height: 3rem;
  align-items: center;
}

/* Next button — surfaces after a wrong answer so the student can study */
.ds-next-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: var(--ds-bg-2);
  color: var(--ds-text);
  border: none;
  padding: .85rem 2.4rem;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: .005em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(58, 38, 22, 0.28), 0 2px 4px rgba(58, 38, 22, 0.12);
  transition: transform .15s, box-shadow .15s, background .15s;
  animation: dsNextIn .25s cubic-bezier(.2,.8,.2,1) both;
}
.ds-next-btn:hover {
  transform: translateY(-2px);
  background: #3a2618;
  box-shadow: 0 12px 26px rgba(58, 38, 22, 0.36), 0 2px 4px rgba(58, 38, 22, 0.16);
}
.ds-next-btn:active { transform: translateY(0); }
@keyframes dsNextIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Distinguish — option list */
.ds-distinguish-prompt {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ds-text);
  text-align: center;
  line-height: 1.5;
  margin-bottom: .25rem;
}
.ds-distinguish-prompt strong {
  color: var(--ds-accent);
  font-weight: 700;
}
.ds-option-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.ds-option {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  width: 100%;
  text-align: left;
  background: rgba(244, 236, 220, 0.03);
  border: 1px solid rgba(244, 236, 220, 0.1);
  color: var(--ds-text);
  padding: .9rem 1.05rem;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: .98rem;
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.ds-option:not(:disabled):hover {
  background: rgba(244, 236, 220, 0.06);
  border-color: rgba(244, 236, 220, 0.22);
  transform: translateX(2px);
}
.ds-option-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(244, 236, 220, 0.08);
  color: var(--ds-muted);
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
  margin-top: .1rem;
}
.ds-option-text { flex: 1; }
.ds-option-text em {
  color: var(--ds-accent);
  font-style: normal;
  font-weight: 700;
}
.ds-option.is-correct {
  background: rgba(93, 212, 168, 0.08);
  border-color: var(--ds-yes);
}
.ds-option.is-correct .ds-option-mark { background: var(--ds-yes); color: #0a2818; }
.ds-option.is-wrong {
  background: rgba(244, 236, 220, 0.04);
  border-color: rgba(232, 100, 100, 0.5);
  opacity: .85;
}
.ds-option:disabled { cursor: default; }

/* ── Action buttons ── */
.ds-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .35s ease-out .25s, transform .35s ease-out .25s;
}
.ds-actions.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.05rem 1.6rem;
  border-radius: 14px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.ds-btn-no {
  background: transparent;
  color: var(--ds-ink);
  border: 1px solid var(--ds-line);
}
.ds-btn-no:hover {
  background: rgba(42, 31, 21, 0.05);
  border-color: rgba(42, 31, 21, 0.32);
}
.ds-btn-yes {
  background: var(--ds-yes);
  color: #0a2818;
  box-shadow: 0 6px 20px rgba(93, 212, 168, 0.25);
}
.ds-btn-yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(93, 212, 168, 0.35);
}
.ds-btn-yes:active { transform: translateY(0); }

.ds-btn-ghost {
  background: transparent;
  color: var(--ds-ink);
  border: 1px solid var(--ds-line);
  padding: .85rem 1.4rem;
  border-radius: 12px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.ds-btn-ghost:hover {
  background: rgba(42, 31, 21, 0.05);
  border-color: rgba(42, 31, 21, 0.32);
}
.ds-btn-primary {
  background: var(--ds-accent);
  color: #1a1308;
  border: none;
  padding: 1rem 2.2rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(232, 166, 82, 0.3);
  transition: transform .15s, box-shadow .15s;
}
.ds-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(232, 166, 82, 0.4);
}

/* ── Finish screen ── */
.ds-finish {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: dsFinishIn .5s cubic-bezier(.2,.8,.2,1) both;
  background: var(--ds-bg-2);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(200, 146, 63, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(200, 146, 63, 0.06) 0%, transparent 50%);
  color: var(--ds-text);
  padding: 2.5rem 3rem 2rem;
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(74, 50, 30, 0.4),
    0 30px 60px rgba(58, 38, 22, 0.28),
    0 4px 12px rgba(58, 38, 22, 0.12);
  max-width: 420px;
}
@keyframes dsFinishIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ds-finish-eyebrow {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ds-accent);
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.ds-finish-numeral {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(5rem, 12vw, 8rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ds-text);
}
.ds-finish-label {
  font-size: 1rem;
  color: var(--ds-muted);
  margin-top: .35rem;
}
.ds-finish-line {
  font-size: .95rem;
  color: var(--ds-text);
  font-weight: 500;
  margin-top: 2rem;
  padding: .6rem 1.2rem;
  background: rgba(244, 236, 220, 0.05);
  border-radius: 999px;
}
.ds-finish-streak {
  font-size: .9rem;
  color: var(--ds-muted);
  margin-top: 1rem;
  margin-bottom: 2.2rem;
}

/* Polished finish-screen variants */
.ds-finish-stats { padding: 2.2rem 3rem 1.8rem; min-width: 320px; }
.ds-finish-stats .ds-finish-eyebrow { margin-bottom: 1.6rem; }
.ds-finish-score {
  display: flex; align-items: baseline; justify-content: center;
  gap: .35rem;
  margin: 0 0 .35rem;
}
.ds-finish-score .ds-finish-numeral {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(4.6rem, 11vw, 6.8rem);
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--ds-text);
}
.ds-finish-divider {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  color: var(--ds-muted);
  line-height: 1;
  transform: translateY(-.2em);
}
.ds-finish-total {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--ds-muted);
  line-height: 1;
  letter-spacing: -.02em;
}
.ds-finish-sub {
  font-size: .92rem;
  color: var(--ds-muted);
  margin-bottom: 1.8rem;
  letter-spacing: .01em;
}

/* "Daily done — all caught up" variant: checkmark instead of score */
.ds-finish-mini { padding: 2.4rem 2.8rem 1.8rem; min-width: 320px; }
.ds-finish-mini .ds-finish-eyebrow { margin-bottom: 1.4rem; }
.ds-finish-check {
  font-size: 4.2rem; line-height: 1;
  color: var(--ds-text);
  margin: .2rem 0 1.1rem;
  font-weight: 300;
}
.ds-finish-headline {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ds-text);
  margin-bottom: .35rem;
}
.ds-finish-mini .ds-finish-sub { margin-bottom: 1.6rem; }

/* Action row: stack vertically with primary first, link second */
.ds-finish-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .55rem;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}
.ds-finish-actions .ds-btn-primary {
  width: 100%;
  justify-content: center;
}
.ds-btn-link {
  background: transparent;
  border: none;
  color: var(--ds-muted);
  font-family: inherit;
  font-size: .88rem;
  cursor: pointer;
  padding: .55rem;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.ds-btn-link:hover {
  color: var(--ds-text);
  background: rgba(244, 236, 220, 0.06);
}

/* ─────────────────────────────────────────────────────────────────
   Mini-games (collocation puzzle, synonym scale, antonym pairs)
   Reuse the dark panel + chips, with their own option / pool styles.
   ───────────────────────────────────────────────────────────────── */

/* Generic word-tile option (collocation + antonym) */
.ds-mini-option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
  margin-top: .25rem;
}
.ds-mini-option {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  background: rgba(244, 236, 220, 0.03);
  border: 1px solid rgba(244, 236, 220, 0.1);
  color: var(--ds-text);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: .98rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.ds-mini-option:not(:disabled):hover {
  background: rgba(244, 236, 220, 0.06);
  border-color: rgba(244, 236, 220, 0.22);
  transform: translateY(-1px);
}
.ds-mini-option-text { flex: 1; }
.ds-mini-option.is-correct {
  background: rgba(93, 212, 168, 0.1);
  border-color: var(--ds-yes);
}
.ds-mini-option.is-correct .ds-option-mark {
  background: var(--ds-yes); color: #0a2818;
}
.ds-mini-option.is-wrong {
  background: rgba(244, 236, 220, 0.04);
  border-color: rgba(232, 100, 100, 0.5);
  opacity: .85;
}
.ds-mini-option:disabled { cursor: default; }

/* Explanation strip below options */
.ds-mini-explain {
  font-size: .88rem;
  line-height: 1.55;
  color: var(--ds-muted);
  padding: .85rem 0 0;
  margin-top: .5rem;
  border-top: 1px solid rgba(244, 236, 220, 0.08);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .25s ease-out, max-height .35s ease-out;
}
.ds-mini-explain.is-visible {
  opacity: 1;
  max-height: 220px;
}
.ds-mini-explain em {
  color: var(--ds-text);
  font-style: italic;
  font-weight: 600;
}

/* ── Antonym headword display ── */
.ds-ant-headword {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  letter-spacing: -.02em;
  color: var(--ds-text);
  text-align: center;
  padding: .5rem 0 .25rem;
}

/* ── Synonym scale game ── */
.ds-syn-theme {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--ds-text);
  font-weight: 500;
  text-align: center;
  margin-top: -.35rem;
}
.ds-syn-pool {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  padding: .5rem 0;
}
.ds-syn-word {
  background: rgba(244, 236, 220, 0.05);
  border: 1px solid rgba(244, 236, 220, 0.15);
  color: var(--ds-text);
  padding: .55rem 1rem;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.ds-syn-word:not(:disabled):hover {
  background: rgba(244, 236, 220, 0.08);
  border-color: rgba(244, 236, 220, 0.32);
  transform: translateY(-1px);
}
.ds-syn-word.is-selected {
  background: var(--ds-accent);
  color: #1a1308;
  border-color: var(--ds-accent);
  box-shadow: 0 0 0 4px rgba(232, 166, 82, 0.15);
}
.ds-syn-word.is-placed {
  opacity: .25;
  cursor: default;
}
.ds-syn-word { cursor: grab; }
.ds-syn-word:active { cursor: grabbing; }
.ds-syn-word.is-placed,
.ds-syn-word:disabled { cursor: default; }
.ds-syn-word.is-dragging {
  opacity: .55;
  transform: scale(.96);
}
.ds-syn-slot.is-dragover {
  border-color: var(--ds-accent, #c8923f);
  background: rgba(200, 146, 63, .14);
  transform: scale(1.02);
}
.ds-syn-axis {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .25rem;
  padding: 0 .25rem;
}
.ds-syn-axis-label {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ds-muted);
  font-weight: 600;
}
.ds-syn-axis-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(244, 236, 220, 0.05), var(--ds-accent));
}
.ds-syn-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .55rem;
}
.ds-syn-slot {
  position: relative;
  height: 70px;
  background: rgba(244, 236, 220, 0.03);
  border: 1.5px dashed rgba(244, 236, 220, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.ds-syn-slot:hover { background: rgba(244, 236, 220, 0.06); border-color: rgba(244, 236, 220, 0.32); }
.ds-syn-slot.is-filled {
  background: rgba(232, 166, 82, 0.08);
  border-style: solid;
  border-color: rgba(232, 166, 82, 0.4);
}
.ds-syn-slot.is-correct {
  background: rgba(93, 212, 168, 0.1);
  border-style: solid;
  border-color: var(--ds-yes);
}
.ds-syn-slot.is-wrong {
  background: rgba(232, 100, 100, 0.08);
  border-style: solid;
  border-color: rgba(232, 100, 100, 0.5);
}
.ds-syn-slot-num {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--ds-muted);
  font-weight: 600;
  opacity: .7;
}
.ds-syn-slot-word {
  font-family: 'Inter', sans-serif;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ds-text);
  text-align: center;
  padding: 0 .5rem;
  line-height: 1.2;
}
.ds-syn-correct-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.ds-syn-correct-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
  color: var(--ds-muted);
}
.ds-syn-correct-pill {
  background: rgba(93, 212, 168, 0.12);
  color: var(--ds-yes);
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
}

/* ── In-app exit confirm modal ── */
.ds-confirm {
  position: absolute;
  inset: 0;
  background: rgba(42, 28, 18, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: dsConfirmIn .18s ease-out both;
}
.ds-confirm.is-leaving { animation: dsConfirmOut .18s ease-in both; }
@keyframes dsConfirmIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes dsConfirmOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.ds-confirm-card {
  background: var(--ds-bg-2);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(200, 146, 63, 0.16) 0%, transparent 55%);
  border: 1px solid rgba(74, 50, 30, 0.4);
  border-radius: 20px;
  padding: 2.1rem 2rem 1.55rem;
  width: min(440px, calc(100% - 2rem));
  box-shadow:
    0 0 0 1px rgba(244, 236, 220, 0.05),
    0 30px 80px rgba(20, 12, 6, 0.5);
  position: relative;
  animation: dsConfirmCardIn .25s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes dsConfirmCardIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
/* Tiny warm gold rule above the title — adds editorial polish */
.ds-confirm-card::before {
  content: '';
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: var(--ds-accent);
  border-radius: 2px;
  opacity: .55;
}
.ds-confirm-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ds-text);
  letter-spacing: -.012em;
  margin: 0 0 .55rem;
  line-height: 1.25;
}
.ds-confirm-body {
  font-size: .95rem;
  color: var(--ds-muted);
  line-height: 1.55;
  margin: 0 0 1.65rem;
}
.ds-confirm-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .35rem;
}
.ds-confirm-btn {
  font-family: 'Inter', sans-serif;
  font-size: .92rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, color .15s, transform .12s;
  border: none;
}
/* "Leave" is the destructive action — quiet text-button so it doesn't
   compete with Stay. Hovers into a warm red. */
.ds-confirm-btn.is-leave {
  background: transparent;
  color: var(--ds-muted);
  padding: .7rem 1rem;
}
.ds-confirm-btn.is-leave:hover {
  color: #e88a8a;
  background: rgba(232, 138, 138, 0.08);
}
/* "Stay" is the safe primary — cream-filled, confident */
.ds-confirm-btn.is-ghost {
  background: var(--ds-text);
  color: var(--ds-bg-2);
  padding: .75rem 1.6rem;
  letter-spacing: .005em;
  box-shadow: 0 4px 14px rgba(244, 236, 220, 0.12);
}
.ds-confirm-btn.is-ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(244, 236, 220, 0.2);
}
.ds-confirm-btn.is-ghost:active { transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 760px) {
  .ds-topbar { padding: .85rem 1rem; gap: .85rem; }
  .ds-stage { padding: 0 1rem 1rem; }
  .ds-flashcard { aspect-ratio: 1.15 / 1; }
  .ds-card-face { padding: 1.75rem 1.4rem; border-radius: 18px; }
  .ds-card-back { padding: 1.5rem 1.4rem; }
  .ds-card-headword { font-size: clamp(2rem, 9vw, 2.8rem); }
  .ds-actions { gap: .65rem; }
  .ds-btn { padding: .9rem 1.2rem; font-size: .95rem; }
}
