/* ---------- hero ---------- */
.hero { padding: 40px 0 10px; }
.hero .lede { font-size: clamp(1.08rem, 2.3vw, 1.3rem); max-width: 760px; color: var(--ink2); }
.u-stitch { background-image: linear-gradient(90deg, var(--rust) 60%, transparent 60%); background-size: 12px 3px; background-repeat: repeat-x; background-position: 0 100%; padding-bottom: 4px; color: var(--rust); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink2); text-decoration: underline; cursor: pointer; }

/* ---------- maker ---------- */
.strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.empty-strip { min-height: 230px; display: grid; place-content: center; text-align: center; color: #efe3c4; padding: 30px; }
.empty-strip p { margin: 4px 0; }
.empty-strip .muted { color: #c3b995; }
.subs { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; gap: 4px; font-size: .98rem; }
.subs .la { font-family: var(--display); font-weight: 700; font-size: .86rem; letter-spacing: .06em; }
.subs .en { font-style: italic; color: var(--ink2); }
.actions { margin: 14px 0 26px; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin: 10px 0 4px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--rust); }
.maker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel-wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .maker-grid { grid-template-columns: 1fr; } }
.panel h3 { display: flex; align-items: center; gap: 10px; }
.step { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--rust); color: #fff8ea; font-size: .95rem; flex: none; }
[data-theme="dark"] .step { color: #14172a; }
.lbl { font-weight: 700; margin: 14px 0 6px; }
.panel label[for] { display: block; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--line); background: var(--sw); cursor: pointer;
  background-image: repeating-linear-gradient(35deg, transparent 0 3px, rgba(0,0,0,.18) 3px 4px); background-color: var(--sw); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); transform: scale(1.08); }
