/* HeroLog — an indigo-bound chronicle. Paper ground · ink lettering · ruled lines · cinnabar seal
   Layout: one column for one-handed phone use (max 520px). Cover → hero list → chronicle spread → final record */
:root {
  --paper: #ECEFE9; --paper-2: #F9FAF7; --paper-3: #DFE4DC; --rule: #C7CFC4;
  --ink: #1B2333; --ink-2: #4D5667; --ink-3: #626A78;
  --indigo: #24396A; --indigo-2: #31497B; --indigo-ink: #EEF1F6; --indigo-tx: #2C4478; --chija-tx: #8A6316;
  --seal: #B0382D; --seal-2: #8E2C23; --chija: #C2913A; --jade: #3B705E;
  --good: #2F7A5E; --bad: #B0382D;
  --shadow: 0 1px 0 rgba(27, 35, 51, .06), 0 6px 18px -10px rgba(27, 35, 51, .35);
  --s0: #FFFFFF; --s1: #F4F5F1; --s2: #E3E7E0; --s3: #C8D0C6; --s4: #A7B1A7; --s5: #6E7973; --s6: #3A433F;
  --sr: #A13A33; --sw: #9DB2BE; --sg: #B6C39E; --sth: #B79A62; --sn: #27324A; --sl: #E7C266; --sy: #C9A24A;
  --yut-f: #EADFC4; --yut-b: #B98A55; --yut-g: #8A5E33;
  --f-display: 'Noto Serif', Georgia, serif;
  --f-body: 'Noto Serif', Georgia, serif;
  --f-ui: 'Noto Sans', system-ui, sans-serif;
  --r: 10px; --gut: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11151C; --paper-2: #1A1F28; --paper-3: #0C1015; --rule: #2B333F;
    --ink: #E7E9EE; --ink-2: #AEB5C2; --ink-3: #8C94A3;
    --indigo: #2A4174; --indigo-2: #36508A; --indigo-ink: #EEF1F6; --indigo-tx: #9DB3E3; --chija-tx: #E0B865;
    --seal: #D45A4B; --seal-2: #B4473A; --chija: #D6AC55; --jade: #5E9E88; --good: #5FAE8D; --bad: #E06B5C;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 22px -12px rgba(0, 0, 0, .8);
    --s0: #DDE3EA; --s1: #3A4554; --s2: #2B3442; --s3: #232B37; --s4: #1C232D; --s5: #141A22; --s6: #0B0F14;
    --sr: #7E3029; --sw: #2D4352; --sg: #2C3A2C; --sth: #5B4A2E; --sn: #0E1424; --sl: #C9A24A; --sy: #8F7633;
    --yut-f: #CDBF9E; --yut-b: #8E6A44; --yut-g: #6A4626;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #11151C; --paper-2: #1A1F28; --paper-3: #0C1015; --rule: #2B333F;
  --ink: #E7E9EE; --ink-2: #AEB5C2; --ink-3: #8C94A3;
  --indigo: #2A4174; --indigo-2: #36508A; --indigo-ink: #EEF1F6; --indigo-tx: #9DB3E3; --chija-tx: #E0B865;
  --seal: #D45A4B; --seal-2: #B4473A; --chija: #D6AC55; --jade: #5E9E88; --good: #5FAE8D; --bad: #E06B5C;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 22px -12px rgba(0, 0, 0, .8);
  --s0: #DDE3EA; --s1: #3A4554; --s2: #2B3442; --s3: #232B37; --s4: #1C232D; --s5: #141A22; --s6: #0B0F14;
  --sr: #7E3029; --sw: #2D4352; --sg: #2C3A2C; --sth: #5B4A2E; --sn: #0E1424; --sl: #C9A24A; --sy: #8F7633;
  --yut-f: #CDBF9E; --yut-b: #8E6A44; --yut-g: #6A4626;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--f-ui); word-break: normal; overflow-wrap: anywhere; }
html[lang="vi"] { --f-ui: 'Be Vietnam Pro', 'Noto Sans', system-ui, sans-serif; }
html[lang="th"] { --f-display: 'Noto Serif Thai', 'Noto Sans Thai', serif; --f-body: 'Noto Sans Thai', system-ui, sans-serif; --f-ui: 'Noto Sans Thai', system-ui, sans-serif; }
html[lang="th"] body { line-height: 1.75; }
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
body { background-image: repeating-linear-gradient(90deg, transparent 0 46px, color-mix(in srgb, var(--rule) 38%, transparent) 46px 47px); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--indigo-tx); }
:focus-visible { outline: 2.5px solid var(--chija); outline-offset: 2px; }
#app { max-width: 520px; margin: 0 auto; padding: 12px var(--gut) 40px; min-height: 100%; }
.scr { display: grid; gap: 14px; }
.hj { font-family: var(--f-display); }
.mute { color: var(--ink-3); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { appearance: none; border: 1.5px solid var(--ink); background: var(--paper-2); color: var(--ink); border-radius: 8px; padding: 10px 16px; font-weight: 600; line-height: 1.3; box-shadow: 2px 2px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn.pri { background: var(--indigo); color: var(--indigo-ink); border-color: var(--indigo); box-shadow: 2px 2px 0 var(--ink); }
.btn.seal { background: var(--seal); color: #fff; border-color: var(--seal-2); }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--rule); color: var(--ink-2); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.lbl { font-size: 11.5px; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--rule); background: var(--paper-2); font-size: 12.5px; color: var(--ink-2); }

/* ── site bar ── */
.sitebar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); }
.sitebar a { color: var(--ink-2); text-decoration: none; }
.sitebar .sp { flex: 1; }
.langs { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.langs b { color: var(--ink); font-weight: 700; }
.sitebar button { white-space: nowrap; background: none; border: 1px solid var(--rule); border-radius: 6px; padding: 3px 8px; color: var(--ink-2); font-size: 12px; }

/* ── cover ── */
.cover { position: relative; background: var(--indigo); color: var(--indigo-ink); border-radius: 6px 12px 12px 6px; padding: 20px 46px 22px 18px; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; overflow: hidden; box-shadow: var(--shadow); }
.cover::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 6px), repeating-linear-gradient(-45deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 7px); pointer-events: none; }
.cover .stitches { position: absolute; right: 14px; top: 10px; bottom: 10px; display: flex; flex-direction: column; justify-content: space-between; }
.cover .stitches i { width: 7px; height: 7px; border-radius: 50%; background: var(--paper-3); box-shadow: 0 0 0 2px rgba(0, 0, 0, .18); position: relative; }
.cover .stitches i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 1.6px; background: #D9CBA6; transform-origin: left; }
.slip { position: relative; background: #F1E6C8; color: #2A2416; border: 1px solid #CDBB8C; padding: 12px 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 176px; box-shadow: inset 0 0 0 3px #F1E6C8, inset 0 0 0 4px #CDBB8C; }
.slip .emblem { width: 56px; height: 56px; display: block; }
.cover .slip { width: 78px; }
.cover { grid-template-columns: 78px 1fr; }
.slip small { display: block; margin-top: 10px; writing-mode: vertical-rl; font-family: var(--f-ui); font-size: 11px; font-weight: 700; letter-spacing: .3em; color: #6B5A35; }
.cover-copy { position: relative; display: grid; gap: 8px; align-content: center; min-height: 176px; }
.cover-copy .kicker { margin: 0; font-size: 12px; letter-spacing: .14em; color: #C9D3EA; font-weight: 600; }
.cover-copy h1 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(23px, 6.4vw, 30px); line-height: 1.25; text-wrap: balance; }
.cover-copy p { margin: 0; font-size: 13.5px; color: #D5DCEB; line-height: 1.55; }
.cover-copy .count { font-size: 12px; color: #AEBAD6; }
.cover-copy .count span { white-space: nowrap; }

.bonform { display: grid; gap: 8px; }
.bonform label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bonform .in { display: flex; gap: 8px; }
.bonform input { flex: 1; min-width: 0; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper-2); padding: 11px 12px; font-size: 16px; font-family: var(--f-body); font-weight: 700; }
.sugg { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sugg li button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; }
.sugg li button b { font-family: var(--f-body); font-size: 16px; }
.sugg li button .mute { font-size: 12.5px; }
.sugg .tag { margin-left: auto; font-size: 11.5px; color: var(--seal); border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.pop { display: flex; flex-wrap: wrap; gap: 6px; }
.pop button { border: 1px solid var(--rule); background: var(--paper-2); border-radius: 99px; padding: 5px 11px; font-size: 13px; font-family: var(--f-body); font-weight: 700; color: var(--ink); }
.pop button .n { font-family: var(--f-ui); font-weight: 500; font-size: 11px; color: var(--ink-3); margin-left: 3px; }

.today { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; }
.ptbox { background: var(--paper-3); border-radius: 50% 50% 10px 10px / 40% 40% 10px 10px; overflow: hidden; aspect-ratio: 120/140; }
.ptbox svg { width: 100%; height: 100%; display: block; }
.today h3, .lg h3 { margin: 0; font-family: var(--f-body); font-size: 18px; font-weight: 800; }
.today .hook, .lg .hook { margin: 2px 0 6px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; text-wrap: pretty; }
.band { background: color-mix(in srgb, var(--chija) 16%, var(--paper-2)); border: 1px solid var(--chija); border-radius: var(--r); padding: 10px 12px; font-size: 13.5px; line-height: 1.5; }
.band b { font-family: var(--f-body); }
.tlinks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.tlinks button, .tlinks a { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.foot { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; padding-top: 8px; border-top: 1px solid var(--rule); }
.foot a { color: var(--ink-3); }

/* ── hero list ── */
.heroHead { display: grid; gap: 6px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; position: relative; overflow: hidden; }
.heroHead::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 34px; background: repeating-linear-gradient(0deg, transparent 0 18px, var(--rule) 18px 19px); opacity: .55; }
.heroHead h2 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1.2; }
.heroHead h2 span { font-size: 17px; color: var(--ink-3); margin-left: 6px; }
.heroHead .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.heroHead p { margin: 0; font-size: 13.5px; color: var(--ink-2); max-width: 46ch; }
.lgs { display: grid; gap: 10px; }
.lg { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: start; }
.lg .life { font-size: 12.5px; color: var(--ink-3); }
.lg .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lg .got { font-size: 12px; color: var(--ink-3); }
.lg.rand { grid-template-columns: 70px 1fr; }
.herolist { display: grid; gap: 10px; }
.herolist h2 { margin: 0; }
.famous { display: grid; gap: 4px; font-size: 13.5px; }
.famous li { list-style: none; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.famous ul { margin: 0; padding: 0; display: grid; gap: 4px; }
.famous b { font-family: var(--f-body); }

/* ── chronicle spread (game) ── */
.hud { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--indigo); color: var(--indigo-ink); border-radius: 0 0 10px 10px; margin: -12px calc(var(--gut) * -1) 0; padding: 8px var(--gut) 9px; display: grid; gap: 6px; box-shadow: var(--shadow); }
.hud .r1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.hud .yr { font-family: var(--f-display); font-size: 18px; white-space: nowrap; }
.hud .yr small { font-family: var(--f-ui); font-size: 11.5px; color: #C2CCE2; margin-left: 4px; }
.hud .rank { margin-left: auto; font-size: 12px; color: #DCE3F2; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud .menu { background: none; border: 1px solid rgba(255, 255, 255, .35); color: #fff; border-radius: 6px; padding: 1px 8px; font-size: 13px; flex: none; }
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.g { display: grid; grid-template-columns: auto 1fr; gap: 5px; align-items: center; font-size: 12px; }
.g .ic { width: 15px; height: 15px; color: #F2E3BF; }
.g.life .ic { color: #F0B8A8; }
.bar { height: 6px; background: rgba(255, 255, 255, .18); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #E8EEF9; border-radius: 3px; transition: width .4s; }
.g.life .bar i { background: #F0B8A8; }
.g.low .bar i { background: #FF8C7A; }
.hud .r3 { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.blade { display: flex; align-items: center; gap: 5px; flex: 1.2; min-width: 0; }
.blade .ic { width: 14px; height: 14px; color: #F3B4A6; }
.blade .bar { flex: 1; background: rgba(255, 255, 255, .14); clip-path: polygon(0 0, 92% 0, 100% 50%, 92% 100%, 0 100%); height: 8px; border-radius: 0; }
.blade .bar i { background: linear-gradient(90deg, #E9B9AE, #FF6B57); border-radius: 0; }
.blade.hot .bar i { animation: hot 1s infinite alternate; }
@keyframes hot { to { filter: brightness(1.35); } }
.side { display: flex; align-items: center; gap: 4px; flex: 1.6; min-width: 0; font-size: 11px; }
.side .t { flex: 1; height: 2px; background: rgba(255, 255, 255, .35); position: relative; min-width: 40px; }
.side .t i { position: absolute; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--chija); transform: translateX(-50%); transition: left .4s; }
.side span { white-space: nowrap; max-width: 4.6em; overflow: hidden; text-overflow: ellipsis; }
.hud .more { background: rgba(255, 255, 255, .12); border: 0; color: #fff; border-radius: 6px; padding: 2px 8px; font-size: 12px; white-space: nowrap; }
.relrow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 2px; }
.relrow::-webkit-scrollbar { display: none; }
.rel { flex: none; width: 40px; text-align: center; font-size: 10.5px; line-height: 1.2; color: #DCE3F2; }
.rel .rp { width: 34px; height: 34px; margin: 0 auto 1px; border-radius: 50%; overflow: hidden; background: rgba(255, 255, 255, .15); border: 1.5px solid rgba(255, 255, 255, .5); }
.rel .rp svg { width: 140%; height: 140%; margin: -6% 0 0 -20%; }
.rel.pos .rp { border-color: #9FD9C2; }
.rel.neg .rp { border-color: #FF9A8A; }
.rel.dead .rp { filter: grayscale(1); opacity: .45; }
.rel .st { display: block; font-size: 9.5px; color: #B9C4DD; }

.stage { position: relative; height: clamp(190px, 34vh, 236px); border-radius: var(--r); overflow: hidden; border: 1px solid var(--rule); background: var(--paper-3); }
.stage .scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .who { position: absolute; bottom: -2px; width: 132px; transition: opacity .2s, transform .25s; }
.stage .who svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .18)); }
.stage .who.l { left: 4px; }
.stage .who.r { right: 4px; width: 104px; }
.stage .who.dim { opacity: .55; }
.stage .who.speak { transform: translateY(-3px); }
.stage .badge { position: absolute; top: 8px; left: 8px; font-size: 11.5px; background: rgba(0, 0, 0, .45); color: #fff; padding: 2px 8px; border-radius: 99px; backdrop-filter: blur(3px); }
.chcard { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(2px); gap: 4px; padding: 10px; animation: chin .45s ease-out; }
@keyframes chin { from { opacity: 0; transform: translateY(8px); } }
.chcard .y { font-family: var(--f-display); font-weight: 700; font-size: 38px; line-height: 1.1; color: var(--ink); }
.chcard .t { font-family: var(--f-display); font-weight: 700; font-size: 23px; line-height: 1.25; text-wrap: balance; }
.chcard .s { font-size: 12.5px; color: var(--ink-2); }
.box { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px 14px; min-height: 104px; position: relative; box-shadow: var(--shadow); cursor: pointer; }
.box .nm { display: inline-flex; gap: 6px; align-items: baseline; margin: -2px 0 6px; font-weight: 700; font-size: 14px; color: var(--indigo-tx); }
.box .nm small { font-weight: 500; font-size: 11.5px; color: var(--ink-3); }
.box .tx { font-family: var(--f-body); font-size: 16px; line-height: 1.72; overflow-wrap: anywhere; }
.box.narr .tx { color: var(--ink); }
.box.narr::before { content: ''; position: absolute; right: 10px; top: 8px; width: 20px; height: 20px; border: 1.2px solid var(--seal); border-radius: 3px; opacity: .75; background: center / 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 3 C12 4 7 9 5 18 L4 21 L6.5 19 C8 15 10 13 13 12 C11 12 10 12.5 9 13 C11 9 14 6.5 20 3Z' fill='%23B0382D'/%3E%3C/svg%3E"); }
.box .nx { position: absolute; right: 12px; bottom: 6px; font-size: 11px; color: var(--ink-3); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.opts { display: grid; gap: 8px; }
.opt { text-align: left; background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; box-shadow: 2px 2px 0 var(--ink); position: relative; }
.opt:active { transform: translate(2px, 2px); box-shadow: none; }
.opt .t { font-weight: 700; font-size: 15px; line-height: 1.35; padding-right: 26px; }
.opt .d { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.opt .ch { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.fx { font-size: 11.5px; border-radius: 4px; padding: 1px 6px; background: var(--paper-3); color: var(--ink-2); white-space: nowrap; }
.fx.up { color: var(--good); }
.fx.dn { color: var(--bad); }
.fx.chk { background: color-mix(in srgb, var(--indigo) 12%, var(--paper-2)); color: var(--indigo-tx); display: inline-flex; gap: 5px; align-items: center; }
.fx.chk i { display: inline-block; width: 34px; height: 5px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.fx.chk i b { display: block; height: 100%; background: var(--indigo-2); }
.opt .shi { position: absolute; right: 10px; top: 9px; font-family: var(--f-display); font-size: 12px; color: var(--seal); border: 1.2px solid var(--seal); border-radius: 3px; width: 20px; height: 20px; display: grid; place-items: center; }
.opt[disabled] { border-style: dashed; box-shadow: none; opacity: .6; cursor: not-allowed; }
.opt .why { font-size: 12px; color: var(--seal); }
.opt.special { border-color: var(--chija); box-shadow: 2px 2px 0 var(--chija); }
.acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.act { background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 10px; padding: 9px 6px; display: grid; justify-items: center; gap: 2px; text-align: center; box-shadow: 2px 2px 0 var(--ink); }
.act .gl { line-height: 1; color: var(--indigo-tx); }
.act .gl .ic { width: 24px; height: 24px; }
.act .t { font-weight: 700; font-size: 13px; }
.act .d { font-size: 11px; color: var(--ink-3); line-height: 1.35; }
.q { font-size: 13.5px; color: var(--ink-2); font-weight: 600; margin: 2px 2px -2px; }

/* casting sticks */
.yutbox { position: absolute; inset: 0; background: color-mix(in srgb, var(--paper) 90%, transparent); display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; padding: 8px; }
.yutbox .lbl2 { font-size: 13px; color: var(--ink-2); }
.yutbox .sticks { display: flex; gap: 10px; height: 92px; align-items: flex-end; }
.yutbox .sticks svg { width: 20px; height: 80px; }
.yutbox .sticks span { display: inline-block; animation: toss .7s cubic-bezier(.3, .6, .4, 1) both; }
.yutbox .sticks span:nth-child(2) { animation-delay: .05s; } .yutbox .sticks span:nth-child(3) { animation-delay: .1s; } .yutbox .sticks span:nth-child(4) { animation-delay: .15s; }
@keyframes toss { 0% { transform: translateY(60px) rotate(0deg); opacity: 0; } 45% { transform: translateY(-46px) rotate(320deg); opacity: 1; } 100% { transform: translateY(0) rotate(var(--rot, 8deg)); } }
.yutbox .res { font-family: var(--f-display); font-weight: 700; font-size: 30px; line-height: 1.1; }
.yutbox .res.ok { color: var(--good); } .yutbox .res.no { color: var(--bad); }
.yutbox .res small { display: block; font-family: var(--f-ui); font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* 3-round duel */
.duel { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; padding: 0 6px; background: color-mix(in srgb, var(--paper) 30%, transparent); }
.duel .who { position: static; width: 100%; max-width: 130px; justify-self: center; }
.duel .mid { align-self: center; text-align: center; display: grid; gap: 4px; padding-bottom: 20px; }
.duel .mid .nm2 { font-family: var(--f-display); font-size: 17px; background: var(--paper-2); padding: 2px 10px; border-radius: 6px; border: 1px solid var(--rule); }
.pips { display: flex; gap: 4px; justify-content: center; }
.pips i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper-2); }
.pips i.w { background: var(--good); border-color: var(--good); }
.pips i.l { background: var(--bad); border-color: var(--bad); }
.tri { font-size: 11.5px; color: var(--ink-3); text-align: center; }

/* purge storm */
.storm { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--seal) 30%, transparent), color-mix(in srgb, var(--paper) 88%, transparent)); }
.storm .n { font-family: var(--f-display); font-weight: 700; font-size: 30px; line-height: 1.15; }
.storm .lv { font-size: 13px; color: var(--ink-2); }
.risk { display: flex; gap: 3px; justify-content: center; }
.risk i { width: 26px; height: 7px; border-radius: 2px; background: var(--rule); }
.risk i.on { background: var(--seal); }

/* overlay */
.ov { position: fixed; inset: 0; z-index: 60; background: rgba(12, 16, 24, .55); display: grid; place-items: end center; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 488px; max-height: 86vh; overflow: auto; background: var(--paper-2); color: var(--ink); border-radius: 14px; padding: 18px 16px; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(20px); opacity: .5; } }
.sheet h3 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1.25; }
.sheet p { margin: 0; }
.sheet .tx { font-family: var(--f-body); line-height: 1.7; }
.sheet .acts2 { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.perks { display: grid; gap: 8px; }
.perks button { text-align: left; border: 1.5px solid var(--ink); background: var(--paper); border-radius: 10px; padding: 10px 12px; box-shadow: 2px 2px 0 var(--ink); }
.perks b { display: block; font-family: var(--f-body); font-size: 16px; }
.perks span { font-size: 13px; color: var(--ink-2); }
.itemglyph { width: 56px; height: 56px; border-radius: 8px; background: var(--seal); color: #fff; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 30px; flex: none; box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 4.5px rgba(255, 255, 255, .7); }
.itm { display: flex; gap: 12px; align-items: center; }
.abl { display: grid; gap: 6px; }
.abl .a { display: grid; grid-template-columns: 22px 84px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.abl .a b { color: var(--indigo-tx); }
.pipsx { display: flex; gap: 3px; }
.pipsx i { width: 12px; height: 12px; border-radius: 2px; background: var(--paper-3); border: 1px solid var(--rule); }
.pipsx i.on { background: var(--indigo-2); border-color: var(--indigo-2); }
.rellist { display: grid; gap: 6px; }
.rellist .r { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.rellist .r .rp { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--paper-3); }
.rellist .r .rp svg { width: 140%; height: 140%; margin: -6% 0 0 -20%; }
.rellist .r .st { font-size: 12px; font-weight: 700; }
.rellist .r .st.pos { color: var(--good); } .rellist .r .st.neg { color: var(--bad); }
.loglist { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 3px; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 112px); z-index: 70; display: grid; gap: 6px; justify-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { background: var(--ink); color: var(--paper); font-size: 13px; padding: 6px 12px; border-radius: 99px; box-shadow: var(--shadow); animation: tin .25s ease-out; text-align: center; }
.toast.d { background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

/* ── final record ── */
.obit { position: relative; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px 18px 18px; display: grid; gap: 12px; overflow: hidden; box-shadow: var(--shadow); }
.obit::before { content: ''; position: absolute; inset: 8px; border: 1px solid var(--rule); border-radius: 6px; pointer-events: none; }
.obit .k { font-size: 12px; letter-spacing: .12em; color: var(--ink-3); font-weight: 600; }
.obit .nmline { font-family: var(--f-body); font-weight: 800; font-size: 22px; line-height: 1.3; }
.obit .nmline small { font-family: var(--f-ui); font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.sealbig { justify-self: start; display: inline-grid; place-items: center; background: var(--seal); color: #fff; border-radius: 6px; padding: 10px 14px; font-family: var(--f-display); font-weight: 700; font-size: clamp(20px, 6vw, 27px); line-height: 1.15; text-align: center; box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 5px rgba(255, 255, 255, .75); transform: rotate(-2deg); max-width: 100%; text-wrap: balance; animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp { from { transform: scale(1.8) rotate(-8deg); opacity: 0; } }
.kind { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; }
.kind i { font-style: normal; font-family: var(--f-display); font-size: 14px; border: 1.2px solid currentColor; border-radius: 3px; padding: 0 5px; }
.kind.k1 { color: var(--jade); } .kind.k2 { color: var(--indigo-tx); } .kind.k3, .kind.k4 { color: var(--seal); } .kind.k5 { color: var(--chija-tx); }
.obit .tx { font-family: var(--f-body); font-size: 16px; line-height: 1.8; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.stats div { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 2px; }
.stats small { display: block; font-size: 11px; color: var(--ink-3); }
.stats b { font-family: var(--f-display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.emo { font-size: 20px; letter-spacing: 2px; text-align: center; }
.mourn { display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); }
.tangle { display: flex; flex-wrap: wrap; gap: 6px; }
.tangle span { font-size: 12.5px; border-radius: 6px; padding: 3px 8px; border: 1px solid var(--rule); background: var(--paper); }
.tangle span.f { border-color: var(--seal); color: var(--seal); }
.tangle span.g { border-color: var(--good); color: var(--good); }
.hist { background: var(--paper); border-left: 3px solid var(--indigo-2); padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.hist h4 { margin: 0 0 4px; font-size: 12.5px; color: var(--indigo-tx); letter-spacing: .06em; }
.hist ol { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }
.hist ol a { color: var(--ink-3); word-break: break-all; }
.share4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 6px; }
.share4 button, .share4 a { border: 1.5px solid var(--ink); background: var(--paper-2); color: var(--ink); text-decoration: none; border-radius: 8px; padding: 8px 2px; font-size: 11.5px; font-weight: 700; display: grid; gap: 2px; justify-items: center; text-align: center; box-shadow: 2px 2px 0 var(--ink); line-height: 1.25; }
.share4 i { font-style: normal; font-size: 17px; font-weight: 800; line-height: 1.2; }
.share4 .whatsapp { background: #25D366; color: #0B2A16; border-color: #0B2A16; }
.share4 .facebook { background: #1877F2; color: #fff; border-color: #0B2F66; }
.share4 .line { background: #06C755; color: #fff; border-color: #03431D; }
.share4 .zalo { background: #0068FF; color: #fff; border-color: #00296B; }
.shimg { background: var(--paper-3); border-radius: 8px; padding: 8px; display: grid; place-items: center; }
.shimg img { max-height: min(48vh, 440px); width: auto; max-width: 100%; box-shadow: var(--shadow); }
.dogam { display: grid; gap: 8px; }
.dogam .f { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: baseline; font-size: 13.5px; border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.dogam .f b { font-family: var(--f-body); }
.dogam .es { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 4px; }
.dogam .es span { font-size: 11.5px; border: 1px solid var(--rule); border-radius: 4px; padding: 0 6px; color: var(--ink-3); }
.dogam .es span.on { border-color: var(--seal); color: var(--seal); }

/* ads */
.adwrap { display: grid; justify-items: center; gap: 4px; margin-top: 150px; margin-bottom: 24px; }
.adslot { max-width: 100%; }
.adslot .adlbl { font-size: 10px; color: var(--ink-3); letter-spacing: .06em; }
.adslot .addisc { font-size: 10px; color: var(--ink-3); margin: 0 0 3px; word-break: keep-all; max-width: 320px; }
.adslot .adbody { max-width: 100%; overflow: hidden; }
.adslot .adbody.pv { border: 1.5px dashed var(--rule); color: var(--ink-3); display: grid; place-items: center; font-size: 11px; text-align: center; padding: 6px; }
.adslot iframe { border: 0; display: block; max-width: 100%; }

/* about */
.about { display: grid; gap: 10px; font-size: 14px; line-height: 1.7; }
.about h2 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 24px; }
.about h3 { margin: 6px 0 0; font-size: 15px; }
.about p, .about ul { margin: 0; max-width: 62ch; }
.about ul { padding-left: 18px; }
.about .figlist { font-size: 12.5px; color: var(--ink-2); }

@media (max-width: 380px) {
  .gauges { gap: 5px; } .g { font-size: 11px; } .hud .yr { font-size: 16px; }
  .acts { grid-template-columns: repeat(2, 1fr); }
  .share4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stage .who { width: 112px; } .stage .who.r { width: 88px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── screen helpers (app.js) ── */
.scr.game { gap: 10px; }
.stage .sc { position: absolute; inset: 0; }
.stage .who[hidden] { display: none; }
.g, .blade { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hud .bar { display: block; }
.rel { background: none; border: 0; padding: 0; color: #DCE3F2; font: inherit; font-size: 10.5px; line-height: 1.2; cursor: pointer; }
.rel .rp { display: block; }
.box .tx.hint { color: var(--ink-3); font-family: var(--f-ui); font-size: 13.5px; }
.q .riskq { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; color: var(--seal); font-weight: 700; white-space: nowrap; }
.q .riskq .risk i { width: 14px; height: 6px; }
.opt.picked { border-color: var(--seal); box-shadow: 2px 2px 0 var(--seal); }
.opts.locked, .acts.locked { pointer-events: none; }
.opts.locked .opt:not(.picked), .acts.locked .act:not(.picked) { opacity: .45; }
.acts.n4 { grid-template-columns: repeat(2, 1fr); }
.act.picked { border-color: var(--seal); box-shadow: 2px 2px 0 var(--seal); }
.toast .up { color: var(--good); font-weight: 700; } .toast .dn { color: var(--bad); font-weight: 700; }
.intro { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; }
.intro h3 small { font-size: 15px; color: var(--ink-3); font-family: var(--f-display); }
.intro .lg { display: block; }
.saju { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sheet .itm .ptbox { width: 84px; flex: none; }
.itemglyph.sm { width: 40px; height: 40px; font-size: 22px; }
.sheet .sec { display: grid; gap: 8px; }
.sheet .sec h4 { margin: 0; font-size: 12px; letter-spacing: .1em; color: var(--ink-3); }
.gw { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.gw .g2 { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; }
.gw .g2 b { color: var(--indigo-tx); grid-row: span 2; }
.gw .bar2 { height: 6px; background: var(--paper-3); border-radius: 3px; overflow: hidden; }
.gw .bar2 i { display: block; height: 100%; background: var(--indigo-2); }
.endbtns { display: grid; gap: 8px; }
.endbtns .row { justify-content: center; }
.cont { display: grid; gap: 6px; }
.lg.hl { outline: 2.5px solid var(--chija); outline-offset: 2px; }
.famous li .chip { cursor: pointer; }
.load { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: color-mix(in srgb, var(--paper) 72%, transparent); font-family: var(--f-display); font-size: 20px; color: var(--ink-2); }
.lg[hidden] { display: none !important; }
.foot .mail { user-select: all; }
.shimg { gap: 8px; text-align: center; }
@media (max-width: 380px) { .gw { grid-template-columns: 1fr; } }

.toasts.bot { top: auto; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.g, .blade { position: relative; }
.fly { position: absolute; left: 50%; top: -4px; transform: translateX(-50%); font-size: 11px; font-weight: 800; letter-spacing: -1px; pointer-events: none; animation: fly 1.2s ease-out forwards; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.fly.up { color: #9FE3C6; } .fly.dn { color: #FF9C8C; }
@keyframes fly { 0% { opacity: 0; transform: translate(-50%, 6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.rel.pulse .rp { animation: pulse 1.1s; } .rel.pulse-n .rp { animation: pulsen 1.1s; }
@keyframes pulse { 30% { box-shadow: 0 0 0 4px rgba(159, 217, 194, .8); transform: scale(1.12); } }
@keyframes pulsen { 30% { box-shadow: 0 0 0 4px rgba(255, 154, 138, .8); transform: scale(.92); } }
.duel .who { max-width: 112px; }
.duel .mid .tri { background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 8px; line-height: 1.45; }
.duel .mid .tri b.ok { color: var(--good); } .duel .mid .tri b.no { color: var(--bad); }
.box.narr .tx { padding-right: 24px; }

.duel .mid { max-width: 48vw; }
.duel .mid .nm2 { word-break: keep-all; line-height: 1.25; }
.trail { border-top: 1px solid var(--rule); padding-top: 8px; font-size: 13px; color: var(--ink-2); }
.trail summary { cursor: pointer; font-weight: 700; color: var(--indigo-tx); font-size: 12.5px; letter-spacing: .04em; }
.trail ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.trail li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: baseline; }
.trail li b { font-family: var(--f-display); font-weight: 400; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.trail li small { display: block; color: var(--ink-3); font-size: 12px; }
.trail li.end span { color: var(--seal); font-weight: 700; }

/* ── review fixes ── */
.msg.err { color: var(--seal); font-weight: 600; }
.stage:has(.chcard, .yutbox, .storm, .duel) .badge { visibility: hidden; }
.lg .acts .btn, .cont .btn, .today .btn, .endbtns .btn { min-height: 44px; }
.hud .menu { padding: 5px 11px; font-size: 15px; }
.hud .more { padding: 6px 11px; }
.hud .r4 { display: flex; align-items: center; gap: 6px; font-size: 11.5px; min-width: 0; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; width: 100%; }
.hud .r4 .t { flex: 1; height: 2px; background: rgba(255, 255, 255, .35); position: relative; min-width: 40px; display: block; }
.hud .r4 .t i { position: absolute; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--chija); transform: translateX(-50%); transition: left .4s; }
.hud .r4 .sl, .hud .r4 .sr { white-space: nowrap; max-width: 44%; overflow: hidden; text-overflow: ellipsis; }
.hud .r4 .sl::before { content: attr(data-pre) ' · '; color: #AEBAD6; }
.rel { width: 38px; }
.rel .rp { width: 30px; height: 30px; }
.rel .st { display: none; }
.duel .who { position: relative; }
.duel .who .tag { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); border-radius: 99px; padding: 0 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.toasts.top { top: var(--toast-top, 120px); bottom: auto; }
.famous .soon { font-size: 11px; color: var(--chija-tx); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.soonbox { display: grid; gap: 6px; }
.soonbox ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.soonbox li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.soonbox li b { font-family: var(--f-body); font-size: 15px; }
.guide { display: grid; gap: 8px; font-size: 13.5px; line-height: 1.55; }
.guide .gl2 { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: start; }
.guide .gl2 b { font-family: var(--f-display); font-weight: 700; font-size: 17px; text-align: center; background: var(--indigo); color: var(--indigo-ink); border-radius: 6px; padding: 3px 0; display: grid; place-items: center; }
.guide .gl2 b .ic { width: 18px; height: 18px; }
@media (max-height: 760px) { .stage { height: clamp(150px, 27vh, 236px); } .box { min-height: 88px; } }
.sugg .tag.soon2 { color: var(--ink-3); }
.duel .mid { align-self: end; padding-bottom: 10px; }

/* HeroLog expanded roster */
.card .acts{flex-wrap:wrap;gap:8px}.card .acts .got{flex-basis:100%}

/* Crossroads: compact entry cards, restrained country editions. */
.crossroads{margin:24px 0}.cross-top h2{font-size:clamp(26px,4vw,40px);line-height:1.15;margin:8px 0 12px}.cross-top>p:last-child{max-width:65ch;color:var(--ink2,#4d5667)}.cross-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.cross-card{display:flex;gap:14px;border:1px solid #c9c8bb;border-radius:16px;padding:20px;background:#fffdf6;box-shadow:0 5px 0 #ddd9cb}.cross-card .ptbox{flex:0 0 76px;width:76px;height:96px}.cross-card h3{font-size:22px;line-height:1.25;margin:10px 0}.cross-card small{color:#697154}.cross-card p{font-size:15px;line-height:1.55}.cross-card .btn{margin-top:8px}.cross-card.selected{border:2px solid #657947}.cross-ad{margin:36px auto 44px}.cross-trace{padding:16px;background:#e9eee0;border-radius:12px;text-align:left}.cross-trace h3{font-size:16px}.cross-trace li{margin:8px 0;line-height:1.5}@media(max-width:650px){.cross-grid{grid-template-columns:1fr}.cross-card{padding:16px}.cross-card .ptbox{flex-basis:62px;width:62px;height:80px}.cross-card h3{font-size:21px}}

.crossroads{background:#f2f0e8;color:#1b2333;padding:22px;border-radius:18px}.cross-top>p:last-child{color:#4d5667}.cross-card{color:#1b2333;min-width:0}.cross-card h3,.cross-trace h3{color:#1b2333}.cross-card p{color:#4d5667}.cross-trace{color:#1b2333}.cover{padding:22px!important;min-height:0!important}.cover .slip,.cover .stitches{display:none}.cover h1{font-size:28px!important;line-height:1.2!important}.cover-copy{max-width:none!important}.cover-copy>p:not(.kicker):not(.count){font-size:15px!important;line-height:1.5!important;margin:10px 0!important}@media(max-width:650px){.crossroads{padding:16px}.cross-card{display:block}.cross-card .ptbox{float:right;margin:0 0 8px 12px}.cross-card .btn{width:100%}}

.cover{display:block!important}.cover-copy{width:100%;min-height:0!important}.cover-copy h1{max-width:none!important}

.cross-grid{grid-template-columns:minmax(0,1fr)}.cross-card{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:start}.cross-card>div{min-width:0}.cross-card h3{overflow-wrap:normal;word-break:normal}@media(max-width:650px){.cross-card{display:block}}

.film-links{display:flex;flex-direction:column;gap:10px;margin:24px 0;padding:18px;background:#e5ecdf;color:#24382d;border-radius:12px}.film-links a{color:#235b3d;font-weight:600}

.next-lives{margin:24px 0;padding:22px;border:1px solid #b4bea9;border-radius:18px;background:#f4f0e4;color:#26342c}.next-lives h2{margin:0 0 6px;font-size:24px}.next-lives>p{margin:0 0 18px;color:#526454}.next-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.next-life{min-width:0;border:1px solid #ccd0c0;background:#fffdf7;border-radius:12px;padding:16px}.next-life .ptbox{width:64px;height:80px;margin-bottom:8px}.next-life h3{font-size:18px;line-height:1.35;margin:6px 0}.next-life p{font-size:13px;line-height:1.6}.next-life small{font-size:12px;color:#596859}.next-life .btn{white-space:normal;height:auto;line-height:1.4;margin-top:12px;max-width:100%;box-sizing:border-box}.next-life:first-child{border:2px solid #47634d}@media(max-width:600px){.next-grid{grid-template-columns:1fr}.next-life{display:grid;grid-template-columns:64px minmax(0,1fr);gap:12px}.next-life .ptbox{grid-row:1/3}.next-life>div{min-width:0}.next-lives{padding:16px}.next-lives h2{font-size:22px}}
