:root {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
    color: #2a2328;
    background: #fff;
    color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; }
button {
    font: inherit;
    border: 0;
    border-radius: 8px;
    background: #f3f4f6;
    color: #2a2328;
    min-height: 44px;
    padding: 8px 16px;
    touch-action: manipulation;
}
button:disabled { opacity: .5; }
button:focus-visible, a:focus-visible { outline: 3px solid #a66c28; outline-offset: 2px; }
[hidden] { display: none !important; }
main {
    max-width: 450px;
    margin: auto;
    height: calc(100dvh - var(--nav-height, 60px));
    padding: 0 6px max(6px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 400px;
}
.stage {
    flex: 1;
    position: relative;
    min-height: 0;
    overflow: hidden;
    background: #20343b;
}
canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: #fff;
    gap: 6px;
    height: 52px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}
.hud button { pointer-events: auto; min-width: 44px; padding: 6px; }
#hearts { color: #b94b55; letter-spacing: 1px; }
.feedback {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 64px;
    text-align: center;
    font-weight: 700;
    color: #fff;
    pointer-events: none;
    text-shadow: 0 1px 3px #14232d;
}
.meter {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 8px 12px 10px;
    pointer-events: none;
}
.meter-values { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
#power { padding-left: 4px; font-size: 16px; }
.track { height: 8px; background: #e6e8eb; border-radius: 4px; position: relative; margin-top: 6px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: #c78c3f; }
.track b { position: absolute; top: 0; height: 100%; width: 3px; background: #2a2328; }
#action { position: absolute; bottom: calc(100% + 8px); left: 8px; right: 8px; margin: 0; font-size: 13px; font-weight: 600; color: #fff; text-align: center; text-shadow: 0 1px 3px #14232d; }
#action:empty { display: none; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #14232d70; padding: 12px; }
.panel { background: #fff; max-width: 300px; width: 100%; max-height: 100%; overflow: auto; border-radius: 12px; text-align: center; padding: 16px; }
.hero { width: 96px; height: 96px; object-fit: contain; }
.panel p { font-size: 13px; line-height: 1.65; margin: 8px 0; }
.panel h2 { font-size: 22px; margin: 6px 0; }
#status { font-weight: 700; }
#play { width: 100%; font-weight: 700; }
#storage { font-size: 11px; color: #6e626a; }
.buddy { min-height: 52px; display: flex; align-items: center; gap: 8px; padding-inline: 4px; }
.buddy img { height: 48px; width: 48px; object-fit: contain; }
.buddy strong { font-size: 11px; color: #6e626a; }
.buddy p { font-size: 13px; margin: 2px 0; line-height: 1.4; }
#hold { flex-shrink: 0; min-height: 52px; font-weight: 700; touch-action: none; user-select: none; -webkit-user-select: none; }
#hold[data-held=true] { background: #eef0f3; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
