#stage {
  --ink:#182d49; --red:#a53320; --gold:#b7823a; --paper:#fff2d6;
  color:var(--ink); min-height:calc(100svh - 56px); padding:clamp(10px,2.4vw,28px);
  background:#785139 url('assets/backgrounds/bg-play.webp') center/cover;
  font-family:"BIZ UDPGothic","Yu Gothic",Meiryo,sans-serif; line-height:1.55;
}
#stage[data-screen="title"] {background-image:url('assets/backgrounds/bg-title.webp')}
#stage *,#stage {box-sizing:border-box}
#stage [hidden]{display:none!important}
#board{width:min(100%,950px);margin:auto}
#stage h1,#stage h2,#stage h3,#stage p,#stage ol {margin:0}
#stage h1,#stage h2,#stage .identity,#stage .points {font-family:"Yu Mincho","Hiragino Mincho ProN",serif}
#stage button {font-family:inherit;cursor:pointer;touch-action:manipulation}
#stage :focus-visible,.skip:focus {outline:4px solid #18729b;outline-offset:3px}
.skip,.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.skip:focus{z-index:20000;background:white;width:auto;height:auto;clip-path:none}
#stage .paper,#stage .folio,#notice,#retry {background:#fff5df url('assets/textures/washi-paper.webp') center/550px;border:2px solid #b88746;border-radius:14px;box-shadow:0 4px 0 #55301560,0 6px 19px #341d1036}
#stage .paper{padding:clamp(14px,2.4vw,28px)}
#stage .btn {min-height:46px;border:0;background:transparent url('assets/ui/button-indigo.svg') center/100% 100% no-repeat;color:#fff6e2;font-weight:800;line-height:1.35;padding:11px 22px;font-size:1rem;display:inline-flex;align-items:center;justify-content:center;gap:.4em}
#stage .btn.red{background-image:url('assets/ui/button-vermilion.svg')}
#stage .btn.light{background-image:url('assets/ui/button-paper.svg');color:var(--ink)}
#stage .btn:active{transform:translateY(1px)}
#stage .btn:disabled{opacity:.55;cursor:default}
#stage .btn img{width:1.4em;height:1.4em}
#stage .btn:not(.light) img{filter:brightness(0) invert(.95)}
#stage .toolbar,#stage .row,#stage .scorebar {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
#stage .hero{max-width:840px;margin:auto;display:grid;justify-items:center;gap:12px}
#stage .hero h1 {max-width:610px;width:84%;line-height:0}
#stage .hero h1 img{width:100%;max-height:185px;object-fit:contain;filter:drop-shadow(0 3px 3px #341a10aa)}
#stage .hero .tagline{background:#fff4d9;color:#562516;border:1px solid #bd8e53;border-radius:25px;padding:4px 18px;font-weight:bold;text-align:center}
#stage .fan{position:relative;width:min(75vw,405px);height:clamp(142px,25vh,224px);margin:4px auto 12px;pointer-events:none}
#stage .fan .card{position:absolute;height:100%;width:auto;top:0;left:50%;transform:translateX(-50%)}
#stage .fan .card:first-child{left:27%;transform:translateX(-50%) rotate(-11deg) scale(.88)}
#stage .fan .card:nth-child(2){left:73%;transform:translateX(-50%) rotate(11deg) scale(.88)}
#stage .modes,#stage .aux,#stage .answers,#stage .buzzers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#stage .modes{width:min(100%,750px)}
#stage .difficulty{min-width:0;max-width:100%;margin:0;padding:0 12px 5px;border:1px solid #ad854c;border-radius:12px;background:#fff4dc;color:var(--ink);text-align:center}
#stage .difficulty legend{margin:auto;padding:2px 10px;border-radius:16px;background:#fff4dc;font-weight:bold}
#stage .difficulty label{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 6px;cursor:pointer}
#stage .difficulty input{margin:0;accent-color:var(--ink)}
#stage .modes .btn,#stage .buzzers .btn{min-height:64px;font-size:clamp(18px,2.8vw,28px)}
#stage .aux{max-width:560px;width:100%;grid-template-columns:1fr 1fr auto}
#stage .best{font-weight:700;background:#fff5df;padding:4px 14px;border-radius:20px}
#stage .card{position:relative;aspect-ratio:2/3;width:100%;overflow:hidden;border-radius:7%;background:#f4e4c0 url('assets/textures/washi-paper.webp') center/cover;box-shadow:0 5px 9px #3d271952;isolation:isolate}
#stage .card:after{content:"";position:absolute;inset:0;background:url('assets/cards/card-frame.svg') center/100% 100%;pointer-events:none}
#stage .card.back{background:#233349 url('assets/cards/card-back.webp') center/100% 100%}
#stage .question{position:absolute;inset:0;display:grid;place-items:center;color:#ffe8b2;font:800 clamp(44px,9vw,116px)/1 Georgia,serif}
#stage .inner{position:absolute;inset:3.33% 5%;display:flex;flex-direction:column}
#stage .portrait{width:100%;aspect-ratio:1;flex:none;object-fit:contain;border-radius:6% 6% 0 0}
#stage .identity{flex:1;min-height:0;display:flex;flex-flow:column;justify-content:center;text-align:center;padding:1% 3%;line-height:1.25;overflow-wrap:anywhere}
#stage .identity small{font:600 clamp(10px,1vw,13px)/1.2 sans-serif}
#stage .identity strong{font-size:clamp(16px,2.4vw,29px)}
#stage .identity .long{font-size:clamp(14px,1.9vw,22px)}
#stage .era{font:600 .76rem/1.3 sans-serif;margin-top:3px}
#stage .lost-art {display:grid;place-items:center;font-size:0.82rem;text-align:center;color:#5e4b3b}
#stage .scorebar{padding:7px 15px;margin-bottom:12px;font-size:clamp(14px,2vw,19px);font-weight:750}
#stage .play-grid{display:grid;grid-template-columns:minmax(145px,.8fr) minmax(0,1.65fr);gap:clamp(10px,2vw,24px);align-items:start}
#stage .card-well{width:min(100%,290px);margin:0 auto;perspective:1100px}
#stage .flip{position:relative;aspect-ratio:2/3;perspective:1000px}
#stage .flip-back,#stage .flip-front{position:absolute;inset:0;backface-visibility:hidden}
#stage .flip-back{transform:rotateY(180deg);animation:fold-back .55s ease-in-out}
#stage .flip-front{animation:fold-front .55s ease-in-out}
@keyframes fold-back{from{transform:rotateY(0)}to{transform:rotateY(180deg)}}
@keyframes fold-front{from{transform:rotateY(-180deg)}to{transform:rotateY(0)}}
#stage .folio{padding:clamp(15px,2.5vw,30px);min-width:0}
#stage .folio h2{border-bottom:1px solid #b99563;padding-bottom:6px;margin-bottom:12px}
#stage .hints{padding:0;list-style:none;counter-reset:clue;display:grid;gap:7px}
#stage .hints li{counter-increment:clue;display:flex;align-items:baseline;gap:.6em;border-bottom:1px dashed #b59872;padding-bottom:6px}
#stage .hints li:before{content:counter(clue);background:var(--ink);color:#fff6df;font:700 .85em/1.65 Georgia,serif;min-width:1.65em;text-align:center;border-radius:50%}
#stage .folio .actions{margin-top:15px;display:grid;gap:8px}
#stage .points{color:var(--red);font-size:1.35em;font-weight:bold}
#stage .counter{font-variant-numeric:tabular-nums;min-height:1.6em}
#stage .toolbar{margin:12px auto 0}
#stage .winner{font-size:clamp(23px,4vw,38px);color:var(--red)}
#stage .answers .btn{display:grid;gap:2px;overflow-wrap:anywhere}
#stage .answers small{font-size:.74em;font-weight:500}
#stage .name-answer{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 8px}
#stage .name-answer label{grid-column:1/-1;font-weight:bold}
#stage .name-answer input{width:100%;min-width:0;min-height:46px;padding:6px 10px;border:2px solid #9a7238;border-radius:6px;background:#fffdf6;color:var(--ink);font:inherit;font-size:max(1em,16px)}
#stage .name-answer .btn{background:var(--ink);border:2px solid #b48b52;border-radius:7px}
#stage .name-answer .btn.red{background:var(--red)}
#stage .page{max-width:790px;margin:auto}
#stage .page h2{margin:12px 0 5px}
#stage .album{display:grid;grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:12px;margin-top:18px}
#stage .album button{padding:0;border:0;background:none;border-radius:8px}
#stage .album .identity strong{font-size:clamp(13px,1.4vw,18px)}
#stage .album .identity small,#stage .album .era{display:none}
#stage .album .question{font-size:clamp(35px,6vw,66px)}
#stage .recap{margin:4px 0 14px;padding:0;list-style:none}
#stage .recap summary{padding:8px 4px;min-height:44px;cursor:pointer}
#stage .recap details[open]{padding-bottom:8px;border-bottom:1px solid #c6a879}
#notice,#retry{padding:7px 12px;margin:10px auto 0;max-width:620px}
@media(max-width:620px){
 #stage{padding:10px}
 #stage .hero{gap:10px}
 #stage .play-grid{grid-template-columns:minmax(0,1fr)}
 #stage .card-well{width:clamp(96px,24vw,145px)}
 #stage .play-grid.revealed .card-well{width:clamp(148px,42vw,205px)}
 #stage .scorebar{margin-bottom:8px}
 #stage .modes .btn,#stage .buzzers .btn{padding:12px 8px;min-height:56px}
 #stage .btn{padding:10px 12px}
 #stage .hints{gap:5px}
 #stage .aux{grid-template-columns:1fr 1fr}
 #stage .aux .sound{grid-column:1/-1;justify-self:center}
 #stage .album{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
}
@media(prefers-reduced-motion:reduce){#stage .flip-back,#stage .flip-front{animation:none} #stage .btn:active{transform:none}}
#leave-dialog{max-width:min(460px,90vw);padding:24px;border:2px solid #a77843;border-radius:14px;background:#fff3d9;color:var(--ink)}
#leave-dialog::backdrop{background:#20181290}
#leave-dialog form{display:flex;gap:8px;margin-top:12px}
#leave-dialog button{min-height:44px;padding:6px 16px}
#stage .room-lobby{max-width:590px}
#stage .room-lobby section,#stage .join-room{margin:18px 0;padding:12px 0;border-top:1px solid #c3a579}
#stage .join-room div{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#invite-code{min-height:46px;max-width:100%;width:9em;border:2px solid #9a7238;border-radius:7px;padding:6px 10px;font:inherit;font-size:18px}
#stage .invite-code{display:block;margin:16px 0;font:bold clamp(32px,8vw,48px)/1.2 Georgia,serif;letter-spacing:.14em}
#room-status:not(:empty){margin-top:12px;padding:8px 12px;border-radius:6px;background:#fff3d9;color:#193450}
#room-status:empty{display:none}
