/* DeskPlay 공통 게임 화면: 가운데 9:16 무대, 데스크톱에서는 양옆에 안내·순위 */
html,body{height:100%;margin:0;overflow:hidden;background:var(--bg)}
[hidden]{display:none!important}
.g-wrap{height:100%;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:28px;align-items:center;padding:0 24px;box-sizing:border-box}
.g-side{align-self:stretch;display:flex;flex-direction:column;justify-content:center;gap:18px;min-width:0;max-width:340px}
.g-left{justify-self:end}.g-right{justify-self:start}
.g-stagebox{position:relative;height:calc(100vh - 32px);aspect-ratio:9/16;max-width:calc(100vw - 32px)}
#stage{width:100%;height:100%;display:block;border-radius:22px;background:#0d0b28;touch-action:none}
.g-home{display:inline-flex;align-items:center;gap:8px;color:var(--sub);text-decoration:none;font-weight:650;font-size:14px}
.g-home:hover{color:#fff}
.g-cat{display:inline-block;font-size:12.5px;font-weight:700;color:var(--bg);background:var(--sun);border-radius:999px;padding:4px 10px;width:max-content}
.g-title{margin:0;font-size:34px;font-weight:850;letter-spacing:-.045em;line-height:1.1}
.g-how{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:10px;counter-reset:h}
.g-how li{counter-increment:h;display:grid;grid-template-columns:26px 1fr;gap:10px;color:var(--sub);font-size:14.5px;line-height:1.55}
.g-how li::before{content:counter(h);width:26px;height:26px;border-radius:50%;background:var(--surface-2);color:#fff;display:grid;place-items:center;font-size:12.5px;font-weight:800}
.g-card{background:var(--surface);border-radius:var(--r-lg);padding:18px}
.g-card h3{margin:0 0 10px;font-size:16px;letter-spacing:-.02em}
.g-rank{display:flex;flex-direction:column;gap:2px;font-variant-numeric:tabular-nums}
.g-rank div{display:grid;grid-template-columns:22px 1fr auto;gap:8px;font-size:14px;padding:6px 0;border-bottom:1px solid var(--line-soft)}
.g-rank div b{color:var(--sun)}.g-rank .me{color:var(--sun)}
.g-mut{color:var(--mute);font-size:13px;line-height:1.6;margin:0}
.g-btn{font:700 15px var(--font);border:0;border-radius:var(--r-md);padding:12px 18px;cursor:pointer;background:var(--surface-2);color:#fff}
.g-btn.coral{background:var(--coral)}.g-btn.coral:hover{background:var(--coral-2)}
.g-btn.ghost{background:transparent;border:1px solid var(--line)}
.g-btn.sm{padding:8px 12px;font-size:13px}
/* 무대 위 시작 카드 */
.g-over{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:flex-end;padding:22px;box-sizing:border-box;border-radius:22px;background:linear-gradient(180deg,#0d0b2800 0%,#0d0b28cc 45%,#0d0b28f2 100%)}
.g-over h2{margin:0 0 6px;font-size:30px;font-weight:850;letter-spacing:-.04em}
.g-over p{margin:0 0 14px;color:var(--sub);font-size:15px;line-height:1.55}
.g-tip{display:flex;gap:12px;align-items:flex-start;background:#ffffff12;border-radius:var(--r-md);padding:12px 14px;margin-bottom:14px;font-size:14px;line-height:1.55;color:#e9e7ff}
.g-tip svg{flex:none;width:34px;height:34px}
.g-dur{display:flex;align-items:center;gap:10px;margin-bottom:14px;font-size:14px;color:var(--sub)}
.g-seg{display:flex;background:#00000040;border-radius:999px;padding:3px}
.g-seg button{font:650 14px var(--font);border:0;background:transparent;color:var(--sub);padding:6px 14px;border-radius:999px;cursor:pointer}
.g-seg button.on{background:#fff;color:var(--bg)}
.g-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.g-row .coral{flex:1;font-size:18px;padding:15px}
.g-load{position:absolute;inset:0;display:grid;place-items:center;text-align:center;padding:24px;border-radius:22px;background:#0d0b28e8;font-size:16px;line-height:1.6;color:#fff}
/* 결과 */
.g-res{position:fixed;inset:0;z-index:20;background:var(--bg);overflow:auto;padding:0 16px 32px}
.g-res .dpnav{width:100%}
.g-resgrid{max-width:1000px;margin:12px auto 0;display:grid;grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:20px;align-items:start}
@media (max-width:820px){.g-resgrid{grid-template-columns:1fr}}
.g-panel{background:var(--surface);border-radius:var(--r-lg);padding:20px;display:flex;flex-direction:column;gap:12px;min-width:0}
.g-clip{position:relative;aspect-ratio:9/16;width:100%;max-width:320px;margin:0 auto;background:#000;border-radius:var(--r-md);overflow:hidden}
.g-clip video{width:100%;height:100%;object-fit:cover;display:block}
.g-clip .w{position:absolute;inset:0;display:grid;place-items:center;color:var(--sub);font-size:14px}
.g-big{font-size:72px;font-weight:900;letter-spacing:-.05em;line-height:1;font-variant-numeric:tabular-nums}
.g-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.g-stats div{background:var(--bg);border-radius:var(--r-md);padding:12px}.g-stats small{display:block;color:var(--sub);font-size:12.5px}.g-stats b{font-size:21px}
.g-sns{display:flex;flex-direction:column;gap:8px}
.g-sns button{display:flex;align-items:center;gap:10px;background:var(--bg);text-align:left}
.g-sns i{width:12px;height:12px;border-radius:50%;flex:none}
.g-dare{display:grid;grid-template-columns:1fr auto;gap:2px 12px;align-items:center;background:var(--bg);border-radius:var(--r-md);padding:14px 16px}
.g-dare span{font-size:13px;color:var(--sub)}.g-dare button{grid-row:1 / span 2;grid-column:2}
.g-next{display:flex;gap:10px;overflow-x:auto;padding-bottom:4px}
.g-next a{flex:none;width:150px;background:var(--bg);border-radius:var(--r-md);padding:12px;color:#fff;text-decoration:none;font-weight:700;font-size:14px}
.g-next a small{display:block;color:var(--mute);font-weight:500;font-size:12px;margin-top:4px}
.g-pm{position:fixed;inset:0;z-index:40;background:#0d0b28cc;display:flex;align-items:center;justify-content:center;padding:16px}
.g-pm .box{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:22px;width:min(420px,100%);text-align:center;display:flex;flex-direction:column;gap:10px}
.g-pm img{width:220px;height:220px;background:#fff;border-radius:14px;padding:8px;margin:4px auto}
.g-pm code{word-break:break-all;color:var(--sun);font-size:13px}
.g-toast{position:fixed;left:50%;top:18px;transform:translateX(-50%);background:var(--sun);color:var(--bg);font-weight:750;border-radius:999px;padding:10px 18px;z-index:60;max-width:calc(100% - 32px);text-align:center}
.g-mbar{display:none}
/* 좁은 화면(휴대폰·태블릿 세로): 무대 + 아래 얇은 조작 줄 */
@media (max-width:1000px){
  .g-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;gap:0;height:100vh;height:100dvh}
  .g-side{display:none}
  .g-stagebox{height:auto;width:min(100vw,calc((100vh - 52px)*9/16));width:min(100vw,calc((100dvh - 52px)*9/16));max-width:none}
  #stage,.g-over,.g-load{border-radius:0}
  .g-mbar{display:flex;align-items:center;gap:10px;height:52px;width:min(100vw,calc((100dvh - 52px)*9/16));min-width:min(100vw,360px);padding:0 12px;box-sizing:border-box;font-size:14px;color:var(--sub)}
  .g-mbar a{color:var(--sub);text-decoration:none;font-weight:650}
  .g-mbar b{flex:1;text-align:center;color:#fff;font-weight:750;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  .g-mbar button{font:650 13px var(--font);background:var(--surface-2);color:#fff;border:0;border-radius:999px;padding:7px 12px}
}
/* 아이 톤 (지침 14절, 2026-11-10): 게임 화면의 바탕·옆 칸을 밝게. 무대(캔버스)·시작 카드·결과 화면은 그대로 */
:root[data-theme="kids"].dpg body{background:linear-gradient(180deg,#bfeefa 0%,#eaf9ff 55%,#fff6dd 100%)}
:root[data-theme="kids"].dpg .g-side,:root[data-theme="kids"].dpg .g-mbar{--text:#173a5e;--sub:#4d6b89;--mute:#6f8aa3;--surface:#ffffffe6;--surface-2:#dff3fb;--line:#cfe9f5;--line-soft:#173a5e14;color:#173a5e}
:root[data-theme="kids"].dpg .g-card{box-shadow:0 10px 24px -14px #1a5f8a66}
:root[data-theme="kids"].dpg .g-how li::before{background:#1689bd;color:#fff}
:root[data-theme="kids"].dpg .g-home:hover{color:#1689bd}
:root[data-theme="kids"].dpg .g-side .g-btn:not(.coral){color:#173a5e;background:#fff;border-color:#bcdde6}
:root[data-theme="kids"].dpg .g-rank div b,:root[data-theme="kids"].dpg .g-rank .me{color:#e07a1f}
:root[data-theme="kids"].dpg .g-mbar button,:root[data-theme="kids"].dpg .g-mbar a{color:#173a5e}
:root[data-theme="kids"].dpg #stage{box-shadow:0 18px 40px -18px #1a5f8a88}
/* 아이 톤 결과 화면: 밝은 하늘 바탕·흰 카드 (메뉴 줄은 메인과 같은 파란 띠) */
:root[data-theme="kids"].dpg .g-res{--bg:#eaf6fb;--surface:#ffffff;--surface-2:#e3f4fb;--text:#173a5e;--sub:#4d6b89;--mute:#6f8aa3;--line:#cfe9f5;--line-soft:#173a5e14;background:linear-gradient(180deg,#bfeefa 0%,#eaf9ff 50%,#fff6dd 100%);color:#173a5e}
:root[data-theme="kids"].dpg .g-res .dpnav{--text:#fff;--sub:#e3f6ff;--mute:#cfeefc;--line:#ffffff66;--line-soft:#ffffff26;--surface:#ffffff26;--surface-2:#ffffff33;--bg:#1689bd;background:#1689bd;box-shadow:0 0 0 100vmax #1689bd;clip-path:inset(0 -100vmax);color:#fff}
:root[data-theme="kids"].dpg .g-panel{box-shadow:0 12px 28px -16px #1a5f8a66}
:root[data-theme="kids"].dpg .g-res .g-btn:not(.coral){color:#173a5e;background:#fff;border:1px solid #bcdde6}
:root[data-theme="kids"].dpg .g-next a{color:#173a5e}
:root[data-theme="kids"].dpg .g-big{color:#e8642c}
.g-big{position:relative}.g-big .g-dog{position:absolute;right:4px;bottom:-4px;width:104px;height:auto;filter:drop-shadow(0 6px 8px #0003)}
:root[data-theme="kids"].dpg .g-over{background:linear-gradient(180deg,#0b4a8000 0%,#0b4a80c4 45%,#0a3d6cf2 100%)}

/* 운동장 넓은 화면 (지침 16-17): A) 3D 장면이 화면 전체 · C) 옆 칸 '지금 놀이 중' 판 */
.g-widebg{position:fixed;inset:0;width:100vw;height:100vh;z-index:0;display:block}
:root.dpg-wide body{background:#000}
:root.dpg-wide .g-wrap{position:relative;z-index:1;padding:0}
:root.dpg-wide .g-side{visibility:hidden}
:root.dpg-wide .g-stagebox{height:100vh;max-width:none}
:root.dpg-wide #stage{border-radius:0;box-shadow:none!important;background:transparent}
.g-live{display:none}
:root.dpg-live .g-side > :not(.g-live){display:none}
:root.dpg-live .g-side{max-width:none;width:100%;align-items:center}
:root.dpg-live .g-livecam.on{display:block;width:min(100%,62vh);aspect-ratio:4/3;border-radius:26px;overflow:hidden;background:#0d0b28;box-shadow:0 18px 40px -18px #1a5f8a88;border:6px solid #fff}
:root.dpg-live .g-livecam video{width:100%;height:100%;object-fit:cover;transform:scaleX(-1);display:block}
:root.dpg-live .g-livesc{display:flex;flex-direction:column;align-items:center;gap:1.2vh;background:var(--surface,#fff);border-radius:30px;padding:4vh 3vw;min-width:min(100%,300px);box-shadow:0 18px 40px -18px #1a5f8a66}
:root.dpg-live .g-livesc b{font-size:min(16vh,9vw);line-height:1;font-weight:900;letter-spacing:-.03em;color:var(--coral,#ff5e5b);font-variant-numeric:tabular-nums}
:root.dpg-live .g-livesc i{font-style:normal;font-size:min(5vh,3vw);font-weight:800;color:var(--sub,#4d6b89)}

/* 끝난 뒤 저절로 한 판 더(설치한 앱에서만, 2026-12-06)의 남은 초 — [다시 하기] 단추 오른쪽 위 */
.g-cd{position:absolute;right:-8px;top:-10px;min-width:26px;height:26px;border-radius:13px;background:#ffc93c;color:#17143f;font:900 14px/26px system-ui,sans-serif;text-align:center;font-style:normal;padding:0 6px;box-shadow:0 2px 6px #0006}
#gAgain,#gHAgain{position:relative}
