:root {color-scheme:light;--paper:#faf7f0;--cream:#fff0d6;--ink:#263c36;--green:#285348;--muted:#68736a;--coral:#bd492d;--line:#e4e2d6;}
* {box-sizing:border-box;}
html {background:var(--paper);scroll-behavior:smooth;}
body {margin:0;color:var(--ink);font-family:"Hiragino Maru Gothic ProN","Hiragino Sans","Noto Sans JP",system-ui,sans-serif;-webkit-tap-highlight-color:transparent;}
button,a {touch-action:manipulation;}
button {font:inherit;cursor:pointer;}
a {color:inherit;text-decoration:none;}
button:focus-visible,a:focus-visible,summary:focus-visible,canvas:focus-visible {outline:3px solid var(--green);outline-offset:4px;}
.hidden {display:none!important;}
#stage {width:min(1120px,calc(100% - 48px));margin:0 auto;}
.app-bar {display:flex;align-items:center;gap:18px;min-height:82px;}
.plaza {font-size:12px;font-weight:750;white-space:nowrap;}
.brand {display:flex;align-items:center;gap:10px;font-size:11px;font-weight:850;letter-spacing:.12em;border-left:1px solid var(--line);padding-left:18px;}
.brand-icon {display:grid;place-items:center;background:var(--coral);color:#fff4dc;border-radius:9px;width:31px;height:31px;transform:rotate(-8deg);font-size:20px;}
.controls {display:flex;gap:8px;margin-left:auto;}
.corner {border:1px solid var(--line);background:#fffdf8;color:var(--green);border-radius:14px;min-height:42px;min-width:42px;font-weight:750;font-size:12px;padding:8px 12px;}
#mute {font-size:19px;}
#mute.off {color:#777f71;}
.nslash {position:relative;display:inline-block;font-style:normal;}
.nslash:after {content:"";position:absolute;left:50%;top:50%;width:1.2em;height:2px;background:currentColor;transform:translate(-50%,-50%) rotate(-45deg);}
.screen {background:#fffdf8;border:1px solid var(--line);border-radius:28px;overflow:hidden;display:grid;grid-template-columns:1fr 1fr;box-shadow:0 16px 44px #48412a05;}
.title-art,.result-art {position:relative;min-height:620px;background:#f4e4c4;overflow:hidden;}
.title-art img,.result-art img {width:100%;height:100%;position:absolute;inset:0;object-fit:cover;}
.art-badge {position:absolute;top:26px;left:26px;border:1px solid #ffffff80;border-radius:30px;background:#fffdf2e8;padding:9px 14px;font-size:11px;font-weight:750;}
.art-caption {position:absolute;bottom:26px;left:28px;right:28px;color:#fffdf2;display:flex;justify-content:space-between;align-items:end;gap:14px;text-shadow:0 2px 10px #493923aa;}
.art-caption strong {font-size:21px;line-height:1.55;}
.art-caption small {font-size:8px;letter-spacing:.14em;white-space:nowrap;}
.title-copy,.result-copy {padding:34px 34px 30px;align-self:center;}
.eyebrow {font-size:9px;font-weight:850;letter-spacing:.17em;color:var(--coral);margin:0 0 14px;}
h1 {font-size:clamp(32px,3.6vw,48px);letter-spacing:-.05em;line-height:1.14;margin:0 0 16px;font-weight:900;}
h1 em {font-style:normal;color:var(--coral);}
.lead {font-size:13px;line-height:1.9;margin:0 0 22px;color:var(--muted);}
.stage-heading {display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0 0 10px;}
.stage-heading .sub {font-size:12px;font-weight:850;}
.stage-heading small {font-size:10px;color:var(--muted);}
.stages {display:grid;gap:10px;}
.stagebtn {appearance:none;width:100%;border:1px solid #deded0;border-radius:16px;padding:0;overflow:hidden;display:flex;align-items:stretch;background:#f7f3e7;text-align:left;color:var(--ink);transition:transform .15s,box-shadow .15s;}
.stagebtn:hover {transform:translateY(-2px);box-shadow:0 6px 14px #51462c10;border-color:#cbb88e;}
.stagebtn:active {transform:translateY(1px);}
.stage-thumb {width:88px;min-height:109px;object-fit:cover;flex-shrink:0;}
.stagebtn .body {padding:13px 8px 13px 14px;flex:1;min-width:0;}
.stagebtn .nm {display:block;font-size:19px;line-height:1.35;font-weight:900;}
.stagebtn .sb {display:block;font-size:10px;color:var(--muted);margin-top:3px;}
.stagebtn .rc {display:block;font-size:9px;color:var(--muted);margin-top:6px;line-height:1.5;}
.stagebtn .go {align-self:center;display:grid;place-items:center;flex-shrink:0;width:28px;height:28px;background:var(--coral);color:white;border-radius:50%;margin-right:12px;font-size:15px;}
.rules {display:flex;gap:7px;margin:16px 0 12px;padding:0;list-style:none;}
.rules li {flex:1;border-radius:10px;background:#f8f2e2;padding:10px 6px;text-align:center;color:#596b57;line-height:1.6;font-size:9px;}
.rules b {display:block;color:var(--green);font-size:11px;}
.howto {border-top:1px solid var(--line);padding-top:13px;color:var(--muted);font-size:10px;line-height:1.9;}
.howto summary {cursor:pointer;font-weight:700;}
.fine {margin:10px 0 0;}
.lastrun {font-size:10px;font-weight:700;color:var(--green);line-height:1.8;margin-top:13px;}
#title>.rw-back,#title>[data-rw-note] {grid-column:1/-1;justify-self:center;}
.app-footer {text-align:center;color:var(--muted);font-size:9px;letter-spacing:.04em;line-height:1.8;padding:22px 8px;}
#play {max-width:960px;margin:0 auto;}
.play-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 12px;}
.play-heading h2 {font-size:14px;margin:0;font-weight:850;}
.play-heading p {font-size:10px;margin:0;color:var(--muted);}
.hud {display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:10px;margin-bottom:14px;}
.stat {background:#fffdf8;border:1px solid var(--line);border-radius:15px;padding:12px 17px;}
.stat>span {display:block;font-size:9px;color:var(--muted);font-weight:750;letter-spacing:.07em;margin-bottom:4px;}
.stat strong {font-size:29px;line-height:1;font-weight:900;font-variant-numeric:tabular-nums;letter-spacing:-.02em;}
.stat small {font-size:10px;color:var(--muted);font-weight:750;margin-left:4px;}
.stat:first-child strong,.stat.urgent strong {color:var(--coral);}
.gauge-label {display:flex;justify-content:space-between;gap:12px;font-size:10px;font-weight:750;color:var(--green);margin-bottom:6px;}
.gauge-label span:first-child {letter-spacing:.07em;color:#9a6331;}
.gauge-track {height:8px;border-radius:10px;background:#e9e4d6;overflow:hidden;margin-bottom:13px;}
.gauge-fill {width:0;height:100%;background:linear-gradient(90deg,#d69e43,#ce5731);border-radius:inherit;}
.board-frame {padding:8px;background:#eddec0;border:1px solid #dcc69d;border-radius:24px;box-shadow:0 10px 28px #6950300c;overflow:hidden;transition:border-color .2s;}
#play.rampage .board-frame {border-color:#cf5838;background:#f0c99e;}
#cv {display:block;width:100%;height:clamp(380px,59svh,610px);border-radius:17px;touch-action:none;cursor:crosshair;background:#efe4cd;}
.board-meta {display:flex;justify-content:space-between;align-items:center;gap:12px;margin:12px 6px 0;font-size:10px;color:var(--muted);}
.board-meta b {color:var(--green);font-weight:850;}
.room-progress {display:flex;align-items:center;gap:7px;}
.room-track {width:65px;height:5px;border-radius:6px;background:#e1dfcf;overflow:hidden;}
#room-fill {display:block;height:100%;width:0;background:#669987;}
.sr-only {position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;}
.result-art {min-height:530px;background:#f8eacd;}
.result-art img {object-position:center;}
.result-copy {text-align:center;}
.rttl {font-size:29px;font-weight:900;margin:0 0 20px;}
.rttl:focus {outline:none;}
.result-label {font-size:10px;font-weight:750;letter-spacing:.15em;color:var(--muted);}
.rbig {font-size:76px;line-height:1.2;font-weight:900;color:var(--coral);font-variant-numeric:tabular-nums;letter-spacing:-.04em;}
.rbig small {font-size:20px;margin-left:6px;}
.rcm {font-size:12px;color:var(--green);font-weight:750;line-height:1.9;margin:8px 0 20px;}
.rstats {display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 24px;}
.rstats>div {background:#f5f2e8;padding:13px 4px;border-radius:12px;}
.rstats b {display:block;font-size:23px;font-weight:900;font-variant-numeric:tabular-nums;}
.rstats span {font-size:9px;color:var(--muted);}
.result-actions {display:grid;gap:12px;}
.btn {appearance:none;border:0;min-height:51px;width:100%;border-radius:30px;background:var(--coral);color:#fff;font-weight:850;font-size:14px;padding:13px 20px;box-shadow:0 5px 0 #953820;transition:transform .15s;}
.btn:active {transform:translateY(3px);box-shadow:0 2px 0 #953820;}
.btn.ghost {box-shadow:none;border:1px solid #d9ddcf;color:var(--green);background:transparent;}
.rw-back {background:#fff8e5!important;color:var(--green)!important;border-color:#d6d7c4!important;font-size:12px!important;}
[data-rw-note] {color:var(--green)!important;padding:8px 20px;}
#rw-lock {background:#263c3699!important;}
#rw-lock>div {background:var(--paper)!important;color:var(--ink)!important;border-color:var(--line)!important;}
#rw-lock>div>div {color:var(--ink)!important;}
#rw-lock a {background:#f0e4c9!important;color:var(--green)!important;border-color:var(--line)!important;}
#rw-lock a:first-of-type {background:var(--coral)!important;color:white!important;}
#rw-lock button {color:var(--muted)!important;}
#oj-gate {background:var(--paper)!important;color:var(--ink)!important;}
#oj-gate>div>div {color:var(--ink)!important;}
@media(max-width:800px) {
  #stage {width:calc(100% - 32px);}
  .title-copy,.result-copy {padding:26px 22px;}
  .stage-thumb {width:70px;}
  .stagebtn .body {padding-left:10px;}
  .stagebtn .nm {font-size:17px;}
  .stagebtn .go {margin-right:8px;width:24px;height:24px;}
  .title-art {min-height:580px;}
}
@media(max-width:620px) {
  #stage {width:calc(100% - 24px);}
  .app-bar {min-height:69px;gap:12px;}
  .brand {font-size:8px;gap:7px;padding-left:11px;letter-spacing:.08em;}
  .brand-icon {width:27px;height:27px;font-size:17px;}
  .plaza {font-size:10px;}
  .corner {min-height:37px;min-width:37px;padding:6px 9px;}
  .screen {grid-template-columns:1fr;border-radius:21px;}
  .title-art {height:235px;min-height:0;}
  .title-art img {object-position:center 49%;}
  .art-badge {top:16px;left:16px;font-size:9px;padding:7px 11px;}
  .art-caption {bottom:16px;left:18px;right:18px;}
  .art-caption strong {font-size:15px;line-height:1.4;}
  .art-caption small {font-size:7px;}
  .title-copy,.result-copy {padding:26px 22px;}
  h1 {font-size:38px;margin-bottom:13px;}
  .eyebrow {font-size:8px;margin-bottom:11px;}
  .lead {font-size:11px;margin-bottom:18px;}
  .stage-thumb {width:86px;min-height:105px;}
  .stagebtn .body {padding:12px;}
  .stagebtn .nm {font-size:19px;}
  .stagebtn .go {margin-right:11px;}
  .app-footer {font-size:8px;}
  .hud {gap:6px;margin-bottom:12px;}
  .stat {padding:11px 11px;border-radius:12px;}
  .stat strong {font-size:25px;}
  .stat small {font-size:9px;}
  .stat>span {font-size:8px;letter-spacing:0;}
  .play-heading h2 {font-size:12px;}
  .play-heading p {font-size:9px;}
  .gauge-label {font-size:9px;}
  .board-frame {padding:5px;border-radius:18px;}
  #cv {height:clamp(350px,57svh,550px);border-radius:12px;}
  .board-meta {font-size:9px;gap:5px;margin:10px 1px;}
  .room-track {width:36px;}
  .result-art {height:220px;min-height:0;}
  .result-art img {object-fit:contain;object-position:center;background:#f8efd9;}
  .rttl {font-size:25px;margin-bottom:16px;}
  .rbig {font-size:66px;}
}
@media(max-width:360px) {
  .brand {letter-spacing:0;font-size:7px;}
  .title-copy,.result-copy {padding:23px 17px;}
  h1 {font-size:34px;}
  .stage-thumb {width:69px;}
  .stagebtn .body {padding:11px 9px;}
  .rules b {font-size:10px;}
  .stat {padding:10px 8px;}
  .board-meta>span:first-child {max-width:52%;line-height:1.5;}
}
@media(prefers-reduced-motion:reduce) {html {scroll-behavior:auto;}*,*:before,*:after {transition:none!important;animation:none!important;}}

/* Match the original viewport-sized play area, including portrait phones. */
html:has(#play:not(.hidden)), body:has(#play:not(.hidden)) { overflow:hidden; overscroll-behavior:none; }
#stage:has(#play:not(.hidden)) { position:fixed; inset:0; width:100%; height:100%; margin:0; padding:0; overflow:hidden; }
#stage:has(#play:not(.hidden)) #play, #stage:has(#play:not(.hidden)) .board-frame { position:absolute; inset:0; width:100%; height:100%; max-width:none; margin:0; padding:0; border:0; border-radius:0; }
#stage:has(#play:not(.hidden)) #cv { width:100%; height:100%; border-radius:0; }
#stage:has(#play:not(.hidden)) .app-bar { position:absolute; z-index:20; top:max(8px,env(safe-area-inset-top)); right:max(8px,env(safe-area-inset-right)); height:auto; min-height:0; padding:0; margin:0; border:0; }
#stage:has(#play:not(.hidden)) .controls { margin:0; gap:4px; }
#stage:has(#play:not(.hidden)) .controls button { min-width:40px; min-height:40px; padding:8px; font-size:11px; border-radius:12px; }
#stage:has(#play:not(.hidden)) #mute { font-size:17px; }
#stage:has(#play:not(.hidden)) .plaza, #stage:has(#play:not(.hidden)) .brand, #stage:has(#play:not(.hidden)) .mini-brand, #stage:has(#play:not(.hidden)) .header-divider,
#stage:has(#play:not(.hidden)) .play-heading, #stage:has(#play:not(.hidden)) .play-note, #stage:has(#play:not(.hidden)) .board-meta,
#stage:has(#play:not(.hidden)) .fever-row, #stage:has(#play:not(.hidden)) .gauge-label, #stage:has(#play:not(.hidden)) .page-footer, #stage:has(#play:not(.hidden)) .app-footer { display:none; }
#stage:has(#play:not(.hidden)) .hud { position:absolute; z-index:5; top:max(8px,env(safe-area-inset-top)); left:max(8px,env(safe-area-inset-left)); right:112px; width:auto; max-width:460px; display:flex; gap:4px; margin:0; }
#stage:has(#play:not(.hidden)) .stat { flex:1; min-width:0; padding:5px; border-radius:10px; }
#stage:has(#play:not(.hidden)) .stat-label, #stage:has(#play:not(.hidden)) .stat>span { display:block; font-size:8px; margin:0 0 2px; letter-spacing:0; white-space:nowrap; }
#stage:has(#play:not(.hidden)) .stat-value, #stage:has(#play:not(.hidden)) .stat strong { font-size:18px; line-height:1.2; margin:0; }
#stage:has(#play:not(.hidden)) .stat>.stat-unit, #stage:has(#play:not(.hidden)) .stat small { display:none; }
#stage:has(#play:not(.hidden)) .gauge-track { position:absolute; z-index:5; top:calc(max(8px,env(safe-area-inset-top)) + 52px); left:max(8px,env(safe-area-inset-left)); right:max(8px,env(safe-area-inset-right)); max-width:560px; height:8px; margin:0; }
