:root {
  --ink: #1E1B4B;
  --muted: #4B4870;
  --soft: #C9C6E3;
  --ground: #EEF6FF;
  --card: #FFFFFF;
  --purple: #6D4AFF;
  --purple-ink: #5B3BEA;
  --yellow: #FFD23F;
  --yellow-soft: #FFF3C4;
  --sky: #4CC9F0;
  --sky-soft: #DDF4FC;
  --pink: #FF5DA2;
  --pink-soft: #FFE2EF;
  --teal: #12B5A6;
  --teal-soft: #D9F6F2;
  --orange: #FF8C42;
  --right: #15803D;
  --right-soft: #DCFCE7;
  --wrong: #D93A3A;
  --wrong-soft: #FFE4E1;
  --bar-wrong: #FB7A6E;
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: 'Nunito', system-ui, sans-serif; font-size: 16px; line-height: 1.45; }
a { color: var(--purple-ink); font-weight: 800; }
a:hover { color: #3F22C4; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; }
h1 { font-size: clamp(30px, 5vw, 40px); font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

/* ---------- layout ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 24px; background: var(--card); border-bottom: 3px solid var(--ink); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 46px; height: 42px; border-radius: 12px; background: var(--yellow); border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -0.5px; flex: none; }
.logo-text { font-family: var(--display); font-weight: 700; font-size: 24px; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--ink); border: 2.5px solid transparent; }
.nav a.active { background: var(--yellow); border-color: var(--ink); }
.nav a.admin.active { background: var(--ink); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--pink); border: 2.5px solid var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.linkbtn { background: none; border: none; padding: 8px 4px; cursor: pointer; color: var(--purple-ink); font-weight: 800; }
.demo-banner { background: var(--yellow-soft); border-bottom: 2px solid var(--ink); padding: 8px 24px; font-size: 14px; font-weight: 700; text-align: center; }
main.page { max-width: 1140px; margin: 0 auto; padding: 32px 20px 64px; display: flex; flex-direction: column; gap: 22px; }
main.narrow { max-width: 800px; }
.row { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.grow { flex: 999 1 560px; min-width: 0; }
.side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.between { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- cards & buttons ---------- */
.card { background: var(--card); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 5px 0 var(--ink); padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { padding: 16px 24px; border-bottom: 2.5px solid var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 16px; border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); background: #fff; color: var(--ink); font-family: var(--display); font-size: 19px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--ink); filter: brightness(0.98); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--purple); color: #fff; }
.btn.primary:hover { color: #fff; }
.btn.big { min-height: 62px; font-size: 23px; padding: 0 34px; }
.btn.small { min-height: 44px; font-size: 16px; padding: 0 16px; box-shadow: 0 3px 0 var(--ink); }
.btn.danger { background: var(--wrong-soft); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 14px; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--ink); border: 2.5px solid var(--soft); background: #fff; }
.chip.on { border-color: var(--ink); background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.chip .count { font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700; color: var(--muted); }
.pill { display: inline-flex; align-items: center; font-family: var(--display); font-size: 15px; font-weight: 600; padding: 5px 14px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; white-space: nowrap; }
.pill.w2m { background: var(--sky); }
.pill.m2w { background: var(--pink); }
.pill.syn { background: var(--teal); }
.pill.ant { background: var(--orange); }
.pill.spell { background: var(--yellow); }
.step { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.step-num { width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.tile { border: 2.5px solid var(--ink); border-radius: 18px; padding: 14px 16px; }
.tile .num { font-family: var(--display); font-size: 30px; font-weight: 700; }
.tile .lbl { font-size: 14px; font-weight: 700; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.note { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: 16px; font-size: 16px; }
.note.dashed { background: #F3EFFF; border: 2px dashed var(--purple); }
.note.yellow { background: var(--yellow-soft); border: 2.5px solid var(--ink); }
.note.red { background: var(--wrong-soft); border: 2.5px solid var(--ink); }
.empty { padding: 36px; text-align: center; background: #fff; border: 3px dashed #9A96BC; border-radius: 24px; font-family: var(--display); font-size: 21px; font-weight: 600; }
.progress { height: 18px; border-radius: 999px; background: #E6E3F7; border: 2px solid var(--ink); overflow: hidden; }
.progress > div { height: 100%; background: var(--teal); }

/* ---------- home ---------- */
.modes { display: flex; flex-wrap: wrap; gap: 14px; }
.mode { flex: 1 1 230px; text-align: left; cursor: pointer; border-radius: 20px; padding: 18px 20px; border: 3px solid var(--soft); display: flex; gap: 14px; align-items: center; }
.mode.m-w2m { background: var(--sky-soft); }
.mode.m-m2w { background: var(--pink-soft); }
.mode.m-syn { background: var(--teal-soft); }
.mode.m-ant { background: #FFE8D6; }
.mode.m-spell { background: var(--yellow-soft); }
.mode.on { border-color: var(--ink); box-shadow: 0 5px 0 var(--ink); }
.mode-icon { flex: none; width: 56px; height: 56px; border-radius: 16px; border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 18px; }
.mode-title { display: block; font-family: var(--display); font-size: 21px; font-weight: 600; }
.mode-tick { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); display: flex; align-items: center; justify-content: center; visibility: hidden; }
.mode.on .mode-tick { visibility: visible; }
.count-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.count-ball { flex: none; width: 84px; height: 84px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 38px; font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--purple); height: 30px; }
.num-chip { min-width: 58px; min-height: 46px; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 17px; border-radius: 999px; border: 2.5px solid var(--ink); background: #fff; }
.num-chip.on { background: var(--ink); color: #fff; }

/* ---------- quiz ---------- */
.segments { display: grid; gap: 6px; }
.seg { height: 14px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; }
.seg.right { background: var(--right); }
.seg.wrong { background: var(--bar-wrong); }
.seg.now { background: var(--yellow); }
.seg.viewing { box-shadow: 0 0 0 3px var(--purple); }
.question { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.question .big-word { font-family: var(--display); font-size: clamp(38px, 8vw, 56px); font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.question .big-meaning { font-family: var(--display); font-size: clamp(24px, 4vw, 30px); font-weight: 600; line-height: 1.25; }
.type-tag { font-size: 15px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--ground); color: var(--muted); }
.revisit-tag { font-size: 14px; font-weight: 800; padding: 3px 12px; border-radius: 999px; background: var(--orange); border: 2px solid var(--ink); }
.options { display: flex; flex-direction: column; gap: 12px; }
.option { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 64px; padding: 10px 18px; text-align: left; font-size: 18px; font-weight: 600; border-radius: 18px; cursor: pointer; border: 3px solid var(--ink); background: #fff; box-shadow: 0 4px 0 var(--ink); }
.option .badge { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 18px; }
.option:nth-child(1) .badge { background: var(--sky-soft); }
.option:nth-child(2) .badge { background: var(--pink-soft); }
.option:nth-child(3) .badge { background: var(--yellow-soft); }
.option:nth-child(4) .badge { background: var(--teal-soft); }
.options.answered .option { cursor: default; box-shadow: none; }
.options.answered .option.dim { border-color: var(--soft); color: #6E6A8F; }
.option.is-right { background: var(--right-soft); border-color: var(--right); }
.option.is-right .badge { background: var(--right); }
.option.is-wrong { background: var(--wrong-soft); border-color: var(--wrong); }
.option.is-wrong .badge { background: var(--wrong); }
.feedback { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 20px; border: 2.5px solid var(--ink); }
.feedback.good { background: var(--right-soft); }
.feedback.bad { background: var(--wrong-soft); }
.feedback-title { font-family: var(--display); font-size: 26px; font-weight: 700; }
.saved { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted); }
.stars { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }

/* ---------- result marks ---------- */
.mark { display: inline-flex; width: 32px; height: 32px; border-radius: 9px; border: 2px solid var(--ink); align-items: center; justify-content: center; vertical-align: middle; flex: none; }
.mark.right { background: var(--right); }
.mark.wrong { background: var(--wrong); }
.mark.none { border: 2px dashed #9A96BC; }
.answer-row { display: flex; gap: 16px; align-items: flex-start; padding: 14px 24px; border-bottom: 2px solid #EEF0FA; }
.answer-row.bad { background: #FFF1EF; }
.answer-word { font-family: var(--display); font-weight: 600; font-size: 20px; }
.you-picked { font-size: 15px; font-weight: 700; color: #B42318; }

/* ---------- history ---------- */
.tabs { display: flex; gap: 6px; padding: 6px; background: #fff; border: 2.5px solid var(--ink); border-radius: 18px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 12px; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 17px; text-decoration: none; }
.tabs a.on { background: var(--purple); color: #fff; }
.attempt { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 24px; border-bottom: 2px solid #EEF0FA; }
.attempt .when { flex: 1 1 140px; display: flex; flex-direction: column; }
.scorebar { flex: 2 1 220px; display: flex; align-items: center; gap: 12px; }
.scorebar .track { flex: 1; height: 16px; border-radius: 999px; background: var(--bar-wrong); border: 2px solid var(--ink); overflow: hidden; }
.scorebar .fill { height: 100%; background: var(--right); }
.scorebar .val { flex: none; min-width: 96px; text-align: right; font-family: var(--display); font-weight: 600; font-size: 17px; }
.seg-group { display: flex; gap: 4px; padding: 3px; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; flex-wrap: wrap; }
.seg-group button { min-height: 38px; padding: 0 14px; border: none; border-radius: 10px; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 15px; background: #fff; }
.seg-group button.on { background: var(--purple); color: #fff; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 800; color: var(--muted); }
.field input[type=search], .field input[type=text], .field input[type=number] { min-height: 46px; padding: 0 14px; border: 2.5px solid var(--ink); border-radius: 14px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 15px; font-weight: 700; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 18px; height: 18px; border-radius: 4px; display: inline-block; }
.tablebox { background: #fff; border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 5px 0 var(--ink); overflow-x: auto; }
table.words { width: 100%; min-width: 860px; border-collapse: collapse; }
table.words th { font-size: 13px; font-weight: 800; color: var(--muted); padding: 10px 8px; }
table.words th.grp { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--ink); padding-top: 12px; }
table.words td { padding: 8px; border-bottom: 2px solid #EEF0FA; text-align: center; }
table.words td.l, table.words th.l { text-align: left; padding-left: 18px; }
.c-w2m { background: var(--sky-soft); }
.c-m2w { background: var(--pink-soft); }
.c-syn { background: var(--teal-soft); }
.c-ant { background: #FFE8D6; }
.c-spell { background: var(--yellow-soft); }
.divl { border-left: 2.5px solid var(--ink); }
.word-tip { position: relative; display: inline-block; font-family: var(--display); font-weight: 600; font-size: 19px; background: none; border: none; border-bottom: 2.5px dotted var(--purple); padding: 4px 0; cursor: help; }
.word-tip .tip { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; width: 280px; padding: 12px 14px; border-radius: 16px; background: var(--ink); color: #fff; text-align: left; font-family: 'Nunito', sans-serif; font-weight: 600; font-size: 15px; line-height: 1.45; box-shadow: 0 5px 0 var(--purple); white-space: normal; }
.word-tip .tip b { display: block; font-family: var(--display); font-size: 17px; color: var(--yellow); margin-bottom: 4px; }
.word-tip:hover .tip, .word-tip:focus .tip { display: block; }
.wrong-count { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 999px; font-family: var(--display); font-weight: 600; border: 2px solid var(--soft); }
.wrong-count.has { background: var(--wrong-soft); border-color: var(--wrong); }

/* ---------- charts ---------- */
.chart { display: flex; flex-direction: column; gap: 10px; }
.plot { display: flex; gap: 10px; align-items: flex-end; border-bottom: 2px solid var(--ink); padding-top: 34px; min-height: 260px; }
.col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; outline: none; }
.col .total { font-size: 13px; font-weight: 800; color: var(--muted); }
.stack { width: 70%; max-width: 64px; display: flex; flex-direction: column; gap: 2px; }
.stack div { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; overflow: hidden; }
.stack .w { background: var(--bar-wrong); color: var(--ink); }
.stack .c { background: var(--right); color: #fff; }
.stack > div:first-child { border-radius: 4px 4px 0 0; }
.col .tt { display: none; position: absolute; bottom: calc(100% - 24px); left: 50%; transform: translateX(-50%); z-index: 10; white-space: nowrap; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.45; }
.col .tt b { display: block; color: var(--yellow); }
.col:hover .tt, .col:focus .tt { display: block; }
.col:hover .stack, .col:focus .stack { filter: brightness(1.08); }
.xlabels { display: flex; gap: 10px; }
.xlabels div { flex: 1 1 0; min-width: 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.xlabels div b { display: block; color: var(--ink); }

/* ---------- login ---------- */
.login { min-height: var(--full-h, 100vh); display: flex; align-items: center; justify-content: center; padding: 48px 20px; position: relative; overflow: hidden; }
.blob { position: absolute; border: 3px solid var(--ink); }
.login-inner { position: relative; width: 100%; max-width: 1080px; display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.hero { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero h1 { font-size: clamp(36px, 6vw, 52px); }
.login-card { flex: 1 1 340px; max-width: 440px; }

/* ---------- admin ---------- */
.drop { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px; border-radius: 20px; border: 3px dashed var(--purple); background: #F3EFFF; }
.drop.over { background: var(--yellow-soft); }
table.preview { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
table.preview th { text-align: left; padding: 10px 14px; background: var(--ground); }
table.preview td { padding: 10px 14px; border-top: 2px solid #EEF0FA; vertical-align: top; }
.book-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px; border-radius: 16px; border: 2.5px solid var(--ink); background: var(--sky-soft); }
.book-num { flex: none; width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 20px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--soft); border-top-color: var(--purple); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { min-height: 60vh; display: flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--display); font-size: 22px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 700; z-index: 50; max-width: 90vw; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .who .email { display: none; }
  .card { padding: 20px; }
  .plot, .xlabels { gap: 4px; }
  .xlabels div { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------- players (admin) ---------- */
.lc { position: relative; height: 280px; padding: 12px 18px 36px 42px; }
.lc-plot { position: relative; width: 100%; height: 100%; }
.lc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lc-y { position: absolute; left: -38px; width: 30px; text-align: right; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--muted); }
.lc-x { position: absolute; bottom: -28px; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.lc-pt { position: absolute; width: 32px; height: 32px; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; outline: none; cursor: default; }
.lc-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 2px #fff; }
.lc-pt:hover .lc-dot, .lc-pt:focus .lc-dot { width: 16px; height: 16px; }
.lc-val { position: absolute; bottom: 26px; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); }
.lc-tt { display: none; position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); z-index: 10; white-space: nowrap; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.45; }
.lc-tt b { display: block; color: var(--yellow); }
.lc-pt:hover .lc-tt, .lc-pt:focus .lc-tt { display: block; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); padding-bottom: 2px; }
.cal-cell { min-height: 74px; border-radius: 12px; border: 2px solid #D9D5EE; padding: 6px 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 0; text-align: left; cursor: pointer; font: inherit; }
.cal-cell.blank { border: none; background: transparent; cursor: default; }
.cal-cell[disabled] { opacity: 0.4; cursor: default; }
.cal-cell.today { border-color: var(--ink); }
.cal-cell.sel { border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.cal-d { font-size: 13px; font-weight: 800; }
.cal-n { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.1; }
.cal-v { font-size: 12px; font-weight: 700; opacity: 0.85; }
table.players { min-width: 760px; }
table.players td { padding: 12px 10px; }
@media (max-width: 640px) {
  .lc-x.odd { display: none; }
  .cal { gap: 3px; }
  .cal-cell { min-height: 56px; padding: 4px; }
  .cal-n { font-size: 18px; }
  .cal-v { display: none; }
}

/* Whole app shown at 90% size on tablets and computers (phones keep full size for readability). */
@media (min-width: 600px) {
  :root { --full-h: calc(100vh / 0.9); }
  body { zoom: 0.9; }
}

/* ---------- synonyms / antonyms / spelling ---------- */
.option.is-sel { border-color: var(--purple); background: #F3EFFF; }
.options.multi .badge { background: #fff; }
.options.multi .option.is-sel .badge { background: var(--yellow); }
.option.is-missed { border-color: var(--right); border-style: dashed; background: #fff; }
.options.multi .option.is-missed .badge { background: #fff; border-color: var(--right); }
.options.multi .option.is-right .badge { background: var(--right); }
.options.multi .option.is-wrong .badge { background: var(--wrong); }
.miss-tag { flex: none; font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--right-soft); color: var(--right); border: 2px solid var(--right); }
.miss-tag.red { background: var(--wrong-soft); color: #B42318; border-color: var(--wrong); }
.spell-row { display: flex; gap: 12px; flex-wrap: wrap; }
.spell-input { flex: 1 1 260px; min-width: 0; min-height: 62px; padding: 0 18px; font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: 1px; color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 18px; }
.spell-input.ok { border-color: var(--right); background: var(--right-soft); }
.spell-input.bad { border-color: var(--wrong); background: var(--wrong-soft); text-decoration: line-through; text-decoration-color: rgba(180,35,24,0.5); }
.spell-row .btn { min-height: 62px; }
.spell-answer { font-size: 20px; padding: 12px 16px; border-radius: 14px; background: var(--right-soft); border: 2.5px solid var(--right); }
.spell-answer b { font-family: var(--display); font-size: 26px; letter-spacing: 1px; }
.synedit td { padding: 6px 8px; border-top: 2px solid #EEF0FA; vertical-align: top; }
.synedit input { width: 100%; min-height: 38px; padding: 0 10px; border: 2px solid var(--soft); border-radius: 10px; font: inherit; font-size: 15px; }
.synedit input:focus { border-color: var(--purple); }

.spell-meaning { margin-top: 10px; max-width: 560px; padding: 10px 16px; border-radius: 14px; background: var(--yellow-soft); border: 2.5px solid var(--ink); font-size: 17px; text-align: center; }

.word-tip .tip { width: 320px; }
.word-tip .tip .tip-line { display: block; margin-top: 6px; }
.word-tip .tip .tip-syn { color: #7EE0D5; font-weight: 800; }
.word-tip .tip .tip-ant { color: #FFB38A; font-weight: 800; }

/* difficulty (word length) */
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 46px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 30px; border-radius: 999px; border: 2.5px solid var(--ink); background: #E7E4F5; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: left .15s; }
.switch:checked { background: var(--purple); }
.switch:checked::after { left: 23px; }
.switch:focus-visible { outline: 3px solid var(--sky, #4CC9F0); outline-offset: 2px; }
.len-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 2px dashed var(--soft); border-radius: 18px; background: #FBFAFF; }
.len-chip { min-height: 56px; text-align: left; line-height: 1.15; }
.len-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.pill.len-pill { background: #F3EFFF; }
