.survival-hud{position:fixed;z-index:22;pointer-events:none;color:#e9ddbc;font:14px/1.2 'Trebuchet MS',sans-serif;box-sizing:border-box}
.survival-hud[hidden],.survival-hud [hidden]{display:none!important}.survival-hud *{box-sizing:border-box}
.hud-card{position:absolute;padding:8px;background:#15291ee8;border:1px solid #61734a88;border-radius:8px;box-shadow:0 2px 6px #08161035}
.hud-player{left:8px;top:8px}.hud-needs,.hud-resources{display:grid;grid-template-columns:repeat(3,70px);gap:8px}.hud-needs{padding-bottom:7px}.hud-resources{padding-top:7px;border-top:1px solid #71815a44;color:#d3d1b6}
.hud-stat{position:relative;display:flex;align-items:center;gap:5px;min-width:0;white-space:nowrap}.hud-stat img{display:block;width:32px;height:32px;object-fit:contain;image-rendering:pixelated}.hud-stat b{font:14px/1.2 monospace;font-variant-numeric:tabular-nums;text-shadow:0 1px #102217}.hud-low{color:#ffc297}.hud-low b{text-decoration:underline;text-underline-offset:3px}
.hud-meter{display:none}.hud-vital{padding-bottom:7px}.hud-vital .hud-meter{display:block;position:absolute;left:0;right:0;bottom:0;height:3px;border-radius:2px;background:#081b15}.hud-meter:after{content:'';display:block;height:100%;width:var(--fill);background:#a5b77a;border-radius:inherit}[data-stat$=health] .hud-meter:after{background:#d38272}[data-stat$=thirst] .hud-meter:after{background:#80b8c1}.hud-low .hud-meter:after{background:#edab71}
.hud-dog{right:8px;top:8px;display:grid;grid-template-columns:1fr 24px;align-items:center;gap:7px}
.hud-dog-needs{display:grid;grid-template-columns:repeat(2,70px);gap:8px;grid-column:1/3}
.hud-pet{pointer-events:auto;display:flex;align-items:center;justify-content:center;gap:7px;margin:0;padding:2px 6px;min-height:34px;background:#263c2c;border:1px solid #65754b;border-radius:4px;color:#d8c697;cursor:pointer;font:20px/1 'Trebuchet MS',sans-serif;touch-action:manipulation}
.hud-pet img{width:24px;height:24px;image-rendering:pixelated}.hud-pet kbd{font:11px monospace}.hud-pet:disabled{opacity:.45;cursor:default}.hud-pet:focus-visible{outline:2px solid #dfc185;outline-offset:2px}.hud-pet:hover:not(:disabled),.hud-pet.hud-affection{background:#41533a;border-color:#dfc185}
.hud-dog-activity{font:22px/1 Georgia,serif;text-align:center;color:#dfc185}
.hud-menu-button,#game-experience .hud-menu-button{box-sizing:border-box;min-width:0;min-height:0;width:var(--menu-circle-size,64px);height:var(--menu-circle-size,64px);pointer-events:auto;border-radius:50%;background:#263c2c;color:#e5d5a6;border:1px solid #899467;padding:0;display:grid;place-items:center;cursor:pointer;box-shadow:0 2px 8px #08161066;touch-action:manipulation}
.hud-inventory{position:absolute;right:8px;bottom:calc(var(--menu-circle-size,64px) + 16px)}.hud-menu-button img{width:var(--shortcut-icon-size,48px);height:var(--shortcut-icon-size,48px);image-rendering:pixelated}.hud-menu-button kbd{position:absolute;bottom:-2px;right:-1px;padding:1px 4px;background:#203425;border:1px solid #62704d;border-radius:5px;font:10px monospace}.hud-menu-button:focus-visible{outline:2px solid #dfc185;outline-offset:2px}.hud-menu-button:hover{background:#41533a}
.hud-small .hud-card{padding:5px}.hud-small .hud-needs,.hud-small .hud-resources,.hud-small .hud-dog-needs{grid-template-columns:repeat(3,48px);gap:3px}.hud-small .hud-dog-needs{grid-template-columns:repeat(2,48px)}.hud-small .hud-stat{gap:1px}.hud-small .hud-stat b{font-size:11px}.hud-small .hud-stat img{width:28px;height:28px}.hud-small .hud-pet{min-height:30px;padding:1px 4px;gap:3px}
.hud-tiny .hud-card{padding:3px;top:4px}.hud-tiny .hud-player{left:4px}.hud-tiny .hud-dog{right:4px;gap:3px;grid-template-columns:1fr 12px}.hud-tiny .hud-needs,.hud-tiny .hud-resources{grid-template-columns:repeat(3,22px);gap:2px;padding-block:3px}.hud-tiny .hud-dog-needs{grid-template-columns:repeat(2,22px);gap:2px}.hud-tiny .hud-stat{flex-direction:column;gap:1px}.hud-tiny .hud-stat img{width:16px;height:16px}.hud-tiny .hud-stat b{font-size:9px}.hud-tiny .hud-vital{padding-bottom:5px}.hud-tiny .hud-pet{min-height:22px;padding:0;gap:1px}.hud-tiny .hud-pet img{width:16px;height:16px}.hud-tiny .hud-pet span{font-size:12px}.hud-tiny .hud-pet kbd{font-size:8px}.hud-tiny .hud-dog-activity{font-size:12px}.hud-tiny .hud-inventory{right:calc(var(--menu-circle-size) + 12px);bottom:4px}
.game-experience[data-game-state="playing"] #shell-stats{display:none}

/* Front-facing portraits use the same approved actor rasters as the world. */
.hud-portrait{position:relative;display:block;width:72px;height:72px;overflow:hidden;border:2px solid #9aa576;border-radius:50%;background:radial-gradient(circle at 50% 35%,#4c6040,#253c2b 75%);box-shadow:inset 0 0 0 3px #192f24;align-self:center}
.hud-portrait img{position:absolute;width:160px;height:160px;max-width:none;left:calc(50% - 80px);top:-20px;image-rendering:pixelated}.hud-dog-portrait img{left:calc(50% - 76px);top:-58px}
.hud-player{display:grid;grid-template-columns:72px auto;column-gap:10px}.hud-player-portrait{grid-column:1;grid-row:1/3}.hud-needs,.hud-resources{grid-column:2}
.hud-dog{grid-template-columns:1fr 24px 72px;column-gap:10px}.hud-dog-portrait{grid-column:3;grid-row:1/3}.hud-pet{grid-column:1}.hud-dog-activity{grid-column:2}
.hud-medium .hud-player{grid-template-columns:auto}.hud-medium .hud-player-portrait{grid-column:1;grid-row:1;justify-self:center;margin-bottom:5px}.hud-medium .hud-needs,.hud-medium .hud-resources{grid-column:1}
.hud-medium .hud-dog{grid-template-columns:1fr 24px}.hud-medium .hud-dog-portrait{grid-column:1/3;grid-row:1;justify-self:center;margin-bottom:5px}.hud-medium .hud-portrait{width:48px;height:48px}.hud-medium .hud-portrait img{width:120px;height:120px;left:calc(50% - 60px);top:-16px}.hud-medium .hud-dog-portrait img{left:calc(50% - 57px);top:-44px}
.hud-tiny .hud-portrait{width:28px;height:28px;margin-bottom:1px}.hud-tiny .hud-portrait img{width:80px;height:80px;left:calc(50% - 40px);top:-12px}.hud-tiny .hud-dog-portrait img{left:calc(50% - 38px);top:-32px}.hud-tiny .hud-dog{grid-template-columns:1fr 12px}.hud-tiny .hud-needs,.hud-tiny .hud-resources{padding-block:2px}

.hud-dog-portrait svg{display:block;width:100%;height:100%;image-rendering:pixelated}
/* Portrait-first disclosure: cards never reserve a rectangle while collapsed. */
.survival-hud .hud-card{display:block;width:72px;height:72px;padding:0;border:0;background:none;box-shadow:none}
.survival-hud .hud-portrait{margin:0;padding:0;min-width:0;min-height:0;pointer-events:auto;cursor:pointer;touch-action:manipulation}
.hud-portrait:focus-visible{outline:2px solid #e5d5a6;outline-offset:3px}.hud-portrait:hover{border-color:#e5d5a6}.hud-portrait[aria-expanded=true]{border-color:#e5d5a6;box-shadow:0 0 0 2px #4c6040}
.hud-details{position:absolute;top:0;width:max-content;padding:8px;background:#15291eed;border:1px solid #61734a88;border-radius:8px;box-shadow:0 2px 6px #08161035}
.hud-player .hud-details{left:80px}.hud-dog .hud-details{right:80px;display:grid;grid-template-columns:1fr 24px;gap:7px}
.hud-portrait.hud-warning{border-color:#e5b765;box-shadow:0 0 0 2px #76552f}.hud-portrait.hud-critical{border-color:#ed9c79;box-shadow:0 0 0 2px #873f2c}
.hud-portrait.hud-warning:after{content:'!';position:absolute;right:5px;bottom:3px;width:14px;height:14px;border-radius:50%;background:#e5b765;color:#302b22;font:bold 11px/14px monospace;text-align:center}
.hud-announcement{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.hud-medium .hud-card{width:48px;height:48px}.hud-medium .hud-details{top:56px}.hud-medium .hud-player .hud-details{left:0}.hud-medium .hud-dog .hud-details{right:0}
.hud-small .hud-details{padding:5px}
.hud-tiny .hud-card{width:28px;height:28px}.hud-tiny .hud-details{top:36px;padding:3px}.hud-tiny .hud-dog .hud-details{grid-template-columns:1fr 12px;gap:3px}.hud-tiny .hud-portrait.hud-warning:after{right:1px;bottom:1px;width:9px;height:9px;font-size:8px;line-height:9px}
/* Retain keyboard input on the map without decorating the entire playfield. */
canvas#map:focus,canvas#map:focus-visible,canvas#game:focus,canvas#game:focus-visible{outline:none}
.hud-stacked .hud-dog .hud-details{top:var(--dog-details-top)}
.hud-details[inert] .hud-pet{pointer-events:none}

/* All HUD circles share the backpack and Dog Ring diameter. */
.survival-hud .hud-card,.survival-hud .hud-portrait{width:var(--menu-circle-size);height:var(--menu-circle-size)}
.survival-hud .hud-player-portrait img{pointer-events:none;user-select:none;width:var(--portrait-raster-size);height:var(--portrait-raster-size);left:calc(50% - var(--portrait-raster-size)/2);top:var(--portrait-raster-top)}
.survival-hud .hud-player .hud-details{left:calc(var(--menu-circle-size) + 8px)}
.survival-hud .hud-dog .hud-details{right:calc(var(--menu-circle-size) + 8px)}
.survival-hud.hud-medium .hud-details{top:calc(var(--menu-circle-size) + 8px)}
.survival-hud.hud-medium .hud-player .hud-details{left:0}
.survival-hud.hud-medium .hud-dog .hud-details{right:0}
.survival-hud.hud-stacked .hud-dog .hud-details{top:var(--dog-details-top)}

/* Quiet resource feedback uses the existing slots, without extra HUD space. */
.hud-resource-gain{color:#ffe087;background:#dfc18518;border-radius:4px}
.hud-resource-empty{color:#edab71;background:#edab7118;border-radius:4px}
.hud-resource-empty b{text-decoration:underline;text-underline-offset:3px}

.hud-resources-only .hud-needs{display:none}
.hud-resources-only .hud-resources{padding-top:0;border-top:0}

/* Day/night dial: the same circle diameter and inset as the other HUD controls. */
.hud-cycle{position:absolute;left:8px;bottom:8px;width:var(--menu-circle-size);height:var(--menu-circle-size);border-radius:50%;border:1px solid #899467;background:#263c2ced;box-shadow:0 2px 8px #08161066;color:#e5d5a6}
.hud-cycle svg{display:block;width:100%;height:100%;overflow:visible}
.cycle-track{fill:none;stroke:#4d616c;stroke-width:2}.cycle-day-arc{fill:none;stroke:#c9952d;stroke-width:2;opacity:.65}.cycle-hand{fill:#f3e7bf}
.cycle-sun,.cycle-moon{transition:opacity 700ms ease}.cycle-moon,.is-night .cycle-sun{opacity:0}.is-night .cycle-moon{opacity:1}
.cycle-day-number{position:absolute;bottom:-2px;left:50%;transform:translateX(-50%);padding:0 3px;background:#263c2c;border-radius:3px;color:#e5d5a6;font:10px/1.2 monospace;font-variant-numeric:tabular-nums}
.hud-tiny .hud-cycle{left:4px;bottom:4px}.hud-tiny .cycle-day-number{font-size:8px}
@media(prefers-reduced-motion:reduce){.cycle-sun,.cycle-moon{transition:none}}

/* Transient dog context reuses the existing card; no invented stamina or fear bars. */
.hud-dog-state{grid-column:1/-1;max-width:155px;font:11px/1.3 'Trebuchet MS',sans-serif;color:#e9ddbc}
.hud-teaching{position:absolute;left:50%;top:calc(var(--menu-circle-size) + 150px);transform:translateX(-50%);max-width:calc(100% - 24px);padding:6px 10px;border:1px solid #899467;background:#203425ed;border-radius:6px;font:12px/1.35 'Trebuchet MS',sans-serif;text-align:center;color:#e9ddbc;pointer-events:none}
.hud-small .hud-dog-state{font-size:10px;max-width:106px}.hud-tiny .hud-dog-state{font-size:9px;max-width:66px}
.hud-small .hud-teaching{top:auto;bottom:calc(var(--menu-circle-size)*2 + 28px);font-size:11px}
