/* Gap Grinder: printed-poster look. Paper, ink, vermilion, teal, butter. */
:root{--ink:#1F2A44;--paper:#F4ECD8;--verm:#E8503A;--teal:#1B8A8F;--butter:#F2B632}
.gg-wrap{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom)}
.gg-stage{position:relative;width:min(100%,calc((100svh - 230px) * 390 / 600));min-width:260px;aspect-ratio:390/600;margin:0 auto;background:var(--paper);border:3px solid var(--ink);border-radius:14px;box-shadow:6px 7px 0 var(--ink);overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;overscroll-behavior:none}
.gg-stage canvas{display:block;width:100%;height:100%;touch-action:none;cursor:pointer}
.gg-ov{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:14px;background:rgba(244,236,216,.78)}
.gg-ov[hidden]{display:none}
.gg-card{width:100%;max-width:300px;display:flex;flex-direction:column;gap:10px;text-align:center;color:var(--ink);font-family:"Trebuchet MS",ui-rounded,system-ui,sans-serif}
.gg-kick{font-weight:800;font-size:1.5rem;letter-spacing:.01em}
.gg-how{font-size:.95rem;line-height:1.35;font-weight:600}
.gg-big{font-weight:800;font-size:3rem;line-height:1}
.gg-new{font-weight:800;color:var(--verm)}
.gg-stat{font-size:.8rem;font-weight:700;opacity:.75}
.gg-streak{font-weight:800;color:var(--verm);font-size:.9rem}
.gg-unlock{font-weight:800;color:var(--teal)}
.gg-rows{border:2px solid var(--ink);border-radius:10px;background:#fffaf0;padding:6px 12px}
.gg-row{display:flex;justify-content:space-between;font-size:.9rem;padding:3px 0}
.gg-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.gg-btn,.gg-tool{min-height:48px;padding:0 14px;border:3px solid var(--ink);border-radius:12px;background:var(--paper);color:var(--ink);font:800 1rem "Trebuchet MS",ui-rounded,system-ui,sans-serif;cursor:pointer;box-shadow:3px 4px 0 var(--ink);touch-action:manipulation}
.gg-btn:active,.gg-tool:active{transform:translate(2px,3px);box-shadow:1px 1px 0 var(--ink)}
.gg-btn.gg-main{background:var(--verm);color:#fff;font-size:1.25rem;min-height:56px}
.gg-btn:focus-visible,.gg-tool:focus-visible,.gg-skin:focus-visible{outline:3px solid var(--teal);outline-offset:2px}
.gg-skins{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.gg-skin{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:96px;padding:8px 4px;border:3px solid var(--ink);border-radius:12px;background:#fffaf0;color:var(--ink);font:700 .75rem "Trebuchet MS",system-ui,sans-serif;cursor:pointer}
.gg-skin.on{background:var(--butter)}
.gg-skin.lock{opacity:.55;cursor:default}
.gg-sw{width:44px;height:30px;border:3px solid var(--ink);border-radius:12px;box-shadow:2px 3px 0 var(--ink)}
.gg-sn{font-weight:800;font-size:.95rem}
.gg-bar{display:flex;gap:10px;justify-content:center;margin:16px auto 6px;max-width:420px}
.gg-bar .gg-tool{flex:1;min-width:44px;font-size:.9rem}
.gg-bar .gg-tool:disabled{opacity:.45}
.gg-note{text-align:center;color:var(--paper);opacity:.85;font-size:.85rem;margin:8px 0}
@media (prefers-reduced-motion:reduce){.gg-btn,.gg-tool{transition:none}.gg-btn:active,.gg-tool:active{transform:none}}
/* full screen (native and immersive): the board fills the stage, extras step aside */
html.pip-immersive .game-wrap,html.pip-native .game-wrap,.game-wrap:fullscreen{display:flex;flex-direction:column;overflow:hidden!important}
html.pip-native .game-wrap,.game-wrap:fullscreen{height:100%;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
html.pip-immersive .gg-wrap,html.pip-native .gg-wrap,.game-wrap:fullscreen .gg-wrap{flex:1 1 0;min-height:0;display:flex;flex-direction:column;align-items:center;padding:0}
html.pip-immersive .gg-stage,html.pip-native .gg-stage,.game-wrap:fullscreen .gg-stage{flex:1 1 0;min-height:0;width:auto;max-width:100%;min-width:0;margin:0;box-shadow:none;aspect-ratio:390/600}
html.pip-immersive .gg-note,html.pip-native .gg-note,html.pip-immersive .facts,html.pip-native .facts,html.pip-immersive .pip-actions,html.pip-native .pip-actions,html.pip-immersive .game-title,html.pip-native .game-title{display:none}
html.pip-immersive .gg-bar,html.pip-native .gg-bar{margin:8px auto 4px;width:100%;flex:none}
html.pip-immersive .gg-ov,html.pip-native .gg-ov{overflow:auto}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .gg-wrap,html.pip-native .gg-wrap{flex-direction:row;justify-content:center;gap:12px}
html.pip-immersive .gg-stage,html.pip-native .gg-stage{flex:0 1 auto;height:100%;width:auto}
html.pip-immersive .gg-bar,html.pip-native .gg-bar{flex-direction:column;width:auto;min-width:104px;margin:0;justify-content:center}
}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .gg-wrap,html.pip-native .gg-wrap{width:100%;align-items:stretch;gap:10px;padding:0 8px}
html.pip-immersive .gg-stage,html.pip-native .gg-stage{flex:1 1 0;min-width:0;width:auto;max-width:none;height:100%;aspect-ratio:auto}
html.pip-immersive .gg-ov,html.pip-native .gg-ov{padding:8px}
html.pip-immersive .gg-card,html.pip-native .gg-card{margin:auto;max-width:360px;gap:6px}
html.pip-immersive .gg-big,html.pip-native .gg-big{font-size:2.2rem}
html.pip-immersive .gg-skins,html.pip-native .gg-skins{grid-template-columns:repeat(3,1fr)}
html.pip-immersive .gg-bar .gg-tool,html.pip-native .gg-bar .gg-tool{min-height:48px}
}
