/* Active play only; preserve all wait, false-start and reaction states. */
.rg-root:has(#rg-single.is-active), .rg-root:has(#rg-battle.is-active) {
  background: #d8e9e4 url("../images/reflex-adventure-play.7129be17a5cd.webp") center / cover no-repeat;
}
.rg-root:has(#rg-single.is-active)::before, .rg-root:has(#rg-single.is-active)::after,
.rg-root:has(#rg-battle.is-active)::before, .rg-root:has(#rg-battle.is-active)::after { display:none; }
.rg-root :is(#rg-single,#rg-battle) .rg-screen-head { color: #193d3a; }
.rg-root #rg-single .rg-stage { border: 10px solid #8a694a; border-radius: 50%; width: min(100%, 620px); aspect-ratio: 1.45; min-height: 300px; max-height: 500px; margin: 12px auto; box-shadow: 0 12px 28px #394e3a55; }
.rg-root #rg-single .rg-stage-idle, .rg-root #rg-single .rg-stage-waiting { background: #5a4f70; }
.rg-root #rg-single .rg-stage-ready { background: #087b44; }
.rg-root #rg-single .rg-stage-foul { background: #a32932; }
.rg-root #rg-single .rg-stage-finished { background: #285b9a; }
.rg-root :is(#rg-single,#rg-battle) .rg-hud, .rg-root #rg-battle .rg-battle-hud { background: #172945; }
.rg-root :is(#rg-single,#rg-battle) .rg-btn-ghost { background: #fff9ec; color: #213c44; }
@media(max-width:600px) { .rg-root #rg-single .rg-stage { min-height: 260px; aspect-ratio:1; } }

.rg-root #rg-single .rg-stage-actions { margin: 12px auto 24px; }
.rg-root #rg-single .rg-note { color: #234c46; }

.rg-root #rg-single .rg-stage-actions .rg-btn-primary { min-width: 150px; border: 12px solid transparent; border-image: url("../images/reflex-button.c0aafb41ccbd.webp") 25% 14% fill / 12px / 0 stretch; color:#392c16; padding: 8px 22px; }

.rg-root #rg-single .rg-stage-actions .rg-btn-primary { background: #efb638; box-shadow: none; border-radius: 14px; }

/* Keep the fullscreen action, without reserving a large empty bar in play. */
.rg-root:has(#rg-single.is-active) .rg-topbar, .rg-root:has(#rg-battle.is-active) .rg-topbar {
  width: fit-content; margin-left: auto; padding: 0; min-height: 0; border: 0; background: transparent; box-shadow: none;
}
.rg-root #rg-single .rg-stage { width: min(100%, 500px); aspect-ratio: 1; min-height: 0; max-height: none; }
@media(max-width:600px) { .rg-root #rg-single .rg-stage { min-height: 0; } }

.rg-root #rg-single .rg-stage { overflow: visible; } .rg-root #rg-single .rg-stage::before { inset: -10px; border: 0; border-radius: 0; background: url("../images/reflex-ring.05190fa6b80e.webp") center / 100% 100% no-repeat; pointer-events: none; z-index: 1; } .rg-root #rg-single .rg-stage > * { z-index: 2; }

.rg-root #rg-single .rg-stage-sub { max-width: 72%; line-height: 1.4; }
@media (max-width: 400px) { .rg-root #rg-single .rg-stage-sub { font-size: 0.95rem; } }

/* Keep the optional record form close to the result at every width. */
.rg-root #rg-single .rg-save-panel { max-width: 480px; margin-inline: auto; }

@media (min-width: 1000px) {
  .rg-root #rg-single .rg-hud { max-width: 340px; margin-left: auto; }
  .rg-root #rg-single .rg-stage { width: min(100%, 500px); }
}

/* During the timed round the start control is hidden, so use the freed space
   for the main tap target while keeping the signal visible at the edge. */
@media (min-width: 1200px) and (min-height: 800px) {
  .rg-root #rg-single :is(.rg-stage-waiting, .rg-stage-ready) {
    width: min(620px, calc(100dvh - 280px));
    margin-top: -40px;
  }
}

/* The same waiting message is already spoken by the live stage text. */
@media (min-width: 1200px) and (min-height: 800px) {
  .rg-root #rg-single .rg-stage-waiting::after {
    content: '초록 불을 기다리세요!';
    position: absolute; top: -66px; left: 50%; transform: translateX(-50%);
    width: max-content; max-width: 90vw; padding: 12px 24px;
    color: #164c36; background: #fffaf0; border: 3px solid #a18a72;
    border-radius: 30px; box-shadow: 0 5px 14px #234a3d30;
    font-size: clamp(18px, 2vw, 25px); font-weight: 900; line-height: 1.2;
    pointer-events: none;
  }
}

.rg-root { scroll-margin-top: var(--classroom-play-height, 0px); }
