*{box-sizing:border-box}
body{margin:0;font-family:Georgia,"Times New Roman",serif;background:#ecd9ae;color:#2f1d12;-webkit-tap-highlight-color:transparent}
.game-header{background:#2f1d12;color:#fbf1d6;padding:.75rem 1rem;padding-left:max(1rem,env(safe-area-inset-left));padding-right:max(1rem,env(safe-area-inset-right));display:flex;justify-content:space-between;align-items:center}
.game-header a{color:#fbf1d6;text-decoration:none;font-weight:700;display:inline-block;min-height:44px;line-height:44px}
.game-tag{font-size:.8rem;opacity:.8}
.game-title{text-align:center;margin-bottom:.5rem}
.game-title p{font-size:.75rem;letter-spacing:.2em;text-transform:uppercase;color:#7a4a28}
.game-title h1{font-size:1.6rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
.game-wrap{padding-left:max(1rem,env(safe-area-inset-left));padding-right:max(1rem,env(safe-area-inset-right))}
.rl-hud{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 auto .5rem;max-width:420px}
.rl-stat{display:flex;flex-direction:column;min-width:56px}
.rl-lab{font-size:.65rem;letter-spacing:.14em;text-transform:uppercase;color:#7a4a28}
.rl-stat b{font-size:1.35rem;font-variant-numeric:tabular-nums;line-height:1.1}
.rl-lives{display:flex;gap:4px;height:24px;align-items:center}
.rl-lives i{display:block;width:10px;height:22px;background:#7a4a28;border:2px solid #2f1d12;border-radius:2px;transition:transform .2s,opacity .2s}
.rl-lives i.off{opacity:.18;transform:scaleY(.5)}
.rl-mute{min-width:64px;min-height:44px;border:3px solid #2f1d12;background:#fbf1d6;color:#2f1d12;font:700 .8rem Georgia,serif;border-radius:6px;cursor:pointer}
.rl-mute[aria-pressed=true]{background:#c8452d;color:#fbf1d6}
.rl-stage{box-sizing:content-box;position:relative;width:min(calc(100% - 8px),calc((100svh - 230px) * .6));min-width:240px;aspect-ratio:3/5;margin:0 auto;border:4px solid #2f1d12;border-radius:6px;box-shadow:5px 5px 0 #2f1d12;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;background:#ecd9ae}
#rl-canvas{display:block;width:100%;height:100%;touch-action:none}
.rl-coach{position:absolute;left:0;right:0;bottom:7%;text-align:center;font-weight:800;font-size:clamp(.9rem,4vw,1.1rem);color:#2f1d12;text-shadow:0 0 6px #fbf1d6,0 0 3px #fbf1d6;pointer-events:none;padding:0 12px}
.rl-ov{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(47,29,18,.55);padding:12px}
.rl-ov[hidden]{display:none}
.rl-card{width:100%;max-width:300px;background:#fbf1d6;border:4px solid #2f1d12;box-shadow:5px 5px 0 #c8452d;border-radius:4px;padding:14px;text-align:center;touch-action:manipulation}
.rl-card h2{margin:0 0 4px;font-size:1.6rem;text-transform:uppercase;letter-spacing:.06em}
.rl-sub{margin:0 0 10px;font-size:.9rem;line-height:1.3}
.rl-big{margin:0;font-size:2.6rem;font-weight:800;font-variant-numeric:tabular-nums}
.rl-new{margin:0 0 8px;color:#c8452d;font-weight:800}
.rl-best{margin:8px 0;font-size:.8rem;color:#7a4a28}
.rl-row,.rl-skins{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin:6px 0}
.rl-chip{min-height:44px;padding:0 12px;border:3px solid #2f1d12;background:#fbf1d6;color:#2f1d12;font:700 .85rem Georgia,serif;border-radius:6px;cursor:pointer}
.rl-chip.on{background:#2f1d12;color:#fbf1d6}
.rl-sk{width:44px;height:44px;border:3px solid #2f1d12;border-radius:50%;cursor:pointer;padding:0;position:relative}
.rl-sk.on{outline:3px solid #c8452d;outline-offset:2px}
.rl-sk.lock{opacity:.35;cursor:not-allowed}
.rl-btn{display:block;width:100%;min-height:48px;margin:8px 0 0;border:3px solid #2f1d12;background:#c8452d;color:#fbf1d6;font:800 1.1rem Georgia,serif;letter-spacing:.06em;text-transform:uppercase;border-radius:6px;cursor:pointer;box-shadow:3px 3px 0 #2f1d12}
.rl-btn.alt{background:#fbf1d6;color:#2f1d12;min-height:44px;font-size:.95rem}
.rl-btn:active{transform:translate(2px,2px);box-shadow:1px 1px 0 #2f1d12}
.rl-how{max-width:420px;margin:.8rem auto 0;font-size:.85rem;line-height:1.45;color:#4a3320}
button:focus-visible{outline:3px solid #3d6e8a;outline-offset:2px}
.pip-actions{text-align:center;margin:1rem 0}
.pip-actions .btn{display:inline-block;min-height:44px;line-height:44px;padding:0 18px;border:3px solid #2f1d12;border-radius:6px;color:#2f1d12;text-decoration:none;font-weight:700;background:#fbf1d6}
footer{text-align:center;padding:1rem;font-size:.8rem}
footer a{color:#2f1d12}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* Full screen (native and immersive): fill the stage, board centred, no scroll */
html.pip-immersive .pip-stage,html.pip-native .pip-stage{max-width:none!important;margin:0!important;padding:6px max(8px,env(safe-area-inset-left)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-right))!important;overflow:hidden;background:#2f1d12}
html.pip-immersive .pip-stage .rl,html.pip-native .pip-stage .rl{display:flex;flex-direction:column;height:100%;min-height:0;gap:6px}
html.pip-immersive .rl-how,html.pip-native .rl-how,html.pip-immersive .rl-hud+.rl-hud{display:none}
html.pip-immersive .rl-hud,html.pip-native .rl-hud{flex:0 0 auto;width:100%;max-width:none;margin:0;color:#fbf1d6}
html.pip-immersive .rl-lab,html.pip-native .rl-lab{color:#e6c590}
html.pip-immersive .rl-stage,html.pip-native .rl-stage{flex:1 1 auto;min-height:0;width:100%;min-width:0;aspect-ratio:auto;margin:0;display:flex;align-items:center;justify-content:center;box-shadow:none}
html.pip-immersive #rl-canvas,html.pip-native #rl-canvas{width:auto;height:auto}
html.pip-immersive .rl-ov,html.pip-native .rl-ov{overflow:auto}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .pip-stage .rl,html.pip-native .pip-stage .rl{flex-direction:row}
html.pip-immersive .rl-hud,html.pip-native .rl-hud{flex-direction:column;width:96px;justify-content:flex-start;align-items:flex-start;gap:6px}
html.pip-immersive .rl-card,html.pip-native .rl-card{padding:8px}
html.pip-immersive .rl-card h2,html.pip-native .rl-card h2{font-size:1.2rem}
html.pip-immersive .rl-btn,html.pip-native .rl-btn{margin-top:4px}
html.pip-immersive .rl-skins,html.pip-immersive .rl-row,html.pip-native .rl-skins,html.pip-native .rl-row{margin:2px 0}
}

/* ---- Full screen (shell immersive / native): board fills the screen ---- */
html.pip-immersive .game-wrap,html.pip-native .game-wrap{display:flex;flex-direction:column;max-width:none;width:100%;height:100%;margin:0;padding:0 max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));overflow:hidden}
html.pip-immersive .game-wrap{padding-top:calc(52px + 4px)}
html.pip-native .game-wrap{padding-top:max(6px,env(safe-area-inset-top))}
html.pip-immersive .game-title,html.pip-native .game-title,html.pip-immersive .rl-how,html.pip-native .rl-how,html.pip-immersive .pip-actions,html.pip-native .pip-actions{display:none}
html.pip-immersive .rl,html.pip-native .rl{flex:1 1 0;min-height:0;min-width:0;display:flex;flex-direction:column}
html.pip-immersive .rl-hud,html.pip-native .rl-hud{flex:0 0 auto;width:100%;max-width:none;margin:0 0 4px}
html.pip-immersive .rl-stage,html.pip-native .rl-stage{box-sizing:border-box;flex:1 1 0;min-height:0;min-width:0;width:100%;max-width:none;aspect-ratio:auto;margin:0;overflow:hidden;display:flex;align-items:center;justify-content:center}
html.pip-immersive .rl-ov,html.pip-native .rl-ov{overflow:auto}
html.pip-immersive .rl-ov[hidden],html.pip-native .rl-ov[hidden]{display:none}
@media (orientation:landscape){
  html.pip-immersive .rl,html.pip-native .rl{flex-direction:row;gap:8px}
  html.pip-immersive .rl-hud,html.pip-native .rl-hud{flex:0 0 112px;width:112px;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:10px;margin:0;overflow:auto}
  html.pip-immersive .game-wrap,html.pip-native .game-wrap{padding-top:max(4px,env(safe-area-inset-top))}
  html.pip-immersive .rl-stage,html.pip-native .rl-stage{width:auto;flex:1 1 0}
}
