.sc-root { --u: 1; --m: 1; --fs: max(14px, calc(18px*var(--u))); --fm: max(12px, calc(14px*var(--u))); --ft: max(20px, calc(30px*var(--u))); }
.sc-root [hidden] { display: none !important; }
.sc-root button { font-family: var(--font); }
.sc-root img { -webkit-user-drag: none; }

/* ---------- title */
.sc-title-scr { position: absolute; inset: 0; pointer-events: auto !important; cursor: pointer; overflow: hidden; }
.sc-title-bg { position: absolute; inset: 0; background: url(../assets/title-bg.webp) center / cover no-repeat #1a0605; }
.sc-title-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 25%, transparent 40%, rgba(44,18,15,.45) 100%); }
.sc-logo-drop { position: absolute; left: max(3%, 72px); top: max(13%, 74px); transform-origin: 50% 0; pointer-events: none; }
.sc-logo-drop.enter { animation: sc-drop .6s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes sc-drop { 0% { transform: translateY(-130%) scale(1.5); opacity: 0; } 55% { transform: translateY(4%) scale(.94); opacity: 1; } 80% { transform: scale(1.04); } 100% { transform: none; opacity: 1; } }
.sc-logo-float { animation: sc-float 3.4s ease-in-out infinite; }
@keyframes sc-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.sc-logo-wrap { position: relative; display: inline-block; line-height: 0; filter: drop-shadow(0 6px 10px rgba(0,0,0,.55)); }
.sc-logo { display: block; width: auto; height: auto; max-width: 48vw; max-height: 33.3vh; }
/* code-drawn title logo 合合三國 */
.sc-tlogo { --ls: min(15vh, 8.4vw); display: flex; flex-direction: column; align-items: center; line-height: 1; font-family: var(--font); font-weight: 900; transform: rotate(-4deg); }
.sc-tl-row { display: flex; align-items: center; gap: calc(var(--ls) * .12); }
.sc-tl-big { position: relative; font-size: var(--ls); letter-spacing: .02em; white-space: nowrap; }
.sc-tl-big > span { display: block; white-space: nowrap; }
.sc-tl-big.sc-tl-long { font-size: calc(var(--ls) * .62); letter-spacing: 0; }
.sc-tl-back { color: #7a160c; -webkit-text-stroke: .16em #2a0604; paint-order: stroke fill;
  text-shadow: 0 .03em 0 #2a0604, 0 .06em 0 #2a0604, 0 .09em 0 #1a0302, 0 .12em 0 #1a0302, 0 .2em .18em rgba(0,0,0,.65); }
.sc-tl-front { position: absolute; left: 0; top: 0; color: transparent; background: linear-gradient(180deg, #fffbe0 0%, #ffe07a 38%, #e9a326 52%, #ffd45a 70%, #fff0b0 100%); -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: .025em #fff5c8; }
.sc-tl-seal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .12em; font-size: calc(var(--ls) * .5); padding: .18em .2em; border-radius: .22em; color: #fff3cf;
  background: radial-gradient(circle at 35% 25%, #ff5a40, #c0180e 55%, #6a0806); border: .09em solid #ffcf5a; box-shadow: 0 0 0 .05em #2a0604, 0 .14em 0 #2a0604, 0 .26em .3em rgba(0,0,0,.6), inset 0 0 .25em rgba(0,0,0,.45);
  text-shadow: 0 .05em 0 #2a0604, 0 0 .12em rgba(60,0,0,.8); transform: rotate(6deg) translateY(.08em); }
.sc-tl-seal span { display: block; line-height: 1; }
.sc-tl-sub { margin-top: calc(var(--ls) * .1); padding: .35em 2.2em .5em; font-family: "Trebuchet MS", var(--font); font-weight: 900; font-size: max(12px, calc(var(--ls) * .17)); letter-spacing: .22em; color: var(--gold-hi); white-space: nowrap;
  text-shadow: 0 2px 0 #2a0604, 0 0 3px #2a0604; background: var(--lq-ribbon-bg); border-radius: 999px; box-shadow: var(--lq-ribbon-sh); }
.sc-shine { position: absolute; inset: 0; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat;
  background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.75) 50%, transparent 58%) no-repeat; background-size: 250% 100%; animation: sc-shine 4s ease-in-out infinite; }
@keyframes sc-shine { 0% { background-position: 130% 0; } 55%,100% { background-position: -130% 0; } }
.sc-prompt { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); width: max-content; max-width: 90%; text-align: center; font-size: max(16px, calc(26px*var(--u))); color: var(--gold-hi); pointer-events: none; animation: sc-pulse 1.4s ease-in-out infinite; }
@keyframes sc-pulse { 0%,100% { transform: translateX(-50%) scale(1); opacity: .85; } 50% { transform: translateX(-50%) scale(1.06); opacity: 1; } }
.sc-corner { position: absolute; top: 10px; }
body.in-cutscene .sc-corner, body.in-cutscene .sc-prompt { display: none !important; }
.sc-corner-r { right: 10px; width: 48px; height: 48px; padding: 0; }
.sc-corner-l { left: 72px; height: 48px; padding: 0 12px 0 8px; gap: 6px; }
.sc-glyph { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.sc-glyph svg { width: 26px; height: 26px; filter: drop-shadow(0 2px 0 #2a0805); }
.sc-blabel { font-size: var(--fs); line-height: 1.1; }

/* ---------- modal shell */
.sc-modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: auto !important; z-index: 20; animation: sc-fade .2s both;
  background: radial-gradient(ellipse at center, rgba(52,22,18,.4) 0%, rgba(34,14,12,.78) 100%); }
.sc-modal.out { opacity: 0; transition: opacity .16s; pointer-events: none !important; }
@keyframes sc-fade { from { opacity: 0; } to { opacity: 1; } }
.sc-panel { position: relative; width: min(94vw, calc(760px*var(--m))); max-height: 94vh; overflow: hidden auto; padding: 8px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: lq-pop .28s ease-out both; color: var(--cream); font-family: var(--font); font-weight: 900;
  background: var(--lq-grain), radial-gradient(ellipse at 50% 0, rgba(255,220,170,.1), transparent 60%), var(--lq-fill); scrollbar-width: none; }
.sc-panel::-webkit-scrollbar { display: none; }
.sc-title, .sc-bigtitle { font-size: var(--ft); color: var(--gold-hi); text-align: center; box-sizing: border-box; width: fit-content; max-width: 100%; padding: 6px 44px 10px; margin: -2px auto 2px;
  background: var(--lq-ribbon-bg); border-radius: 999px; box-shadow: var(--lq-ribbon-sh); letter-spacing: 2px; line-height: 1.15; }
.sc-head .sc-title { margin: 0; }
.sc-bigtitle { font-size: max(26px, calc(44px*var(--u))); color: #ffb09a; padding: 8px 56px 12px; }
.sc-sub { font-size: var(--fs); color: var(--gold); text-align: center; }
.sc-note { font-size: var(--fm); color: #e9d3a8; text-align: center; font-weight: 700; }
.sc-small { font-size: var(--fm); }
.sc-head { display: flex; align-items: center; gap: 10px; width: 100%; }
.sc-head .sc-title { flex: 0 1 auto; margin-right: auto; }
.sc-x { min-width: 44px; padding: 0; font-size: 18px; }
.sc-bicon { width: 28px; height: 28px; object-fit: contain; }
.sc-mini, .sc-mini2 { min-height: 44px; padding: 0 10px; font-size: var(--fm); }
.sc-gicon { width: 24px; height: 24px; object-fit: contain; }
.sc-spark { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #ffd86a; box-shadow: 0 0 8px #ffb52e; pointer-events: none; animation: sc-spark .9s ease-out forwards; z-index: 5; }
@keyframes sc-spark { from { transform: translate(0,0) scale(1.2); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.sc-pips { display: inline-flex; gap: 4px; } .sc-pips i { width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c8, var(--gold) 50%, #a86a10); box-shadow: 0 0 5px #ffb52e, 0 0 0 1px #4a2606; }

/* ---------- lobby */
.sc-lobby { position: absolute; inset: 0; box-sizing: border-box; padding-top: 56px; background: radial-gradient(ellipse at center, rgba(0,0,0,.05) 30%, rgba(44,18,15,.8) 100%); display: flex; align-items: center; justify-content: center; }
.sc-topbar { position: absolute; top: 8px; left: 66px; right: 8px; display: flex; gap: 8px; align-items: center; z-index: 2; }
.sc-back { width: 48px; height: 48px; padding: 0; font-size: 18px; }
.sc-chipbar { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 2px 14px; border-radius: 20px; background: linear-gradient(#7c362e, #4c221d); border: 2px solid var(--gold); box-shadow: 0 3px 0 rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,220,140,.35), inset 0 6px 8px rgba(255,255,255,.08); font-size: var(--fs); font-weight: 900; text-shadow: var(--outline); }
.sc-chipbar.sc-gold { margin-left: auto; margin-right: 56px; color: var(--gold-hi); }
.sc-lvl { color: var(--gold-hi); }
.sc-bar { width: max(70px, calc(120px*var(--u))); height: 14px; flex: none; }
.sc-lobby-panel { width: min(88vw, calc(620px*var(--m))); padding: 4px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; max-height: 92%; }
.sc-lobby-panel .sc-title { font-size: max(22px, calc(34px*var(--u))); }
.sc-start { width: min(90%, 360px); min-height: 56px; font-size: max(20px, calc(30px*var(--u))); border-width: 13px 18px; letter-spacing: 3px; }
.sc-start.pulse { animation: sc-pulse2 1.6s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(255,200,90,.7)); }
@keyframes sc-pulse2 { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.sc-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sc-chip { display: flex; align-items: center; gap: 2px; padding: 1px; border-radius: 14px; background: rgba(0,0,0,.4); border: 2px solid rgba(255,220,140,.25); }
.sc-chip.on { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,200,90,.8); background: rgba(120,40,10,.55); }
.sc-chipbtn { min-height: 46px; padding: 0 4px; }
.sc-chipicon { width: 30px; height: 30px; object-fit: contain; }
.sc-count { color: var(--gold-hi); font-size: var(--fs); }
.sc-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; width: 100%; }
.sc-row .sc-menubtn { padding-left: 2px; padding-right: 2px; line-height: 1.1; text-align: center; }
.sc-menubtn { position: relative; flex-direction: column; gap: 2px; min-height: max(64px, calc(78px*var(--u))); border-width: 11px 16px; }
.sc-micon { display: inline-flex; line-height: 0; width: max(26px, calc(34px*var(--u))); height: max(26px, calc(34px*var(--u))); }
.sc-micon svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 0 #2a0805); }
.sc-badge { position: absolute; top: -10px; right: -8px; min-width: 24px; height: 24px; border-radius: 12px; background: radial-gradient(circle at 35% 30%, #ff7a6a, #c8180e); border: 2px solid var(--gold-hi); font-size: 13px; display: flex; align-items: center; justify-content: center; text-shadow: none; box-shadow: 0 0 8px #ff4a3a; animation: sc-pulse2 1.2s infinite; }

/* ---------- talents */
.sc-talents .sc-panel { width: min(96vw, calc(900px*var(--m))); gap: 5px; }
.sc-points { font-size: var(--fs); color: var(--gold-hi); padding: 2px 12px; border-radius: 14px; background: rgba(0,0,0,.45); border: 1px solid var(--gold-dark); }
.sc-cols { display: flex; gap: 8px; width: 100%; }
.sc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 0 4px 4px; border-radius: 10px; overflow: hidden; background: linear-gradient(color-mix(in srgb, var(--bc) 30%, rgba(0,0,0,.5)), rgba(0,0,0,.45)); border: 2px solid var(--bc); box-shadow: inset 0 0 14px color-mix(in srgb, var(--bc) 35%, transparent); position: relative; }
.sc-col::before { content: ""; position: absolute; left: 50%; top: 30px; bottom: 8px; width: 3px; margin-left: -1px; background: linear-gradient(var(--bc), rgba(255,255,255,.15)); opacity: .55; box-shadow: 0 0 6px var(--bc); }
.sc-col > * { position: relative; }
.sc-colname { text-align: center; font-size: var(--fs); color: #fff6dc; line-height: 1.1; margin: 0 -4px; padding: 3px 0; background: linear-gradient(var(--bc), color-mix(in srgb, var(--bc) 55%, #000)); border-bottom: 2px solid rgba(0,0,0,.5); }
.sc-node { flex-direction: column; align-items: stretch; justify-content: center; gap: 0; min-height: 46px; padding: 0 4px; border-width: 7px 12px; text-align: left; }
.sc-node-top { display: flex; justify-content: space-between; gap: 4px; }
.sc-node-name { font-size: max(14px, calc(16px*var(--u))); }
.sc-node-rank { font-size: var(--fm); color: var(--gold-hi); white-space: nowrap; padding: 0 6px; border-radius: 8px; background: rgba(0,0,0,.5); }
.sc-node-desc { font-size: var(--fm); font-weight: 700; line-height: 1.1; color: #fbe9c4; text-shadow: 0 1px 0 #2a0805; }
.sc-node-desc.sc-node-next { color: #9fe39a; }
.sc-node.locked { filter: grayscale(.7) brightness(.6); }
.sc-node.can { filter: drop-shadow(0 0 8px var(--gold)); animation: sc-pulse2 1.6s infinite; }
.sc-node.maxed { filter: drop-shadow(0 0 6px #8ff0b0); }
.sc-node.maxed .sc-node-rank { color: #8ff0b0; }

/* ---------- armory */
.sc-armory .sc-panel { width: min(96vw, calc(860px*var(--m))); }
.sc-armbody { display: flex; gap: 10px; width: 100%; min-height: 0; }
.sc-armleft { flex: 0 0 40%; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.sc-armright { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; max-height: calc(94vh - 130px); overflow-y: auto; scrollbar-width: none; }
.sc-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
.sc-slot { min-height: 54px; padding: 0; font-size: var(--fm); border-width: 8px; border-radius: 50%; background: radial-gradient(circle, #1a0503 55%, transparent 70%); box-shadow: inset 0 0 12px #000; }
.sc-slot.full { box-shadow: inset 0 0 12px var(--rc), 0 0 8px var(--rc); }
.sc-slot img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 4px var(--rc)); }
.sc-skins { display: flex; gap: 6px; width: 100%; }
.sc-skin { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 10px; padding: 2px; }
.sc-skin.cur { background: rgba(255,200,90,.22); box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(255,200,90,.6); }
.sc-skin.lock .sc-skinbtn { filter: grayscale(.6) brightness(.7); }
.sc-skinbtn { flex-direction: column; width: 100%; min-height: 62px; padding: 0 2px; gap: 2px; }
.sc-skin-icon { width: 34px; height: 34px; object-fit: contain; }
.sc-skin-def { font-size: 22px; }
.sc-skin-name { font-size: 12px; }
.sc-skin-state { font-size: 12px; color: #8ff0b0; text-shadow: var(--outline); }
.sc-relgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.sc-relbtn { position: relative; padding: 0; text-align: left; justify-content: flex-start; min-height: 56px; }
.sc-relbtn.worn { filter: brightness(.8); }
.sc-worn { position: absolute; top: -2px; right: 0; font-size: 12px; color: #8ff0b0; }
.sc-relic { display: flex; align-items: center; gap: 6px; text-align: left; padding: 2px 4px; border-radius: 8px; }
.sc-relic.glow { background: rgba(0,0,0,.45); border: 2px solid var(--rc); box-shadow: 0 0 12px var(--rc); animation: lq-pop .4s ease-out both; }
.sc-relic-icon { width: 38px; height: 38px; object-fit: contain; flex: none; filter: drop-shadow(0 0 5px var(--rc)); }
.sc-relic-name { font-size: var(--fm); text-shadow: var(--outline); }
.sc-relic-desc { font-size: 12px; font-weight: 700; color: #fbe9c4; line-height: 1.15; text-shadow: 0 1px 0 #2a0805; }
.sc-empty { margin: auto; padding: 20px 6px; font-size: var(--fs); text-align: center; color: #e9d3a8; }

/* ---------- battle HUD */
.sc-hud { position: absolute; inset: 0; pointer-events: none !important; }
.sc-hud > * { pointer-events: none; }
.sc-hudplate { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); min-width: min(56vw, 400px); padding: 5px 16px 8px; border-radius: 16px;
  background: var(--lq-grain), linear-gradient(rgba(132,56,47,.94), rgba(74,32,28,.94)); border: 2px solid rgba(230,194,126,.85); border-radius: 18px; box-shadow: 0 4px 10px rgba(30,12,10,.4), inset 0 2px 0 rgba(255,230,180,.18); }
.sc-hudrow { display: flex; justify-content: space-between; align-items: center; gap: 14px; font-size: max(16px, calc(22px*var(--u))); }
.sc-hwave { color: var(--gold-hi); white-space: nowrap; }
.sc-henemy, .sc-hhp { display: inline-flex; align-items: center; gap: 4px; }
.sc-henemy img { width: 24px; height: 24px; object-fit: contain; }
.sc-heart { color: #ff5a4a; font-style: normal; text-shadow: var(--outline); }
.sc-hudrow b { font-weight: 900; text-shadow: var(--outline); }
.sc-timebar { height: 12px; margin-top: 3px; padding: 2px; border-radius: 7px; }
.sc-timebar::before { inset: 2px; }
.sc-timebar i { width: 100%; }
.sc-timebar.low i { background: linear-gradient(#ffb0a0, #e0302a 45%, #8a0e0a); animation: sc-blink .6s infinite alternate; }
@keyframes sc-blink { to { filter: brightness(1.5); } }
.sc-boss { position: absolute; top: calc(8px + max(66px, calc(74px*var(--u)))); left: 50%; transform: translateX(-50%); width: min(50vw, 520px); text-align: center; } /* narrow enough to clear the 主公 on the left terrace */
.sc-bossname { display: block; width: fit-content; margin: 0 auto -4px; padding: 3px 34px 7px; font-size: max(14px, calc(18px*var(--u))); color: #ffe08a; background: var(--lq-ribbon-bg); border-radius: 999px; box-shadow: var(--lq-ribbon-sh); position: relative; z-index: 2; white-space: nowrap; max-width: 100%; box-sizing: border-box; }
.sc-bossbar { height: 20px; border-radius: 10px; padding: 4px; }
.sc-bossbar::before { inset: 4px; }
.sc-bossbar i { width: 100%; transition: width .15s; }
.sc-bhint { position: absolute; left: 0; right: 0; margin: 0 auto; top: 31%; width: fit-content; max-width: min(60vw, 560px); padding: 8px 16px; border-radius: 14px; background: rgba(70,30,26,.92); border: 2px solid var(--gold); font-size: var(--fm); color: var(--cream); text-align: center; pointer-events: none !important; animation: sc-slide .3s ease-out both; }
@keyframes sc-glow { from { box-shadow: 0 0 8px #ffb52e; } to { box-shadow: 0 0 26px #ffd86a; } }
@keyframes sc-hit { 0% { transform: scale(.86); } 100% { transform: scale(1); } }


/* game speed button: left of the platform pause button */
.sc-hud > .sc-speed { position: absolute; right: 62px; top: 10px; width: 56px; height: 44px; min-width: 52px; padding: 0; gap: 3px; pointer-events: auto !important; touch-action: none; border-width: 8px 12px; z-index: 45; cursor: pointer; }
.sc-splabel { font-size: 20px; line-height: 1; letter-spacing: 0; }
.sc-spico { display: inline-flex; line-height: 0; width: 14px; }
.sc-spico svg { width: 100%; height: 12px; }
.sc-speed.fast { border-color: #f6e6c0 !important; background: linear-gradient(180deg, #f0d697, #d8ad62 55%, #bb8c46); color: #fffaf0; filter: drop-shadow(0 0 6px rgba(240,190,100,.65)); }
.sc-speed.x3 { filter: drop-shadow(0 0 9px rgba(255,110,30,.95)) hue-rotate(-12deg); }
.sc-speed.sq { animation: sc-hit .16s ease-out; }
.sc-spkey { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 1px; font-size: 12px; padding: 0 6px; border-radius: 6px; background: rgba(70,30,26,.85); border: 1px solid var(--gold); line-height: 14px; }
.sc-speed.touch .sc-spkey { display: none; }

/* ---------- banners, toasts, wave plate, subtitle */
.sc-toasts { position: absolute; top: 70px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none !important; z-index: 30; }
.sc-toast { padding: 6px 18px; border-radius: 16px; background: linear-gradient(rgba(126,54,45,.95), rgba(76,33,28,.95)); border: 1.5px solid rgba(230,194,126,.85); border-radius: 999px; box-shadow: 0 3px 10px rgba(30,12,10,.4), inset 0 1px 0 rgba(255,230,180,.2); font-size: var(--fs); animation: sc-slide .25s ease-out both; max-width: 80vw; text-align: center; }
.sc-toast.out { opacity: 0; transition: opacity .3s; }
@keyframes sc-slide { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
.sc-banner, .sc-burst { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-size: max(28px, calc(60px*var(--u))); color: var(--gold-hi); pointer-events: none !important; opacity: 0; z-index: 25; letter-spacing: 2px; text-shadow: var(--outline), 0 0 24px rgba(255,180,60,.7); }
.sc-banner.boss { color: #ff6a50; text-shadow: var(--outline), 0 0 26px rgba(255,40,20,.8); }
.sc-burst { top: 20%; font-size: max(30px, calc(72px*var(--u))); color: #ffd36a; }
.sc-banner.go, .sc-burst.go { animation: sc-slam 1.6s both; }
@keyframes sc-slam { 0% { transform: scale(3); opacity: 0; } 15% { transform: scale(.92); opacity: 1; } 25% { transform: scale(1.05); } 32% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
.sc-waveplate { position: absolute; top: 8vh; left: 50%; transform: translateX(-50%); min-width: min(70vw, 440px); padding: 10px 18px 12px; border-radius: 16px; text-align: center; background: var(--lq-grain), linear-gradient(rgba(132,56,47,.95), rgba(74,32,28,.95)); border: 2px solid rgba(230,194,126,.85); border-radius: 20px; box-shadow: 0 5px 14px rgba(30,12,10,.45), 0 0 20px rgba(230,190,110,.3), inset 0 2px 0 rgba(255,230,180,.18); z-index: 24; pointer-events: none !important; }
.sc-waveplate.lost { border-color: #e9846c; box-shadow: 0 5px 14px rgba(30,12,10,.45), 0 0 20px rgba(230,100,80,.4); }
.sc-waveplate.go { animation: sc-wave 1.6s both; }
@keyframes sc-wave { 0% { transform: translate(-50%, -140%); } 14% { transform: translate(-50%, 6%); } 22% { transform: translate(-50%, 0); } 88% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, -30%); opacity: 0; } }
.sc-wtitle { font-size: max(18px, calc(26px*var(--u))); color: var(--gold-hi); }
.sc-waveplate.lost .sc-wtitle { color: #ff8a70; }
.sc-wlines { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; align-items: center; font-size: max(14px, calc(16px*var(--u))); }
.sc-wtotal { display: inline-flex; align-items: center; gap: 4px; color: var(--gold-hi); font-size: max(16px, calc(20px*var(--u))); }
.sc-wtotal img { width: 22px; height: 22px; }
.sc-subtitle { position: absolute; left: 50%; top: 72%; transform: translateX(-50%); max-width: 80vw; padding: 6px 18px; border-radius: 14px; background: rgba(58,24,20,.7); font-size: var(--fs); text-align: center; pointer-events: none !important; z-index: 22; }
.sc-online { position: absolute; top: 90px; left: 8px; min-width: 120px; max-width: 220px; padding: 4px 10px; border-radius: 14px; background: linear-gradient(rgba(118,50,42,.92), rgba(70,30,26,.92)); border: 1.5px solid rgba(230,194,126,.8); box-shadow: 0 3px 0 rgba(0,0,0,.5); pointer-events: none !important; z-index: 12; font-size: var(--fm); }
.sc-onl-title { color: var(--gold); font-size: var(--fm); }
.sc-onl-row { display: flex; gap: 6px; font-weight: 700; align-items: center; }
.sc-onl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-onl-hp { color: #ff8a70; }

/* ---------- loot */
.sc-loot .sc-panel { width: min(94vw, calc(760px*var(--m))); padding-bottom: 16px; }
.sc-lootrow { display: flex; gap: 6px; width: 100%; justify-content: center; }
.sc-lootcard { flex: 1; max-width: 260px; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px; padding: 6px 2px; min-height: max(170px, calc(230px*var(--u))); border-width: 12px 14px; animation: lq-pop .35s ease-out both; text-align: center; }
.sc-lootframe { display: flex; align-items: center; justify-content: center; width: max(72px, calc(108px*var(--u))); height: max(72px, calc(108px*var(--u))); border-radius: 14px; background: radial-gradient(circle, rgba(255,230,160,.25), rgba(44,18,15,.7)); }
.sc-lootimg { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
.sc-lootname { font-size: var(--fs); color: var(--gold-hi); }
.sc-lootdesc { font-size: var(--fm); font-weight: 700; color: #fbe9c4; line-height: 1.2; text-shadow: 0 1px 0 #2a0805; }

/* ---------- 可掉落套裝預覽 (boss loot + run end) */
.sp-box { width: 100%; display: flex; flex-direction: column; gap: 4px; margin-top: 4px; padding: 6px 8px 8px; box-sizing: border-box; border-radius: 12px; background: rgba(44,18,15,.55); border: 1px solid var(--gold-dark); }
.sp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sp-title { font-size: max(16px, calc(20px*var(--u))); color: var(--gold-hi); }
.sp-note { font-size: max(12px, calc(14px*var(--u))); font-weight: 700; color: #e9d6ae; text-shadow: 0 1px 0 #2a0805; }
.sp-odds { flex-basis: 100%; font-size: max(12px, calc(13px*var(--u))); font-weight: 800; color: #ffd98a; text-shadow: 0 1px 0 #2a0805; }
.sp-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; max-height: max(150px, 30vh); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--gold-dark) transparent; touch-action: pan-y; }
.sp-row { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 4px 8px; min-height: 48px; text-align: left; border-radius: 10px; background: linear-gradient(rgba(118,50,42,.88), rgba(70,30,26,.92)); border: 2px solid color-mix(in srgb, var(--sc) 55%, #6a3a2a); box-shadow: 0 2px 0 rgba(0,0,0,.45); cursor: pointer; color: #fff4d8; font: inherit; }
.sp-row:hover, .sp-row:focus-visible, .sp-row.nav-focus { border-color: var(--sc); filter: brightness(1.15); outline: none; }
.sp-row.open { grid-column: 1 / -1; border-color: var(--sc); }
.sp-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sp-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 6px var(--sc); }
.sp-name { flex: 1 1 auto; min-width: 0; font-size: max(14px, calc(17px*var(--u))); color: var(--sc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-n { flex: none; font-size: 13px; font-weight: 900; color: #fff4d8; font-variant-numeric: tabular-nums; }
.sp-rar { flex: none; font-size: 11px; font-weight: 900; padding: 0 5px; border-radius: 6px; border: 1px solid currentColor; white-space: nowrap; }
.sp-rar.r-rare { color: #7ec8ff; } .sp-rar.r-epic { color: #d59bff; } .sp-rar.r-legend { color: #ffb347; }
.sp-tag { flex: none; font-style: normal; font-size: 11px; font-weight: 900; padding: 1px 6px; border-radius: 8px; background: #2f6b3a; color: #e6ffe9; white-space: nowrap; }
.sp-tag.draw { background: #6b4a12; color: #ffe9b8; }
.sp-icons { display: flex; gap: 3px; flex-wrap: nowrap; }
.sp-ic { width: max(26px, calc(32px*var(--u))); height: max(26px, calc(32px*var(--u))); object-fit: contain; border-radius: 6px; background: rgba(0,0,0,.4); filter: grayscale(1) brightness(.55); opacity: .7; }
.sp-ic.own { filter: drop-shadow(0 0 4px var(--sc)); opacity: 1; background: rgba(255,220,140,.18); }
.sp-det { display: flex; flex-wrap: wrap; gap: 4px 8px; padding-top: 4px; border-top: 1px solid rgba(255,220,140,.2); }
.sp-det[hidden] { display: none; }
.sp-piece { display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 160px; font-size: 13px; color: #9a8a78; }
.sp-piece b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-piece.own { color: #fff4d8; }
.sp-pic { flex: none; width: 28px; height: 28px; object-fit: contain; filter: grayscale(1) brightness(.55); }
.sp-piece.own .sp-pic { filter: drop-shadow(0 0 3px var(--sc)); }
.sp-pslot { flex: none; font-size: 11px; font-weight: 900; padding: 0 5px; border-radius: 6px; background: rgba(0,0,0,.45); color: #e9d6ae; }
.sp-bonus { flex: 1 1 100%; font-size: 13px; font-weight: 800; color: #8ff0b0; text-shadow: 0 1px 0 #10260f; }
.sp-alt { flex: 1 1 100%; font-size: 12px; font-weight: 700; color: #ffd98a; }

/* ---------- game over / run end */
.sc-over .sc-panel, .sc-end .sc-panel { width: min(92vw, calc(680px*var(--m))); padding-bottom: 14px; gap: 6px; }
.sc-hold { display: flex; align-items: center; gap: 12px; font-size: var(--fs); }
.sc-holditem { display: inline-flex; align-items: center; gap: 4px; padding: 2px 12px 2px 4px; border-radius: 16px; background: rgba(0,0,0,.5); border: 1px solid var(--gold-dark); }
.sc-holditem img { width: 28px; height: 28px; object-fit: contain; }
.sc-options { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sc-opt { min-width: 150px; min-height: 56px; padding: 0 6px; }
.sc-optcol { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.sc-optcol small { font-size: 12px; color: var(--gold-hi); }
.sc-over .sc-end { min-width: 160px; }
.sc-revmsg { font-size: max(18px, calc(26px*var(--u))); color: #8ff0b0; text-align: center; padding: 16px 0; animation: lq-pop .3s both; }
.sc-endbanner { font-size: max(24px, calc(40px*var(--u))); color: var(--gold-hi); text-align: center; animation: sc-slam2 .6s both; box-sizing: border-box; max-width: 100%; padding: 8px 56px 12px; background: var(--lq-ribbon-bg); border-radius: 999px; box-shadow: var(--lq-ribbon-sh); }
.sc-end.won .sc-endbanner { color: #ffd36a; text-shadow: var(--outline), 0 0 18px #ffb52e; }
@keyframes sc-slam2 { 0% { transform: scale(2.6); opacity: 0; } 60% { transform: scale(.95); opacity: 1; } 100% { transform: scale(1); } }
.sc-scorerow { display: flex; align-items: baseline; gap: 10px; font-size: var(--fs); padding: 2px 22px; border-radius: 12px; background: rgba(0,0,0,.45); border: 1px solid var(--gold-dark); }
.sc-score { font-size: max(24px, calc(38px*var(--u))); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.sc-rewards { display: flex; flex-direction: column; align-items: center; gap: 4px; max-height: 34vh; overflow-y: auto; width: 100%; scrollbar-width: none; }
.sc-rw { display: flex; align-items: center; gap: 6px; font-size: var(--fs); animation: sc-slide .3s both; }
.sc-rw.small { font-size: var(--fm); color: #8ff0b0; }
.sc-rw.lvup { color: #8ff0b0; font-size: max(18px, calc(24px*var(--u))); }
.sc-endrelics { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sc-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sc-cont { min-width: 160px; min-height: 54px; font-size: max(18px, calc(22px*var(--u))); }

/* ---------- help */
.sc-help .sc-panel { width: min(94vw, calc(820px*var(--m))); }
.sc-helplist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; width: 100%; max-height: calc(94vh - 120px); overflow-y: auto; scrollbar-width: none; }
.sc-helpitem { display: flex; gap: 8px; align-items: flex-start; padding: 5px; border-radius: 10px; background: rgba(0,0,0,.32); border: 1px solid rgba(255,220,140,.2); }
.sc-helpimg { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; border: 2px solid var(--gold); }
.sc-helpt { font-size: var(--fs); color: var(--gold-hi); }
.sc-helpd { font-size: var(--fm); font-weight: 700; line-height: 1.25; color: #fbe9c4; text-shadow: 0 1px 0 #2a0805; }
/* short landscape screens (phones held sideways, the handheld console view) */
@media (max-height: 520px) {
  .sc-lobby { padding-top: 54px; padding-bottom: 4px; }
  .sc-lobby-panel { gap: 4px; padding: 0 8px 6px; max-height: calc(100% - 4px); width: min(96vw, 820px); }
  .sc-chip .lq-btn { font-size: 14px; }
  .sc-chipicon { width: 24px; height: 24px; }
  .sc-row { gap: 6px; }
  .sc-menubtn { height: 52px; max-height: 52px; font-size: 13px; border-width: 9px 10px; }
  .sc-lobby-panel .sc-title { font-size: 20px; padding-top: 3px; padding-bottom: 5px; margin-bottom: 0; }
  .sc-start { min-height: 46px; font-size: 20px; }
  .sc-chips { flex-wrap: nowrap; }
  .sc-chipbtn { min-height: 44px; }
  .sc-menubtn { min-height: 48px; flex-direction: row; gap: 6px; border-width: 9px 14px; }
  .sc-micon { width: 24px; height: 24px; }
  .sc-chipbar { min-height: 36px; }
  .sc-lootcard { min-height: 130px; border-width: 9px 10px; gap: 2px; }
  .sc-lootframe { width: 52px; height: 52px; }
  .sp-box { padding: 4px 6px 6px; }
  .sp-list { max-height: 34vh; }
  .sp-row { padding: 3px 6px; }
  .sp-ic { width: 24px; height: 24px; }
}
/* phones held sideways: the lobby's six buttons must fit, so drop the medallions' secondary lines */
@media (max-height: 420px) {
  .sc-lobby .sc-dlock, .sc-lobby .sc-dstats { display: none; }
  .sc-lobby-panel .sc-title { font-size: 18px; padding-top: 2px; padding-bottom: 3px; }
  .sc-lobby .sc-start { min-height: 44px; font-size: 18px; border-width: 10px 16px; }
  .sc-lobby .sc-menubtn { height: 46px; min-height: 46px; max-height: 46px; }
  /* boss loot: keep the three picks short so the first sets of the preview show without scrolling */
  .sc-loot .sc-panel { gap: 3px; padding-top: 2px; }
  .sc-loot .sc-title { font-size: 18px; padding-top: 2px; padding-bottom: 3px; margin-bottom: 0; }
  .sc-lootnote { font-size: 11px; line-height: 1.15; }
  .sc-lootcard { min-height: 104px; padding: 2px; }
  .sc-lootframe { width: 42px; height: 42px; }
  .sc-lootdesc { font-size: 12px; }
  .sp-title { font-size: 15px; }
  .sp-note { font-size: 11px; }
}
@media (max-aspect-ratio: 1/1) { .sc-helplist { grid-template-columns: 1fr; } .sc-cols { flex-direction: column; } .sc-armbody { flex-direction: column; } .sc-armleft { flex-basis: auto; width: 100%; } }
