.pg-shell{max-width:1060px;margin:0 auto;padding:8px 0 30px;color:#314d42}.pg-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.pg-heading h1{font-size:clamp(30px,4vw,48px);line-height:1.05;margin:7px 0 0}.pg-heading .eyebrow{font-size:10px}.pg-shell button{min-height:48px;min-width:48px;touch-action:manipulation;border-radius:14px;font-weight:750}.pg-shell button:focus-visible{outline:3px solid #8a64ae;outline-offset:3px}.pg-toolbar{display:flex;align-items:center;gap:12px;margin-bottom:14px;flex-wrap:wrap}.pg-name{display:flex;align-items:center;gap:8px;font-size:12px;color:#63776b}.pg-name input{font:inherit;font-weight:700;font-size:17px;border:1px solid #d8dfd0;border-radius:12px;background:#fffefa;max-width:230px;height:46px;padding:8px 12px;color:#354f42}.pg-saved{font-size:11px;color:#5c7e67;margin-right:auto}.pg-palette{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;margin-bottom:12px}.pg-palette button{display:flex;gap:5px;align-items:center;justify-content:center;flex-direction:column;background:#fffdf6;border:1px solid #dfdfd2;font-size:12px;padding:7px 4px;min-height:63px;color:#4b6153}.pg-palette button span{font-family:system-ui;font-size:25px;line-height:27px}.pg-palette button[aria-pressed=true]{background:#386c55;color:#fff9ed;border-color:#386c55;box-shadow:0 4px 0 #294d3e}.pg-stage{padding:8px;background:#fffaf0;border:1px solid #dadfcf;border-radius:23px;box-shadow:0 6px 0 #dae2cd}.pg-board{position:relative;aspect-ratio:12/7;overflow:hidden;border-radius:16px;touch-action:none;user-select:none;-webkit-user-select:none;background:#e5efd9}.pg-board canvas{display:block;width:100%;height:100%;max-height:none}.pg-grid{position:absolute;inset:0;display:grid;grid-template-rows:repeat(7,minmax(0,1fr));z-index:1}.pg-grid>[role=row]{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));min-height:0}.pg-grid button{display:block;width:100%;height:100%;min-width:0;min-height:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;cursor:crosshair;touch-action:none}.pg-grid button:hover{background:#fff8}.pg-grid button:focus-visible{outline:4px solid #9163ab;outline-offset:-5px;background:#ffffff38}.pg-grid button:active{transform:none}.pg-instruction{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:14px}.pg-instruction p{font-size:14px;margin:0}.pg-instruction button{font-size:12px;background:#f1ecdf;white-space:nowrap;border:0}.pg-bottom{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px}.pg-route{font-size:12px;color:#487354;margin-right:auto}.pg-warning{color:#8b6038}.pg-bottom button{background:#f0ecdf;border:0;font-size:12px}.pg-options{margin-top:16px;border-top:1px solid #deded0;padding-top:14px}.pg-options summary{font-size:13px;font-weight:750;cursor:pointer;min-height:40px;display:flex;align-items:center}.pg-options summary:before{content:'＋';margin-right:8px}.pg-options[open] summary:before{content:'−'}.pg-options p{font-size:12px;color:#697a6d}.pg-templates{display:flex;gap:10px;flex-wrap:wrap}.pg-templates button{background:#fffaf0;border:1px solid #deded0}.pg-play-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px}.pg-play-top>div{display:flex;flex-direction:column;gap:4px;text-align:center}.pg-play-top strong{font-size:19px}.pg-play-top span{font-size:13px;color:#66816c}.pg-play-controls{display:flex;gap:12px;align-items:center;justify-content:center;margin-top:18px}.pg-dpad{display:grid;grid-template-columns:repeat(4,64px);gap:10px}.pg-dpad button{height:62px;font-size:29px;background:#e4eacc;border:1px solid #ccd6b9;box-shadow:0 4px 0 #cad5b9}.pg-dpad button:active{transform:translateY(3px);box-shadow:0 1px 0 #cad5b9}.pg-play-controls>#pgJump{background:#e8daf0;border:1px solid #cfb4df;font-size:14px;min-height:62px}.pg-play-controls>#pgJump[aria-pressed=true]{background:#8961a4;color:#fff}.pg-play-controls>#pgRestart{font-size:12px}.pg-play-hint{text-align:center;font-size:14px;margin:15px 0 0}.pg-shade{position:absolute;inset:0;z-index:3;background:#edf3e6d9;display:flex;align-items:center;justify-content:center;padding:20px;touch-action:pan-y;overflow:auto}.pg-shade[hidden]{display:none}.pg-dialog{background:#fffaf0;border-radius:24px;padding:20px 26px;text-align:center;max-width:460px;box-shadow:0 8px 30px #365d4325}.pg-dialog h2{font-size:clamp(22px,3vw,30px);margin:8px 0}.pg-dialog p{font-size:14px;line-height:1.5;margin:10px 0 16px}.pg-dialog>div{display:flex;justify-content:center;flex-wrap:wrap;gap:8px}.pg-dialog-icon{font-size:35px;color:#dca83e}.pg-playing .pg-grid button:hover{background:transparent}.pg-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.pg-shell button:disabled{opacity:.42;cursor:default}.pg-playing .pg-heading{margin-bottom:12px}.pg-playing .pg-heading h1{font-size:32px}.pg-playing .pg-heading .eyebrow{display:none}
@media(min-width:900px) and (max-height:850px){.pg-playing{max-width:900px}.pg-playing .pg-stage{max-width:770px;margin:auto}.pg-shell .pg-heading{margin-bottom:10px}.pg-play-controls{margin-top:13px}.pg-play-hint{margin-top:12px}.pg-playing .pg-heading h1{font-size:27px}}
@media(max-width:850px){.pg-shell{padding-top:0}.pg-heading{margin-bottom:12px}.pg-heading h1{font-size:35px}.pg-name{flex:1}.pg-name input{max-width:220px}.pg-saved{order:4;flex-basis:100%;text-align:right;margin-top:-4px}.pg-toolbar{gap:8px;margin-bottom:8px}.pg-play-controls{gap:9px}.pg-dpad{grid-template-columns:repeat(4,58px);gap:8px}.pg-dpad button{height:58px}.pg-palette{gap:6px}.pg-heading>button{font-size:12px}.pg-instruction p{font-size:13px}}
@media(max-width:540px){.pg-heading h1{font-size:27px}.pg-heading .eyebrow{font-size:8px}.pg-heading>button{font-size:11px;padding:8px}.pg-toolbar>.primary{flex:1}.pg-name{flex-basis:100%;justify-content:space-between}.pg-name input{max-width:240px;width:70%}.pg-saved{font-size:10px}.pg-palette{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.pg-palette button{min-height:52px;font-size:11px;flex-direction:row;gap:4px}.pg-palette button span{font-size:23px}.pg-stage{padding:4px;border-radius:17px}.pg-board{border-radius:12px}.pg-instruction{gap:8px}.pg-instruction p{font-size:12px}.pg-instruction button{font-size:10px;padding:8px}.pg-bottom{gap:6px}.pg-route{flex-basis:100%;font-size:11px;margin:3px 0}.pg-play-top{gap:7px}.pg-play-top strong{font-size:15px}.pg-play-top span{font-size:11px}.pg-play-top button{font-size:11px;padding:7px}.pg-play-controls{flex-wrap:wrap}.pg-dpad{grid-template-columns:repeat(4,60px)}.pg-play-controls>#pgJump{min-height:48px}.pg-play-controls>#pgRestart{min-height:48px}.pg-play-hint{font-size:12px}.pg-dialog{padding:10px 13px;border-radius:17px}.pg-dialog-icon{display:none}.pg-dialog h2{font-size:20px;margin:4px 0}.pg-dialog p{font-size:11px;line-height:1.35;margin:5px 0 9px}.pg-dialog button{min-height:40px;font-size:11px;padding:7px 10px}.pg-shade{padding:8px}.pg-playing .pg-heading h1{font-size:25px}.pg-templates button{font-size:12px;flex:1 1 40%}}
@media(prefers-reduced-motion:reduce){.pg-shell *{scroll-behavior:auto!important;transition:none!important}}

@media(min-width:900px) and (max-height:900px){.pg-shell:not(.pg-playing) .pg-heading h1{font-size:32px}.pg-shell:not(.pg-playing) .pg-heading .eyebrow{display:none}.pg-shell:not(.pg-playing) .pg-stage{max-width:760px;margin:0 auto}.pg-shell:not(.pg-playing) .pg-palette{max-width:760px;margin:0 auto 12px}.pg-shell:not(.pg-playing) .pg-palette button{min-height:56px}.pg-shell:not(.pg-playing) .pg-instruction,.pg-shell:not(.pg-playing) .pg-bottom{max-width:760px;margin-left:auto;margin-right:auto}.pg-shell:not(.pg-playing) .pg-heading{margin-bottom:12px}}
/* Leave room for Safari's bars and the large arrow controls in landscape. */
@media(min-width:900px) and (max-height:850px){.pg-playing .pg-stage{width:min(770px,calc(171.43dvh - 565px));max-width:100%;min-width:480px}.pg-playing .pg-play-controls{margin-top:10px}.pg-playing .pg-play-hint{margin-top:9px}}

.pg-guest{font-size:12px;color:#7b658b;margin:6px 0 0}.pg-playing .pg-guest{font-size:11px;margin:4px 0 0}
/* In landscape, tools sit beside the world so a child never draws offscreen. */
@media(min-width:900px) and (max-height:850px){
 .pg-shell:not(.pg-playing){display:grid;grid-template-columns:160px minmax(0,1fr);column-gap:20px;row-gap:10px;max-width:1040px}
 .pg-shell:not(.pg-playing)>.pg-heading,.pg-shell:not(.pg-playing)>.pg-toolbar,.pg-shell:not(.pg-playing)>.pg-instruction,.pg-shell:not(.pg-playing)>.pg-bottom,.pg-shell:not(.pg-playing)>.pg-options{grid-column:1/-1;width:100%;max-width:none;margin:0}
 .pg-shell:not(.pg-playing) .pg-heading h1{font-size:28px}
 .pg-shell:not(.pg-playing)>.pg-palette{grid-column:1;grid-row:3;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-content:start;width:160px;margin:0}
 .pg-shell:not(.pg-playing) .pg-palette button{min-height:62px}
 .pg-shell:not(.pg-playing)>.pg-stage{grid-column:2;grid-row:3;width:min(760px,calc(171.43dvh - 625px));max-width:100%;margin:0 auto;align-self:start}
 .pg-shell:not(.pg-playing)>.pg-instruction{margin-top:3px}
 .pg-shell:not(.pg-playing)>.pg-options{margin-top:3px}
 .pg-shell:not(.pg-playing) .pg-saved{font-size:10px}
}
