/* Shared chrome; native play stages keep their signal colors and controls. */
:root{--pg-header-h:96px;--timer-h:var(--pg-header-h)}
header.pg-site-header{position:relative!important;top:auto;background:#f7f8f2;backdrop-filter:none;flex-shrink:0}
body:has(>.pg-site-header){background:#f7f8f2;color:#192d25}
body.pg-app{--paper:#f7f8f2;--bg:#f7f8f2;background:#f7f8f2}
body.pg-app>.pg-site-header{display:block!important}
body.pg-app #app{padding-top:0;margin-top:0}
body.pg-game:not(.pg-idle):not(.pg-result) #app>.view.active:not(.pg-arena-game){min-height:0;display:flex;flex-direction:column}
body.pg-app #app .pg-game-view>.game-header{position:relative;top:auto;flex-shrink:0;background:#f7f8f2;color:#192d25;padding:12px 24px;gap:14px;border-bottom:1px solid #dbe3d966}
body.pg-app #app .pg-game-view>.game-header .brand{font-size:15px;line-height:1.5;font-weight:650;min-width:0}
body.pg-app #app .pg-game-view>.game-header .brand>span:first-child{display:none}
body.pg-app #app .pg-game-view>.game-header .brand>span:last-child{opacity:1;font-weight:650;margin:0}
body.pg-app #app .pg-game-view>.game-header .back-btn{width:38px;height:38px;border-radius:10px;background:#fff;border:1px solid #dbe3d9;color:#176b4b}
body.pg-app .pg-game-view>.game-footer{font-size:12px;padding:12px 18px;gap:18px}
.pg-common-game-footer{display:none}body.pg-idle .view.active>.pg-common-game-footer,body.pg-result .view.active>.pg-common-game-footer,body.pg-result .view.active>.pg-start-footer{display:block}
body.pg-idle:not(.pg-start) #app>.view.active,body.pg-result #app>.view.active{height:auto;min-height:calc(100dvh - var(--pg-header-h));overflow:visible;background:#f7f8f2;color:#192d25;display:flex}
body.pg-idle .pg-game-view:not(.game-cs):not(.game-moment)>.game-header{max-width:1100px;width:100%;margin:auto;border:0;padding:20px 32px 0}
/* Legacy introductions contain different native mode pickers: give each a full-width content card. */
.pg-legacy-cover{display:none}
body.pg-idle #app>.view.active:not(.pg-arena-game)>main:not(.pg-native-idle-host){display:block;flex:none;width:100%;max-width:1100px;height:auto;min-height:0;max-height:none;margin:0 auto;padding:0;overflow:visible}
body.pg-idle #app .view.active .pg-native-idle-host{position:relative;box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;flex:none;width:calc(100% - 64px);max-width:840px;min-width:0;min-height:0;height:auto;max-height:none;margin:24px auto 32px;padding:28px;gap:18px;overflow:visible;color:#192d25;background:#fff;border:1px solid #dbe3d9;border-radius:24px;text-align:left;transform:none}
body.pg-idle #app .pg-legacy-cover{display:grid;position:relative;grid-template-columns:minmax(0,1fr) 180px;grid-template-rows:auto 1fr;gap:10px 24px;left:auto;top:auto;width:100%;min-width:0;align-items:start;margin:0 0 6px;padding:0;transform:none}
body.pg-idle #app .pg-legacy-cover>.pg-eyebrow{grid-column:1;grid-row:1;align-self:end}
body.pg-idle #app .pg-legacy-cover>h1{grid-column:1;grid-row:2;font-size:32px;line-height:1.35;margin:0;letter-spacing:-1px;overflow-wrap:anywhere}
body.pg-idle #app .pg-legacy-cover .pg-start-art{grid-column:2;grid-row:1 / 3;width:180px;height:160px;min-height:0;display:grid;place-items:center;margin:0;background:#e4efe5;border-radius:18px;overflow:hidden;align-self:center}
body.pg-idle #app .pg-legacy-cover .preview{position:relative;display:grid;place-items:center;width:132px;height:132px;min-width:0;min-height:0;margin:0;border:0;border-radius:14px;zoom:1;transform:none;overflow:hidden;flex:none}
body.pg-idle #app .pg-legacy-cover .preview>svg,body.pg-idle #app .pg-legacy-cover .preview>img{display:block;width:100%;height:100%;max-width:100%;object-fit:contain;position:static;transform:none}
body.pg-idle #app .view.active .pg-native-idle-host>.pg-native-title{font-size:21px;line-height:1.5;letter-spacing:-.5px;width:100%;max-width:none;min-width:0;text-align:left;margin:0;color:#192d25;position:static;transform:none}
body.pg-idle #app .view.active .pg-native-idle-host>.pg-native-description{font-size:14px;line-height:1.9;width:100%;max-width:none;min-width:0;text-align:left;margin:0;color:#5b6d63;position:static;transform:none}
body.pg-idle #app .view.active .pg-native-idle-host>.pg-original-idle-art{display:none!important}
body.pg-idle #app .view.active .pg-native-idle-host>:is(.t2-ages,.cl-ages,.bb-ages,.ck-ages){position:static;align-self:flex-start;flex:none;width:auto;max-width:100%;margin:0;transform:none}
body.pg-idle #app .view.active .pg-native-idle-host>:is(div,section){min-width:0;max-width:100%;box-sizing:border-box}
body.pg-idle #app .view.active .pg-native-idle-host .btn{border-radius:13px;font-size:14px;min-height:46px;max-width:100%;white-space:normal}
body.pg-idle #app .view.active .pg-native-idle-host .single-start{width:100%;min-height:48px;padding:13px 24px;background:#176b4b;color:white;border:0}
body.pg-idle .pg-game-view>.game-footer{max-width:1100px;width:100%;margin:0 auto;color:#5b6d63}
@media(max-width:600px){body.pg-idle #app .view.active .pg-native-idle-host{width:calc(100% - 32px);padding:20px;margin:20px auto 24px;gap:16px;border-radius:18px}body.pg-idle #app .pg-legacy-cover{grid-template-columns:minmax(0,1fr) 96px;gap:8px 14px}body.pg-idle #app .pg-legacy-cover>h1{font-size:27px}body.pg-idle #app .pg-legacy-cover .pg-start-art{width:96px;height:104px;border-radius:14px}body.pg-idle #app .pg-legacy-cover .preview{width:84px;height:84px}body.pg-idle #app .view.active .pg-native-idle-host>.pg-native-title{font-size:19px}}
/* Results scroll as a page beneath the same site header. */
body.pg-result #app>.view.active>.cs-main,body.pg-result #app>.view.active>.mo-main{height:auto;min-height:0;overflow:visible;flex:none;width:100%}
body.pg-result #app .view.active :is(.cs-result,#moScrResult){height:auto;min-height:0;max-height:none;overflow:visible;max-width:620px;width:calc(100% - 40px);margin:24px auto;padding:28px!important;border:1px solid #dbe3d9;border-radius:24px;background:#fff;color:#192d25;box-sizing:border-box}
body.pg-result #app .view.active :is(.cs-result,#moScrResult)>.cs-res-btns{width:100%}
body.pg-result #app .view.active :is(.cs-res-btns,.mo-res-btns) .btn{border-radius:13px;min-height:46px}
body.pg-result #app .view.active :is(.arena-submit,.arena-result-rank){border-radius:18px}
body.pg-result #app .view.active>.game-footer{display:none}
body.pg-result #app>.pg-game-view:not(.game-cs):not(.game-moment)>main{width:calc(100% - 40px);max-width:900px;height:auto;min-height:300px;max-height:none;margin:24px auto;padding:28px;box-sizing:border-box;background:#fff;border:1px solid #dbe3d9;border-radius:24px;overflow:visible;flex:none}
/* Leave a visible page gutter around native arena stages. */
body.pg-playing #app>.view.active.pg-arena-game{width:calc(100% - 64px);max-width:1100px;margin:20px auto;height:calc(100dvh - var(--pg-header-h) - 40px);border:1px solid #dbe3d9;border-radius:24px;overflow:hidden;box-sizing:border-box}
@media(max-width:600px){body.pg-playing #app>.view.active.pg-arena-game{width:calc(100% - 32px);margin:12px auto;height:calc(100dvh - var(--pg-header-h) - 24px);border-radius:18px}}

/* All introductions use the arena's visual / instructions layout. */
body.pg-idle #app .view.active.pg-legacy-game>.game-header{display:none}
body.pg-idle #app .view.active .pg-native-idle-host{display:block;width:100%;max-width:1100px;padding:30px 32px 40px!important;margin:0 auto;border:0;border-radius:0;background:transparent;gap:0}
body.pg-idle #app .pg-legacy-cover{display:flex;flex-direction:column;gap:0;margin:0;align-items:flex-start}
body.pg-idle #app .pg-legacy-cover>h1{font:750 38px/1.3 'Noto Sans KR',system-ui,sans-serif;letter-spacing:-1.5px;margin:12px 0;text-align:left}
body.pg-idle #app .pg-legacy-cover .pg-start-art{display:grid;place-items:center;width:100%;height:280px;min-height:280px;margin:24px 0 0;border-radius:24px;background:#e4efe5}
body.pg-idle #app .pg-legacy-cover .preview{width:180px;height:180px;border-radius:18px}
body.pg-idle #app .pg-legacy-details{padding-top:4px;gap:14px;align-items:stretch;min-width:0}
body.pg-idle #app .pg-legacy-details>.pg-start-instructions{margin:18px 0 0;font-size:23px;line-height:1.4;letter-spacing:-.6px;text-align:left}
body.pg-idle #app .pg-legacy-details>.pg-native-title,body.pg-idle #app .pg-legacy-details>.pg-original-idle-art{display:none!important}
body.pg-idle #app .pg-legacy-details>.pg-native-description{position:static;transform:none;width:100%;max-width:none;margin:0;text-align:left;font-size:14px;line-height:1.95;color:#5b6d63}
body.pg-idle #app .pg-legacy-details>:is(.t2-ages,.cl-ages,.bb-ages,.ck-ages){align-self:flex-start;position:static;margin:0;max-width:100%}
body.pg-idle #app .pg-legacy-details>:is(div,section){min-width:0;max-width:100%;box-sizing:border-box}
body.pg-idle #app .pg-legacy-details .btn{border-radius:13px;min-height:48px;font-size:15px;white-space:normal;max-width:100%}
body.pg-idle #app .pg-legacy-details .single-start{width:100%;margin:8px 0 0;background:#176b4b;color:#fff;padding:13px 24px;border:0}
/* Match the home content edges, including play stages. */
body.pg-playing #app>.view.active.pg-game-view{width:calc(100% - 64px);max-width:1036px;margin:20px auto;height:calc(100dvh - var(--pg-header-h) - 40px);box-sizing:border-box;border:1px solid #dbe3d9;border-radius:24px;overflow:hidden}
body.pg-idle .pg-game-view>.game-footer{padding-left:32px;padding-right:32px;box-sizing:border-box}
/* The game header belongs to the same native signal-color surface. */
body.pg-playing #app .pg-game-view>.game-header{background:inherit!important;color:inherit!important;border-bottom-color:transparent}
body.pg-app #app :is(.back-btn,.pg-start-back){display:grid;place-items:center;box-sizing:border-box;width:38px;min-width:38px;height:38px;min-height:38px;padding:0;border:1px solid #dbe3d9;border-radius:10px;background:#fff;color:#176b4b;font:20px/1 system-ui,sans-serif;text-decoration:none;box-shadow:none;flex-shrink:0}
body.pg-app #app .pg-start-back{margin:0 0 24px}
body.pg-app #app .back-btn>span{display:none}
body.pg-playing #app .pg-game-view>.game-header .back-btn{background:transparent!important;color:inherit!important;border-color:currentColor!important;opacity:.9}
@media(max-width:600px){
 body.pg-idle #app .view.active .pg-native-idle-host{padding:20px 16px 32px!important}
 body.pg-idle #app .pg-legacy-cover>h1{font-size:34px}
 body.pg-idle #app .pg-legacy-cover .pg-start-art{height:210px;min-height:210px}
 body.pg-idle #app .pg-legacy-cover .preview{width:145px;height:145px}
 body.pg-playing #app>.view.active.pg-game-view{width:calc(100% - 32px);max-width:none;margin:12px auto;height:calc(100dvh - var(--pg-header-h) - 24px);border-radius:18px}
 body.pg-idle .pg-game-view>.game-footer{padding-left:16px;padding-right:16px}
}

body.pg-idle #app .pg-legacy-cover>.pg-eyebrow{align-self:flex-start}
body.pg-idle #app .pg-legacy-cover .preview{display:flex;align-items:center;justify-content:center}
body.pg-idle #app .pg-legacy-details>#memGrid{display:none}

body.pg-start #app>.view.active>:is(.cs-main,.mo-main){padding-inline:var(--pg-gutter)}
body.pg-idle #app .view.active .pg-native-idle-host{padding-inline:var(--pg-gutter)!important}
body.pg-playing #app>.view.active.pg-game-view{width:calc(100% - var(--pg-gutter) * 2);max-width:calc(1100px - var(--pg-gutter) * 2)}
body.pg-idle .pg-game-view>.game-footer{display:none}

/* Keep introduction art centered in both axes at every breakpoint. */
body.pg-idle #app .pg-start-art{background:#fff;display:grid;place-items:center}
body.pg-idle #app .pg-legacy-cover .pg-start-art{background:#fff}
body.pg-idle #app .pg-start-art>:is(.preview,img){align-self:center;justify-self:center;position:relative;top:auto;left:auto;margin:0;transform:none}
body.pg-idle #app .pg-legacy-cover .preview{background:transparent;align-self:center;justify-self:center}
/* Only the selected page can paint, including during state changes. */
body.pg-app #app>.view:not(.active){display:none!important;visibility:hidden!important;pointer-events:none!important}
body.pg-app #app>.view.active{isolation:isolate}

/* All game introduction actions match the reflex start button. */
body.pg-idle #app .view:not(#view-choice) button.pg-start-action:not([hidden]),
body.pg-start #app .view:not(#view-choice) .pg-start-details button.pg-start-action:not([hidden]){
 display:flex;align-items:center;justify-content:center;box-sizing:border-box;
 width:100%!important;max-width:100%!important;min-width:0!important;min-height:48px!important;height:auto!important;max-height:none!important;
 padding:13px 24px!important;margin:4px 0 0!important;border:0!important;border-radius:13px!important;
 background:#176b4b!important;color:#fff!important;font:700 15px/1.45 'Noto Sans KR',system-ui,sans-serif!important;
 white-space:normal!important;text-align:center;box-shadow:none!important;cursor:pointer;
}
body.pg-idle #app button.pg-start-action:hover{background:#11563c!important}
body.pg-idle #app button.pg-start-action:focus-visible{outline:3px solid #75ae8e;outline-offset:3px}

body.pg-idle #app .pg-start-action small{color:inherit!important;opacity:.8;font-size:11px;line-height:1.4}
body.pg-idle #app .pg-start-action :is(b,span){color:inherit}
body.pg-idle #app .pg-start-action>i{background:#ffffff24;color:inherit}
