/* Hex Warden: chalk on slate. */
:root{--hw-bg:#14181c;--hw-panel:#1b2227;--hw-line:#3d4a53;--hw-chalk:#d9e2da;--hw-mut:#9fb0a8;--hw-teal:#4fe0cf;--hw-haz:#ff5a3c;--hw-gold:#ffd24a}
.hw{display:flex;flex-direction:column;gap:.5rem;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.hw button{font:inherit;color:var(--hw-chalk);cursor:pointer;touch-action:manipulation}
.hw button:focus-visible{outline:3px solid var(--hw-gold);outline-offset:2px}
.hw button:disabled{opacity:.4;cursor:default}
.hw-top{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.hw-name{font-size:1.15rem;font-weight:800;letter-spacing:.02em;text-align:center;flex:1}
.hw-btn{min-height:44px;min-width:44px;padding:0 .8rem;background:var(--hw-panel);border:2px solid var(--hw-line);border-radius:6px;font-size:.85rem;font-weight:600}
.hw-stats{flex-wrap:wrap;display:flex;align-items:center;justify-content:space-between;gap:.5rem;font-size:.85rem;color:var(--hw-mut);padding:0 .1rem}
.hw-stats b{color:var(--hw-chalk);font-variant-numeric:tabular-nums}
.hw-hp{display:flex;gap:5px}
.hw-hp i{width:16px;height:18px;background:#2b353c;clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%)}
.hw-hp i.on{background:var(--hw-teal)}
.hw-tip{min-height:2.7em;font-size:.88rem;line-height:1.35;color:var(--hw-chalk);padding:.4rem .6rem;border-left:4px solid var(--hw-haz);background:var(--hw-panel)}
.hw-field{position:relative;width:100%;height:clamp(320px,100vw,410px);background:var(--hw-bg);border:2px solid var(--hw-line);border-radius:8px;overflow:hidden;touch-action:none;overscroll-behavior:contain}
#hwCanvas{display:block;width:100%;height:100%;touch-action:none;cursor:pointer}
.hw-panel{position:absolute;inset:0;background:rgba(15,19,22,.93);display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:.6rem;padding:1rem;touch-action:pan-y;overflow-y:auto}
.hw-panel[hidden],.hw-result[hidden]{display:none}
.hw-title h2{font-size:2rem;font-weight:900;letter-spacing:.06em;text-transform:uppercase;text-align:center;color:var(--hw-teal)}
.hw-sub{text-align:center;color:var(--hw-mut);font-size:.9rem;line-height:1.4;margin-bottom:.2rem}
.hw-go,.hw-alt{min-height:50px;border-radius:6px;font-weight:800;font-size:1rem;border:2px solid var(--hw-line);background:var(--hw-panel)}
.hw-go{background:var(--hw-teal);border-color:var(--hw-teal);color:#06201d!important}
.hw-rec{display:flex;justify-content:space-between;gap:.4rem;margin-top:.3rem;text-align:center}
.hw-rec div{flex:1}.hw-rec dt{font-size:.7rem;color:var(--hw-mut);text-transform:uppercase;letter-spacing:.08em}.hw-rec dd{font-weight:800;font-variant-numeric:tabular-nums}
.hw-floors{justify-content:flex-start;overflow-y:auto;-webkit-overflow-scrolling:touch;gap:.5rem}
.hw-floors-head{display:flex;align-items:center;justify-content:space-between}
.hw-floors h2{font-size:1.2rem}
.hw-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.fl{min-height:48px;background:var(--hw-panel);border:2px solid var(--hw-line);border-radius:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.1}
.fl b{font-size:.95rem}.fl span{font-size:.62rem;color:var(--hw-mut)}
.fl.done{border-color:var(--hw-teal)}
.hw-result{position:absolute;left:.6rem;right:.6rem;bottom:.6rem;background:rgba(20,26,30,.97);border:2px solid var(--hw-teal);border-radius:8px;padding:.9rem;text-align:center;display:flex;flex-direction:column;gap:.4rem;animation:hw-up .22s ease-out}
.hw-result h2{font-size:1.3rem}
.hw-result p{font-size:.9rem;color:var(--hw-mut)}
.hw-score{color:var(--hw-gold)!important;font-weight:700}
.hw-stars{display:flex;justify-content:center;gap:6px}
.hw-stars svg{width:34px;height:34px;fill:#2b353c}.hw-stars svg.on{fill:var(--hw-gold)}
.hw-res-btns{display:flex;flex-direction:column;gap:.45rem;margin-top:.2rem}
.hw-bar{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem}
.hw-act{min-height:52px;background:var(--hw-panel);border:2px solid var(--hw-line);border-radius:6px;font-weight:700;font-size:1rem}
.hw-about{margin-top:1.4rem;color:var(--hw-mut);font-size:.9rem;line-height:1.55}
.hw-about h2{color:var(--hw-chalk);font-size:1.05rem;margin-bottom:.4rem}
.hw-about p{margin-bottom:.7rem}
.hw-foot{padding:1rem;text-align:center;font-size:.8rem;color:var(--hw-mut)}
.hw-foot a{color:var(--hw-chalk);display:inline-block;min-height:32px;line-height:32px}
@keyframes hw-up{from{transform:translateY(14px);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.hw-result{animation:none}}

.hw-pb{font-style:normal;color:var(--hw-gold);font-size:.78rem}
.hw-progt{text-align:center;font-size:.8rem;color:var(--hw-mut);line-height:1.3}
.hw-prog{height:6px;background:#2b353c;border-radius:3px;overflow:hidden}
.hw-prog i{display:block;height:100%;width:0;background:var(--hw-teal);transition:width .4s}
.hw-title{gap:.45rem}
.hw-title .hw-alt{min-height:46px}
.hw-title h2{text-shadow:0 0 18px rgba(79,224,207,.35)}
.hw-field{background:radial-gradient(ellipse at 50% 40%,#1b2329,#14181c 70%)}
@media (prefers-reduced-motion:reduce){.hw-prog i{transition:none}}

/* Full screen (shell stage = .game-wrap): fill the stage, no scroll */
html.pip-immersive .game-wrap.pip-stage{max-width:none!important;display:flex;flex-direction:column;padding:.4rem .5rem;overflow:hidden}
html.pip-immersive .pip-stage>.hw{flex:1;min-height:0;gap:.35rem}
html.pip-immersive .hw-name{font-size:1rem}
html.pip-immersive .hw-tip{min-height:0;padding:.3rem .5rem;font-size:.82rem}
html.pip-immersive .hw-field{flex:1;min-height:0;height:auto}
html.pip-immersive #hwCanvas{position:absolute;inset:0}
html.pip-immersive .hw-act{min-height:48px}
html.pip-immersive .hw-about,html.pip-immersive .hw-foot,html.pip-immersive .ad-well,html.pip-immersive .game-header{display:none}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .pip-stage>.hw{display:grid;grid-template-columns:1fr minmax(120px,170px);grid-template-rows:auto auto 1fr;grid-auto-flow:row;gap:.3rem .5rem}
html.pip-immersive .hw-top{grid-column:2;grid-row:1}
html.pip-immersive .hw-stats{grid-column:2;grid-row:2}
html.pip-immersive .hw-tip{display:none}
html.pip-immersive .hw-field{grid-column:1;grid-row:1/4}
html.pip-immersive .hw-bar{grid-column:2;grid-row:3;grid-template-columns:1fr;align-self:end}
}
/* title polish */
.hw-title h2{background:linear-gradient(180deg,#8ff5e8,#2fb8a8);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;text-shadow:none;filter:drop-shadow(0 0 14px rgba(79,224,207,.35))}
.hw-go{box-shadow:0 3px 0 #1f8f84,0 0 18px rgba(79,224,207,.25)}.hw-go:active{transform:translateY(2px);box-shadow:0 1px 0 #1f8f84}
.hw-act:active,.hw-alt:active{transform:translateY(1px)}
