/* Layout: one centered working column under a sticky top bar, cut as chunky Bauhaus blocks:
   thick ink edges, hard offset shadows, primary-color fields on a yellow page.
   Shapes carry meaning: circle = SAME (synonym, blue), triangle = OPPOSITE (antonym, red).
   This is a single bright look on purpose, so there is no dark variant. */
:root {
  --bg: #ffd43b;
  --surface: #ffffff;
  --surface-2: #fff6d1;
  --ink: #111111;
  --muted: #3d3a33;
  --line: #111111;
  --edge: #111111;
  --hard: #111111;
  --c-red: #f0364b;
  --c-yellow: #ffd43b;
  --c-blue: #2346e8;
  --on-color: #ffffff;
  --accent: #111111;
  --accent-ink: #ffd43b;
  --accent-soft: #ffe98f;
  --same: #2346e8;
  --same-soft: #dbe1ff;
  --opp: #f0364b;
  --opp-soft: #ffd9de;
  --bar-bg: #ffffff;
  --bar-ink: #111111;
  --logo-b: #f0364b;
  --bw: 3px;
  --off: 5px;
  --r: 20px;
  --r-btn: 999px;
  --font-logo: "Bricolage Grotesque", "Arial Black", sans-serif;
  --font-word: "Bricolage Grotesque", "Arial Black", sans-serif;
  --font-ui: "Bricolage Grotesque", "Segoe UI", Helvetica, Arial, sans-serif;
  --display-case: none;
  color-scheme: light;
  --shadow: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--surface);
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding-block: 10px 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.logo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo {
  font-family: var(--font-logo);
  font-size: 22px;
  letter-spacing: .02em;
  line-height: 1;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.logo b { color: var(--accent); font-weight: 400; }
.streak-pill {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.streak-pill strong { color: var(--ink); }
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -4px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 8px 10px 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Page */
main {
  max-width: 880px;
  margin: 0 auto;
  padding-block: 24px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 20px;
}
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel.flat { box-shadow: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* Home */
.hero { display: grid; gap: 6px; }
.hero h1 { font-size: 30px; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.mode-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.mode-card:hover { border-color: var(--accent); }
.mode-card .glyph {
  font-family: var(--font-logo);
  font-size: 20px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.mode-card h3 { font-size: 18px; }
.mode-card p { color: var(--muted); font-size: 15px; }

.tip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
}
.tip .tip-mark {
  font-family: var(--font-logo);
  color: var(--opp);
  font-size: 22px;
  line-height: 1;
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tile .num { font-family: var(--font-logo); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .lbl { font-size: 13px; color: var(--muted); }
.tile.warn .num { color: var(--opp); }
.tile.good .num { color: var(--same); }

/* Vocab word display */
.word {
  font-family: var(--font-word);
  font-weight: 700;
  font-size: clamp(34px, 8vw, 52px);
  line-height: 1.05;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.word.caps { text-transform: uppercase; letter-spacing: .02em; }
.pos { font-style: italic; color: var(--muted); font-size: 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 15px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.chip.same { background: var(--same-soft); border-color: transparent; color: var(--ink); }
.chip.opp { background: var(--opp-soft); border-color: transparent; color: var(--ink); }
.chip.root { background: var(--accent-soft); border-color: transparent; }
.chip button { all: unset; cursor: pointer; }
.sym { font-family: var(--font-logo); font-size: 14px; }
.sym.same { color: var(--same); }
.sym.opp { color: var(--opp); }

.labeled { display: grid; grid-template-columns: 112px 1fr; gap: 6px 14px; align-items: baseline; }
.labeled > .k { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.labeled > * { min-width: 0; }
@media (max-width: 520px) {
  .labeled { grid-template-columns: 1fr; gap: 2px; }
  .labeled > .k { margin-top: 10px; }
}
.example { font-family: var(--font-word); font-size: 18px; font-style: italic; }
.example mark { background: var(--accent-soft); color: inherit; font-style: normal; font-weight: 700; padding: 0 3px; border-radius: 4px; }

/* Quiz */
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.score { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--muted); }
.score strong { color: var(--ink); }
.prompt-q { font-size: 15px; color: var(--muted); }
.prompt-q strong { color: var(--ink); }
.choices { display: grid; gap: 10px; }
.choice {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  min-height: 56px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--surface);
  font-size: 19px;
  cursor: pointer;
}
.choice:hover:not([disabled]) { border-color: var(--muted); }
.choice .letter {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.choice .tag { font-size: 13px; font-weight: 700; }
.choice.picked { border-color: var(--accent); background: var(--accent-soft); }
.choice.is-right { border-color: var(--same); background: var(--same-soft); }
.choice.is-right .tag { color: var(--same); }
.choice.is-trap { border-color: var(--opp); background: var(--opp-soft); }
.choice.is-trap .tag { color: var(--opp); }
.choice.is-wrong { border-color: var(--muted); opacity: .8; }
.choice.dim { opacity: .55; }
.choice[disabled] { cursor: default; }

.check-box {
  border-radius: 12px;
  border: 2px solid var(--accent);
  background: var(--surface-2);
  padding: 16px;
  display: grid;
  gap: 12px;
}
.check-box .example { font-size: 20px; }

.verdict { border-radius: 12px; padding: 16px; display: grid; gap: 8px; }
.verdict.right { background: var(--same-soft); }
.verdict.trap { background: var(--opp-soft); }
.verdict.wrong { background: var(--surface-2); border: 1px solid var(--line); }
.verdict h3 { font-size: 19px; }
.verdict.right h3 { color: var(--same); }
.verdict.trap h3 { color: var(--opp); }

.hint { background: var(--surface-2); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 15px; }

/* Same or Opposite */
.so-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 18px 0;
}
.so-pair .word { font-size: clamp(26px, 6vw, 40px); }
.so-pair .vs { font-family: var(--font-logo); font-size: 24px; color: var(--muted); }
@media (max-width: 520px) {
  .so-pair { grid-template-columns: 1fr; gap: 4px; }
}
.so-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.so-btn {
  min-height: 84px;
  border-radius: 14px;
  border: 2px solid transparent;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.so-btn .big { font-family: var(--font-logo); font-size: 30px; line-height: 1; }
.so-btn.same { background: var(--same-soft); color: var(--same); }
.so-btn.opp { background: var(--opp-soft); color: var(--opp); }
.so-btn:hover:not([disabled]) { border-color: currentColor; }
.so-btn[disabled] { cursor: default; opacity: .6; }
.so-btn kbd { font-family: var(--font-ui); font-size: 12px; color: var(--muted); font-weight: 400; }
.flash-good { color: var(--same); font-weight: 700; }
.flash-bad { color: var(--opp); font-weight: 700; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }

/* Roots */
.root-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.root-card {
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer;
}
.root-card:hover { border-color: var(--accent); }
.root-card .form { font-family: var(--font-word); font-weight: 700; font-size: 22px; }
.root-card .mean { font-weight: 700; }
.root-card .meta { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.examples { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.examples li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.examples .ex-w { font-family: var(--font-word); font-weight: 700; font-size: 18px; }
.root-split { font-family: var(--font-word); font-size: 30px; font-weight: 700; overflow-wrap: anywhere; }
.root-split .hl { color: var(--accent); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

input[type="search"] {
  width: 100%;
  font: inherit;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.word-list { display: grid; gap: 0; }
.word-list details { border-top: 1px solid var(--line); padding: 10px 0; }
.word-list summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.word-list summary .w { font-family: var(--font-word); font-weight: 700; font-size: 19px; }
.word-list details > div { padding-top: 10px; }

/* Progress */
.boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end; height: 120px; }
.boxes .bar { background: var(--accent); border-radius: 6px 6px 0 0; min-height: 2px; }
.boxes .bar.b0 { background: var(--opp); }
.boxes .bar.b5 { background: var(--same); }
.box-labels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.trap-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trap-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.trap-list .w { font-family: var(--font-word); font-weight: 700; font-size: 19px; }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.confirm { background: var(--opp-soft); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; }

kbd { font-family: var(--font-ui); font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface); }
.keys-hint { font-size: 13px; color: var(--muted); }
@media (hover: none) { .keys-hint, .so-btn kbd { display: none; } }

@media (prefers-reduced-motion: no-preference) {
  .pop { animation: pop .22s ease-out; }
  @keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
}

/* Server mode: sign-in, profiles, Parent page */
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.who { font-size: 14px; white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.gate { max-width: 520px; width: 100%; margin: 24px auto 0; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 700; }
.field .muted { font-weight: 400; }
input:not([type="checkbox"]):not([type="search"]), select, textarea {
  width: 100%;
  font: inherit;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
input[readonly] { background: var(--surface-2); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.word-row { align-items: flex-end; flex-wrap: nowrap; }
.word-row .grow { flex: 1; }
.form-msg { font-size: 15px; padding: 10px 12px; border-radius: 10px; }
.form-msg.err { background: var(--opp-soft); }
.form-msg.ok { background: var(--same-soft); }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.profile-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 17px; cursor: pointer;
  overflow-wrap: anywhere;
}
.profile-btn:hover { border-color: var(--accent); }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-logo); font-size: 24px;
  background: var(--accent-soft); color: var(--accent);
}
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 110px; }
.wk { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: end; gap: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk .bar { width: 70%; min-height: 2px; background: var(--accent); border-radius: 5px 5px 0 0; }
.admin-words { display: grid; }
.aw { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.aw-text { min-width: 0; flex: 1 1 240px; }
.aw .w { font-family: var(--font-word); font-weight: 700; font-size: 18px; }
code { font-size: 14px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- Pop: Bauhaus block styling ---------- */
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); }
body::before { background: var(--bar-bg); }
:focus-visible { outline: 3px solid var(--c-blue); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-logo); font-weight: 800; text-transform: var(--display-case); letter-spacing: .01em; }
h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.05; }
.eyebrow { font-family: var(--font-logo); color: var(--ink); letter-spacing: .16em; }

/* Top bar */
.topbar { background: var(--bar-bg); border-bottom: var(--bw) solid var(--edge); color: var(--bar-ink); }
.logo { font-family: var(--font-logo); font-weight: 900; font-size: 26px; text-transform: uppercase; color: var(--bar-ink); letter-spacing: -.01em; }
.logo b { color: var(--logo-b); font-weight: 900; }
.streak-pill, .streak-pill strong { color: var(--bar-ink); }
.tabs { gap: 6px; padding-bottom: 10px; }
.tab {
  font-family: var(--font-logo); text-transform: var(--display-case); font-weight: 700; letter-spacing: .04em; font-size: 14px;
  color: var(--bar-ink); border: var(--bw) solid transparent; border-radius: var(--r-btn); padding: 6px 12px;
}
.tab:hover { border-color: var(--bar-ink); color: var(--bar-ink); }
.tab[aria-current="page"] { background: var(--c-blue); color: var(--on-color); border-color: var(--edge); }

/* Blocks */
.panel { border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: var(--off) var(--off) 0 var(--hard); }
.panel.flat { box-shadow: none; }
.btn {
  border: var(--bw) solid var(--edge); border-radius: var(--r-btn); box-shadow: 4px 4px 0 var(--hard);
  font-family: var(--font-logo); text-transform: var(--display-case); letter-spacing: .04em; background: var(--surface);
}
.btn:hover { border-color: var(--edge); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--edge); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn[disabled] { box-shadow: none; }

/* Home: the hero is a blue field with a circle, square and triangle composition */
.hero {
  position: relative; overflow: hidden;
  background: var(--c-blue); color: var(--on-color);
  border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: var(--off) var(--off) 0 var(--hard);
  padding: 28px 24px 120px;
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow, .hero .muted { color: var(--on-color); opacity: .92; }
.hero h1 { font-size: clamp(32px, 7vw, 52px); max-width: 15ch; }
.hero::before {
  content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%;
  background: var(--c-yellow); border: var(--bw) solid var(--edge); right: -30px; bottom: -40px;
}
.hero::after {
  content: ""; position: absolute; width: 110px; height: 96px; right: 120px; bottom: -4px;
  background: var(--c-red); clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
@media (min-width: 700px) {
  .hero { padding: 36px 300px 36px 32px; min-height: 260px; }
  .hero::before { width: 220px; height: 220px; right: 40px; top: 24px; bottom: auto; }
  .hero::after { width: 150px; height: 130px; right: 190px; bottom: -4px; }
}

.tiles { gap: 14px; }
.tile { border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: 4px 4px 0 var(--hard); }
.tile .num { font-family: var(--font-logo); font-weight: 900; color: inherit; }
.tile.good .num, .tile.warn .num { color: inherit; }
.tile .lbl { color: inherit; opacity: .85; font-weight: 600; }
.tile .muted { color: inherit; opacity: .7; }
.tiles .tile:nth-child(4n+1) { background: var(--c-yellow); color: #141414; }
.tiles .tile:nth-child(4n+2) { background: var(--c-blue); color: var(--on-color); }
.tiles .tile:nth-child(4n+3) { background: var(--surface); color: var(--ink); }
.tiles .tile:nth-child(4n+4) { background: var(--c-red); color: var(--on-color); }

.mode-card {
  border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: var(--off) var(--off) 0 var(--hard);
  background: var(--surface); padding: 20px; gap: 12px;
}
.mode-card:hover { border-color: var(--edge); }
.mode-card h3 { font-size: 22px; }
.mode-card p { color: var(--muted); }
.mode-card .glyph {
  width: 64px; height: 64px; font-family: var(--font-logo); font-weight: 900; font-size: 20px;
  border-radius: 0; color: var(--on-color); border: var(--bw) solid var(--edge);
}
.modes .mode-card:nth-child(1) .glyph { background: var(--c-blue); border-radius: 50%; }
.modes .mode-card:nth-child(2) .glyph { background: var(--c-red); clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; padding-top: 22px; }
.modes .mode-card:nth-child(3) .glyph { background: var(--c-yellow); color: #141414; }
.modes .mode-card:nth-child(4) .glyph { background: var(--ink); color: var(--bg); border-radius: 64px 64px 0 0; }

.tip { background: var(--c-yellow); color: #141414; border: var(--bw) solid var(--edge); border-radius: var(--r); }
.tip .tip-mark { color: var(--c-red); font-family: var(--font-logo); font-size: 34px; font-weight: 900; }
.tip .btn.ghost { border-color: #141414; color: #141414; }
.labeled > .k { color: var(--ink); font-family: var(--font-logo); }

/* Words and chips */
.word { font-family: var(--font-word); font-weight: 900; letter-spacing: -.01em; }
.example { font-family: var(--font-ui); font-style: normal; font-weight: 500; }
.example mark { background: var(--accent); color: var(--accent-ink); border-radius: 0; }
.chip { border: 2px solid var(--edge); border-radius: var(--r-btn); font-weight: 600; }
.chip.same, .chip.opp, .chip.root { border-color: var(--edge); }
.chip.root { background: var(--accent-soft); }
.sym { font-family: var(--font-logo); font-weight: 900; }

/* Quiz */
.prompt-q strong { background: var(--accent); color: var(--accent-ink); padding: 0 6px; }
.choice {
  border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: 4px 4px 0 var(--hard);
  font-weight: 600; font-size: 20px;
}
.choice:hover:not([disabled]) { border-color: var(--edge); }
.choice .letter { border: var(--bw) solid var(--edge); border-radius: 50%; font-family: var(--font-logo); font-weight: 900; color: var(--on-color); }
.choices .choice:nth-child(1) .letter { background: var(--c-red); }
.choices .choice:nth-child(2) .letter { background: var(--c-yellow); color: #141414; }
.choices .choice:nth-child(3) .letter { background: var(--c-blue); }
.choices .choice:nth-child(4) .letter { background: var(--ink); color: var(--bg); }
.choice.picked { background: var(--accent-soft); border-color: var(--edge); }
.choice.is-right { background: var(--same); color: var(--on-color); border-color: var(--edge); }
.choice.is-trap { background: var(--opp); color: var(--on-color); border-color: var(--edge); }
.choice.is-right .tag, .choice.is-trap .tag { color: var(--on-color); font-family: var(--font-logo); }
.choice.is-wrong { border-color: var(--edge); }
.choice.dim { opacity: .45; box-shadow: none; }
.check-box { border: var(--bw) solid var(--edge); border-radius: var(--r); background: var(--accent-soft); box-shadow: 4px 4px 0 var(--hard); }
.verdict { border: var(--bw) solid var(--edge); border-radius: var(--r); position: relative; padding-left: 64px; }
.verdict::before { content: ""; position: absolute; left: 16px; top: 18px; width: 30px; height: 30px; background: var(--ink); }
.verdict.right { background: var(--same-soft); }
.verdict.right::before { background: var(--same); border-radius: 50%; }
.verdict.trap { background: var(--opp-soft); }
.verdict.trap::before { background: var(--opp); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.verdict.wrong { border-color: var(--edge); }
.verdict h3 { font-size: 22px; }
.hint { border-left: 0; border: var(--bw) solid var(--edge); border-radius: var(--r); background: var(--accent-soft); }

/* Same or Opposite: circle for SAME, triangle for OPPOSITE */
.so-pair .vs { color: var(--ink); font-family: var(--font-logo); font-weight: 900; font-size: 36px; }
.so-btn { border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: var(--off) var(--off) 0 var(--hard); font-family: var(--font-logo); text-transform: var(--display-case); min-height: 110px; gap: 8px; }
.so-btn.same { background: var(--same); color: var(--on-color); }
.so-btn.opp { background: var(--opp); color: var(--on-color); }
.so-btn .big { font-size: 0; width: 40px; height: 40px; background: var(--on-color); }
.so-btn.same .big { border-radius: 50%; }
.so-btn.opp .big { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.so-btn kbd { color: var(--on-color); background: transparent; border-color: var(--on-color); }
.flash-good { color: var(--same); }
.flash-bad { color: var(--opp); }
.progress-bar { height: 14px; border: var(--bw) solid var(--edge); border-radius: var(--r-btn); background: var(--surface); }
.progress-bar > span { background: var(--c-red); }

/* Roots and lists */
.root-card { border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: 4px 4px 0 var(--hard); }
.root-card:hover { border-color: var(--edge); }
.root-card .form { font-family: var(--font-word); font-weight: 900; }
.root-grid .root-card:nth-of-type(3n+1) .form { color: var(--c-red); }
.root-grid .root-card:nth-of-type(3n+2) .form { color: var(--c-blue); }
/* Dense flow lets the cards after the open one fill out its row, so the panel lands right under that row. */
.root-grid { grid-auto-flow: row dense; }
.root-grid #root-detail { grid-column: 1 / -1; border-top-width: 6px; }
.root-card[aria-expanded="true"] { background: var(--c-blue); color: #fff; box-shadow: 4px 4px 0 var(--hard); }
.root-grid .root-card[aria-expanded="true"] .form, .root-grid .root-card[aria-expanded="true"] .meta { color: #fff; }
.root-split .hl { color: var(--c-red); text-decoration-color: var(--c-yellow); text-decoration-thickness: 6px; }
.badge { border: 2px solid var(--edge); border-radius: 0; color: var(--ink); background: var(--accent-soft); }
.seg { border: var(--bw) solid var(--edge); border-radius: var(--r-btn); box-shadow: 4px 4px 0 var(--hard); }
.seg button { font-family: var(--font-logo); text-transform: var(--display-case); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
input[type="search"] { border: var(--bw) solid var(--edge); border-radius: var(--r-btn); }
.word-list details, .trap-list li { border-top: 2px solid var(--edge); }
.word-list summary .w, .trap-list .w, .examples .ex-w { font-family: var(--font-word); font-weight: 800; }
.boxes .bar { border: var(--bw) solid var(--edge); border-bottom: 0; border-radius: 0; background: var(--c-yellow); }
.boxes .bar.b0 { background: var(--c-red); }
.boxes .bar.b5 { background: var(--c-blue); }
.confirm { border: var(--bw) solid var(--edge); }
kbd { border-color: var(--edge); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .choice, .mode-card, .root-card, .so-btn { transition: transform .08s ease, box-shadow .08s ease; }
  .btn:active:not([disabled]), .choice:active:not([disabled]), .so-btn:active:not([disabled]) { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--hard); }
  .mode-card:hover, .root-card:hover, .choice:hover:not([disabled]) { transform: translate(-2px, -2px); }
}


/* Server-mode screens in the same style */
input:not([type="checkbox"]):not([type="search"]), select, textarea { border: var(--bw) solid var(--edge); border-radius: 14px; }
.profile-btn { border: var(--bw) solid var(--edge); border-radius: var(--r); box-shadow: 4px 4px 0 var(--hard); font-family: var(--font-logo); }
.profile-btn:hover { border-color: var(--edge); }
.avatar { border: var(--bw) solid var(--edge); font-family: var(--font-logo); font-weight: 800; color: var(--on-color); }
.profiles .profile-btn:nth-child(3n+1) .avatar { background: var(--c-blue); }
.profiles .profile-btn:nth-child(3n+2) .avatar { background: var(--c-red); }
.profiles .profile-btn:nth-child(3n) .avatar { background: var(--c-yellow); color: var(--ink); }
.form-msg { border: var(--bw) solid var(--edge); border-radius: 14px; }
.wk .bar { background: var(--c-blue); border: 2px solid var(--edge); border-bottom: 0; }
.aw { border-top: 2px solid var(--edge); }
.aw .w { font-weight: 800; }
.who strong { font-family: var(--font-logo); }
.linkish { color: var(--c-blue); }
