/* Public pages (chapters, profiles, rankings, landing). Builds on theme.css. */
main { padding-block: 36px 0; }
.page-head { margin: 8px 0 28px; }
.page-head .eyebrow { display: block; margin-bottom: 10px; }

/* ---------- landing ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-block: 48px 36px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); line-height: 1.05; margin-bottom: 18px; }
.hero .lead { max-width: 560px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 420px; margin-inline: auto; width: 100%; }
.hero-art .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line-gold); box-shadow: inset 0 0 80px rgba(212,166,74,.12), 0 0 120px rgba(163,38,42,.18); }
.hero-art .ring.r2 { inset: 9%; border-style: dashed; opacity: .5; animation: spin 120s linear infinite; }
.hero-art .ring.r3 { inset: 20%; opacity: .7; }
.hero-art .core { position: absolute; inset: 26%; display: grid; place-items: center; color: var(--gold); filter: drop-shadow(0 0 30px rgba(212,166,74,.5)); }
.hero-art .core .icon { width: 100%; height: 100%; }
.hero-art .orbit { position: absolute; width: 56px; height: 56px; color: var(--parch-2); }
.hero-art .orbit .medallion { --size: 56px; }
@keyframes spin { to { transform: rotate(360deg); } }
.agents { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.features { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature .icon { width: 34px; height: 34px; color: var(--gold); margin-bottom: 10px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--parch-2); font-size: .95rem; }
.steps { counter-reset: s; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; }
.step::before { counter-increment: s; content: counter(s, upper-roman); display: block; font: 700 2.2rem/1 var(--font-display); color: var(--gold); opacity: .55; margin-bottom: 10px; }
.section-title { text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--muted); margin: 0 auto 26px; max-width: 560px; }

/* ---------- chronicle cards ---------- */
.chron { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.chron h3 { margin: 0; font-size: 1.1rem; }
.chron .excerpt { font-family: var(--font-story); color: var(--parch-2); font-size: 1.02rem; line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.chron .meta { display: flex; gap: 12px; align-items: center; font-size: .8rem; color: var(--muted); }
.chron .meta .icon { color: var(--crimson-hi); }

/* ---------- chapter manuscript ---------- */
.chapter-head { text-align: center; padding-block: 18px 6px; }
.chapter-head h1 { margin-bottom: 8px; }
.chapter-nav { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.chapter-nav a, .chapter-nav span { min-width: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; font: 600 .78rem var(--font-display); text-align: center; color: var(--parch-2); }
.chapter-nav span.on { border-color: var(--gold); color: var(--gold-hi); background: rgba(212,166,74,.08); }
.party-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 26px 0; }
.member { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(11,9,7,.45); }
.member .who { min-width: 0; flex: 1; }
.member .who b { display: block; font: 600 .86rem/1.2 var(--font-display); color: var(--parch); overflow-wrap: anywhere; }
.member .who small { display: block; font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 6px; }
.member.dead { opacity: .55; }
.member.gm { border-color: var(--line-gold); background: rgba(212,166,74,.06); }
.opening { margin: 10px 0 8px; }
.round-head { display: flex; align-items: center; gap: 14px; margin: 38px 0 18px; }
.round-head::before, .round-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-gold), transparent); }
.round-head span { font: 600 .82rem/1 var(--font-display); letter-spacing: .3em; color: var(--gold); }
.actions { display: grid; gap: 12px; }
.act { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(26,20,16,.75); }
.act .head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.act .name { font: 600 .95rem var(--font-display); color: var(--parch); }
.act .speech { font-family: var(--font-story); font-style: italic; font-size: 1.08rem; color: var(--parch); margin: 6px 0 4px; }
.act .speech::before { content: "“"; color: var(--gold); } .act .speech::after { content: "”"; color: var(--gold); }
.act .doing { font-size: .9rem; color: var(--parch-2); margin: 0; }
.act .auto { font-size: .72rem; color: var(--muted); }
.narration { margin-top: 20px; padding: 22px 26px; border-left: 2px solid var(--gold-lo); background: linear-gradient(90deg, rgba(212,166,74,.05), transparent 70%); }
.pending { font-family: var(--font-story); font-style: italic; color: var(--muted); text-align: center; margin: 22px 0; }
.report { font: 500 .68rem var(--font-ui); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 4px; opacity: .55; }
.report:hover { opacity: 1; color: var(--crimson-hi); }
.summary-box h3 { display: flex; gap: 8px; align-items: center; }
.summary-box ul { margin: 10px 0 0; padding-left: 20px; color: var(--parch-2); }
.social { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; margin: 32px 0 10px; }
.like { display: inline-flex; gap: 8px; align-items: center; font: 600 .9rem var(--font-ui); padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(201,56,58,.55); background: rgba(163,38,42,.12); color: #f3b3ab; cursor: pointer; transition: all .15s; }
.like:hover, .like.on { background: rgba(163,38,42,.3); color: #fff; }
.like .icon { color: var(--crimson-hi); }
.stars { display: inline-flex; gap: 2px; }
.star { background: none; border: 0; cursor: pointer; padding: 2px; color: var(--line-gold); font-size: 1.4rem; line-height: 1; transition: color .1s, transform .1s; }
.star:hover, .star:hover ~ .star { color: var(--line-gold); }
.stars:hover .star { color: var(--gold); } .stars .star:hover ~ .star { color: var(--line-gold); }
.rating-text { font-size: .85rem; color: var(--muted); }

/* ---------- profile ---------- */
.profile-hero { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.profile-hero h1 { margin-bottom: 4px; }
.profile-hero .title { font-family: var(--font-story); font-style: italic; color: var(--gold); font-size: 1.2rem; }
.persona { font-family: var(--font-story); font-size: 1.12rem; color: var(--parch-2); font-style: italic; }
.ach-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ach { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(11,9,7,.45); }
.ach .icon { width: 28px; height: 28px; color: var(--rc); flex: none; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rc) 50%, transparent)); }
.ach b { display: block; font: 600 .86rem var(--font-display); color: var(--rc); }
.ach small { color: var(--muted); font-size: .76rem; line-height: 1.35; display: block; }
.medal-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- leaderboard ---------- */
.lb-name { display: flex; align-items: center; gap: 10px; }
.lb-name b { font: 600 .95rem var(--font-display); }
.scope { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; }
.scope a { font-size: .75rem; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--parch-2); }
.scope a.on { border-color: var(--gold); color: var(--gold-hi); }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); font-family: var(--font-story); font-style: italic; font-size: 1.1rem; }
.empty .icon { display: block; margin: 0 auto 10px; width: 42px; height: 42px; color: var(--line-gold); }
.rules-list li { margin-bottom: 8px; }

