:root{--paper:#f4edda;--ink:#1d3f8f;--deep:#14214d;--red:#c8402a;--gold:#e8a21a}
.game-wrap{padding-left:max(1rem,env(safe-area-inset-left));padding-right:max(1rem,env(safe-area-inset-right));padding-bottom:max(1rem,env(safe-area-inset-bottom))}
.wf-h1{font-size:1.25rem;letter-spacing:.02em;margin:0 0 .5rem;color:var(--ink)}
.wf-hud{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-bottom:.5rem}
.wf-hudL{display:flex;flex-direction:column;font-size:.8rem;line-height:1.25;min-width:0}
.wf-hudL b{font-size:.95rem;color:var(--ink)}
.wf-hudR{display:flex;gap:.3rem;flex-shrink:0}
.wf-ib{min-height:44px;min-width:44px;padding:0 .6rem;border:2px solid var(--ink);background:var(--paper);color:var(--ink);border-radius:10px;font:600 .78rem system-ui,sans-serif;cursor:pointer}
.wf-ib:active{background:var(--ink);color:var(--paper)}
.wf-stage{position:relative;width:100%;margin:0 auto;display:flex;justify-content:center;border-radius:6px;overflow:hidden;touch-action:none}
#wf-canvas{display:block;touch-action:none;user-select:none;-webkit-user-select:none;background:var(--paper);border-radius:6px;max-width:100%}
.wf-hint{position:absolute;left:50%;bottom:16%;transform:translateX(-50%);max-width:80%;background:var(--deep);color:var(--paper);padding:.5rem .8rem;border-radius:10px;font-size:.85rem;text-align:center;opacity:0;pointer-events:none;transition:opacity .3s}
.wf-hint.on{opacity:.95}
.wf-ov{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(244,237,218,.82);padding:.75rem;touch-action:manipulation;overflow:auto}
.wf-ov[hidden]{display:none}
.wf-card{width:100%;max-width:310px;background:var(--paper);border:3px solid var(--ink);border-radius:14px;padding:1rem;box-shadow:5px 5px 0 var(--ink);display:flex;flex-direction:column;gap:.55rem;text-align:center;animation:wfIn .25s ease-out}
@keyframes wfIn{from{transform:translateY(10px);opacity:0}to{transform:none;opacity:1}}
.wf-kicker{font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;color:var(--red);font-weight:700}
.wf-title{font-size:1.7rem;line-height:1.1;color:var(--ink);font-family:Georgia,"Times New Roman",serif}
.wf-sub{font-size:.88rem;line-height:1.35}
.wf-streak{font-size:.82rem;font-weight:700;color:var(--red)}
.wf-note{font-size:.82rem;font-weight:700;color:var(--red)}
.wf-foot{font-size:.74rem;opacity:.75;line-height:1.3}
.wf-how{font-size:.82rem;margin:.6rem 0;line-height:1.4}
.wf-step{display:flex;align-items:center;justify-content:center;gap:.6rem}
.wf-steplab{min-width:6.5rem;font-weight:700;color:var(--ink)}
.wf-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 1rem;border-radius:12px;border:2px solid var(--ink);background:var(--paper);color:var(--ink);font:700 1rem system-ui,sans-serif;cursor:pointer;text-decoration:none}
.wf-btn.main{background:var(--red);border-color:var(--deep);color:#fff}
.wf-btn.alt{background:var(--ink);color:var(--paper)}
.wf-btn.ghost{border-color:transparent;background:none;text-decoration:underline;min-height:44px}
.wf-btn.sq{min-width:48px;padding:0;font-size:1.3rem}
.wf-btn:active{transform:translateY(2px)}
.wf-btn:focus-visible,.wf-ib:focus-visible,.wf-skin:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.wf-skins{display:flex;justify-content:center;gap:.4rem}
.wf-skin{width:44px;height:44px;border-radius:50%;border:3px solid var(--r);background:radial-gradient(circle at 35% 30%,#fff8 0 12%,transparent 13%),var(--c);cursor:pointer;position:relative;color:#fff}
.wf-skin.sel{outline:3px solid var(--ink);outline-offset:2px}
.wf-skin.lock{filter:grayscale(1);opacity:.45}
.wf-skin small{font:700 .7rem system-ui;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#000}
.wf-stars{display:flex;justify-content:center;gap:.4rem}
.wf-star{width:38px;height:38px;background:#c9c0a6;clip-path:polygon(50% 2%,62% 36%,98% 38%,69% 59%,80% 94%,50% 73%,20% 94%,31% 59%,2% 38%,38% 36%)}
.wf-star.on{background:var(--gold);animation:wfPop .4s calc(var(--i)*.15s) both cubic-bezier(.3,1.6,.5,1)}
@keyframes wfPop{from{transform:scale(0) rotate(-40deg)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.wf-card,.wf-star.on{animation:none}.wf-hint{transition:none}.wf-btn:active{transform:none}}

/* full screen: board fills the stage under the dock */
html.pip-immersive .game-wrap,html.pip-native .game-wrap,.game-wrap:fullscreen{display:flex;flex-direction:column;max-width:none;width:100%;height:100%;margin:0;padding:.4rem max(.6rem,env(safe-area-inset-left)) max(.4rem,env(safe-area-inset-bottom)) max(.6rem,env(safe-area-inset-right));background:var(--paper);overflow:hidden}
html.pip-immersive .wf-h1,html.pip-native .wf-h1,html.pip-immersive .wf-how,html.pip-native .wf-how,html.pip-immersive .pip-actions,html.pip-native .pip-actions,html.pip-immersive .ad-well,html.pip-native .ad-well{display:none}
html.pip-immersive .wf-hud,html.pip-native .wf-hud{margin-bottom:.3rem;flex:none}
html.pip-immersive .wf-stage,html.pip-native .wf-stage{flex:1;min-height:0;align-items:center}
html.pip-immersive #wf-canvas,html.pip-native #wf-canvas{max-width:100%;max-height:100%}
@media (orientation:landscape) and (max-height:520px){html.pip-immersive .wf-hud,html.pip-native .wf-hud{gap:.3rem}.wf-hudL{font-size:.72rem}}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .game-wrap,html.pip-native .game-wrap{flex-direction:row;align-items:stretch;gap:.6rem;padding-top:max(.2rem,env(safe-area-inset-top));padding-bottom:max(.2rem,env(safe-area-inset-bottom))}
html.pip-immersive .wf-hud,html.pip-native .wf-hud{flex-direction:column;justify-content:center;align-items:stretch;width:8.5rem;margin:0;flex:none;gap:.5rem}
html.pip-immersive .wf-hudL,html.pip-native .wf-hudL{font-size:.78rem}
html.pip-immersive .wf-hudR,html.pip-native .wf-hudR{flex-direction:column;gap:.3rem}
html.pip-immersive .wf-stage,html.pip-native .wf-stage{flex:1;min-width:0;min-height:0;width:auto;margin:0}
}
