/* Panda Arcade 3.1: modal portal and responsive Jade */
body.p31-story-open{overflow:hidden!important}
body>.p120-modal{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;padding:16px!important;display:flex!important;align-items:center!important;justify-content:center!important;z-index:999999!important;overflow-y:auto!important;transform:none!important}
body>.p120-modal .p120-dialog{flex:0 1 420px;width:min(100%,420px)!important;max-height:88dvh!important;overflow-y:auto!important;margin:auto!important}
body.arcade-game-live .jade-shell{width:100%!important;max-width:100%!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto minmax(0,1fr) auto!important;overflow:hidden!important}
body.arcade-game-live .jade-shell>.jade-head,body.arcade-game-live .jade-shell>.jade-progress,body.arcade-game-live .jade-shell>.jade-actions{min-width:0!important;width:100%!important;max-width:100%!important;justify-self:stretch!important;box-sizing:border-box!important}
body.arcade-game-live .jade-shell>.jade-board{box-sizing:border-box!important;width:min(100%,53dvh,510px)!important;max-width:100%!important;max-height:53dvh!important;aspect-ratio:1!important;justify-self:center!important;align-self:center!important;min-width:0!important;margin:auto!important}
body.arcade-game-live .jade-head{padding-right:12px!important;flex-wrap:wrap!important;gap:7px!important}
body.arcade-game-live .jade-hud{justify-content:flex-start!important;max-width:100%!important}
body.arcade-game-live .jade-hud span{font-size:11px!important}
body.arcade-game-live .jade-progress{min-height:29px!important;height:29px!important}
body.arcade-game-live .jade-progress span{font-size:13px!important;white-space:nowrap}
body.arcade-game-live .jade-actions{align-self:end!important;justify-content:space-between!important}
body.arcade-game-live .jade-actions button{font-size:13px!important;min-height:44px!important}
body.arcade-game-live .jade-actions span{font-size:11px!important;max-width:52%!important;color:#d9f8e9!important}
body.arcade-game-live .jade-gem{border-radius:clamp(6px,2vw,14px)!important}
body.maze-fullscreen .maze-canvas{max-width:100%!important}
body.maze-fullscreen .pmaze-ctrl{touch-action:manipulation!important}
@media(max-width:390px){body.arcade-game-live .jade-shell{padding:8px!important;gap:7px!important}body.arcade-game-live .jade-head strong{font-size:17px!important}}

/* Chronicle, Passport and Daily Challenges */
.p31-root,.p31-root *{box-sizing:border-box}
.p31-root{margin:18px 0 24px;padding:15px;border-radius:26px;background:linear-gradient(158deg,#123b32,#1d5b49 62%,#316d54);border:1px solid #76aa8e;box-shadow:0 12px 26px #123e392d;color:#f9fff8;overflow:hidden}
.p31-title{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.p31-title img{width:64px;height:68px;object-fit:contain;flex:0 0 64px}
.p31-title small{color:#c6f4cf;font-size:10px;letter-spacing:1.5px;font-weight:900}
.p31-title h2{margin:4px 0!important;font-size:24px!important;color:#fff!important;line-height:1.1}
.p31-title p{margin:0;font-size:12px;line-height:1.35;color:#dcefe2}
.p31-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:14px 0}
.p31-nav button{min-height:46px;min-width:0;padding:8px 4px;border-radius:13px;border:1px solid #ffffff3b;background:#ffffff18;color:#e8f4eb;font-size:12px;font-weight:850}
.p31-nav button[aria-selected=true]{background:#f8e6ab;color:#234c3b;border-color:#e6c76f}
.p31-panel[hidden]{display:none!important}
.p31-progress{background:#ffffff17;border:1px solid #ffffff27;border-radius:14px;padding:10px 12px;font-size:12px;line-height:1.45;margin-bottom:11px}
.p31-progress strong{color:#ffe9a4;font-size:15px}
.p31-chapter{border:1px solid #ffffff26;border-radius:18px;margin:10px 0;background:#ffffff0c;overflow:hidden}
.p31-chapter summary{padding:12px 13px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:9px;font-size:14px;font-weight:900}
.p31-chapter summary small{font-size:11px;font-weight:750;color:#e3ebd5;white-space:nowrap}
.p31-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 10px 12px}
.p31-memory{display:flex;flex-direction:column;min-width:0;min-height:122px;text-align:left;border:1px solid #d7efc480;border-radius:14px;background:#ffffff17;padding:9px;color:#fff}
.p31-memory img{width:44px;height:45px;object-fit:contain;align-self:flex-start}
.p31-memory b{font-size:12px;line-height:1.22;margin-top:5px;overflow-wrap:anywhere}
.p31-memory small{font-size:10px;color:#e0ecdd;margin-top:4px}
.p31-memory.done{background:linear-gradient(160deg,#4e865f,#2a604a);border-color:#cde8a0}
.p31-memory.ready{background:linear-gradient(160deg,#fff5da,#ddf5d5);color:#1c4b37}
.p31-memory.ready small{color:#466c56}
.p31-memory.locked{opacity:.61;filter:saturate(.55)}
.p31-worlds{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.p31-world{border:1px solid #b2d2a777;background:#ffffff13;padding:10px;border-radius:15px;min-height:115px}
.p31-world.stamped{background:#eff8df;color:#244735;border-color:#eddfa4}
.p31-world img{width:42px;height:46px;object-fit:contain}
.p31-world b{display:block;font-size:13px;margin:5px 0}
.p31-world small{font-size:11px;line-height:1.3}

.p31-quest{display:flex;align-items:center;justify-content:space-between;gap:9px;padding:12px 10px;margin:9px 0;border:1px solid #ffffff35;border-radius:15px;background:#ffffff0d}
.p31-quest>div{flex:1;min-width:0}.p31-quest b{display:block;font-size:13px}.p31-quest small{font-size:11px;color:#e1efde;display:block;margin-top:4px}
.p31-quest button{min-width:83px;min-height:42px;background:#f7e1a2;color:#2b4a30;border:0;border-radius:12px;padding:7px 9px;font-weight:900;font-size:11px}
.p31-quest button:disabled{opacity:.58;cursor:default}
.p31-muted{font-size:11px;line-height:1.5;color:#d8ebdc;margin:11px 0 0}
.p31-dialog-layer{position:fixed;inset:0;z-index:1000000;display:flex;align-items:center;justify-content:center;padding:16px;background:#061c16dd;backdrop-filter:blur(7px);overflow:auto}
.p31-dialog{width:min(100%,420px);max-height:87dvh;overflow-y:auto;border-radius:23px;background:#fbf8ea;color:#22452f;padding:21px;box-shadow:0 28px 85px #0009}
.p31-dialog img{width:82px;height:84px;object-fit:contain;float:right}
.p31-dialog small{font-size:11px;font-weight:900;color:#69816a}
.p31-dialog h2{font-size:26px!important;line-height:1.15;margin:8px 0 13px!important;color:#244531!important}
.p31-dialog p{font-size:15px;line-height:1.5;clear:both}
.p31-dialog button{display:block;width:100%;min-height:48px;margin-top:9px;border-radius:13px;padding:12px;font-size:13px;font-weight:900;border:0;background:#276c4f;color:#fff;text-align:left}
.p31-dialog button.p31-cancel{background:#e7eee5;color:#2e573e;text-align:center}
@media(max-width:360px){.p31-root{padding:10px}.p31-grid,.p31-worlds{gap:6px}.p31-memory{min-height:116px;padding:7px}.p31-nav button{font-size:11px}}
@media(prefers-reduced-motion:reduce){.p31-root *,body>.p120-modal *{animation:none!important;transition:none!important}}
