*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;background:#0b211c;color:#f4ecd6;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom)}
a{color:#c9a24b}
.game-header{display:flex;justify-content:space-between;align-items:center;padding:.5rem 1rem;font-size:.9rem;min-height:44px}
.game-header a{display:inline-flex;align-items:center;min-height:44px}
.game-tag{color:#8fb3a5;font-size:.8rem}
.ls-top{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.5rem}
.ls-top h1{margin:0;font:800 1.35rem Georgia,"Times New Roman",serif;letter-spacing:.02em}
.ls-btns{display:flex;gap:.4rem}
.ls-small{min-height:44px;min-width:44px;padding:0 .6rem;border-radius:10px;border:2px solid #c9a24b;background:transparent;color:#f4ecd6;font:700 .85rem system-ui,sans-serif;cursor:pointer}
.ls-small:active{background:#c9a24b33}
.ls-stage{position:relative;width:100%;height:clamp(380px,calc(100vh - 290px),640px);height:clamp(380px,calc(100dvh - 290px),640px);border-radius:14px;overflow:hidden;background:#0e2b25;border:2px solid #c9a24b}
#ls-canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.ls-panel{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;gap:.6rem;padding:1.1rem;background:rgba(9,29,24,.93);overflow:auto;text-align:center}
.ls-panel h2{margin:0;font:800 2rem Georgia,"Times New Roman",serif;color:#f4ecd6}
.ls-lead{margin:0;color:#d9d0b4;line-height:1.4}
.ls-steps{margin:0;padding:0 0 0 1.2rem;text-align:left;color:#cfe3d9;font-size:.92rem;line-height:1.4}
.ls-steps li{margin:.25rem 0}
.ls-row{display:flex;gap:.6rem}
.ls-row .ls-btn{flex:1}
.ls-btn{min-height:48px;padding:.5rem 1rem;border-radius:12px;border:2px solid #c9a24b;background:#154036;color:#f4ecd6;font:700 1rem system-ui,sans-serif;cursor:pointer}
.ls-btn:active{transform:translateY(1px)}
.ls-btn:disabled{opacity:.45;cursor:default}
.ls-primary{background:#d8482d;border-color:#f4ecd6;font-size:1.2rem;min-height:56px}
.ls-ghost{background:transparent;font-weight:600;font-size:.9rem}
.ls-stats{margin:0;color:#8fb3a5;font-size:.82rem}
.ls-badge{margin:0;color:#c9a24b;font-weight:700}
.ls-foot{margin:.5rem 0 0;color:#8fb3a5;font-size:.75rem;text-align:center}
.ls-btn:focus-visible,.ls-small:focus-visible{outline:3px solid #f4ecd6;outline-offset:2px}
@media (max-height:640px){.ls-steps{font-size:.8rem}.ls-panel h2{font-size:1.5rem}.ls-panel{gap:.4rem}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.ls-rank{margin:0;color:#c9a24b;font-weight:700;font-size:.9rem}
.ls-pad{display:grid;grid-template-columns:1fr 1.2fr 1fr;gap:.5rem;margin-top:.5rem}
.ls-pad .ls-btn{min-height:56px;padding:.4rem .5rem;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
.ls-small:disabled{opacity:.45;cursor:default}

/* full screen: shell makes .game-wrap the stage (immersive: fixed under dock; native: fullscreen element) */
html.pip-immersive .game-wrap,html.pip-native .game-wrap,.game-wrap:fullscreen{display:flex;flex-direction:column;gap:.4rem;padding-left:.6rem;padding-right:.6rem;padding-bottom:max(.5rem,env(safe-area-inset-bottom));overflow:hidden!important}
html.pip-native .game-wrap,.game-wrap:fullscreen{height:100%;padding-top:max(.5rem,env(safe-area-inset-top))}
html.pip-immersive .ls-top h1,html.pip-native .ls-top h1,html.pip-immersive .ls-foot,html.pip-native .ls-foot,html.pip-immersive .ls-top #ls-mute,html.pip-native .ls-top #ls-mute,html.pip-immersive .ls-top #ls-pause,html.pip-native .ls-top #ls-pause{display:none}
html.pip-immersive .ls-top,html.pip-native .ls-top{justify-content:flex-end;margin:0}
html.pip-immersive .ls-stage,html.pip-native .ls-stage,.game-wrap:fullscreen .ls-stage{flex:1 1 auto;min-height:0;height:auto}
html.pip-immersive .ls-pad,html.pip-native .ls-pad{margin:0;flex:none}
html.pip-immersive .ls-steps,html.pip-native .ls-steps{font-size:.8rem}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .game-wrap,html.pip-native .game-wrap{display:grid;grid-template-columns:minmax(0,1fr) 210px;grid-template-rows:auto 1fr;column-gap:.6rem}
html.pip-immersive .ls-stage,html.pip-native .ls-stage{grid-column:1;grid-row:1 / span 2}
html.pip-immersive .ls-top,html.pip-native .ls-top{grid-column:2;grid-row:1}
html.pip-immersive .ls-pad,html.pip-native .ls-pad{grid-column:2;grid-row:2;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;align-self:stretch}
html.pip-immersive #ls-drop,html.pip-native #ls-drop{grid-column:1 / span 2;grid-row:2}
}
