/* Stage 4. Source artwork / layout remain in style.css. Only transient presentation here. */
body.stage4-motion #game-hud .draft-corner.folded #pyramid-scale-box,
body.stage4-motion #game-hud .draft-corner.folded .pyramid-help{display:block}
body.stage4-motion #game-hud .draft-corner.folded #pyramid-scale-box,
body.stage4-motion #game-hud .draft-corner.folded .pyramid-help{visibility:hidden;pointer-events:none}
body.stage4-motion #game-hud.info-hidden .sidebar-shell{display:block;visibility:hidden;pointer-events:none}
body.stage4-motion #game-hud.hands-hidden .game-hands{display:grid;visibility:hidden;pointer-events:none}
body.stage4-motion #game-hud.all-hidden .draft-corner,
body.stage4-motion #game-hud.all-hidden .sidebar-shell,
body.stage4-motion #game-hud.all-hidden .hide-info,
body.stage4-motion #game-hud.all-hidden .hide-hands,
body.stage4-motion #game-hud.all-hidden .game-brand{display:block!important;visibility:hidden;pointer-events:none}
body.stage4-motion #game-hud.all-hidden .game-hands{display:grid!important;visibility:hidden;pointer-events:none}
body.stage4-motion #game-hud .stage4-sliding{visibility:visible!important}
body.stage4-motion #game-hud .stage4-sliding.is-leaving,
body.stage4-motion #game-hud .stage4-sliding.is-leaving *{pointer-events:none!important}
body.stage4-motion #game-hud .pcard.newly-open{animation:none}
/* A viewport-centred announcement, using the same painted plank as the top turn label. */
#game-hud #game-banner.turn-banner{position:fixed;left:50%;top:50%;right:auto;bottom:auto;
 transform:translate(-50%,-50%);box-sizing:border-box;width:max-content;min-width:min(370px,88vw);max-width:min(760px,92vw);
 padding:24px 56px 27px;border:0;border-radius:0;background:url('../../assets/game/plate_cream.webp') center/100% 100% no-repeat;
 box-shadow:none;filter:drop-shadow(0 9px 10px #203b4555);font:700 clamp(20px,2.1vw,39px)/1.3 Georgia,serif;
 color:var(--player-color);text-align:center;white-space:normal;overflow-wrap:anywhere;pointer-events:none;z-index:30}
#game-hud #game-banner .turn-kicker{display:block;margin-bottom:7px;font:700 clamp(10px,.72vw,14px)/1.3 'Trebuchet MS',sans-serif;
 color:#766549;letter-spacing:.16em;text-transform:uppercase}