/* ---------- hall of fame wall (landing) ---------- */
.podium-row { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 16px; align-items: end; }
@media (max-width: 760px) { .podium-row { grid-template-columns: 1fr; } .podium.p1 { order: -1; } }
.podium { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 30px; position: relative; }
.podium .place { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); }
.podium .place .icon { width: 26px; height: 26px; }
.podium.p1 { padding-block: 44px 28px; border-color: var(--gold); box-shadow: 0 0 0 1px rgba(212,166,74,.25), 0 20px 50px rgba(0,0,0,.55), 0 0 60px rgba(212,166,74,.12); }
.podium.p1 .place { color: #f1c45c; } .podium.p2 .place { color: #cfd6dd; } .podium.p3 .place { color: #d39363; }
.podium b { font: 600 1.1rem var(--font-display); color: var(--parch); }
.podium.p1 b { font-size: 1.35rem; }
.podium small { color: var(--muted); font-size: .78rem; }
.podium .score { font: 700 .95rem var(--font-display); color: var(--gold-hi); }
.fame-list { list-style: none; margin: 0; padding: 0; }
.fame-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fame-list li:last-child { border-bottom: 0; }
.fame-list .rank { width: 22px; font: 700 .95rem var(--font-display); color: var(--muted); }
.fame-list a { font: 600 .92rem var(--font-display); }
.fame-list b { font: 700 .92rem var(--font-display); color: var(--gold-hi); }

/* ---------- live chapter ---------- */
.livebar { position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 10px 14px; border: 1px solid rgba(201,56,58,.45);
  border-radius: var(--r); background: rgba(26,16,14,.92); backdrop-filter: blur(6px); font-size: .88rem; color: var(--parch-2); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.livebar b { color: #f3b3ab; letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; }
.livebar.next { border-color: var(--gold-lo); color: var(--parch); position: static; }
.livebar.next b { color: var(--gold-hi); letter-spacing: 0; text-transform: none; font-size: inherit; }
.livebar.next .icon, .livebar.done .icon { color: var(--gold); }
.livebar.done { border-color: var(--line-gold); position: static; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--crimson-hi); box-shadow: 0 0 0 0 rgba(201,56,58,.7); animation: pulse 1.6s infinite; flex: none; }
.pulse.slow { background: var(--gold); animation-duration: 3s; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(201,56,58,.6); } 70% { box-shadow: 0 0 0 10px rgba(201,56,58,0); } 100% { box-shadow: 0 0 0 0 rgba(201,56,58,0); } }
.fresh { animation: fresh 2.8s ease-out; }
@keyframes fresh { 0% { box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(212,166,74,.45); background-color: rgba(212,166,74,.12); } 100% { box-shadow: none; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 50; padding: 10px 16px; border-radius: 999px;
  background: var(--ink-3); border: 1px solid var(--gold-lo); color: var(--parch); font-size: .86rem; box-shadow: var(--shadow); transition: all .3s; cursor: pointer; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 760px) { .livebar { top: 104px; } }

/* ---------- dice roll animation (live chapters) ---------- */
.act { position: relative; overflow: hidden; }
.dice-stage { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(circle at 30% 50%, #2e2218, #0d0a08 75%); transition: opacity .35s; }
.dice-stage.out { opacity: 0; }
.die { position: relative; width: 78px; height: 78px; flex: none; filter: drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
.die svg { width: 100%; height: 100%; }
.die .num { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 10px; font: 700 1.45rem/1 var(--font-display); color: #1c140b; }
.dice-stage.rolling .die { animation: tumble .32s linear infinite, hop .64s ease-in-out infinite; }
@keyframes tumble { to { transform: rotate(360deg); } }
@keyframes hop { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.dice-stage .what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dice-stage .who { font: 600 1rem var(--font-display); color: var(--parch); }
.dice-stage .check { font-size: .8rem; color: var(--muted); text-transform: capitalize; }
.dice-stage .verdict { font: 700 1.05rem var(--font-display); letter-spacing: .12em; text-transform: uppercase; opacity: 0; transform: translateY(6px); transition: all .3s; }
.dice-stage .math { font-size: .8rem; color: var(--parch-2); opacity: 0; transition: opacity .3s .1s; }
.dice-stage.landed .verdict, .dice-stage.landed .math { opacity: 1; transform: none; }
.dice-stage.landed .die { animation: land .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes land { 0% { transform: scale(1.35) rotate(-12deg); } 100% { transform: scale(1) rotate(0); } }
.dice-stage.crit_success { box-shadow: inset 0 0 80px rgba(241,196,92,.35); }
.dice-stage.crit_success .die { filter: drop-shadow(0 0 22px rgba(241,196,92,.95)); }
.dice-stage.crit_success .verdict { color: var(--gold-hi); text-shadow: 0 0 18px rgba(241,196,92,.8); }
.dice-stage.crit_success::after { content: ""; position: absolute; left: 50px; top: 50%; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gold-hi); animation: burst .9s ease-out forwards; }
@keyframes burst { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(-50%, -50%) scale(40); opacity: 0; } }
.dice-stage.success .verdict { color: var(--verdigris); }
.dice-stage.fail .verdict { color: var(--ember); }
.dice-stage.crit_fail { box-shadow: inset 0 0 80px rgba(201,56,58,.35); animation: shake .5s; }
.dice-stage.crit_fail .die { filter: drop-shadow(0 0 18px rgba(201,56,58,.9)) grayscale(.4); }
.dice-stage.crit_fail .verdict { color: #f3a39b; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.veiled { opacity: 0; max-height: 0; overflow: hidden; margin: 0 !important; padding-block: 0 !important; }
.unveil { transition: opacity .8s; }
@media (prefers-reduced-motion: reduce) { .dice-stage { display: none; } }

/* ---------- report menu ---------- */
.report-menu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; padding: 12px; border: 1px solid rgba(201,56,58,.45); border-radius: var(--r); background: rgba(26,16,14,.96); font-family: var(--font-ui); font-style: normal; }
.report-menu p { width: 100%; margin: 0 0 4px; font-size: .82rem; color: var(--parch-2); }
.report-menu button { font: 500 .78rem var(--font-ui); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--ink-1); color: var(--parch); cursor: pointer; }
.report-menu button:hover { border-color: var(--crimson-hi); color: #fff; }
.report-menu .report-cancel { border-style: dashed; color: var(--muted); }

/* ---------- catalog, books, authors, docs ---------- */
.crumbs { margin: 6px 0 14px; letter-spacing: .02em; }
.crumbs a { color: var(--muted, #a99c86); }
.pager { margin: 26px 0 8px; gap: 12px; flex-wrap: wrap; }
.module-card .excerpt, .book-card .excerpt { -webkit-line-clamp: 5; }
.module-card .meta span, .book-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.book-chapter { margin-top: 10px; }
.book-chapter h2 { margin-top: 6px; }
.toc li { flex-wrap: wrap; }
.toc li > .muted.small:last-child { flex-basis: 100%; padding-left: 36px; }
.doc h2, .doc h3, .doc h4 { margin-top: 1.6em; }
.doc table { font-size: .92rem; }
.doc code { font-size: .88em; }
.doc pre.scroll { white-space: pre-wrap; }
.topbar select.lang { width: auto; padding: 6px 26px 6px 10px; font-size: .78rem; background-color: transparent; color: var(--parch, #e8dcc4); border: 1px solid var(--line, #3a3024); border-radius: 6px; margin-right: 10px; }
.topbar select.lang option { color: #1a1410; }
.translation-note { margin: 10px 0 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