.saga-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.saga-list li { display: flex; align-items: center; gap: 8px; background: var(--bg2); border-radius: 10px; padding: 6px 8px; }
.saga-list li.empty { background: none; padding: 4px 0; }
.saga-list .num { font-family: var(--display); font-weight: 700; color: var(--rust); width: 1.4em; text-align: center; flex: none; }
.saga-list .ico { font-size: 1.3rem; flex: none; }
.saga-list .cap-in { font-family: var(--display); font-weight: 700; font-size: .85rem; letter-spacing: .04em; padding: 8px; min-width: 0; flex: 1; text-transform: uppercase; }
.li-btns { display: flex; gap: 4px; flex: none; }
.mini { width: 36px; height: 36px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-size: .85rem; }
.mini:hover:not([disabled]) { border-color: var(--rust); }
.mini[disabled] { opacity: .35; cursor: default; }
.mini.del:hover { background: var(--rust); color: #fff8ea; }
@media (max-width: 520px) {
  .saga-list li { flex-wrap: wrap; }
  .saga-list .cap-in { flex-basis: calc(100% - 70px); }
  .li-btns { margin-left: auto; }
}
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.scene-btn { position: relative; display: flex; align-items: center; gap: 8px; text-align: left; padding: 10px 12px; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: 500 .98rem var(--body); cursor: pointer; transition: transform .12s, border-color .12s; }
.scene-btn:hover { border-color: var(--rust); transform: translateY(-2px); }
.scene-btn:active { transform: translateY(1px); }
.scene-btn .ico { font-size: 1.35rem; }
.scene-btn .ab { position: absolute; top: 3px; right: 6px; font-size: .62rem; font-weight: 700; color: var(--green); letter-spacing: .05em; }
.scene-grid.full .scene-btn { opacity: .45; }

/* presets & gallery */
.preset-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.preset { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); color: var(--ink); font: 1rem var(--body); cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.preset:hover { transform: translateY(-3px); border-color: var(--gold); }
.preset .ico { font-size: 1.6rem; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gal-item { padding: 12px; }
.gal-thumb { background: #2a2016; border-radius: 8px; overflow: hidden; }
.gal-thumb svg { display: block; width: 100%; height: auto; }
.gal-cap { font-family: var(--display); font-weight: 700; font-size: .82rem; margin: 10px 0 0; letter-spacing: .04em; }
.gal-item .btn { padding: 6px 14px; min-height: 38px; font-size: .9rem; }

/* facts */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.fact { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 14px; display: grid; }
.fact b { font-family: var(--display); font-size: 1.8rem; color: var(--rust); }
.fact span { color: var(--ink2); font-size: .98rem; }

/* ---------- walk page ---------- */
.walk-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 18px; }
.walk-tools select { width: auto; }
.progress { position: sticky; top: 60px; z-index: 5; background: var(--bg); padding: 8px 0; }
.progress-bar { height: 10px; border-radius: 99px; background: var(--bg2); overflow: hidden; border: 1px solid var(--line); }
.progress-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--rust) 0 8px, var(--gold) 8px 12px); transition: width .2s; }
.progress small { display: block; margin-top: 4px; color: var(--ink2); }
.scene-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; padding: 18px; margin-bottom: 18px; scroll-margin-top: 130px; }
@media (max-width: 820px) { .scene-card { grid-template-columns: 1fr; } }
.scene-art { background: #2a2016; border-radius: 10px; overflow: hidden; min-height: 120px; }
.scene-art svg { display: block; width: 100%; height: auto; }
.scene-num { font-family: var(--display); font-weight: 700; color: var(--rust); letter-spacing: .15em; font-size: .85rem; }
.latin { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; line-height: 1.6; margin: 6px 0 8px; display: flex; flex-wrap: wrap; gap: 2px 6px; }
.lw { background: none; border: 0; border-bottom: 2px dotted var(--gold); padding: 0 1px; font: inherit; color: var(--ink); cursor: pointer; }
.lw:hover, .lw[aria-expanded="true"] { color: var(--rust); border-bottom-color: var(--rust); }
.lw.plain { border-bottom-color: transparent; cursor: default; }
.gloss { min-height: 1.6em; font-size: .95rem; color: var(--green); font-weight: 700; }
.trans { font-style: italic; color: var(--ink2); }
.note { margin-top: 8px; }

/* ---------- anglish ---------- */
.ang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .ang-grid { grid-template-columns: 1fr; } }
.ang-out { background: var(--card); border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 150px; line-height: 1.9; white-space: pre-wrap; word-wrap: break-word; }
.nw { background: color-mix(in srgb, var(--gold) 28%, transparent); border-bottom: 2px solid var(--gold); border-radius: 3px; padding: 0 2px; cursor: help; }
.sw { background: color-mix(in srgb, var(--green) 22%, transparent); border-bottom: 2px solid var(--green); border-radius: 3px; padding: 0 2px; }
.meter { margin: 16px 0; }
.meter-bar { height: 22px; border-radius: 99px; overflow: hidden; display: flex; border: 2px solid var(--line); }
.meter-bar .sx { background: var(--green); transition: width .4s; }
.meter-bar .nm { background: var(--gold); flex: 1; }
.meter-legend { display: flex; justify-content: space-between; font-size: .92rem; color: var(--ink2); margin-top: 4px; }
.verdict { font-family: var(--display); font-size: 1.3rem; color: var(--rust); margin: 6px 0; }
.samples { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.game-box { text-align: center; padding: 26px 18px; }
.game-word { font-family: var(--display); font-size: clamp(2rem, 8vw, 3.4rem); margin: 10px 0 18px; min-height: 1.3em; }
.game-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; margin: 0 auto; }
.game-btns .btn { min-height: 64px; font-size: 1.1rem; border-radius: 16px; }
.game-stats { display: flex; justify-content: center; gap: 24px; font-weight: 700; margin-bottom: 8px; flex-wrap: wrap; }
.timer { height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin: 8px auto 14px; max-width: 520px; }
.timer span { display: block; height: 100%; background: var(--rust); width: 100%; transition: width .1s linear; }
.flash-ok { animation: okf .35s; }
.flash-no { animation: nof .35s; }
@keyframes okf { 50% { color: var(--green); transform: scale(1.06); } }
@keyframes nof { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } 50% { color: var(--rust); } }
.feedback { min-height: 1.6em; color: var(--ink2); }
.pairs { columns: 3 220px; column-gap: 24px; font-size: .98rem; }
.pairs div { break-inside: avoid; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.pairs b { color: var(--gold); }
[data-theme="light"] .pairs b { color: #8a6418; }
.pairs i { color: var(--green); font-style: normal; font-weight: 700; }

/* ---------- quiz ---------- */
.quiz-card { max-width: 760px; margin: 0 auto; }
.q-meta { display: flex; justify-content: space-between; color: var(--ink2); font-weight: 700; font-size: .95rem; }
.q-text { font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 700; margin: 14px 0 16px; line-height: 1.35; }
.q-opts { display: grid; gap: 10px; }
.q-opt { text-align: left; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: 1.05rem var(--body); cursor: pointer; min-height: 52px; transition: border-color .15s, transform .1s; }
.q-opt:hover:not([disabled]) { border-color: var(--rust); transform: translateX(3px); }
.q-opt.right { border-color: var(--green); background: color-mix(in srgb, var(--green) 18%, var(--card)); }
.q-opt.wrong { border-color: var(--rust); background: color-mix(in srgb, var(--rust) 16%, var(--card)); }
.q-opt[disabled] { cursor: default; }
.q-explain { margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--gold); background: var(--bg2); border-radius: 0 10px 10px 0; }
.shieldbar { display: flex; gap: 4px; margin: 10px 0 0; flex-wrap: wrap; }
.shieldbar i { width: 18px; height: 22px; background: var(--line); clip-path: polygon(0 0, 100% 0, 100% 45%, 50% 100%, 0 45%); }
.shieldbar i.ok { background: var(--green); }
.shieldbar i.no { background: var(--rust); }
.result-card { text-align: center; }
.rank-title { font-family: var(--display); font-size: clamp(1.8rem, 6vw, 2.8rem); color: var(--rust); margin: 6px 0; }
.rank-art { max-width: 320px; margin: 0 auto; background: #2a2016; border-radius: 12px; overflow: hidden; }
.rank-art svg { display: block; width: 100%; height: auto; }
.ranks { display: grid; gap: 8px; }
.ranks div { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.ranks b { font-family: var(--display); min-width: 4.5em; color: var(--rust); }
.ranks .me { border: 2px solid var(--rust); }

/* ---------- about ---------- */
.prose h2 { margin-top: 1.4em; }
.prose li { margin-bottom: .4em; }
.timeline { list-style: none; padding: 0; border-left: 3px dashed var(--rust); margin-left: 8px; }
.timeline li { position: relative; padding: 0 0 14px 20px; }
.timeline li::before { content: ''; position: absolute; left: -9px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 2px solid var(--ink); }
.timeline b { font-family: var(--display); color: var(--rust); }
