/* Extend the existing tabletop below the stage without touching board transforms. */
.near-hand{top:83%}.far-hand{top:2.1%}
#point-flight{position:fixed;inset:0;z-index:26;pointer-events:none}
.point-award{position:fixed;left:50%;top:var(--point-start,45%);width:max-content;max-width:92vw;text-align:center;font-size:clamp(32px,9vw,70px);font-weight:900;line-height:1.1;color:#a2ffbd;text-shadow:0 3px 12px #000,0 0 22px currentColor;animation:pointCollection 2.2s var(--point-delay,0ms) both}
.point-award.blue{color:#aed2ff}
@keyframes pointCollection{0%,58%{left:50%;top:var(--point-start,45%)}0%{opacity:0;transform:translate(-50%,-50%) scale(.25)}22%{opacity:1;transform:translate(-50%,-50%) scale(1.15)}36%,58%{opacity:1;transform:translate(-50%,-50%) scale(1)}43%{filter:brightness(1.7);text-shadow:0 0 8px white,0 0 24px currentColor}100%{left:var(--point-x);top:var(--point-y);transform:translate(-50%,-50%) scale(.16);opacity:0}}
#auto-move-notice{position:fixed;left:50%;transform:translateX(-50%);z-index:18;pointer-events:none;padding:7px 14px;border:1px solid currentColor;border-radius:12px;background:#10251ee8;color:#a2ffbd;font-size:20px;font-weight:bold}
#auto-move-notice.blue{color:#aed2ff}#auto-move-notice.near-side{bottom:max(11dvh,env(safe-area-inset-bottom))}#auto-move-notice.far-side{top:max(13dvh,env(safe-area-inset-top))}
.burn-card .game-card.battle.deal-face{animation-name:spentBattleFlash}
@keyframes spentBattleFlash{0%,36%,65%,100%{box-shadow:0 6px 25px #0006}45%,53%{box-shadow:0 0 0 5px #ff344b,0 0 40px #ff344b,0 0 75px #ff344b}}
@media(prefers-reduced-motion:reduce){.point-award{animation-name:pointStill}.burn-card .game-card.battle.deal-face{animation:none;box-shadow:0 0 24px #ff344b}}
@keyframes pointStill{0%,100%{opacity:0;transform:translate(-50%,-50%)}10%,90%{opacity:1;transform:translate(-50%,-50%)}}
#stage::before{content:'';position:absolute;left:0;right:0;top:100%;height:100dvh;background:inherit;background-position:center bottom;z-index:-1;pointer-events:none}
#table-surface{position:absolute;inset:0;background:url('../board.png') center/100% 100%;transform-origin:0 0;pointer-events:none}

/* Keep marker geometry independent of font baselines and line-box height. */
.cancel-x,.rest-x,.chip:not(.finished-chip) .defeat-mark{font-size:0;line-height:0}
.cancel-x::before,.cancel-x::after,.rest-x::before,.rest-x::after,
.chip:not(.finished-chip) .defeat-mark::before,.chip:not(.finished-chip) .defeat-mark::after{content:'';position:absolute;left:50%;top:50%;width:72%;height:10%;border-radius:2px;background:currentColor;transform:translate(-50%,-50%) rotate(45deg)}
.cancel-x::after,.rest-x::after,.chip:not(.finished-chip) .defeat-mark::after{transform:translate(-50%,-50%) rotate(-45deg)}
.empty-deck{height:auto;min-height:0;aspect-ratio:1;display:grid;place-items:center;line-height:0}

#lobby .lobby-card{max-height:calc(var(--pwa-height,100dvh) - 48px);overflow-y:auto}
#tutorial h2{font-size:19px;margin:24px 0 8px}
#tutorial p{font-size:15px;line-height:1.6;margin:8px 0}
#tutorial-return{position:sticky;bottom:0;background:#17352d}

/* One persistent endgame panel, with its original Roll control moved inside. */
#end-screen #end-control{position:static;transform:none;width:100%;padding:0;margin:0 auto 12px;background:none;border:0;box-shadow:none}
#end-screen #end-roll{width:min(100%,220px);min-height:48px;font-size:20px;display:block;margin:0 auto}
#end-roll.end-roll-prompt:not(:disabled){animation:endRollPrompt 1s ease-in-out infinite;border-color:#fff4b3}
@keyframes endRollPrompt{0%,100%{box-shadow:0 0 0 2px #ffe99f,0 0 8px #ffd66b}50%{box-shadow:0 0 0 3px white,0 0 18px #ffe99f,0 0 28px #ffdc7788}}
@media(prefers-reduced-motion:reduce){#end-roll.end-roll-prompt:not(:disabled){animation:none;box-shadow:0 0 0 3px #ffe99f,0 0 18px #ffe99f}}
#end-screen #end-preview{display:none}
#end-screen .end-panel{max-height:calc(100dvh - 48px);overflow-y:auto;overflow-x:hidden}
#end-screen.six-contest .end-panel{visibility:hidden}
#finish-end:not(:disabled){border:2px solid white;box-shadow:0 0 8px #fff,0 0 22px #ffffff90;color:white}
#end-screen [hidden]{display:none!important}

/* Keep the reel clipped independently from the exterior golden halo. */
/* Reference: strip ~1.35 dice wide and eight dice tall, centered on final die.
   Absolute positioning preserves all other dice and panel geometry. */
.battle-die.slot-die{overflow:visible;isolation:isolate;z-index:5;--overdrive-height:min(800%,60dvh);--overdrive-width:min(135%,76px)}
.overdrive-window{position:absolute;left:50%;top:50%;width:var(--overdrive-width);height:var(--overdrive-height);transform:translate(-50%,-50%);border-radius:12px;overflow:hidden;z-index:1;pointer-events:none;outline:2px solid #f4ca67;box-shadow:0 0 14px #efc65b88}
.overdrive-window .last-die-reel{inset:50% 0 auto;height:auto}
.overdrive-window .slot-cell{box-sizing:border-box;width:100%;height:auto;aspect-ratio:1;flex:0 0 auto}
.slot-die::before{content:'';position:absolute;left:50%;top:50%;width:calc(var(--overdrive-width) + 48px);height:calc(var(--overdrive-height) + 48px);transform:translate(-50%,-50%);border-radius:28%;pointer-events:none;background:radial-gradient(ellipse,transparent 36%,#ffe69999 52%,#efbc3244 65%,transparent 73%);box-shadow:0 0 30px #efc65baa;z-index:-1;animation:overdriveHalo .85s ease-in-out infinite}
#end-screen .end-panel:has(.slot-die){overflow:visible}
@keyframes overdriveHalo{0%,100%{opacity:.65}50%{opacity:1;filter:brightness(1.4)}}

.slow-turn-warning.awaiting-move #targets .move-outline{fill:#fff4a5b3!important;stroke:#fff!important;stroke-width:5;filter:drop-shadow(0 0 10px #fff) drop-shadow(0 0 22px #ffd53c)}
.slow-turn-warning.awaiting-move .chip.battle-target{filter:brightness(1.65) drop-shadow(0 0 14px #fff4a5)!important}
.slow-turn-warning.awaiting-roll #die{outline:3px solid white;outline-offset:4px;box-shadow:0 0 22px #fff,0 0 40px #ffe887!important}
.battle-card-side>span{margin-top:10px;text-align:center;line-height:1.4}
#visuals-panel:not([hidden]){display:flex;flex-direction:column;gap:18px}
#visuals-panel .dice-switch{display:flex;align-items:center;justify-content:space-between;gap:18px;width:100%;margin:0;padding:12px 0;border-bottom:1px solid #ffffff25}
#visuals-panel .dice-switch span{flex:1;line-height:1.5}
#visuals-panel .dice-switch input{flex:0 0 auto;margin:0}
#visuals-panel>label[for=view-angle]{display:block;margin:0;padding-top:4px}
#visuals-panel input[type=range]{display:block;margin:0;width:100%}
#visuals-panel .view-help{margin:0;line-height:1.5}
@media(prefers-reduced-motion:reduce){.slot-die::before{animation:none}.slow-turn-warning #targets .move-outline{animation:none!important}}

/* Approved preview: external sparks, pulsing gold rim, edge fade and result frame. */
.overdrive-window{box-shadow:0 0 5px #fff1a6,0 0 22px #ffb700,0 0 38px #ffb70099;border:2px solid #f5c350}
.overdrive-window::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(#130d03eb,transparent 25%,transparent 75%,#130d03eb)}
.slot-die::before{opacity:var(--overdrive-pulse,.8);filter:brightness(1.35)}
.slot-die::after{content:'';position:absolute;left:50%;top:50%;width:var(--overdrive-width);height:var(--overdrive-width);transform:translate(-50%,-50%);outline:2px solid #fff0a6;z-index:3;pointer-events:none}
.overdrive-sparks{position:absolute;left:50%;top:50%;width:var(--overdrive-width);height:var(--overdrive-height);transform:translate(-50%,-50%);z-index:2;pointer-events:none}
.overdrive-sparks i{position:absolute;width:3px;height:8px;background:#ffdc72;box-shadow:0 0 5px #fff2b0,0 0 12px #ffb700;border-radius:1px}
@media(prefers-reduced-motion:reduce){.overdrive-sparks{display:none}.slot-die::before{opacity:.8;filter:none}}

/* Screen-filling exterior energy, independent of the unchanged reel/dice layout. */
.slot-die::before{width:min(90vw,900px);height:90dvh;border-radius:50%;background:radial-gradient(ellipse,#ffdc7222 8%,#ffbf4055 23%,#f6a90033 42%,transparent 72%),repeating-conic-gradient(from 0deg,transparent 0deg 12deg,#ffd67030 13deg 16deg,transparent 18deg 30deg);mask-image:radial-gradient(ellipse,#000 18%,#000b 42%,transparent 71%);box-shadow:none}
.overdrive-sparks{width:min(76vw,760px);height:86dvh}
.overdrive-sparks i{background:#fff0b0;box-shadow:0 0 8px #fff5bd,0 0 20px #ffb700,0 0 35px #ff9400}

/* Compact Med Pack grid: all seven held cards fit without a scrolling choice. */
#recovery-panel{width:min(94vw,540px);padding:14px 12px;max-height:calc(var(--pwa-height,100dvh) - 24px);overflow:visible}
#recovery-panel h2{font-size:24px;margin:0 0 6px}
#recovery-note{min-height:0;margin:6px 0;font-size:14px}
#recovery-card-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;overflow:visible;max-width:100%;padding:7px 4px}
#recovery-card-options:empty{display:none}
#recovery-card-options .timed-card{width:100%;min-width:0;padding:2px;justify-self:center}
#recovery-card-options .game-card{height:clamp(104px,15dvh,124px);aspect-ratio:auto;padding:4px;gap:3px}
#recovery-card-options .card-kind{font-size:9px;letter-spacing:0}
#recovery-card-options .card-number{font-size:24px}
#recovery-card-options .pair-number{font-size:15px;line-height:1.15}
#recovery-card-options .card-caption,#recovery-card-options .card-instruction{font-size:10px;line-height:1.1}
#recovery-card-options .card-instruction{display:none}
#recovery-result{height:52px}#recovery-total{font-size:42px}
#recovery-dice{margin:10px 0}
#recovery-panel .choice-clock{font-size:17px;padding:3px;margin:5px auto}
#settings-close,#hand-close,#account-close{width:auto;height:auto;font-size:15px;line-height:1.3;padding:9px;border:1px solid currentColor;border-radius:8px;flex-shrink:0}
#stats-return{margin-bottom:10px}
@media(max-width:360px){
 #recovery-screen{padding:56px 8px 42px}
 #recovery-panel{padding:10px}
 #recovery-panel h2{font-size:22px}
 #recovery-note{font-size:12px;margin:4px 0}
 #recovery-card-options .card-kind{font-size:8px;white-space:nowrap}
 #recovery-card-options .card-number{font-size:18px}
 #recovery-card-options .pair-number{font-size:12px}
 #recovery-card-options .card-caption{font-size:9px}
 #recovery-dice .battle-die{width:46px;height:46px}
 #recovery-result{height:38px}#recovery-total{font-size:34px}
}
@media(max-height:500px){
 #recovery-screen{padding:12px 18px}
 #recovery-panel{width:min(94vw,660px);padding:8px 12px}
 #recovery-panel h2{font-size:18px;margin:0}
 #recovery-note{font-size:12px;margin:4px 0}
 #recovery-card-options{grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;padding:5px 4px}
 #recovery-dice .battle-die{width:42px;height:42px}
 #recovery-dice{margin:6px 0}
 #recovery-result{height:36px}#recovery-total{font-size:32px}
}
