/* Geometry is authored in the same 1600 × 740 camera plane as the approved
   preview. Existing game inputs are kept in native buttons over that plane. */
.approved-camera-frame[hidden]{display:none}
body.immersive:has(.approved-camera-active){background:#10080c}
body.immersive.royal-play-full:has(.approved-camera-active) main{max-width:none;background:#10080c}
body.immersive.royal-play-full .scene-3d.approved-camera-active{
 position:relative; isolation:isolate; padding:0; margin:0; border:0;
 background:#10080c; border-radius:0; box-shadow:none; overflow:hidden;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active::before,
body.immersive.royal-play-full .scene-3d.approved-camera-active::after{display:none}
body.immersive.royal-play-full .scene-3d.approved-camera-active .approved-camera-frame,
body.immersive.royal-play-full .scene-3d.approved-camera-active .player{
 position:absolute;inset:auto;
 left:var(--approved-left,0px);top:var(--approved-top,0px);
 width:var(--approved-width,100%);height:var(--approved-height,100%);
 margin:0;padding:0;border:0;min-height:0;max-height:none;transform:none;
 overflow:visible;pointer-events:none;
}
.approved-camera-frame{z-index:3;overflow:hidden}
.approved-camera-surface,.approved-camera-frame>svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.approved-camera-title,.approved-camera-badge{position:absolute;color:#f2dfae;font-family:system-ui,sans-serif;white-space:nowrap}
.approved-camera-title{left:50%;top:2%;transform:translateX(-50%);font-weight:800;letter-spacing:.12em;font-size:clamp(.68rem,2.6cqh,1.55rem)}
.approved-camera-badge{
 font-size:clamp(.55rem,1.75cqh,1rem);font-weight:760;letter-spacing:.02em;
 background:#18382f;border:1px solid #75927b9c;border-radius:clamp(5px,1.5cqh,12px);padding:.25em .65em;top:13.15%;
}
.approved-camera-round{left:6.55%}
.approved-camera-wall{left:83%}
body.immersive.royal-play-full .scene-3d.approved-camera-active :is(.table-model,.opponents,.center,.player-head,.discard-flight){opacity:0;pointer-events:none}
body.immersive.royal-play-full .scene-3d.approved-camera-active .player{z-index:8}
.game-landscape-compact body.immersive.royal-play-full .scene-3d.approved-camera-active .player .hand,
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .hand{
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
 padding:0;margin:0;display:block!important;overflow:visible;transform:none;pointer-events:none;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .hand[data-approved-count]>.tile{
 position:absolute!important;
 inset:var(--approved-hit-top) auto auto var(--approved-hit-left)!important;
 width:var(--approved-hit-width)!important;height:var(--approved-hit-height)!important;
 min-width:0!important;min-height:0!important;
 max-width:none!important;max-height:none!important;
 padding:0;margin:0;transform:none!important;border-radius:3px;
 background:transparent;border:0;box-shadow:none;pointer-events:auto;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .hand[data-approved-count]>.tile:is(span,:disabled){pointer-events:none}
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .hand[data-approved-count]>.tile :is(img,.tile-fallback),
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .hand[data-approved-count]>.tile::before,
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .hand[data-approved-count]>.tile::after{opacity:0;pointer-events:none}
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .hand .tile:focus-visible{outline:2px solid #ffdd82;outline-offset:0}
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .move{
 display:block!important;position:absolute!important;inset:0!important;width:100%!important;
 max-width:none;max-height:none;min-height:0;margin:0;pointer-events:none;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .move #status{
 position:absolute;left:5.5%;right:6%;top:90.5%;width:auto;height:auto;clip-path:none;max-width:none;margin:0;padding:0;
 text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
 color:#ecdfba;font-size:clamp(.58rem,1.8cqh,1rem);
}
body.immersive.royal-play-full .scene-3d.approved-camera-active .move #turn-clock:not([hidden]){
 display:block;position:absolute;right:3.5%;top:13.1%;min-width:0;
 max-width:100%;white-space:nowrap;color:#fff0bd;border-color:#947243;background:#49381e;
 transform:translateY(125%);font-size:clamp(.58rem,1.9cqh,1rem);padding:.15em .5em;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active .move .actions:not(:empty){
 /* The standard action row carries width:100%. In this absolute lane it
    must size between the two insets or all buttons are pushed off the table. */
 position:absolute;z-index:2;left:79%;right:3.5%;top:auto;bottom:10%;
 width:auto;max-width:none;min-width:0;margin:0;padding:0;
 display:flex;flex-wrap:wrap;justify-content:flex-end;align-content:flex-end;
 gap:4px;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active .move .actions button.action{
 color:#fff1ce;background:#18382f;border:1px solid #819b83;
 border-radius:clamp(5px,1.65cqh,12px);line-height:1.1;
 flex:0 1 calc((100% - 4px)/2);min-height:44px;min-width:0;max-width:100%;
 padding:.35em .35em;font-size:clamp(.76rem,2.4cqh,1.04rem);font-weight:780;
 white-space:normal;overflow-wrap:anywhere;pointer-events:auto;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active .move .actions button.action.win{background:#f6d18d;color:#24180c;border-color:#ffe4a4}
body.immersive.royal-play-full .scene-3d.approved-camera-active>.top{
 inset:auto!important;
 left:calc(var(--approved-left) + var(--approved-width) * .825)!important;
 top:calc(var(--approved-top) + var(--approved-height) * .031)!important;
 width:calc(var(--approved-width) * .143)!important;
 min-height:0!important;
 display:block!important;z-index:25;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active>.top .brand{display:none}
body.immersive.royal-play-full .scene-3d.approved-camera-active>.top .nav{display:flex;justify-content:space-between;gap:3px}
body.immersive.royal-play-full .scene-3d.approved-camera-active>.top .nav > #sound-toggle,
body.immersive.royal-play-full .scene-3d.approved-camera-active>.top .nav .royal-hud-more>summary{
 width:auto;min-width:0;min-height:28px;padding:.25em .6em;
 border:1px solid #819b83;border-radius:clamp(5px,1.65cqh,12px);
 background:#18382f;color:#fff1ce;font-size:clamp(.55rem,1.78cqh,1rem);text-transform:uppercase;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active>.top #sound-toggle::after{display:none}

/* Approved seat/name margins and options-only sound. */
.approved-camera-frame{container-type:size}
.approved-camera-seat{
 position:absolute;display:inline-flex;align-items:center;justify-content:center;gap:.28em;
 max-width:13%;color:#ffda84;white-space:nowrap;font:650 clamp(.57rem,1.7cqw,1.5rem)/1.15 system-ui,sans-serif;
 text-shadow:0 1px 2px #000;pointer-events:none;
 transform:translate(-50%,-50%) rotate(var(--approved-seat-tilt,0deg));
}
.approved-camera-seat[hidden],.approved-camera-seat-wind[hidden]{display:none}
.approved-camera-seat-name{overflow:hidden;text-overflow:ellipsis}
.approved-camera-seat-wind{
 display:grid;place-items:center;flex:none;padding:0 .12em;
 min-width:.9em;height:1.14em;border:1px solid #bd8c48;border-radius:.16em;
 background:linear-gradient(#fff4d0,#eacb8d);color:#291e14;box-shadow:0 1px 2px #000;
 font-family:"Songti SC","Noto Serif CJK TC",serif;font-size:.9em;line-height:1;text-shadow:none;
}
.approved-camera-seat--left{left:9.1%;top:48.5%;--approved-seat-tilt:-60deg}
.approved-camera-seat--far{left:50%;top:4.7%}
.approved-camera-seat--right{left:91.4%;top:49.2%;--approved-seat-tilt:60deg}
.approved-camera-seat--self{left:50%;top:97.25%}
body.immersive.royal-play-full .scene-3d.approved-camera-active>.top .nav{justify-content:flex-end}
body.immersive.royal-play-full .scene-3d.approved-camera-active>.top .nav > #sound-toggle{display:none}
.approved-camera-active .approved-camera-badge{top:4.25%;font-size:clamp(.55rem,1.26cqw,1.05rem)}
.approved-camera-active .approved-camera-round{left:8.5%}
.approved-camera-active .approved-camera-wall{left:77%}
body.immersive.royal-play-full .scene-3d.approved-camera-active>.top .royal-hud-links>#sound-toggle{
 font-size:.84rem;text-align:center;min-width:100%;width:auto;
}

/* The match wrapper is the flex item; without a definite available height
   its absolutely positioned camera contributes no height and clips on reopen. */
body.immersive.royal-play-full main>.game-main:not([hidden]){
 display:flex;flex-direction:column;flex:1 1 0%;width:100%;min-width:0;min-height:0;
}

/* The decorative turn marker travels with the projected, rotated seat. */
.approved-camera-seat{padding:.10em .26em;border-radius:.40em;max-width:16%}
.approved-camera-seat[aria-current="true"]{
 background:#2a1c08c7;outline:1.5px solid #f2c467;outline-offset:0;
 box-shadow:0 0 .30em #e39338a0;
}
.approved-camera-seat-score{
 flex:none;color:#f5e6c1;font-size:.71em;font-variant-numeric:tabular-nums;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active .player .move #status[data-approved-routine]{
 /* Visually hide routine turn commentary only; the original live region is
    still accessible, and claim / special decisions / results stay visible. */
 left:0;right:auto;top:0;width:1px;height:1px;clip-path:inset(50%);
 overflow:hidden;white-space:nowrap;
}

/* A larger countdown sits under the top-right HUD without moving the tiles. */
.turn-clock{font-size:1rem;min-width:62px;padding:.3em .55em}
.game-landscape-compact .turn-clock{font-size:.87rem;min-width:55px;padding:.3em .5em}
body.immersive.royal-play-full .scene-3d.approved-camera-active .move #turn-clock:not([hidden]){
 display:inline-flex;top:13%;font-size:clamp(.76rem,2.4cqh,1.2rem);padding:.35em .55em;
 transform:none;border-color:#c3a766;
}
body.immersive.royal-play-full .scene-3d.approved-camera-active .move #turn-clock.urgent:not([hidden]){
 background:#811f18;color:#fff4dd;border-color:#ffc477;
}

/* Pulse the outline, never the name or the tile layer. */
.scene-3d:not(.approved-camera-active) :is(.bot.turn,.player-head.own-turn) .royal-seat-badge,
.young-seat-name[aria-current="true"]{
 outline:1.5px solid #f2c467;outline-offset:1px;border-radius:.40em;
}
.approved-camera-seat[aria-current="true"],
.scene-3d:not(.approved-camera-active) :is(.bot.turn,.player-head.own-turn) .royal-seat-badge,
.young-seat-name[aria-current="true"]{
 animation:mahjong-seat-turn 900ms ease-in-out infinite;
}
@keyframes mahjong-seat-turn{
 0%,100%{outline-color:#ffdc86;box-shadow:0 0 .62em #f0a337b0}
 50%{outline-color:#b1884e;box-shadow:0 0 .08em #e393384d}
}
@media(prefers-reduced-motion:reduce){
 .approved-camera-seat[aria-current="true"],
 .scene-3d:not(.approved-camera-active) :is(.bot.turn,.player-head.own-turn) .royal-seat-badge,
 .young-seat-name[aria-current="true"]{animation:none}
}
