/* Glyph Ladder: lamplit slate and brass */
.gl{--bg:#14110f;--slab:#211c17;--edge:#51463a;--brass:#e3b04b;--ink:#efe6cf;--mute:#a69a85;
  background:var(--bg);color:var(--ink);border-radius:16px;padding:10px 10px calc(10px + env(safe-area-inset-bottom));
  border:1px solid var(--edge);user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.gl-hud{display:flex;gap:8px;margin-bottom:8px}
.gl-cell{flex:1;background:var(--slab);border:1px solid var(--edge);border-radius:10px;padding:6px 8px;min-height:44px}
.gl-k{display:block;font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--mute)}
.gl-cell b{font-size:17px;color:var(--brass);font-variant-numeric:tabular-nums}
.gl-cell.low b{color:#ff7a5c;animation:glpulse .8s ease-in-out infinite}
.gl-stage{position:relative;width:100%;min-height:300px;border-radius:12px;overflow:hidden;background:var(--bg)}
#gl-canvas{display:block;touch-action:none;cursor:pointer;margin:0 auto}
.gl-panel{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:safe center;gap:6px;padding:12px 14px;overflow-y:auto;
  background:rgba(14,12,10,.93);text-align:center;animation:glfade .25s ease-out}
.gl-panel[hidden]{display:none}
.gl-panel h2{font-size:1.5rem;color:var(--brass);letter-spacing:.02em}
.gl-lead{font-size:.9rem;line-height:1.4;color:var(--ink)}
.gl-stats{display:flex;justify-content:center;flex-wrap:wrap;gap:4px 12px;font-size:.78rem;color:var(--mute)}
.gl-note{font-size:.78rem;color:var(--mute)}
.gl-btn{min-height:48px;padding:0 16px;border-radius:12px;border:1px solid var(--edge);background:var(--slab);color:var(--ink);
  font:600 1rem system-ui,sans-serif;cursor:pointer;touch-action:manipulation}
.gl-btn:hover{border-color:var(--brass)}
.gl-btn:focus-visible,.gl-skin:focus-visible{outline:3px solid var(--brass);outline-offset:2px}
.gl-btn:disabled{opacity:.4;cursor:default}
.gl-btn[hidden]{display:none}
.gl-pick{display:flex;gap:6px}
.gl-pick .gl-primary{flex:1}
.gl-step{width:48px;padding:0;font-size:1.6rem;line-height:1}
.gl-streak{font-size:.8rem;color:var(--brass);min-height:1.1em}
.gl-streak:empty{display:none}
#gl-hint-btn.used{border-color:var(--brass);color:var(--brass)}
.gl-btn small{font-weight:500;color:inherit;opacity:.75;margin-left:6px}
.gl-primary{background:var(--brass);color:#1b1408;border-color:var(--brass)}
.gl-ghost{background:transparent;color:var(--mute)}
.gl-small{min-height:44px;min-width:44px;flex:1;padding:0 4px;font-size:.8rem}
.gl-bar{display:flex;gap:5px;margin-top:8px}
.gl-hint{min-height:2.6em;margin-top:8px;font-size:.82rem;line-height:1.35;color:var(--mute);text-align:center}
.gl-skins{display:flex;gap:6px;margin-top:4px}
.gl-skin{flex:1;min-height:48px;border-radius:10px;border:2px solid var(--edge);background:var(--sk2);color:var(--ink);cursor:pointer;
  display:flex;flex-direction:column;align-items:center;justify-content:center;font:600 .72rem system-ui,sans-serif;touch-action:manipulation}
.gl-skin span{border-bottom:3px solid var(--sk);padding-bottom:1px}
.gl-skin small{font-size:.62rem;font-weight:500;opacity:.7;margin-top:2px}
.gl-skin.on{border-color:var(--brass)}
.gl-skin.locked{opacity:.45;cursor:default}
.gl-stars{display:flex;justify-content:center;gap:8px;margin:2px 0}
.gl-star{width:34px;height:34px;background:#3a3329;clip-path:polygon(50% 0,62% 36%,100% 38%,70% 60%,80% 100%,50% 76%,20% 100%,30% 60%,0 38%,38% 36%)}
.gl-star.on{background:var(--brass);animation:glpop .45s cubic-bezier(.3,1.6,.5,1) both}
@keyframes glpop{from{transform:scale(0)}to{transform:scale(1)}}
@keyframes glfade{from{opacity:0}to{opacity:1}}
@keyframes glpulse{50%{opacity:.55}}
@media (prefers-reduced-motion:reduce){.gl *,.gl-panel{animation:none!important;transition:none!important}}
@media (max-width:360px){.gl-stage{min-height:280px}.gl-panel{padding:10px;gap:6px}}

/* full screen: stage is a flex column, the board fills what is left */
html.pip-immersive .game-wrap,html.pip-native .game-wrap{display:flex;flex-direction:column;overflow:hidden!important}
html.pip-immersive .game-wrap>.gl,html.pip-native .game-wrap>.gl{flex:1;min-height:0;display:flex;flex-direction:column;border-radius:0;border:0;padding:6px 8px calc(6px + env(safe-area-inset-bottom))}
html.pip-immersive .gl-stage,html.pip-native .gl-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center}
html.pip-immersive .gl-hint,html.pip-native .gl-hint{min-height:0;margin-top:4px;font-size:.78rem}
html.pip-immersive .gl-bar,html.pip-native .gl-bar{margin-top:4px}
html.pip-immersive .gl-small,html.pip-native .gl-small{min-height:48px}
html.pip-immersive .gl-panel,html.pip-native .gl-panel{justify-content:safe center}
.gl-stage{box-shadow:inset 0 0 40px rgba(0,0,0,.55)}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .gl-hud,html.pip-native .gl-hud{margin-bottom:4px}
html.pip-immersive .gl-cell,html.pip-native .gl-cell{min-height:36px;padding:2px 8px}
html.pip-immersive .gl-hint,html.pip-native .gl-hint{display:none}
html.pip-immersive .gl-bar,html.pip-native .gl-bar{margin-top:4px}
html.pip-immersive .gl-small,html.pip-native .gl-small{min-height:44px}
}

/* full screen v2: tall board in portrait, side controls in landscape */
html.pip-immersive .gl-hint,html.pip-native .gl-hint{display:none}
html.pip-immersive .gl-stage,html.pip-native .gl-stage{border-radius:8px}
html.pip-immersive .gl-hud,html.pip-native .gl-hud{margin-bottom:4px}
@media (orientation:landscape){
  html.pip-immersive .game-wrap>.gl,html.pip-native .game-wrap>.gl{display:grid;grid-template-columns:104px minmax(0,1fr) 104px;grid-template-rows:minmax(0,1fr);gap:8px;padding:6px calc(8px + env(safe-area-inset-right)) 6px calc(8px + env(safe-area-inset-left))}
  html.pip-immersive .gl-hud,html.pip-native .gl-hud{flex-direction:column;margin:0;justify-content:center}
  html.pip-immersive .gl-stage,html.pip-native .gl-stage{min-width:0}
  html.pip-immersive .gl-bar,html.pip-native .gl-bar{flex-direction:column;margin:0;justify-content:center}
  html.pip-immersive .gl-bar .gl-small,html.pip-native .gl-bar .gl-small{flex:0 0 auto;min-height:48px}
}
