/* Reading stories (js/stories.js) */
.st-lib, .st-read { display: grid; gap: 22px; }
.st-read { max-width: 760px; margin-inline: auto; width: 100%; }
.st-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 26px 28px; border-radius: 26px;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--a2) 20%, transparent), transparent 60%),
              radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%), var(--surface);
  border: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); box-shadow: var(--shadow); }
.st-hero h1 { margin: 0 0 6px; font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.3rem); }
.st-hero .lead { margin: 0; max-width: 46ch; }
.st-hero-art { flex: none; width: 150px; height: 150px; object-fit: cover; border-radius: 30px; transform: rotate(-3deg);
  box-shadow: 0 18px 36px -20px var(--accent); border: 3px solid var(--surface); }
.st-filter { justify-content: flex-start; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.st-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; border-radius: 22px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s ease, box-shadow .2s ease; }
.st-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--lv, var(--accent)); opacity: .85; }
.st-card:hover { transform: translateY(-2px); }
.st-card h2 { margin: 6px 0 0; font: 700 1.2rem/1.25 var(--font-target); text-align: start; }
.st-card .st-tr { margin: 0; font-weight: 500; }
.st-card p { margin: 0; }
.st-card.is-locked { opacity: .82; }
.st-card-top { display: flex; align-items: center; justify-content: space-between; }
.st-ico { width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.5rem; border-radius: 15px; background: color-mix(in srgb, var(--lv, var(--accent)) 16%, var(--surface-2)); }
.st-ico.big { width: 64px; height: 64px; font-size: 2.1rem; border-radius: 20px; margin-inline: auto; }
.st-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sto-bar { display: flex; align-items: center; justify-content: space-between; }
.st-head { text-align: center; display: grid; gap: 8px; justify-items: center; }
.st-head h1 { margin: 4px 0 0; font: 800 clamp(1.7rem, 5vw, 2.4rem)/1.15 var(--font-display); }
.st-head .st-tr { margin: 0; color: var(--muted); font-size: 1.05rem; }
.st-head p.small { margin: 0; }
.st-tools { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.st-tools .btn svg { width: 20px; height: 20px; vertical-align: -4px; margin-inline-end: 6px; }
.st-text { direction: ltr; text-align: left; padding: 26px clamp(18px, 4vw, 34px); border-radius: 24px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); box-shadow: var(--shadow); line-height: 1.75; }
.st-sent { display: inline; margin: 0; }
.st-text.with-tr .st-sent { display: block; margin: 0 0 14px; }
.st-line { appearance: none; border: 0; background: none; padding: 1px 3px; margin: 0 -1px; font: 400 clamp(1.08rem, 2.6vw, 1.22rem)/1.75 var(--font-target); color: var(--ink);
  text-align: left; cursor: pointer; border-radius: 6px; transition: background-color .2s; box-decoration-break: clone; -webkit-box-decoration-break: clone; display: inline; }
.st-line:hover { background: color-mix(in srgb, var(--lv, var(--accent)) 12%, transparent); }
.st-sent.now .st-line { background: color-mix(in srgb, var(--lv, var(--accent)) 26%, transparent); }
.st-line:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.st-sent-tr { display: block; text-align: start; color: var(--muted); font-size: .98rem; line-height: 1.5; padding-inline: 3px; }
.st-words h2, .st-quiz h2 { margin: 0 0 12px; font-size: 1.2rem; }
.st-words ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.st-words li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); }
.st-w { flex: 1; min-width: 0; display: grid; gap: 1px; }
.st-words li b { font: 600 1.02rem var(--font-target); justify-self: start; overflow-wrap: anywhere; }
.st-words li .st-w span { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.st-words .speak { flex: none; }
.st-quiz { display: grid; gap: 16px; }
.st-q { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.st-q legend { display: grid; gap: 2px; padding: 0; margin-bottom: 8px; }
.st-q legend span { font: 600 1.08rem var(--font-target); }
.st-q legend small { color: var(--muted); font-size: .9rem; }
.st-opts { display: grid; gap: 8px; }
.st-opt { min-height: 50px; padding: 12px 14px; font-size: 1rem; text-align: left; }
.st-opt.picked { border-color: var(--lv, var(--accent)); background: color-mix(in srgb, var(--lv, var(--accent)) 12%, var(--surface)); }
.st-fb { margin: 0; font-weight: 600; }
.st-fb.ok { color: var(--ok); } .st-fb.bad { color: var(--bad); }
.st-result { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 20px; background: color-mix(in srgb, var(--ok) 10%, var(--surface-2)); }
.st-result img { width: 110px; height: 110px; object-fit: cover; border-radius: 22px; flex: none; }
.st-result p { margin: 0 0 6px; }
.st-score { font-size: 1.25rem; font-weight: 700; }
.st-result .sp-gems { display: inline-block; font-weight: 700; padding: .3em .9em; border-radius: 999px; background: color-mix(in srgb, #f0b72a 22%, var(--surface)); margin-bottom: 10px; }
.g-stories .st-card-art { width: 100%; height: 120px; object-fit: cover; object-position: 50% 30%; border-radius: 16px; }
@media (max-width: 640px) {
  .st-hero { padding: 20px; }
  .st-hero-art { width: 92px; height: 92px; border-radius: 22px; }
  .st-result { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .st-card { transition: none; } .st-card:hover { transform: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.st-hero-art, .st-card-art, .st-result img) { filter: brightness(.86); } }
:root[data-theme="dark"] :is(.st-hero-art, .st-card-art, .st-result img) { filter: brightness(.86); }
.st-pick { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--lv, var(--accent)) 16%, var(--surface)), var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--lv, var(--accent)) 35%, transparent); }
.st-pick img { width: 58px; height: 58px; border-radius: 14px; object-fit: cover; flex: none; }
.st-pick > div { flex: 1; min-width: 0; }
.st-pick p { margin: 0; }
.st-pick-k { font-size: .8rem; font-weight: 600; color: var(--muted); }
.st-pick-t { font: 700 1.05rem/1.3 var(--font-target); text-align: start; }
.st-pick .btn { flex: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-pick img { filter: brightness(.86); } }
:root[data-theme="dark"] .st-pick img { filter: brightness(.86); }
.st-words li { flex-wrap: nowrap; } .st-add, .st-inrev { flex: none; white-space: nowrap; }
.st-add { appearance: none; border: 1px dashed color-mix(in srgb, var(--lv, var(--accent)) 60%, var(--rule)); background: transparent; color: var(--ink);
  font: 600 .78rem var(--font-body); padding: .3em .7em; border-radius: 999px; cursor: pointer; }
.st-add:hover { background: color-mix(in srgb, var(--lv, var(--accent)) 14%, transparent); }
.st-inrev { font-size: .78rem; font-weight: 600; color: var(--ok); }
.st-photo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; }
