/* ==========================================================================
   TikTok Live Pet — stage, creature rig, HUD
   ========================================================================== */

:root {
    --ink: #f4ecff;
    --ink-dim: rgba(244, 236, 255, .68);
    --panel: rgba(28, 16, 52, .55);
    --panel-strong: rgba(24, 12, 46, .82);
    --stroke: rgba(255, 255, 255, .14);
    --gold: #ffd166;
    --rose: #ff6b9d;
    --cyan: #7ef0ff;
    --violet: #a78bfa;
    --good: #59e39b;
    --warn: #ffbf4d;
    --danger: #ff5d73;
    --font: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    --dock-space: 0px;
}

* { box-sizing: border-box; }

html {
    margin: 0;
    height: 100%;
    overflow: hidden;
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

/* The page background lives on <body> only: when body is transparent the
   canvas stays transparent too, which is what OBS browser sources need. */
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #0b0618;
}

body.transparent-bg { background: transparent; }

body.has-dock { --dock-space: min(25vh, 220px); }

#app { position: fixed; inset: 0; }

.stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    contain: layout paint;
}

/* ---------------------------------------------------------------- backdrop */
.backdrop { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 8%, #2b1352 0%, #1a0d3a 45%, #0a0518 100%); }

.bg-transparent .backdrop { display: none; }

.bg-dark .backdrop { filter: saturate(.35) brightness(.6); }

.aurora {
    position: absolute;
    width: 60vw; height: 60vw;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    mix-blend-mode: screen;
    animation: drift 26s ease-in-out infinite alternate;
}

.aurora-a { top: -18vw; left: -12vw; background: radial-gradient(circle, #ff4fa3 0%, transparent 62%); }

.aurora-b { top: 4vh; right: -16vw; background: radial-gradient(circle, #2ad3ff 0%, transparent 62%); animation-duration: 31s; animation-direction: alternate-reverse; }

.aurora-c { bottom: -22vw; left: 26vw; background: radial-gradient(circle, #8a5cff 0%, transparent 60%); animation-duration: 38s; }

@keyframes drift {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
    100% { transform: translate3d(-3vw, -2vh, 0) scale(.95); }
}

.stars {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(1.6px 1.6px at 12% 22%, rgba(255,255,255,.9) 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 32% 68%, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(1.8px 1.8px at 58% 18%, rgba(255,255,255,.85) 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 74% 54%, rgba(255,255,255,.6) 50%, transparent 51%),
        radial-gradient(1.6px 1.6px at 88% 30%, rgba(255,255,255,.8) 50%, transparent 51%),
        radial-gradient(1.1px 1.1px at 22% 84%, rgba(255,255,255,.5) 50%, transparent 51%),
        radial-gradient(1.4px 1.4px at 46% 42%, rgba(255,255,255,.6) 50%, transparent 51%),
        radial-gradient(1.1px 1.1px at 66% 78%, rgba(255,255,255,.45) 50%, transparent 51%);
    animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }

.horizon {
    position: absolute; left: 50%; bottom: 0; width: 150vw; height: 42vh;
    transform: translateX(-50%);
    background:
        radial-gradient(60% 100% at 50% 100%, rgba(255, 122, 189, .28), transparent 70%),
        radial-gradient(40% 80% at 50% 100%, rgba(126, 240, 255, .22), transparent 72%);
    pointer-events: none;
}

.horizon::after {
    content: "";
    position: absolute; inset: auto 0 0 0; height: 26vh;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 1px, transparent 1px 84px),
        repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 44px);
    transform: perspective(280px) rotateX(62deg);
    transform-origin: bottom center;
    mask-image: linear-gradient(to top, #000 0%, transparent 78%);
    opacity: .5;
}

.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

/* ------------------------------------------------------------------- arena */
.arena {
    position: absolute; inset: 0;
    display: flex; align-items: flex-end; justify-content: center; gap: 2vw;
    padding-bottom: calc(4vh + var(--dock-space));
    z-index: 2;
}

.actor-lane { display: flex; align-items: flex-end; justify-content: center; gap: 1.2vw; height: 100%; padding-bottom: 6vh; }

/* Wrapping row: every rival keeps its own box, so plates can never cross into
   the neighbour's slot no matter how many pets join the arena. */
.rival-lane {
    position: absolute; top: calc(11vh + var(--dock-space) * .35); right: 3vw; height: auto;
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end;
    gap: 2vh 1.4vw; max-width: 46vw;
    opacity: 0; transform: translateX(5vw);
    transition: opacity .45s ease, transform .45s ease;
}

.arena.is-arena .rival-lane { opacity: 1; transform: none; }

.arena.is-arena .self-lane .actor { transform: translateX(-10vw); }

.self-lane { z-index: 1; }

.actor {
    --pet-size: calc(var(--actor-scale, 1) * var(--pet-scale, 1));
    --pet-width: calc(clamp(104px, 19vh, 240px) * var(--pet-size, 1));
    /* The head cluster is shrunk around the collar in petArt.js, so the hair
       is now ~56% of the svg box; the hp bar stays capped just past the dress,
       never as wide as the hair cloud. */
    --pet-body: calc(var(--pet-width) * .5);
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    transform-origin: bottom center;
    transition: opacity .4s ease;
}

.actor.leaving { opacity: 0; transform: scale(.6); }

.arena.is-arena .self-lane .actor.leaving { transform: translateX(-10vw) scale(.6); }

.actor.pop .actor-stage { animation: actor-pop .5s cubic-bezier(.2, 1.6, .3, 1); }

@keyframes actor-pop { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }

/* The cat's ears reach almost to the top edge of the svg box, so the stage is
   pulled up only a little; beyond ~4% of the pet width the name plate starts
   to clip the ear tips. */
.actor-stage { position: relative; margin-top: calc(-0.03 * var(--pet-width)); }

.actor-rival .actor-stage { filter: saturate(.92); }

.actor-plate { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; z-index: 4; width: 100%; margin-bottom: 2px; }

.actor-name {
    font-size: clamp(11px, 1.35vh, 18px); font-weight: 700; letter-spacing: .02em;
    padding: 4px 12px; border-radius: 999px;
    background: var(--panel-strong); border: 1px solid var(--stroke);
    box-shadow: 0 6px 18px rgba(6, 2, 18, .5);
    white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}

.actor-rival .actor-name { background: rgba(58, 14, 34, .78); }

.actor-hp { position: relative; width: min(var(--pet-body), 200px); height: clamp(11px, 1.65vh, 18px); border-radius: 999px; background: rgba(8, 4, 20, .7); border: 1px solid var(--stroke); box-shadow: inset 0 1px 3px rgba(0,0,0,.6); }

.actor-rival .actor-hp { height: clamp(10px, 1.5vh, 16px); }

.actor-rival .actor-hp span { font-size: clamp(7px, .95vh, 10px); }

.actor-hp i { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: linear-gradient(90deg, #59e39b, #b8ff6b); transition: width .35s cubic-bezier(.2, .9, .2, 1); }

.actor-hp[data-state="warn"] i { background: linear-gradient(90deg, #ffbf4d, #ffe08a); }

.actor-hp[data-state="danger"] i { background: linear-gradient(90deg, #ff4d6d, #ff9d6b); animation: hp-alarm 1s ease-in-out infinite; }

@keyframes hp-alarm { 50% { filter: brightness(1.35); } }

/* Scales with the viewport like the pet box does, so the label keeps its
   proportion at any preview size. Not clipped by the track either: a narrow bar
   must never cut digits off, so an over-long label spills symmetrically. */
.actor-hp span { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 4px; font-size: clamp(8px, 1.15vh, 12px); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.85), 0 0 4px rgba(6, 2, 18, .8); }

.actor-bubble {
    position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
    padding: 8px 14px; border-radius: 16px 16px 16px 6px;
    background: #fff; color: #23133c; font-weight: 700; font-size: clamp(12px, 1.6vh, 19px);
    box-shadow: 0 10px 26px rgba(6, 2, 18, .45);
    white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis;
}

.actor-bubble.show { animation: bubble-in .32s cubic-bezier(.2, 1.5, .3, 1); }

@keyframes bubble-in { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.8); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

/* ------------------------------------------------------------- creature rig */
/* Sized so a pet never covers the stage: the arena lanes rely on this box. */
.pet { width: var(--pet-width); }

.pet-svg { display: block; width: 100%; height: auto; overflow: visible; }

.pet-svg g, .pet-svg path, .pet-svg ellipse, .pet-svg circle, .pet-svg text { transform-box: fill-box; }

.ink-soft { paint-order: stroke fill; stroke: var(--line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: .9; }

.pet-tears .tear { fill: #9fe4ff; opacity: 0; }

.pet-crown { opacity: 0; transform: translateY(-26px) scale(.6); transform-origin: 50% 100%; transition: opacity .3s ease, transform .45s cubic-bezier(.2, 1.6, .3, 1); }

.pet-shield { opacity: 0; transform-origin: 50% 50%; transition: opacity .25s ease; }

.pet-zzz { fill: #cfe4ff; font-weight: 800; opacity: 0; }

/* Lucky coins ride behind the paw during 招财; they are drawn but dormant. */
.pet-coins { opacity: 0; }

.pet-coins .coin { transform-origin: center; }

.pet-aura .aura-ring { opacity: 0; transition: opacity .4s ease; transform-origin: center; }

.pet-aura .aura-spin { transform-origin: center; }

.pet[data-action="dance"] .pet-aura .aura-ring { opacity: .55; }

.pet[data-action="laugh"] .tear { animation: tear 1.1s ease-in infinite; }

@keyframes tear { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: .95; } 100% { opacity: 0; transform: translateY(38px); } }

.pet[data-action="sleep"] .pet-zzz { animation: zzz 1.8s ease-out infinite; }

@keyframes zzz { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 35% { opacity: 1; } 100% { opacity: 0; transform: translate(16px, -34px) scale(1.15); } }

.pet[data-action="celebrate"] .pet-crown { opacity: 1; transform: translateY(0) scale(1); }

.pet[data-action="celebrate"] .pet-aura .aura-ring { opacity: .9; animation: aura-pulse 1.1s ease-in-out infinite; }

.pet[data-action="celebrate"] .pet-aura .aura-spin { opacity: 1; animation: aura-spin 2.4s linear infinite; }

@keyframes aura-pulse { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }

@keyframes aura-spin { to { transform: rotate(360deg); } }

.pet[data-action="maneki"] .pet-coins { animation: coins-show 2.8s ease-in-out both; }

.pet[data-action="maneki"] .coin-a { animation: coin-bob 1.4s ease-in-out infinite; }

.pet[data-action="maneki"] .coin-b { animation: coin-bob 1.4s ease-in-out .42s infinite; }

.pet[data-action="maneki"] .pet-aura .aura-ring { opacity: .4; }

@keyframes coins-show { 0% { opacity: 0; transform: translateY(6px); } 22% { opacity: 1; transform: translateY(0); } 78% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-8px); } }

@keyframes coin-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-7px) rotate(6deg); } }

/* action: 护盾 */
.pet[data-action="shield"] .pet-shield { opacity: 1; animation: shield-pulse .9s ease-in-out infinite; }

@keyframes shield-pulse { 0%, 100% { transform: scale(.96); opacity: .8; } 50% { transform: scale(1.03); opacity: 1; } }

/* ---------------------------------------------------------------- img rig */
/* 姿势帧画在 <canvas class="rig-canvas"> 上，由 src/render/canvasPet.js 驱动；
   帧轨道、身体运动、动作窗只有一份，在 src/render/timeline.js。
   pet.css 在这里只剩"盒子怎么排"，不再参与动作节奏——这是本轮重做的核心：
   以前帧由 JS 切、整只位移由 CSS 关键帧算，两条时间轴各走各的，才会出现
   "鞠躬点两次头""躺好的照片又被压扁""循环没播完就被切回去"。
   84.6% = (240/232) ÷ (560/640)：帧盒与原 240×232 的 SVG 盒在相同 --pet-width
   下等高，布局（名牌/血条/竞技场车道）保持不变。 */
.pet-img .pet-rig {
    position: relative;
    width: 84.6%;
    margin: 0 auto;
    aspect-ratio: 560 / 640;
}

/* 画布比帧框四周各外扩一圈：动作会平移（重击 +21%、群攻 17%）、也会翻转
   （击倒 82° 外接框有 707×643），画布按帧框裁的话，扑出去的前爪和倒下的身体会被切边。
   多出来的 25% / 16% / 24% 就是给这些位移用的安全带；帧仍按 560×640 画在中间。
   （透明度之外没有可见像素，所以放大画布不影响布局与相邻元素。） */
.pet-img .rig-canvas {
    position: absolute;
    left: -25%;
    top: -16%;
    display: block;
    width: 150%;
    height: 140%;
}

.pet-img .rig-overlay { position: absolute; inset: 0; pointer-events: none; }

/* stage effects */
.stage.shaking { animation: shake .42s ease-in-out; }

@keyframes shake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    15% { transform: translate3d(calc(var(--shake, 1) * -9px), calc(var(--shake, 1) * 4px), 0) rotate(calc(var(--shake, 1) * -.4deg)); }
    35% { transform: translate3d(calc(var(--shake, 1) * 8px), calc(var(--shake, 1) * -3px), 0) rotate(calc(var(--shake, 1) * .35deg)); }
    55% { transform: translate3d(calc(var(--shake, 1) * -6px), calc(var(--shake, 1) * 2px), 0); }
    75% { transform: translate3d(calc(var(--shake, 1) * 4px), 0, 0); }
}

.flash-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: .9; transition: opacity .24s ease; }

.flash-layer.out { opacity: 0; }

/* --------------------------------------------------------------------- HUD */
.hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }

.no-chrome .hud { display: none; }

.hud-top { position: absolute; top: max(2vh, 16px); left: max(2vw, 16px); right: max(2vw, 16px); display: flex; align-items: flex-start; gap: 12px; }

.chip {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 15px; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--stroke);
    backdrop-filter: blur(12px) saturate(140%);
    box-shadow: 0 10px 28px rgba(6, 2, 18, .42);
    font-size: clamp(12px, 1.5vh, 17px);
}

.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: #7c6a95; box-shadow: 0 0 0 0 rgba(0,0,0,0); }

.chip .dot[data-kind="live"] { background: var(--good); animation: dot-pulse 1.8s ease-out infinite; }

.chip .dot[data-kind="connecting"] { background: var(--warn); animation: dot-pulse 1.1s ease-out infinite; }

.chip .dot[data-kind="error"] { background: var(--danger); }

.chip .dot[data-kind="demo"] { background: var(--cyan); animation: dot-pulse 2.4s ease-out infinite; }

@keyframes dot-pulse { 0% { box-shadow: 0 0 0 0 rgba(89, 227, 155, .55); } 100% { box-shadow: 0 0 0 12px rgba(89, 227, 155, 0); } }

.host-name { letter-spacing: .01em; }

.host-status { color: var(--ink-dim); font-size: .86em; max-width: 26vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mode-chip { margin-left: auto; order: 3; }

.mode-chip .mode-name { font-weight: 800; }

.mode-chip .mode-reason { color: var(--ink-dim); font-size: .84em; }

.mode-chip[data-mode="multi"] { border-color: rgba(255, 107, 157, .55); box-shadow: 0 10px 28px rgba(122, 12, 62, .45); }

.mode-chip[data-mode="multi"] .mode-name { color: #ffb3cd; }

.score-chip { order: 4; display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 10px; border-radius: 22px; background: linear-gradient(160deg, rgba(255, 209, 102, .22), rgba(167, 139, 250, .2)); border: 1px solid rgba(255, 224, 138, .38); }

.level-ring { position: relative; width: 44px; height: 44px; flex: none; }

.level-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.level-ring circle { fill: none; stroke-width: 4; }

.level-ring .track { stroke: rgba(255, 255, 255, .16); }

.level-ring .fill { stroke: var(--gold); stroke-linecap: round; transition: stroke-dasharray .5s ease; filter: drop-shadow(0 0 5px rgba(255, 209, 102, .8)); }

.level-ring .level { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 800; }

.score-lines { line-height: 1.1; }

.score { font-size: clamp(20px, 3vh, 34px); font-weight: 800; letter-spacing: .01em; color: #fff6db; text-shadow: 0 2px 14px rgba(255, 209, 102, .45); }

.score.bumped { animation: score-bump .45s cubic-bezier(.2, 1.6, .3, 1); }

@keyframes score-bump { 40% { transform: scale(1.18); color: #ffe9a8; } }

.score-label { font-size: 11px; color: var(--ink-dim); letter-spacing: .12em; text-transform: uppercase; }

.combo-pill { position: absolute; top: calc(max(2vh, 16px) + 62px); left: max(2vw, 16px); display: flex; align-items: baseline; gap: 6px; padding: 6px 18px; border-radius: 999px; background: linear-gradient(120deg, rgba(255, 107, 157, .85), rgba(255, 209, 102, .85)); color: #2b0d1e; font-weight: 900; box-shadow: 0 10px 26px rgba(255, 107, 157, .35); }

.combo-pill b { font-size: clamp(18px, 3vh, 30px); }

.combo-pill span { font-size: 12px; letter-spacing: .1em; }

.combo-pill.tick { animation: combo-pop .34s cubic-bezier(.2, 1.7, .3, 1); }

@keyframes combo-pop { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }

.board { position: absolute; left: max(2vw, 16px); bottom: calc(max(4vh, 26px) + var(--dock-space)); min-width: 210px; padding: 12px 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--stroke); backdrop-filter: blur(12px) saturate(140%); box-shadow: 0 12px 30px rgba(6, 2, 18, .45); }

.board-title { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 8px; }

.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.board-list li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; font-size: 13px; }

.board-list .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.board-list .pts { color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }

.board-list li.rank-1 .who { color: #fff3c4; }

.feed { position: absolute; right: max(2vw, 16px); bottom: calc(max(4vh, 26px) + var(--dock-space)); width: min(34vw, 380px); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.feed-item { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 13px; border-radius: 14px 14px 4px 14px; background: rgba(16, 8, 34, .6); border: 1px solid var(--stroke); backdrop-filter: blur(8px); font-size: 13px; opacity: 0; transform: translateX(18px); transition: opacity .3s ease, transform .3s ease; }

.feed-item.in { opacity: 1; transform: none; }

.feed-item.fade { opacity: 0; transform: translateY(-6px); }

.feed-item i { width: 6px; height: 6px; border-radius: 50%; flex: none; }

.feed-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed-item.kind-gift { background: rgba(72, 26, 10, .6); border-color: rgba(255, 209, 102, .35); }

.feed-item.kind-battle { background: rgba(72, 10, 32, .62); border-color: rgba(255, 107, 157, .4); }

.big-banner { position: absolute; top: 26vh; left: 50%; transform: translateX(-50%); padding: 10px 30px; border-radius: 999px; font-size: clamp(18px, 3.4vh, 40px); font-weight: 900; letter-spacing: .04em; white-space: nowrap; background: linear-gradient(120deg, #ffd166, #ff6b9d, #7ef0ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 20px rgba(255, 209, 102, .35)); }

.big-banner[data-tone="danger"] { background: linear-gradient(120deg, #ff5d73, #ffb648); -webkit-background-clip: text; background-clip: text; }

.big-banner[data-tone="heal"] { background: linear-gradient(120deg, #59e39b, #7ef0ff); -webkit-background-clip: text; background-clip: text; }

.big-banner.show { animation: banner-in 2.6s cubic-bezier(.2, 1.3, .3, 1) forwards; }

@keyframes banner-in { 0% { opacity: 0; transform: translateX(-50%) scale(.7); } 12% { opacity: 1; transform: translateX(-50%) scale(1.06); } 22% { transform: translateX(-50%) scale(1); } 82% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(1.02); } }

/* --------------------------------------------------------------- demo dock */
.dock { position: absolute; z-index: 8; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; max-width: 96vw; max-height: 25vh; overflow: auto; scrollbar-width: thin; padding: 9px 11px; border-radius: 18px; background: rgba(12, 6, 26, .82); border: 1px solid var(--stroke); backdrop-filter: blur(14px); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); font-size: 12px; }

.dock[hidden] { display: none; }

.dock button { pointer-events: auto; cursor: pointer; padding: 7px 11px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .16); background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05)); color: var(--ink); font: inherit; font-weight: 600; transition: transform .12s ease, background .2s ease, border-color .2s ease; white-space: nowrap; }

.dock button:hover { transform: translateY(-2px); border-color: rgba(255, 209, 102, .6); }

.dock button:active { transform: translateY(0) scale(.97); }

.dock button.accent { background: linear-gradient(160deg, #ffd166, #ff8fb1); color: #33101f; border-color: rgba(255, 232, 160, .7); }

.dock button.danger { background: linear-gradient(160deg, #ff6b6b, #c9367a); color: #fff; }

.dock button.ghost { background: rgba(255, 255, 255, .06); }

.dock button.on { background: linear-gradient(160deg, #7ef0ff, #a78bfa); color: #101226; border-color: rgba(126, 240, 255, .75); }

.dock .dock-group { display: flex; gap: 6px; align-items: center; padding: 4px 8px 4px 4px; border-radius: 14px; background: rgba(255, 255, 255, .05); }

.dock .dock-label { font-size: 10px; letter-spacing: .1em; color: var(--ink-dim); padding-left: 6px; white-space: nowrap; }

.dock-toggle {
    position: fixed; z-index: 9; left: 50%; bottom: 12px; transform: translateX(-50%);
    pointer-events: auto; cursor: pointer; padding: 7px 14px; border-radius: 999px;
    border: 1px solid rgba(255, 232, 160, .7); color: #33101f; font: 600 12px var(--font);
    background: linear-gradient(160deg, #ffd166, #ff8fb1); box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}

.dock input[type=text] { pointer-events: auto; flex: 1 1 180px; min-width: 140px; padding: 7px 10px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .35); color: var(--ink); font: inherit; }

.dock .storm { animation: storm-glow 1.4s ease-in-out infinite; }

@keyframes storm-glow { 50% { box-shadow: 0 0 0 3px rgba(255, 107, 157, .35); } }

/* ------------------------------------------------------------ diagnostics */
/* ?diag=1 only. Monospace on a dark chip so it stays readable over any bg. */
.diag-hud {
    position: fixed;
    left: 8px;
    top: 8px;
    z-index: 9;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(8, 4, 20, .72);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #ffe9f3;
    font: 600 11px/1.4 "Consolas", "SFMono-Regular", monospace;
    letter-spacing: .02em;
    pointer-events: none;
    white-space: nowrap;
}

/* ------------------------------------------------------------- polish hooks */
/* Reduced motion is an accessibility preference for a person reading the page.
   An OBS capture has no such person, yet its CEF inherits the Windows
   "turn off animations" switch and used to freeze the whole overlay, so the
   override deliberately skips body.obs. */
@media (prefers-reduced-motion: reduce) {
    body:not(.obs) .aurora,
    body:not(.obs) .stars { animation-duration: 12s !important; animation-iteration-count: 1 !important; }
    body:not(.obs) .stage.shaking { animation: none; }
}

@media (max-width: 640px) {
    .feed { display: none; }
    .board { min-width: 160px; }
    .chip { padding: 7px 11px; }
}
