.story-mode{position:fixed;inset:0;z-index:1000;overflow:auto;background:radial-gradient(circle at 30% 0,#2b1d4a,#0e0a1c 70%);color:#fff4d6;padding:10px 14px 30px}
html.story-open{overflow:hidden}html.story-open .sound-dock{z-index:1001}
.st-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.st-top h2{margin:0;color:#ffe9a8;font-size:1.4rem}
.st-chapters{display:flex;gap:6px;flex-wrap:wrap;flex:1}
.st-chapters button{border:2px solid rgba(255,233,168,.45);background:rgba(255,255,255,.08);color:#fff4d6;border-radius:999px;padding:.3rem .8rem;font-weight:800;cursor:pointer;width:auto}
.st-chapters button.on{background:#ffe9a8;color:#241b35}.st-chapters button:disabled{opacity:.45;cursor:default}
.story-mode button.subtle{width:auto;color:#fff4d6!important;background:rgba(255,255,255,.08)!important;border:1.5px solid rgba(255,233,168,.45)!important}
.story-mode button.primary{width:auto;color:#241b35!important}
.st-body{max-width:920px;margin:0 auto}
.st-hero{border:3px solid var(--ch,#c79d50);border-radius:16px;min-height:150px;background-size:cover;background-position:center 60%;display:flex;align-items:flex-end;overflow:hidden;position:relative}
.st-hero>div{width:100%;padding:12px 16px;background:linear-gradient(transparent,rgba(10,6,24,.88) 45%)}
.st-hero h3{margin:0;font-size:1.6rem;color:#fff4d6}.st-eyebrow{font-size:.8rem;letter-spacing:.12em;color:var(--ch)}
.st-shards{margin:.3rem 0 0}.st-shards span{color:rgba(255,255,255,.25);font-size:1.3rem;margin-right:2px}.st-shards span.got{color:var(--ch);text-shadow:0 0 8px var(--ch)}
.st-shards small{color:#fff4d6;opacity:.85}
.st-say{display:flex;gap:12px;align-items:flex-end;margin:14px 0}
.st-mentor{width:clamp(110px,22vw,190px);height:auto;flex:none;filter:drop-shadow(0 6px 12px rgba(0,0,0,.5))}
.st-bubble{position:relative;background:#fbf3df;color:#241b35;border:3px solid #c79d50;border-radius:16px;padding:12px 16px;flex:1;margin-bottom:14px}
.st-bubble::before{content:'';position:absolute;left:-14px;bottom:22px;border:12px solid transparent;border-right-color:#c79d50;border-left:0}
.st-bubble strong{color:#8a4a10}.st-bubble p{margin:.35rem 0;color:#241b35!important;font-size:1.02rem;line-height:1.4}
.st-reward{font-weight:800;color:#2f6b2a!important}
.st-bubble button{margin:.3rem .3rem 0 0}
.st-path{list-style:none;padding:0;margin:10px 0;display:grid;gap:8px}
.st-path li{display:flex;align-items:center;gap:12px;background:rgba(255,255,255,.07);border:2px solid rgba(255,233,168,.25);border-radius:14px;padding:10px 12px}
.st-path li.open{border-color:#ffe9a8;background:rgba(255,233,168,.12)}.st-path li.done{border-color:#7fd88a}.st-path li.locked{opacity:.55}
.st-path li>div{flex:1;display:flex;flex-direction:column}.st-path small{opacity:.85}
.st-step-ic{font-size:1.6rem;width:2rem;text-align:center}
.st-card{margin:0 auto;max-width:520px;background:#fbf3df;color:#241b35;border:4px solid var(--ch,#c79d50);border-radius:18px;padding:18px 22px;text-align:center;position:relative}
.st-card h3{font-size:3rem;margin:.2rem 0;color:#241b35;font-family:Georgia,serif}.st-lang{position:absolute;top:10px;right:14px;font-size:.8rem;font-weight:800;color:#8a6a2c}
.st-mean{font-size:1.2rem;margin:0 0 .6rem;color:#3d2f18!important}
.st-words{list-style:none;padding:0;margin:0 0 .8rem;display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.st-words li{background:#fff;border:1.5px solid #d9bd7c;border-radius:999px;padding:.3rem .8rem;font-size:1.05rem}
.st-words mark{background:none;color:var(--ch,#c0392b);font-weight:900;text-decoration:underline}
.st-nav{display:flex;justify-content:space-between;max-width:520px;margin:12px auto}
.st-quiz{max-width:560px;margin:0 auto;background:#fbf3df;color:#241b35;border:3px solid #c79d50;border-radius:16px;padding:14px 18px}
.st-qp{font-size:1.2rem;margin:0 0 .6rem;color:#241b35!important}.st-opts{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.st-opts button{border:2px solid #c79d50;background:#fff;color:#241b35;border-radius:10px;padding:.6rem;font-weight:700;font-size:1rem;cursor:pointer;width:auto}
.st-opts button.right{background:#c9f2c3;border-color:#3b8a3b}.st-opts button.wrong{background:#ffd3cc;border-color:#b43a2a}
.st-fb{min-height:1.3em;font-weight:800;margin:.5rem 0 0;color:#3d2f18!important}
.story-hint{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(150px + env(safe-area-inset-bottom));z-index:70;background:#2b1d4a;color:#ffe9a8;border:2px solid #c79d50;border-radius:14px;padding:.6rem .9rem;max-width:min(560px,92vw);box-shadow:0 8px 24px rgba(0,0,0,.4);font-size:.92rem}
.story-hint button{width:auto;margin-left:.5rem}
@media (min-width:741px){.story-hint{bottom:20px}}
@media (max-width:600px){.st-say{flex-direction:column;align-items:center}.st-bubble::before{display:none}.st-mentor{width:120px}.st-hero h3{font-size:1.25rem}.st-card h3{font-size:2.3rem}}
.wild-mood{margin:.2rem 0 0;font-size:.8rem;font-weight:800;min-height:1.1em}
.arena-meter.surging .wild-mood{color:#b2401f}.arena-meter.calm .wild-mood{color:#2f6b2a}.arena-meter.restless .wild-mood{color:#7a5a1a}
.arena-meter.surging #beastMeter{filter:hue-rotate(-60deg) saturate(1.6)}
.wild-line{position:absolute;width:3px;background:#e6b23a;border-radius:2px;box-shadow:0 0 6px #ffd76a;pointer-events:none}
.wild-help{width:22px!important;height:22px;min-width:0;padding:0!important;border-radius:50%;border:1.5px solid #8a6a2c;background:#fff8e6;color:#5b3d10;font-weight:900;font-size:.8rem;line-height:1;cursor:pointer;margin-left:4px;vertical-align:middle}
.bag-treasures ul{list-style:none;padding:0;margin:.4rem 0;display:grid;gap:6px}
.bag-treasures li{display:flex;align-items:center;gap:10px;border:1.5px solid #d9bd7c;border-radius:10px;padding:.4rem .6rem;background:rgba(255,255,255,.6)}
.bag-treasures .tr-ic{font-size:1.6rem}.bag-treasures .tr-name{flex:1;display:flex;flex-direction:column}
.bag-treasures li.r-rare{border-color:#4a8fd8}.bag-treasures li.r-epic{border-color:#9a4ad8}.bag-treasures li.r-legendary{border-color:#e6a23a;box-shadow:0 0 0 2px rgba(230,162,58,.35)}
.bag-treasures button{width:auto}.tr-keep{font-style:italic;max-width:12rem}
.story-mode .st-card .st-hear{color:#3b2c63!important;background:#fff7e3!important;border:2px solid #d9bd7c!important;font-weight:800}
.arena-meter label{display:flex;align-items:center;flex-wrap:wrap;gap:2px 4px}
.arena-meter label strong{flex-basis:100%}
.st-tease{margin-top:.6rem!important;padding:.4rem .6rem;border-radius:8px;background:rgba(192,139,255,.15);font-size:.95rem}
/* ---------- codex, class boss, daily, votes ---------- */
.codex{border:3px solid #c79d50;border-radius:18px;background:#fbf3df;color:#241b35;width:min(980px,calc(100% - 16px));max-height:calc(100vh - 24px);padding:14px 16px}
.codex::backdrop{background:rgba(12,8,30,.65)}
.cx-head{display:flex;align-items:center}.cx-head h2{flex:1;margin:0;color:#241b35}.cx-close{border:0;background:none;font-size:1.8rem;cursor:pointer;color:#5b4a2a;width:auto}
.cx-sum{font-size:.92rem;color:#3d2f18!important}.cx-key i{display:inline-block;width:12px;height:12px;border-radius:3px;margin:0 3px 0 8px;vertical-align:middle;border:2px solid}
.cx-key .t0,.cx-root.t0{border-color:#cdbf9f;background:#f1eadb}.cx-key .t1,.cx-root.t1{border-color:#b0723a;background:#f7e2cc}.cx-key .t2,.cx-root.t2{border-color:#9aa7b4;background:#eef2f6}.cx-key .t3,.cx-root.t3{border-color:#e6b23a;background:linear-gradient(160deg,#fff6d6,#ffe39a)}
.cx-status{min-height:1.2em;font-weight:800;color:#2f6b2a!important}
.cx-fams{display:flex;flex-direction:column;gap:6px}
.cx-fam{border:2px solid #d9bd7c;border-radius:12px;background:rgba(255,255,255,.6);padding:.4rem .6rem}.cx-fam.done{border-color:#e6b23a;box-shadow:0 0 0 2px rgba(230,178,58,.3)}
.cx-fam summary{display:flex;align-items:center;gap:8px;cursor:pointer;flex-wrap:wrap}.cx-ic{font-size:1.3rem}.cx-fam summary strong{flex:1;min-width:8rem}
.cx-prog{display:flex;align-items:center;gap:6px;font-size:.82rem}.cx-bar{display:inline-block;width:80px;height:8px;border-radius:4px;background:#ead8b0;overflow:hidden}.cx-bar i{display:block;height:100%;background:#e6a23a}
.cx-badge{font-weight:800;color:#2f6b2a}.cx-claim{width:auto}
.cx-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:6px;margin:.5rem 0 .2rem}
.cx-root{border:2.5px solid;border-radius:10px;padding:.35rem .3rem;text-align:center;display:flex;flex-direction:column}.cx-root b{font-family:Georgia,serif;font-size:1.05rem}.cx-root small{font-size:.72rem;color:#5b4a2a}
.cx-root.locked{border:2px dashed #b9a57c;background:#ece6d6;color:#8a7a5a}
.class-boss{display:flex;align-items:center;gap:12px;margin:0 0 1rem;padding:.6rem .9rem;border:3px solid #e6a23a;border-radius:16px;background:linear-gradient(120deg,rgba(59,44,99,.92),rgba(31,64,41,.92));color:#fff4d6}
.class-boss img{width:96px;height:72px;object-fit:contain;filter:drop-shadow(0 4px 8px rgba(0,0,0,.5))}.cb-body{flex:1;display:flex;flex-direction:column;gap:3px}
.cb-eyebrow{font-size:.72rem;letter-spacing:.1em;color:#ffd76a}.class-boss strong{font-size:1.15rem}.class-boss small{opacity:.95;color:#fff4d6}
.cb-bar{height:12px;border-radius:6px;background:rgba(255,255,255,.18);overflow:hidden}.cb-bar i{display:block;height:100%;background:linear-gradient(90deg,#7dff8a,#ffd76a)}
.class-boss button{width:auto}.cb-done{font-weight:800;color:#7dff8a}
.root-of-day,.golden-card{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:0 0 .8rem;padding:.55rem .9rem;border-radius:14px;border:2px solid #e6b23a;background:linear-gradient(120deg,#fff3c4,#ffe39a);color:#3d2f18}
.root-of-day button,.golden-card button{width:auto}
.golden-card{background:linear-gradient(120deg,#fff0b0,#f7c84a);box-shadow:0 0 18px rgba(255,200,60,.45)}
.guardian-frame.duel.golden .duel-boss{filter:sepia(.55) saturate(2.2) brightness(1.15) drop-shadow(0 0 18px #ffd34d)!important}
.daily-toast{position:fixed;bottom:90px;left:50%;transform:translateX(-50%);z-index:1200;background:#3d2f18;color:#ffe9a8;border:2px solid #e6b23a;border-radius:999px;padding:.45rem 1rem;font-weight:800;box-shadow:0 6px 18px rgba(0,0,0,.35)}
.break-card .tame-img{max-height:110px}
.sotw-banner{background:linear-gradient(90deg,#ffe39a,#fff6d6);border:2px solid #e6b23a;border-radius:10px;padding:.4rem .7rem;font-weight:700}
.sotw-help{font-size:.85rem}
.cg-vote{border:2px solid #9a6bd8;background:#f6efff;color:#3b2c63;border-radius:999px;padding:.35rem .8rem;font-weight:700;cursor:pointer}.cg-vote.on{background:#3b2c63;color:#ffe9a8}
.cg-item.sotw .spell-card{box-shadow:0 0 0 4px #e6b23a,0 0 22px rgba(230,178,58,.7)}.cg-item{position:relative}
.sotw-ribbon{position:absolute;top:-10px;left:50%;transform:translateX(-50%);z-index:2;background:#e6b23a;color:#241b35;font-weight:900;font-size:.75rem;border-radius:999px;padding:.15rem .6rem;white-space:nowrap}

.root-of-day button.subtle{background:#3d2f18!important;color:#ffe9a8!important;border:0!important;font-weight:700}
