:root {
  --cover: #0e4a38;
  --cover-deep: #093527;
  --cover-ink: #e8f3ec;
  --cover-ink-2: #a9c9b8;
  --ground: #edf3ee;
  --plate: #fbfdfb;
  --field: #e3ece5;
  --ink: #15241d;
  --ink-2: #46594f;
  --ink-3: #56675e;
  --rule: #c7d5cb;
  --rule-2: #dfe8e1;

  --logic: #1f5fa6;
  --numbers: #0b6f6a;
  --language: #b3303e;
  --knowledge: #8f5f05;
  --memory: #6a45a3;
  --creativity: #b34916;
  --logic-t: #dde8f5;
  --numbers-t: #d4ecea;
  --language-t: #f6e0e2;
  --knowledge-t: #f4ead2;
  --memory-t: #e9e1f4;
  --creativity-t: #f7e3d7;

  --right: #17744a;
  --right-t: #d9efe2;
  --wrong: #b3303e;
  --wrong-t: #f7e1e3;

  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --binomial: "Alegreya", Georgia, serif;
  --r: 14px;
  --r-s: 9px;
  --shadow: 0 1px 2px rgba(14, 54, 40, .08), 0 6px 18px -8px rgba(14, 54, 40, .22);
  --shadow-lift: 0 2px 4px rgba(14, 54, 40, .08), 0 14px 30px -12px rgba(14, 54, 40, .32);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gut: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule) var(--ground); }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
