/* Hourglass Bank. Counting-house look: verdigris ledger, brass plates, amber sand. */
:root{--hb-bg:#0f1d1a;--hb-plate:#172a26;--hb-plate2:#1f3732;--hb-line:#2d4a43;--hb-brass:#d4a84a;--hb-brass-d:#8a6a26;--hb-cream:#f3e7c9;--hb-sand:#eab44f;--hb-mist:#8fc9bb;--hb-warn:#e0694a;--hb-ink:#0a1412}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--hb-bg);color:var(--hb-cream);font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-text-size-adjust:100%;overscroll-behavior-y:contain}
.game-header{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:.5rem 1rem;padding-left:max(1rem,env(safe-area-inset-left));padding-right:max(1rem,env(safe-area-inset-right));background:var(--hb-plate);border-bottom:1px solid var(--hb-line);min-height:44px}
.game-header a{color:var(--hb-brass);text-decoration:none;font-weight:700;display:inline-flex;align-items:center;min-height:44px}
.game-tag{font-size:.8rem;color:var(--hb-mist)}
.game-wrap{padding-left:max(1rem,env(safe-area-inset-left));padding-right:max(1rem,env(safe-area-inset-right))}
.game-title{text-align:center;margin:.25rem 0 .5rem}
.game-title h1{margin:0;font-family:Georgia,"Times New Roman",serif;font-size:1.45rem;letter-spacing:.04em;color:var(--hb-cream)}
.hb{display:block}
.hb-hud{padding:2px 0 8px}
.hb-row{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:.95rem;margin-bottom:6px}
#hb-time{font-variant-numeric:tabular-nums;color:var(--hb-brass)}
#hb-strikes{display:inline-flex;gap:6px}
.hb-pip{width:12px;height:12px;border-radius:50%;border:2px solid var(--hb-brass-d);display:inline-block}
.hb-pip.on{background:var(--hb-warn);border-color:var(--hb-warn)}
.hb-meter{position:relative;height:24px;border-radius:6px;background:var(--hb-plate);border:1px solid var(--hb-line);overflow:hidden}
.hb-fill{position:absolute;left:0;top:0;bottom:0;width:0;background:linear-gradient(90deg,var(--hb-brass-d),var(--hb-brass));transition:width .25s ease-out}
.hb-fill.done{background:linear-gradient(90deg,#b98a2e,#ffd97a)}
.hb-meter span{position:relative;z-index:1;display:block;text-align:center;line-height:22px;font-size:.78rem;font-weight:700;color:var(--hb-cream);text-shadow:0 1px 0 var(--hb-ink)}
.hb-stage{position:relative;width:100%;height:480px;height:clamp(380px,calc(100svh - 340px),640px);border-radius:12px;overflow:hidden;background:var(--hb-bg);border:1px solid var(--hb-line)}
#hb-canvas{display:block;width:100%;height:100%;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline:none}
.hb-overlay,.hb-sheet{position:absolute;inset:0;background:rgba(10,20,18,.88);display:flex;align-items:center;justify-content:center;padding:14px;animation:hbIn .22s ease-out}
.hb-overlay[hidden],.hb-sheet[hidden]{display:none}
.hb-sheet{display:block;overflow-y:auto;touch-action:pan-y;background:rgba(15,29,26,.97);align-items:flex-start;justify-content:flex-start}
@keyframes hbIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.hb-card{width:100%;max-width:330px;background:var(--hb-plate);border:1.5px solid var(--hb-brass-d);border-radius:12px;padding:18px 16px;text-align:center;box-shadow:0 0 0 3px var(--hb-plate2)}
.hb-card h2{margin:0 0 8px;font-family:Georgia,"Times New Roman",serif;font-size:1.5rem;color:var(--hb-brass)}
.hb-card h2.good{color:#ffd97a}.hb-card h2.bad{color:var(--hb-warn)}
.hb-card .lead{margin:0 0 12px;font-size:.92rem;line-height:1.45;color:var(--hb-cream)}
.stats{list-style:none;margin:0 0 14px;padding:0;font-size:.88rem;color:var(--hb-mist);line-height:1.7}
button{font:inherit;color:inherit}
button.primary,button.ghost,button.buy,button.close,.hb-bar button{min-height:48px;border-radius:8px;cursor:pointer;font-weight:700;border:1.5px solid var(--hb-brass);padding:0 14px}
button.primary{display:block;width:100%;background:var(--hb-brass);color:var(--hb-ink);margin-top:6px;font-size:1rem}
button.ghost{display:block;width:100%;background:transparent;color:var(--hb-brass);margin-top:8px}
button:focus-visible{outline:3px solid var(--hb-mist);outline-offset:2px}
button:disabled{opacity:.45;cursor:default}
.hb-hint{min-height:2.6em;margin:8px 0 6px;font-size:.88rem;line-height:1.35;color:var(--hb-mist);text-align:center}
.hb-bar{display:flex;gap:8px;padding-bottom:max(4px,env(safe-area-inset-bottom))}
.hb-bar button{flex:1;background:var(--hb-plate2);color:var(--hb-cream)}
.hb-bar button:active,button.primary:active{transform:translateY(1px)}
.hb-shophead{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.hb-shophead h3{margin:0;font-family:Georgia,serif;color:var(--hb-brass);font-size:1.15rem}
button.close{background:var(--hb-plate2);color:var(--hb-cream);min-width:84px}
.hb-list h4{margin:14px 0 6px;font-size:.8rem;letter-spacing:.06em;text-transform:uppercase;color:var(--hb-mist)}
.hb-row2{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--hb-plate);border:1px solid var(--hb-line);border-radius:8px;padding:8px 10px;margin-bottom:8px}
.hb-rowtxt{display:flex;flex-direction:column;min-width:0;font-size:.82rem;color:var(--hb-mist)}
.hb-rowtxt strong{color:var(--hb-cream);font-size:.92rem}
button.buy{background:var(--hb-brass);color:var(--hb-ink);min-width:84px;flex:none}
.hb-audit{margin-top:14px;padding:10px;border:1px dashed var(--hb-brass-d);border-radius:8px;font-size:.82rem;color:var(--hb-mist)}
.hb-audit p{margin:0 0 8px;line-height:1.4}
.hb-audit button{width:100%}
footer{text-align:center;padding:1.2rem;font-size:.8rem;color:var(--hb-mist)}
footer a{color:var(--hb-mist)}
.pip-actions{text-align:center;margin:.75rem 0}
.pip-actions .btn{display:inline-block;background:var(--hb-plate2);color:var(--hb-cream);padding:.7rem 1.2rem;border-radius:8px;text-decoration:none;font-weight:700;border:1px solid var(--hb-brass-d)}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.hb-stars{display:flex;justify-content:center;gap:6px;font-size:2rem;line-height:1;margin:0 0 6px;color:var(--hb-line)}
.hb-stars .on{color:#ffd97a;text-shadow:0 0 8px rgba(255,217,122,.5)}
.hb-stars.fresh .on{animation:hbPop .5s ease-out both}
.hb-stars.fresh .on:nth-child(2){animation-delay:.12s}.hb-stars.fresh .on:nth-child(3){animation-delay:.24s}
@keyframes hbPop{0%{transform:scale(.3);opacity:0}70%{transform:scale(1.25)}100%{transform:none;opacity:1}}
.newbest{margin:0 0 8px;font-size:.82rem;font-weight:700;color:var(--hb-brass)}
.stats .daily{color:var(--hb-brass);font-weight:700}
/* Full screen (shell stage = .game-wrap). Board fills the stage; chrome hidden. */
html.pip-immersive .game-wrap,.game-wrap:fullscreen{display:flex;flex-direction:column;max-width:none;width:auto;height:auto;margin:0;padding:6px max(8px,env(safe-area-inset-left)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-right));overflow:hidden;background:var(--hb-bg)}
.game-wrap:fullscreen{width:100%;height:100%}
html.pip-immersive .hb,.game-wrap:fullscreen .hb{flex:1;min-height:0;display:flex;flex-direction:column}
html.pip-immersive .hb-stage,.game-wrap:fullscreen .hb-stage{flex:1;min-height:0;height:auto}
html.pip-immersive .game-title,html.pip-immersive .pip-actions,html.pip-immersive .hb-hint:empty,.game-wrap:fullscreen .game-title,.game-wrap:fullscreen .pip-actions{display:none}
html.pip-immersive .hb-hint,.game-wrap:fullscreen .hb-hint{min-height:0;margin:4px 0;font-size:.82rem}
html.pip-immersive .hb-bar button,.game-wrap:fullscreen .hb-bar button{min-height:48px}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .hb,.game-wrap:fullscreen .hb{display:grid;grid-template-columns:minmax(0,1fr) 200px;grid-template-rows:auto auto 1fr;column-gap:10px;align-content:stretch}
html.pip-immersive .hb-stage,.game-wrap:fullscreen .hb-stage{grid-column:1;grid-row:1/4}
html.pip-immersive .hb-hud,.game-wrap:fullscreen .hb-hud{grid-column:2;grid-row:1}
html.pip-immersive .hb-hint,.game-wrap:fullscreen .hb-hint{grid-column:2;grid-row:2}
html.pip-immersive .hb-bar,.game-wrap:fullscreen .hb-bar{grid-column:2;grid-row:3;flex-direction:column;justify-content:flex-end}
}
