/* PLAY — drunk walk sim chrome (player/drunk.js, handover.md §4g).
   Every element here is created by drunk.js only when ?drunk is set, so this
   file is inert on every other tour. */

#drunkVignette,
#drunkShards,
#drunkGlass,
#drunkFlash {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

#drunkVignette {
    z-index: 5;
    opacity: 0;
    background: radial-gradient(ellipse at center,
        rgba(0, 0, 0, 0) 45%,
        rgba(20, 0, 10, 0.45) 75%,
        rgba(0, 0, 0, 0.85) 100%);
    mix-blend-mode: multiply;
}

/* Shard panes between the cracks: each a clip-path polygon with its own
   backdrop-filter, so the live scene looks refracted pane by pane. */
#drunkShards {
    z-index: 6;
}

.drunkShard {
    position: absolute;
    inset: 0;
}

#drunkGlass {
    z-index: 7;
    width: 100%;
    height: 100%;
    opacity: 0;
}

#drunkFlash {
    z-index: 8;
    opacity: 0;
    background: #fff;
}

#drunkFlash.hit {
    animation: drunkFlash 0.45s ease-out;
}

@keyframes drunkFlash {
    0% { opacity: 0.85; }
    100% { opacity: 0; }
}

#drunkHud {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    user-select: none;
}

/* The level control: a pint you drag to tip over (drawBeer in drunk.js). */
#drunkHud .drunkBeer {
    /* index.css styles EVERY canvas as the fixed, full-screen scene canvas
       (position: fixed, 100% × 100%, --canvas-opacity) — undo that here. */
    position: static;
    opacity: 1;
    flex: none;
    width: 92px;
    height: 64px;
    cursor: ew-resize;
    touch-action: none;
    border-radius: 8px;
}

#drunkHud .drunkBeer:focus-visible {
    outline: 2px solid #f5b041;
    outline-offset: 2px;
}

.drunkHudValue {
    min-width: 3.2em;
    text-align: right;
}

/* Balance meter — how close you are to going over. */
.drunkHudMeter {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.drunkHudMeter span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #f5b041, #e74c3c);
}