::selection { background: #bfe0cd; color: var(--ink); }
img, svg { display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cover); text-underline-offset: .18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid #3d9a6c; outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--plate); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.ico { width: 1.1em; height: 1.1em; flex: none; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- cover (header) ---------- */
.cover { background: var(--cover); color: var(--cover-ink); position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 0 var(--cover-deep); }
.cover__in { max-width: 1180px; margin: 0 auto; padding: 0 var(--gut); height: 62px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--cover-ink); text-decoration: none; margin-right: auto; }
.brand__mark { width: 30px; height: 30px; color: #8fd3a8; }
.brand__word { font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--cover-ink-2); text-decoration: none; font-weight: 700; font-size: .98rem; padding: 10px 12px; border-radius: 10px; min-height: 44px; display: flex; align-items: center; }
.nav a:hover { color: var(--cover-ink); background: rgba(255,255,255,.06); }
.nav a[aria-current="page"] { color: var(--cover-ink); background: rgba(255,255,255,.1); }

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gut) 56px; outline: none; }
.foot { text-align: center; color: var(--ink-3); font-size: .9rem; padding: 22px var(--gut) 34px; border-top: 1px solid var(--rule-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 12px; border: 0;
  background: var(--cover); color: var(--cover-ink); font-weight: 800; font-size: 1.02rem; letter-spacing: .005em;
  text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 6px 14px -8px rgba(0,0,0,.4);
  transition: transform .18s var(--ease), background .18s;
}
.btn:hover { background: #125a45; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled] { background: #b8c7bd; color: #f4f8f5; box-shadow: none; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn--ghost:hover { background: var(--plate); }
.btn--light { background: var(--cover-ink); color: var(--cover); box-shadow: none; }
.btn--light:hover { background: #fff; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: .95rem; border-radius: 10px; }
.link-btn { background: none; border: 0; padding: 8px 4px; color: var(--ink-2); font-weight: 700; text-decoration: underline; text-underline-offset: .2em; min-height: 44px; }
.link-btn:hover { color: var(--ink); }

/* ---------- today strip ---------- */
.today {
  margin: 26px 0 0; background: var(--cover); color: var(--cover-ink); border-radius: var(--r);
  padding: 22px clamp(18px, 3vw, 30px); display: grid; grid-template-columns: 1fr auto; gap: 18px 28px; align-items: center;
  position: relative; overflow: hidden;
}
.today::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%; border: 1.5px solid rgba(232,243,236,.12); box-shadow: 0 0 0 26px rgba(232,243,236,.04), 0 0 0 52px rgba(232,243,236,.03); pointer-events: none; }
.today h1 { font-size: clamp(1.55rem, 3.4vw, 2.15rem); font-weight: 900; letter-spacing: -.02em; }
.today p { color: var(--cover-ink-2); margin-top: 6px; max-width: 52ch; }
.today__trail { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.today__stop { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.07); border-radius: 999px; padding: 5px 12px 5px 5px; font-weight: 700; font-size: .93rem; }
.today__stop svg { width: 28px; height: 28px; border-radius: 50%; background: var(--t); color: var(--c); padding: 3px; }
.today__stop.is-done { opacity: .6; }
.today__stop.is-done span { text-decoration: line-through; }
.today__act { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; position: relative; z-index: 1; }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: #ffd27a; font-size: 1rem; }
.streak .ico { width: 20px; height: 20px; }
.streak--off { color: var(--cover-ink-2); }

/* ---------- shelf: thumb-index tabs + plates ---------- */
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 38px 0 14px; flex-wrap: wrap; }
.shelf-head h2 { font-size: 1.45rem; font-weight: 900; }
.shelf-head p { color: var(--ink-2); }
.shelf { display: grid; grid-template-columns: 1fr 132px; align-items: start; }
.tabs { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 6px; padding-top: 18px; }
.tab {
  --c: var(--ink-2); --t: var(--field);
  border: 0; text-align: left; background: var(--c); color: #fff; font-weight: 800; font-size: .95rem;
  padding: 0 12px 0 16px; min-height: 52px; border-radius: 0 12px 12px 0; width: 108px; display: flex; align-items: center; gap: 8px;
  box-shadow: inset 6px 0 0 rgba(0,0,0,.13); transition: width .32s var(--ease), filter .2s;
}
.tab small { display: block; font-weight: 500; font-size: .76rem; opacity: .85; }
.tab:hover { width: 118px; }
.tab[aria-selected="true"] { width: 132px; box-shadow: inset 6px 0 0 rgba(0,0,0,.18), var(--shadow); }
.tab[aria-selected="false"] { filter: saturate(.75) brightness(1.04); }
.tab--all { --c: var(--ink); }
.plates {
  background: var(--plate); border-radius: var(--r) 0 var(--r) var(--r); padding: clamp(14px, 2.4vw, 26px);
  box-shadow: var(--shadow); display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: clamp(14px, 2vw, 22px);
  min-height: 420px; border-right: 6px solid var(--tabc, var(--ink));
  transition: border-color .3s;
}
.plate {
  --c: var(--ink); --t: var(--field);
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid var(--rule-2); border-radius: 12px; overflow: hidden; background: #fff;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.plate:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--rule); }
.plate__fig { background: var(--t); aspect-ratio: 16 / 10; display: grid; place-items: center; position: relative; border-bottom: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.plate__fig svg { width: 62%; height: 78%; color: var(--c); }
.plate__no { position: absolute; top: 10px; left: 12px; font-size: .74rem; font-weight: 800; letter-spacing: .1em; color: var(--c); font-variant: small-caps; }
.plate__new { position: absolute; top: 9px; right: 10px; font-size: .74rem; font-weight: 800; background: #fff; color: var(--c); border-radius: 999px; padding: 2px 9px; }
.plate__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.plate__name { font-size: 1.24rem; font-weight: 900; letter-spacing: -.01em; }
.plate__bin { font-family: var(--binomial); font-style: italic; font-weight: 500; color: var(--ink-3); font-size: .95rem; }
.plate__blurb { color: var(--ink-2); font-size: .98rem; margin-top: 4px; }
.plate__meta { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 12px; color: var(--ink-3); font-size: .88rem; font-weight: 500; flex-wrap: wrap; }
.plate__meta span { display: inline-flex; align-items: center; gap: 4px; }
.skill-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 800; color: var(--c); background: var(--t); padding: 3px 9px 3px 7px; border-radius: 999px; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.empty-shelf { grid-column: 1 / -1; display: grid; place-items: center; color: var(--ink-3); padding: 60px 0; }

[data-skill="logic"] { --c: var(--logic); --t: var(--logic-t); }
[data-skill="numbers"] { --c: var(--numbers); --t: var(--numbers-t); }
[data-skill="language"] { --c: var(--language); --t: var(--language-t); }
[data-skill="knowledge"] { --c: var(--knowledge); --t: var(--knowledge-t); }
[data-skill="memory"] { --c: var(--memory); --t: var(--memory-t); }
[data-skill="creativity"] { --c: var(--creativity); --t: var(--creativity-t); }

/* ---------- play screen ---------- */
.play { max-width: 760px; margin: 0 auto; padding-top: 18px; }
.play__bar { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); font-weight: 800; text-decoration: none; padding: 8px 10px 8px 4px; min-height: 44px; border-radius: 10px; background: none; border: 0; }
.back:hover { color: var(--ink); background: var(--plate); }
.back .ico { width: 22px; height: 22px; }
.play__title { font-weight: 900; font-size: 1.05rem; margin-right: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.play__title svg { width: 30px; height: 30px; color: var(--c); background: var(--t); border-radius: 8px; padding: 3px; flex: none; }
.play__title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-pill { font-weight: 900; color: var(--c); background: var(--t); border-radius: 999px; padding: 6px 13px; font-size: .95rem; white-space: nowrap; }
.score-pill:empty { visibility: hidden; }
.review .ico { display: inline-block; vertical-align: -.15em; }
.review .ico--hit { color: var(--right); }
.review .ico--miss { color: var(--wrong); }
.marks { display: flex; gap: 5px; margin: 8px 0 18px; }
.mark { flex: 1; height: 7px; border-radius: 4px; background: var(--rule-2); position: relative; overflow: hidden; }
.mark.is-now { background: color-mix(in srgb, var(--c) 35%, var(--rule-2)); }
.mark.is-right { background: var(--right); }
.mark.is-wrong { background: var(--wrong); }
.mark.is-half { background: #d79a2b; }

.card { background: var(--plate); border-radius: var(--r); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 34px); position: relative; }
.card--tint { border-top: 5px solid var(--c); }
.q-kicker-free { display: none; }
.q-speaker { color: var(--ink-3); font-weight: 700; font-size: .92rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.q-speaker::before { content: ""; width: 18px; height: 2px; background: var(--c); border-radius: 2px; }
.q-quote { font-size: clamp(1.18rem, 2.6vw, 1.42rem); line-height: 1.42; font-weight: 500; }
.q-quote--big { font-size: clamp(1.3rem, 3vw, 1.65rem); }
.q-ask { margin-top: 16px; font-weight: 800; color: var(--c); }
.q-help { margin-top: 6px; color: var(--ink-2); font-size: .96rem; }
.blank { display: inline-block; min-width: 4.2em; border-bottom: 2.5px solid var(--c); margin: 0 .1em; color: var(--c); font-weight: 800; text-align: center; line-height: 1.1; }

.opts { display: grid; gap: 10px; margin-top: 22px; }
.opts--2 { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: #fff; border: 1.5px solid var(--rule); border-radius: 12px; padding: 13px 16px; min-height: 56px;
  font-weight: 600; font-size: 1.02rem; line-height: 1.35; transition: border-color .15s, background .15s, transform .15s var(--ease);
}
.opt:hover:not([disabled]) { border-color: var(--c); background: color-mix(in srgb, var(--t) 45%, #fff); }
.opt:active:not([disabled]) { transform: scale(.99); }
.opt__key { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: .85rem; color: var(--ink-3); border: 1.5px solid var(--rule); }
.opt__mark { margin-left: auto; width: 22px; height: 22px; flex: none; }
.opt[disabled] { cursor: default; }
.opt.is-right { border-color: var(--right); background: var(--right-t); color: #0f3d27; }
.opt.is-right .opt__key { background: var(--right); border-color: var(--right); color: #fff; }
.opt.is-wrong { border-color: var(--wrong); background: var(--wrong-t); }
.opt.is-wrong .opt__text { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--wrong) 70%, transparent); }
.opt.is-wrong .opt__key { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.opt.is-dim { opacity: .55; }

/* field note slip */
.note {
  margin-top: 16px; background: #fffef7; border: 1px solid #e6dfbf; border-radius: 12px; padding: 16px 18px 18px;
  box-shadow: 0 1px 0 #efe7c6, 0 10px 22px -16px rgba(80, 60, 0, .45);
  animation: slip .5s var(--ease) both; position: relative;
}
.note::before { content: ""; position: absolute; top: -7px; left: 26px; width: 56px; height: 14px; background: rgba(199, 213, 203, .75); border-radius: 2px; transform: rotate(-2deg); }
.note__head { display: flex; align-items: center; gap: 8px; font-weight: 900; margin-bottom: 6px; }
.note__head .ico { width: 22px; height: 22px; padding: 3px; border-radius: 50%; color: #fff; }
.note--right .note__head .ico { background: var(--right); }
.note--wrong .note__head .ico { background: var(--wrong); }
.note--info .note__head .ico { background: var(--c); }
.note__head small { margin-left: auto; color: var(--ink-3); font-weight: 700; font-size: .82rem; letter-spacing: .06em; font-variant: small-caps; }
.note p { color: #3a4740; }
.note p + p { margin-top: 6px; }
.note .def { font-size: .93rem; color: var(--ink-3); }
.note__act { display: flex; justify-content: flex-end; margin-top: 14px; gap: 10px; flex-wrap: wrap; }
@keyframes slip { from { opacity: 0; transform: translateY(14px) rotate(-.4deg); } to { opacity: 1; transform: none; } }

/* intro + end */
.intro { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: center; }
.intro__fig { background: var(--t); border-radius: 12px; aspect-ratio: 1; display: grid; place-items: center; }
.intro__fig svg { width: 72%; height: 72%; color: var(--c); }
.intro h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: -.02em; }
.intro .plate__bin { margin-top: 2px; font-size: 1.05rem; }
.intro__how { margin-top: 14px; color: var(--ink-2); max-width: 56ch; }
.intro__how li { margin: 4px 0; }
.intro__how ul { padding-left: 1.1em; margin: 8px 0 0; }
.intro__act { margin-top: 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.intro__best { color: var(--ink-3); font-weight: 700; font-size: .95rem; }

.end { text-align: center; }
.end__score { font-size: clamp(3.2rem, 9vw, 4.6rem); font-weight: 900; letter-spacing: -.03em; color: var(--c); line-height: 1; margin: 6px 0 2px; }
.end__of { color: var(--ink-3); font-weight: 700; }
.end h1 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 900; }
.end__msg { color: var(--ink-2); max-width: 48ch; margin: 12px auto 0; }
.end__xp { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.end__act { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.end__best { display: inline-block; margin-top: 10px; font-weight: 800; color: var(--right); background: var(--right-t); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.review { text-align: left; margin-top: 26px; border-top: 1px solid var(--rule-2); padding-top: 16px; }
.review h2 { font-size: 1.05rem; font-weight: 900; margin-bottom: 8px; }
.review li { margin: 8px 0; color: var(--ink-2); }
.review ol { padding-left: 1.2em; margin: 0; }
.review b { color: var(--ink); }

/* inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 800; font-size: .95rem; }
.input, .textarea {
  width: 100%; border: 1.5px solid var(--rule); background: #fff; border-radius: 12px; padding: 12px 14px; min-height: 52px; font-size: 1.1rem;
  caret-color: var(--c); transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }
.input::placeholder, .textarea::placeholder { color: #7f8f86; }
.textarea { min-height: 128px; resize: vertical; line-height: 1.45; }
.row { display: flex; gap: 10px; align-items: stretch; }
.row > .input { flex: 1; }
.hint-line { color: var(--ink-2); font-size: .95rem; margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.hint-line .ico { color: var(--c); }

/* bridge */
.triad { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.triad span { font-size: clamp(1.3rem, 3.6vw, 1.8rem); font-weight: 900; background: var(--t); color: var(--c); padding: 10px 18px; border-radius: 12px; letter-spacing: -.01em; }
.triad-link { text-align: center; color: var(--ink-3); font-weight: 700; margin-bottom: 18px; font-size: .95rem; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* taboo */
.taboo-word { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 900; color: var(--c); letter-spacing: -.02em; line-height: 1; }
.banned { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 18px; }
.banned span { font-weight: 800; font-size: .9rem; padding: 4px 11px; border-radius: 999px; background: var(--field); color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.banned span.is-hit { background: var(--wrong); color: #fff; }
.taboo-meter { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: .92rem; color: var(--ink-3); font-weight: 700; gap: 12px; flex-wrap: wrap; }
.taboo-meter .bad { color: var(--wrong); }
.compare { display: grid; gap: 10px; margin-top: 14px; }
.compare blockquote { margin: 0; padding: 12px 14px; background: var(--ground); border-radius: 10px; }
.compare blockquote b { display: block; font-size: .8rem; letter-spacing: .07em; font-variant: small-caps; color: var(--ink-3); margin-bottom: 3px; }

/* cipher */
.code-slots { display: flex; gap: 10px; justify-content: center; margin: 4px 0 16px; }
.slot { width: 58px; height: 68px; border-radius: 12px; background: #fff; border: 2px solid var(--rule); display: grid; place-items: center; font-size: 2rem; font-weight: 900; color: var(--ink); transition: border-color .15s; }
.slot.is-cur { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 15%, transparent); }
.keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 420px; margin: 0 auto; }
.key { min-height: 54px; border-radius: 12px; border: 1.5px solid var(--rule); background: #fff; font-weight: 900; font-size: 1.3rem; position: relative; transition: background .15s, transform .12s; }
.key:hover:not([disabled]) { border-color: var(--c); }
.key:active:not([disabled]) { transform: scale(.96); }
.key[disabled] { opacity: .35; cursor: default; }
.key.is-struck { color: var(--ink-3); background: var(--field); }
.key.is-struck::after { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 2.5px; background: var(--wrong); transform: rotate(-35deg); border-radius: 2px; }
.key.is-sure { box-shadow: inset 0 0 0 2.5px var(--right); }
.keypad__fn { display: flex; gap: 8px; max-width: 420px; margin: 10px auto 0; }
.keypad__fn .btn { flex: 1; }
.guesses { margin-top: 20px; display: grid; gap: 6px; }
.guess { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--rule-2); border-radius: 10px; padding: 8px 12px; }
.guess__n { color: var(--ink-3); font-weight: 800; font-size: .85rem; }
.guess__d { font-size: 1.35rem; font-weight: 900; letter-spacing: .3em; }
.pegs { display: flex; gap: 4px; }
.peg { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--rule); }
.peg--hit { background: var(--right); border-color: var(--right); }
.peg--near { border-color: #d79a2b; background: #fff; }
.legend { display: flex; gap: 16px; justify-content: center; color: var(--ink-3); font-size: .88rem; font-weight: 700; margin-top: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.notes-help { text-align: center; color: var(--ink-3); font-size: .88rem; margin: 6px 0 0; }

/* pattern */
.seq { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 22px; }
.seq b { min-width: 58px; padding: 10px 12px; border-radius: 12px; background: var(--t); color: var(--c); font-size: clamp(1.25rem, 3.4vw, 1.6rem); font-weight: 900; text-align: center; }
.seq b.q { background: #fff; border: 2.5px dashed var(--c); }
.timer { height: 5px; border-radius: 3px; background: var(--rule-2); overflow: hidden; margin: -8px 0 18px; }
.timer i { display: block; height: 100%; background: var(--c); transform-origin: left; }

/* calibrate */
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.range__to { padding-bottom: 14px; font-weight: 800; color: var(--ink-3); }
.unit { color: var(--ink-3); font-weight: 700; font-size: .95rem; margin-top: 8px; text-align: center; }
.ruler { position: relative; height: 70px; margin: 18px 6px 6px; }
.ruler__line { position: absolute; left: 0; right: 0; top: 34px; height: 2px; background: var(--rule); }
.ruler__band { position: absolute; top: 24px; height: 22px; background: color-mix(in srgb, var(--c) 22%, transparent); border: 2px solid var(--c); border-radius: 6px; }
.ruler__ans { position: absolute; top: 14px; width: 3px; height: 42px; background: var(--ink); border-radius: 2px; transform: translateX(-1.5px); }
.ruler__lab { position: absolute; top: 58px; transform: translateX(-50%); font-size: .8rem; font-weight: 800; white-space: nowrap; color: var(--ink-2); }
.ruler__lab--ans { top: -6px; color: var(--ink); }
.calib { display: flex; gap: 4px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.calib i { width: 22px; height: 22px; border-radius: 6px; background: var(--rule-2); display: grid; place-items: center; color: #fff; }
.calib i.hit { background: var(--right); }
.calib i.miss { background: var(--wrong); }

/* timeline */
.tl { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; position: relative; }
.tl-item {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--rule); border-radius: 12px;
  padding: 8px 8px 8px 6px; min-height: 60px; touch-action: none; user-select: none; transition: box-shadow .2s, border-color .2s, background .2s;
}
.tl-item.is-drag { box-shadow: var(--shadow-lift); border-color: var(--c); position: relative; z-index: 2; }
.tl-item__grip { color: var(--ink-3); cursor: grab; display: grid; place-items: center; height: 44px; }
.tl-item__grip .ico { width: 22px; height: 22px; }
.tl-item__txt { font-weight: 700; line-height: 1.3; }
.tl-item__txt small { display: block; font-weight: 500; color: var(--ink-3); font-size: .88rem; margin-top: 2px; }
.tl-item__mv { display: flex; gap: 2px; }
.tl-item__mv button { width: 40px; height: 44px; border-radius: 9px; border: 0; background: var(--field); color: var(--ink-2); display: grid; place-items: center; }
.tl-item__mv button:hover { background: var(--t); color: var(--c); }
.tl-item__mv button[disabled] { opacity: .3; }
.tl-item__year { font-weight: 900; font-size: 1.05rem; padding: 0 8px; color: var(--ink); }
.tl-item.is-right { border-color: var(--right); background: var(--right-t); }
.tl-item.is-wrong { border-color: var(--wrong); background: var(--wrong-t); }
.tl-ends { display: flex; justify-content: space-between; color: var(--ink-3); font-size: .85rem; font-weight: 800; margin-top: 14px; letter-spacing: .05em; font-variant: small-caps; }

/* memory */
.mem-stage { min-height: 170px; display: grid; place-items: center; }
.mem-word { font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 900; color: var(--c); letter-spacing: -.02em; animation: pop .35s var(--ease); }
.mem-count { color: var(--ink-3); font-weight: 800; text-align: center; }
@keyframes pop { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
.mem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.mem-btn { min-height: 54px; border-radius: 12px; border: 1.5px solid var(--rule); background: #fff; font-weight: 800; font-size: 1.02rem; position: relative; }
.mem-btn:hover:not([disabled]) { border-color: var(--c); }
.mem-btn.is-picked { background: var(--right-t); border-color: var(--right); color: #0f3d27; }
.mem-btn.is-wrong { background: var(--wrong-t); border-color: var(--wrong); }
.mem-btn b { position: absolute; top: 4px; left: 7px; font-size: .72rem; color: var(--right); }
.mem-picked { display: flex; gap: 6px; flex-wrap: wrap; min-height: 34px; justify-content: center; }
.mem-picked span { background: var(--t); color: var(--c); font-weight: 800; border-radius: 999px; padding: 4px 11px; font-size: .92rem; }

/* sure bet */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.topic { text-align: left; min-height: 64px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--rule); background: #fff; font-weight: 800; font-size: 1.02rem; }
.topic small { display: block; font-weight: 500; color: var(--ink-3); font-size: .84rem; }
.topic:hover { border-color: var(--c); background: color-mix(in srgb, var(--t) 45%, #fff); }
.topic:first-child { background: var(--t); border-color: var(--c); }
.opt.is-chosen { border-color: var(--c); background: var(--t); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.stakes { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--rule); animation: slip .4s var(--ease) both; }
.stakes__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stake { min-height: 64px; border-radius: 12px; border: 1.5px solid var(--rule); background: #fff; font-weight: 700; font-size: .92rem; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.stake b { font-size: 1.5rem; font-weight: 900; color: var(--c); line-height: 1.1; }
.stake:hover { border-color: var(--c); background: var(--t); }

/* number forge */
.target { font-size: clamp(3rem, 10vw, 4.4rem); font-weight: 900; color: var(--c); line-height: 1; letter-spacing: -.03em; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 14px; min-height: 66px; }
.tile { min-width: 66px; height: 66px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--rule); background: #fff; font-size: 1.6rem; font-weight: 900; box-shadow: 0 2px 0 var(--rule); transition: transform .15s var(--ease), border-color .15s, background .15s; }
.tile:hover { border-color: var(--c); }
.tile.is-sel { border-color: var(--c); background: var(--t); color: var(--c); transform: translateY(-3px); box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 40%, transparent); }
.tile.is-fresh { animation: pop .35s var(--ease); border-style: dashed; }
.tile.is-hit { background: var(--right); border-color: var(--right); color: #fff; }
.ops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 360px; }
.op { height: 52px; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--ground); font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.op:hover:not([disabled]) { border-color: var(--c); }
.op.is-sel { background: var(--c); border-color: var(--c); color: #fff; }
.op[disabled] { opacity: .4; cursor: default; }
.steps { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.steps li { background: var(--ground); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: .95rem; color: var(--ink-2); }
.steps b { color: var(--ink); }
.forge-fn { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.forge-fn .link-btn { margin-left: auto; }

/* balance scales */
.given { display: inline-flex; align-items: center; gap: 10px; background: var(--ground); border-radius: 999px; padding: 6px 16px 6px 8px; font-weight: 700; }
.given .shp { width: 26px; height: 26px; }
.scales { display: grid; gap: 14px; margin: 18px 0 14px; }
.scale { display: grid; grid-template-columns: 1fr 44px 1fr; align-items: end; position: relative; padding-bottom: 6px; }
.scale::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 30px; height: 3px; border-radius: 2px; background: var(--ink-2); }
.pan { min-height: 64px; display: flex; flex-wrap: wrap; align-content: flex-end; justify-content: center; gap: 4px; padding: 0 6px 38px; }
.fulcrum { width: 40px; height: 30px; fill: var(--ink-2); align-self: end; }
.shp { width: 30px; height: 30px; }
.shp--a { fill: #c58a0c; }
.shp--b { fill: #2a63a8; }
.shp--c { fill: #b3303e; }

/* liars' island */
.islanders { display: grid; gap: 10px; }
.islander { border: 1.5px solid var(--rule); background: #fff; border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; }
.islander__who { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--t); color: var(--c); font-weight: 900; }
.islander__says { font-size: 1.12rem; font-weight: 500; line-height: 1.4; }
.seg { display: flex; border: 1.5px solid var(--rule); border-radius: 11px; overflow: hidden; }
.seg button { border: 0; background: #fff; min-height: 44px; padding: 0 14px; font-weight: 800; color: var(--ink-2); }
.seg button + button { border-left: 1.5px solid var(--rule); }
.seg button[aria-checked="true"] { background: var(--c); color: #fff; }
.seg button[disabled] { cursor: default; }
.islander.is-right { border-color: var(--right); background: var(--right-t); }
.islander.is-wrong { border-color: var(--wrong); background: var(--wrong-t); }
.islander__is { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-weight: 700; }

/* hundred uses */
.ideas { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ideas li { background: var(--ground); border-radius: 10px; padding: 6px 12px; font-weight: 700; display: flex; flex-direction: column; animation: pop .3s var(--ease); }
.ideas li small { font-weight: 600; color: var(--ink-3); font-size: .78rem; }
.ideas li.is-orig { background: var(--t); color: var(--c); }
.timer i { transition: none; }

/* journal */
.j-head { margin: 32px 0 18px; display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.j-head h1 { font-size: clamp(1.8rem, 4vw, 2.3rem); font-weight: 900; letter-spacing: -.02em; }
.j-head p { color: var(--ink-2); margin-top: 4px; }
.j-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.j-card { background: var(--plate); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; }
.j-card h2 { font-size: 1.15rem; font-weight: 900; margin-bottom: 14px; }
.skill-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule-2); }
.skill-row:last-child { border-bottom: 0; }
.skill-row__name { font-weight: 800; color: var(--c); display: flex; align-items: center; gap: 7px; }
.skill-row__name::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.bar { height: 12px; border-radius: 6px; background: var(--t); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c); border-radius: 6px; transform-origin: left; animation: grow .9s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.skill-row__lv { font-weight: 900; font-size: .95rem; min-width: 52px; text-align: right; }
.skill-row__lv small { display: block; font-weight: 600; color: var(--ink-3); font-size: .76rem; }
.days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; }
.day { aspect-ratio: 1; border-radius: 5px; background: var(--rule-2); }
.day.l1 { background: #a9d5bb; } .day.l2 { background: #5fae84; } .day.l3 { background: var(--right); }
.day.is-today { box-shadow: 0 0 0 2px var(--ink); }
.days-lab { display: flex; justify-content: space-between; color: var(--ink-3); font-size: .8rem; font-weight: 700; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--ground); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.stat span { color: var(--ink-3); font-size: .86rem; font-weight: 700; }
.specimens { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.spec { text-align: center; text-decoration: none; color: var(--ink); font-size: .82rem; font-weight: 800; line-height: 1.2; }
.spec__fig { aspect-ratio: 1; border-radius: 12px; background: var(--t); display: grid; place-items: center; margin-bottom: 6px; position: relative; }
.spec__fig svg { width: 64%; height: 64%; color: var(--c); }
.spec.is-unseen .spec__fig { background: var(--field); }
.spec.is-unseen .spec__fig svg { color: #b4c3b9; }
.spec.is-unseen { color: var(--ink-3); }
.spec__best { position: absolute; bottom: 5px; right: 6px; font-size: .7rem; background: #fff; color: var(--c); padding: 1px 6px; border-radius: 999px; }
.j-cal { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule-2); color: var(--ink-2); font-size: .95rem; }
.danger { margin-top: 18px; text-align: right; }

/* friend guess */
.guess-card .q-quote { font-style: normal; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 700; z-index: 20; box-shadow: var(--shadow-lift); animation: slip .35s var(--ease); max-width: calc(100% - 32px); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .shelf { grid-template-columns: 1fr; }
  .tabs { position: static; flex-direction: row; overflow-x: auto; padding: 0 2px; gap: 5px; scrollbar-width: none; align-items: flex-end; min-height: 58px; order: -1; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { width: auto; min-height: 46px; border-radius: 12px 12px 0 0; padding: 0 14px; flex: none; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); white-space: nowrap; }
  .tab small { display: none; }
  .tab:hover { width: auto; }
  .tab[aria-selected="true"] { width: auto; min-height: 56px; box-shadow: none; }
  .plates { border-right: 0; border-top: 6px solid var(--tabc, var(--ink)); border-radius: 0 0 var(--r) var(--r); }
  .j-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .cover__in { height: 56px; gap: 8px; }
  .brand__word { font-size: 1.18rem; }
  .brand__mark { width: 26px; height: 26px; }
  .nav a { padding: 8px 9px; font-size: .93rem; }
  .today { grid-template-columns: 1fr; }
  .today__act { flex-direction: column-reverse; align-items: stretch; }
  .today__act .btn { width: 100%; }
  .today__act .streak { justify-content: center; }
  .plates { grid-template-columns: 1fr; padding: 12px; }
  .plate { flex-direction: row; }
  .plate__fig { aspect-ratio: auto; width: 34%; flex: none; border-bottom: 0; border-right: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
  .plate__fig svg { width: 76%; height: auto; }
  .plate__no { top: 6px; left: 8px; font-size: .68rem; }
  .plate__new { display: none; }
  .plate__body { padding: 12px 13px 13px; }
  .plate__name { font-size: 1.12rem; }
  .plate__blurb { font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .plate__meta { padding-top: 8px; gap: 8px; }
  .intro { grid-template-columns: 1fr; gap: 16px; }
  .note__head small { display: none; }
  .intro__fig { width: 120px; }
  .opts--2 { grid-template-columns: 1fr; }
  .slot { width: 52px; height: 60px; font-size: 1.7rem; }
  .skill-row { grid-template-columns: 92px 1fr auto; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat b { font-size: 1.3rem; }
  .range { grid-template-columns: 1fr; }
  .islander { grid-template-columns: 1fr; }
  .seg { justify-self: start; }
  .stake { font-size: .82rem; }
  .tile { min-width: 58px; height: 58px; font-size: 1.4rem; }
  .range__to { display: none; }
  .tl-item { grid-template-columns: 26px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