#game-hud #game-banner .turn-instruction{display:block;font:400 clamp(11px,.85vw,16px)/1.3 'Trebuchet MS',sans-serif;color:#766549;margin-top:7px}
#game-hud.all-hidden #game-banner:not([hidden]){display:block!important}
#game-fx{position:fixed;inset:0;pointer-events:none;z-index:55;overflow:hidden;contain:layout style;isolation:isolate}
#game-fx>*{position:absolute;pointer-events:none!important;user-select:none}
#game-fx img{object-fit:contain;pointer-events:none;display:block}
.fx-coin{width:30px;height:30px;filter:drop-shadow(0 3px 2px #70522766);transform-style:preserve-3d}
.fx-coin img{width:100%;height:100%;backface-visibility:visible}
.fx-card-flight{filter:drop-shadow(0 7px 7px #12334066);transform-origin:center}
.fx-card-flight .pcard{position:absolute;width:94px;height:74px;min-height:74px;padding:0;border:0;
 background-size:100% 100%;background-color:transparent;border-radius:5px;overflow:hidden;text-align:left;line-height:1.1;transform-origin:0 0}
.fx-receipt{max-width:210px;padding:11px 23px;background:url('../../assets/game/plate_cream.webp') center/100% 100% no-repeat;
 font:700 clamp(14px,1.1vw,23px)/1.2 Georgia,serif;color:#446140;white-space:nowrap;filter:drop-shadow(0 3px 3px #152d3a44)}
.fx-receipt.negative{color:#9b4644}
.fx-receipt img{display:inline-block!important;width:1.2em;height:1.2em;vertical-align:-.22em;margin-left:4px}
.fx-spark{width:17px;height:17px;filter:drop-shadow(0 1px 2px #e7bc69aa)}
.fx-modal-exit{position:fixed;pointer-events:none!important;z-index:79}
.fx-modal-exit *{pointer-events:none!important}
#game-overlay .event-stage{position:relative;min-height:80px;text-align:center;perspective:800px}
#game-overlay .event-stage .event-dice{display:flex;justify-content:center;align-items:center;gap:24px;margin:10px 0 16px;min-height:82px}
#game-overlay .event-die{display:grid;place-items:center;width:68px;height:68px;position:relative;
 background:url('../../assets/game/board_cardframe.webp') center/100% 100% no-repeat;font:700 30px Georgia,serif;color:#705129;
 filter:drop-shadow(0 4px 3px #4d382b44);transform-origin:center}
#game-overlay .event-die small{position:absolute;bottom:-15px;font:700 10px 'Trebuchet MS',sans-serif;color:#7d6d52;white-space:nowrap}
#game-overlay .event-status{min-height:1.4em;margin:5px 0;color:#867451;font-style:italic;font-size:.9em}
#game-overlay .event-result{overflow:hidden}
#game-overlay .event-result.awaiting-result{visibility:hidden;max-height:0;pointer-events:none}
#game-overlay .event-fighters{display:grid;grid-template-columns:1fr 36px 1fr;align-items:center;gap:10px;margin:8px 0 3px}
#game-overlay .event-fighter{min-width:0;text-align:center;transform-origin:50% 90%}
#game-overlay .event-fighter img{width:100%;height:clamp(85px,15vh,160px);object-fit:contain;filter:drop-shadow(0 4px 4px #73543533)}
#game-overlay .event-fighter strong{display:block;font:700 1em/1.2 Georgia,serif;margin:7px 0;overflow-wrap:anywhere}
#game-overlay .event-versus{font:italic 20px Georgia,serif;color:#9a7853}
#game-overlay .battle-sides{margin-top:12px}
#game-overlay .battle-sides .battle-body{display:none}
#game-overlay .vault-stage-meter{width:min(310px,90%);height:12px;margin:12px auto;background:#dbcba9;border:1px solid #998160;border-radius:6px;overflow:hidden}
#game-overlay .vault-stage-meter i{display:block;height:100%;width:100%;background:#bc7760;transform-origin:left}
/* Twelve original-textured numbered planks on a timber wheel; the engine supplies its stop. */
#game-overlay .fortune-stage{width:min(286px,59vw,35vh);aspect-ratio:1;margin:12px auto 18px;position:relative}
#game-overlay .fortune-wheel{position:absolute;inset:0;border-radius:50%;background:url('../../assets/game/panel_wood.webp') center/cover;
 border:9px solid #c0a579;box-shadow:0 4px 9px #60483255,inset 0 0 0 2px #806345;box-sizing:border-box;transform-origin:center}
#game-overlay .fortune-wheel .fortune-number{position:absolute;left:50%;top:50%;width:10%;height:12%;margin:-6% -5%;
 background:url('../../assets/fortune42/number-plank.svg') center/100% 100% no-repeat;display:grid;place-items:center;font:700 clamp(11px,1.2vw,18px) Georgia,serif;color:#78552e}
#game-overlay .fortune-wheel .fortune-centre{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:32%;height:32%;object-fit:contain}
#game-overlay .fortune-pointer{position:absolute;left:50%;top:-13px;transform:translateX(-50%);width:24px;height:29px;z-index:2;
 object-fit:contain;filter:drop-shadow(0 2px 1px #5f402666)}
#game-overlay .fortune-pointer{height:36px;top:-19px;}
#game-overlay .fortune-wheel{will-change:transform;backface-visibility:hidden;}
#game-overlay .fortune-centre{image-rendering:auto;}
#game-overlay .fortune-readout{font:700 1.3em Georgia,serif;color:#8d683c;margin:12px 0 3px}
#game-overlay .quarter-deal{height:100px;position:relative;margin:10px auto 18px;width:230px}
#game-overlay .quarter-deal img{position:absolute;top:0;left:75px;width:94px;height:74px;transform-origin:50% 100%;filter:drop-shadow(0 4px 3px #5d493b33)}
#game-overlay .result-seal{display:block;margin:5px auto 15px;width:95px;height:95px;object-fit:contain}
#game-overlay .result-flourish{display:flex;justify-content:center;align-items:center;gap:9px;margin:8px auto 18px}
#game-overlay .result-flourish img,.result-flourish svg{width:32px;height:32px;object-fit:contain;flex:0 0 32px}
.world-anchor.stage4-posed{transition:none!important}
.world-anchor.stage4-posed>*{transition:none!important}
#game-world .world-plate.stage4-capture{filter:drop-shadow(0 0 12px #edd196)}
@media(max-width:760px){#game-hud #game-banner.turn-banner{padding:21px 29px 24px;min-width:min(305px,90vw);font-size:22px}
 #game-overlay .event-die{width:55px;height:55px;font-size:25px}.fx-coin{width:24px;height:24px}
 #game-overlay .event-stage .event-dice{min-height:64px;gap:18px}.fx-receipt{font-size:14px}
 #game-overlay .event-fighter img{height:90px}#game-overlay .event-fighters{gap:5px}
 #game-overlay .fortune-wheel{border-width:6px}#game-overlay .event-fighter strong{font-size:.9em}}
@media(prefers-reduced-motion:reduce){#game-fx .fx-coin,#game-fx .fx-spark{display:none!important}}

/* Ghost artwork is rendered inside the Three.js scene too, never twice above clouds. */
#game-world.scene-sprites .stage4-ghost>*{visibility:hidden}

/* Stage 4.1: only the player's turn, with no fast-disappearing secondary copy. */
#game-hud #game-banner.turn-banner{padding:24px 45px 26px;min-width:min(335px,88vw);}
