/*
 * One dark palette for menus, one high-contrast layer for the HUD.
 *
 * The HUD sits over a bright, moving 3D scene, so every readable thing on it
 * has either a dark scrim or a text shadow - light-on-light over a sunlit beach
 * is invisible exactly when it matters.
 *
 * The menus lean warm rather than neutral-grey: the game is a sunny one, and a
 * cold slate UI in front of it reads as a debug overlay somebody forgot to
 * restyle. Every surface gets a hairline top highlight and a real shadow, which
 * is the cheapest way to stop flat rectangles looking like flat rectangles.
 */

:root {
    --ink: #f7f2e8;
    --muted: #a89e8e;
    --panel: #171420;
    --panel-2: #241f2e;
    --line: #3a3346;
    --line-soft: rgba(255, 255, 255, .07);
    --gold: #ffce5c;
    --gold-deep: #e8a838;
    --good: #86dd93;
    --bad: #ff7a68;
    --rose: #ff8fb0;

    /* Layered rather than one blob: contact, mid and ambient. */
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 20px rgba(0, 0, 0, .35),
        0 28px 64px rgba(0, 0, 0, .45);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45), 0 4px 12px rgba(0, 0, 0, .3);
    --edge: inset 0 1px 0 rgba(255, 255, 255, .07);
    --radius: 18px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

* {
    box-sizing: border-box;
}

/*
 * `hidden` is only a `display: none` in the UA sheet, so any class here that
 * sets `display` silently outranks it - which is how the HYPER bar ended up
 * permanently on screen. Restate it at a specificity nothing else reaches.
 */
[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #0b0910;
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
    touch-action: none;
}

#stage {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* --- screens ---------------------------------------------------------- */

.screen {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-y: auto;
    /* Warm at the top where the sun would be, deep at the edges. The blur and
       saturate keep the live 3D scene behind readable as *atmosphere* without
       competing with the text in front of it. */
    background:
        radial-gradient(140% 100% at 50% -10%, rgba(120, 80, 60, .35), transparent 55%),
        radial-gradient(120% 90% at 50% 0%, rgba(24, 20, 34, .72), rgba(6, 5, 10, .94));
    backdrop-filter: blur(14px) saturate(.85);
    z-index: 10;
    animation: screen-in .28s ease both;
}

@keyframes screen-in {
    from {
        opacity: 0;
    }
}

.screen[hidden] {
    display: none;
}

.panel {
    position: relative;
    width: min(560px, 100%);
    background:
        radial-gradient(120% 80% at 50% -20%, rgba(255, 206, 92, .09), transparent 60%),
        linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow), var(--edge);
    padding: 30px;
    margin: auto;
    animation: panel-in .34s cubic-bezier(.2, .9, .3, 1) both;
}

/* A single warm hairline along the top edge, the way a lit surface catches. */
.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, transparent, rgba(255, 206, 92, .5), transparent);
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }
}

.panel.wide {
    width: min(980px, 100%);
}

h1 {
    font-size: clamp(42px, 8.5vw, 72px);
    line-height: .92;
    margin: 0 0 12px;
    letter-spacing: -.04em;
    font-weight: 800;
    background: linear-gradient(178deg, #fffaf0 30%, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* The gradient eats the text colour, so the drop shadow has to be a filter
       rather than a text-shadow. */
    filter: drop-shadow(0 3px 14px rgba(255, 206, 92, .22));
}

h2 {
    font-size: 24px;
    margin: 0 0 6px;
    letter-spacing: -.01em;
}

h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    margin: 20px 0 8px;
}

p {
    line-height: 1.55;
    margin: 0 0 12px;
}

.sub {
    color: #cfc6b6;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.fineprint {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 16px;
}

.controls {
    font-size: 14px;
    color: var(--gold);
    background: rgba(255, 209, 102, .08);
    border: 1px solid rgba(255, 209, 102, .25);
    border-radius: 10px;
    padding: 10px 12px;
}

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
    flex-wrap: wrap;
}

.row.secondary {
    margin-top: 12px;
}

button {
    font: inherit;
    font-weight: 550;
    cursor: pointer;
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: 12px 20px;
    background: linear-gradient(180deg, #322b40, #262032);
    color: var(--ink);
    box-shadow: var(--shadow-sm), var(--edge);
    transition: transform .1s cubic-bezier(.2, .9, .3, 1), background .18s ease,
        border-color .18s ease, box-shadow .18s ease;
}

button:hover {
    background: linear-gradient(180deg, #3d3550, #2e2740);
    border-color: #4b4260;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

button.primary {
    background: linear-gradient(180deg, #ffdc86, var(--gold) 55%, var(--gold-deep));
    border-color: #d99b2c;
    color: #2b1d05;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 22px rgba(255, 180, 60, .28),
        inset 0 1px 0 rgba(255, 255, 255, .45);
}

button.primary:hover {
    background: linear-gradient(180deg, #ffe7a4, #ffd671 55%, #f0b344);
}

button.ghost {
    background: transparent;
}

button.small {
    padding: 7px 12px;
    font-size: 13px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    color: var(--muted);
}

.field input {
    font: inherit;
    color: var(--ink);
    background: #10141c;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    width: 200px;
}

/* --- breed picker ------------------------------------------------------ */

.picker {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: stretch;
    margin-top: 18px;
}

/*
 * The preview is a lit stage, not a swatch: a warm pool under the animal and a
 * cool surround, so the model reads as standing *in* something.
 */
#preview {
    width: 100%;
    height: 320px;
    border-radius: 14px;
    background:
        radial-gradient(60% 42% at 50% 78%, rgba(255, 206, 92, .16), transparent 70%),
        radial-gradient(90% 80% at 50% 26%, #2f2a42, #16121e 70%);
    border: 1px solid var(--line);
    box-shadow: inset 0 2px 24px rgba(0, 0, 0, .55), var(--edge);
}

#breed-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 10px;
    align-content: start;
}

.breed-card {
    text-align: left;
    padding: 14px 16px;
    background: linear-gradient(180deg, #221d2e, #1a1624);
    display: grid;
    gap: 4px;
    box-shadow: var(--shadow-sm), var(--edge);
}

.breed-card h3 {
    margin: 0;
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
}

.breed-card .tagline {
    margin: 0;
    font-size: 13px;
    color: var(--gold);
}

.breed-card .blurb {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.45;
}

.perk {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #f0c987;
    background: rgba(255, 209, 102, .07);
    border-left: 2px solid rgba(255, 209, 102, .5);
    padding: 6px 9px;
    border-radius: 0 8px 8px 0;
}

.perk strong {
    color: var(--gold);
}

.badge {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    vertical-align: middle;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 99px;
    background: rgba(255, 122, 158, .16);
    color: #ff9ab4;
    font-weight: 700;
}

.breed-card[data-speciality="yes"] {
    border-color: rgba(255, 122, 158, .3);
}

.breed-card[data-selected="yes"] {
    border-color: var(--gold);
    background: linear-gradient(180deg, #322a33, #221c28);
    box-shadow: inset 0 0 0 1px rgba(255, 206, 92, .35),
        0 0 0 4px rgba(255, 206, 92, .09), var(--shadow-sm);
    transform: none;
}

.tilt {
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 4px 0 0;
    padding: 0;
    font-size: 11.5px;
}

.tilt li {
    padding: 2px 7px;
    border-radius: 99px;
    background: rgba(127, 212, 138, .14);
    color: var(--good);
}

.tilt li[data-sign="down"] {
    background: rgba(242, 112, 95, .14);
    color: var(--bad);
}

/* --- hub --------------------------------------------------------------- */

.hub-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
}

.dog-card {
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(255, 206, 92, .06), transparent 60%),
        linear-gradient(180deg, #1c1826, #141019);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-sm), var(--edge);
}

.trait-row {
    margin: 12px 0;
}

.trait {
    display: grid;
    grid-template-columns: 92px 1fr 30px 42px;
    align-items: center;
    gap: 9px;
    font-size: 13px;
}

.trait-delta {
    font-size: 11.5px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.trait-delta[data-sign="up"] {
    color: var(--good);
}

.trait-delta[data-sign="down"] {
    color: var(--bad);
}

.trait-help {
    margin: 3px 0 0 101px;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--muted);
}

.trait-help strong {
    color: #c3bbad;
    font-weight: 550;
}

h2.section {
    font-size: 15px;
    margin: 26px 0 10px;
    color: #cfc6b6;
}

/* --- the menu and the goals ------------------------------------------- */

.menu {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.menu th {
    text-align: left;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 600;
    padding: 0 8px 6px 0;
}

.menu td {
    padding: 5px 8px 5px 0;
    border-top: 1px solid var(--line);
    color: #c3bbad;
    vertical-align: top;
}

.menu .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Out of reach for now: dimmed, but still listed — it is the target. */
.menu tr[data-locked="true"] td {
    opacity: .45;
}

.menu tr[data-locked="true"] td:last-child {
    color: var(--muted) !important;
    font-style: italic;
}

.menu tr[data-kind="healthy"] td:last-child {
    color: var(--good);
}

.menu tr[data-kind="garbage"] td:last-child,
.menu tr[data-kind="treat"] td:last-child {
    color: #e2b06a;
}

.swatch {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    margin-right: 7px;
    vertical-align: baseline;
}

#hub-goals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.goal {
    background: #1b2130;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
}

.goal[data-state="ready"] {
    border-color: rgba(127, 212, 138, .55);
}

.goal[data-state="won"] {
    border-color: rgba(255, 122, 158, .55);
    background: linear-gradient(180deg, #2a1f2c, #1d1926);
}

.goal-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 6px;
}

.goal-head span {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.needs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 3px;
    font-size: 11.5px;
    color: var(--muted);
}

.needs li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.needs li strong {
    font-variant-numeric: tabular-nums;
    color: var(--bad);
    font-weight: 600;
}

.needs li[data-ok="true"] strong {
    color: var(--good);
}

.trait-name {
    color: var(--muted);
}

.trait-bar {
    height: 8px;
    background: #2a2436;
    border-radius: 99px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .55);
}

.trait-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #7f7bf0, #ffb35c 70%, var(--gold));
    border-radius: 99px;
    box-shadow: 0 0 10px rgba(255, 179, 92, .35);
    transition: width .5s cubic-bezier(.2, .9, .3, 1);
}

.trait-fill.health {
    background: linear-gradient(90deg, #d8574a, var(--good));
}

.trait-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

#adventures {
    display: grid;
    gap: 10px;
}

.adventure {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    text-align: left;
    padding: 16px 18px;
    background: linear-gradient(180deg, #221d2e, #1a1624);
    width: 100%;
    border-radius: 14px;
}

.adventure:hover {
    border-color: rgba(255, 206, 92, .4);
}

.adventure-emoji {
    font-size: 28px;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    box-shadow: var(--edge);
    flex: none;
}

.adventure-body {
    display: grid;
    gap: 3px;
}

.adventure-body strong {
    font-size: 16px;
}

.adventure-blurb {
    font-size: 13px;
    color: #c3bbad;
}

.adventure-meta {
    font-size: 12px;
    color: var(--muted);
}

.adventure.finale {
    margin-top: 12px;
    border-color: rgba(255, 143, 176, .38);
    background:
        radial-gradient(120% 100% at 20% 0%, rgba(255, 143, 176, .16), transparent 60%),
        linear-gradient(180deg, #2c1f2c, #1d1926);
}

.adventure.finale:hover {
    border-color: rgba(255, 143, 176, .7);
}

/* --- results ----------------------------------------------------------- */

.score {
    font-size: 15px;
    color: var(--muted);
}

.score strong {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--gold);
    display: inline-block;
    margin-right: 10px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 26px rgba(255, 206, 92, .35);
    animation: score-in .5s cubic-bezier(.2, .9, .3, 1) both;
}

@keyframes score-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.9);
    }
}

.notes,
.growth {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.notes li {
    font-size: 14px;
    color: #c3bbad;
}

.growth li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 14px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 5px;
}

/* The "why" under each gain. */
.growth li em {
    display: block;
    font-style: normal;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 1px;
}

.growth strong[data-sign="up"] {
    color: var(--good);
}

.growth strong[data-sign="down"] {
    color: var(--bad);
}

/* --- HUD --------------------------------------------------------------- */

#hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    padding: max(14px, env(safe-area-inset-top)) 16px 16px;
}

#hud[hidden] {
    display: none;
}

#status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.chip {
    background: linear-gradient(180deg, rgba(24, 20, 32, .82), rgba(10, 8, 14, .82));
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: 6px 12px;
    display: grid;
    gap: 1px;
    min-width: 78px;
    text-align: center;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm), var(--edge);
}

.chip-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #9aa2b0;
}

.chip-value {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.chip[data-tone="bad"] .chip-value {
    color: var(--bad);
}

.chip[data-tone="good"] .chip-value {
    color: var(--good);
}

#vitals {
    position: absolute;
    left: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    display: grid;
    gap: 6px;
    width: min(260px, 46vw);
}

.bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    background: linear-gradient(180deg, rgba(24, 20, 32, .82), rgba(10, 8, 14, .82));
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: 7px 11px;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm), var(--edge);
}

.bar-label {
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9aa2b0;
}

.bar-track {
    height: 8px;
    background: #221d2c;
    border-radius: 99px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6);
}

.bar-fill {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #e8604f, var(--good));
    box-shadow: 0 0 8px rgba(134, 221, 147, .3);
    transition: width .2s ease;
}

#bar-health-fill[data-low="yes"] {
    background: var(--bad);
    animation: pulse 1s ease-in-out infinite;
}

#bar-hyper[data-mode="hyper"] .bar-fill {
    background: linear-gradient(90deg, #ff6ad5, #ffd166, #6affd5, #ff6ad5);
    background-size: 200% 100%;
    box-shadow: 0 0 12px rgba(255, 130, 220, .5);
    animation: hyper-slide 1.1s linear infinite;
}

@keyframes hyper-slide {
    to {
        background-position: -200% 0;
    }
}

#bar-hyper[data-mode="hyper"] .bar-label {
    color: var(--gold);
}

#bar-hyper[data-mode="sluggish"] .bar-fill {
    background: linear-gradient(90deg, #4f9d4a, #8fc07a);
}

.bar-value {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: #cfd6e2;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .45;
    }
}

/* Contextual action line, sat just above the key legend. */
#prompt {
    position: absolute;
    left: 50%;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 48px);
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(30, 23, 12, .88), rgba(14, 10, 6, .88));
    border: 1px solid rgba(255, 206, 92, .45);
    color: var(--gold);
    border-radius: 99px;
    padding: 8px 20px;
    font-size: 15px;
    font-weight: 650;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
    box-shadow: 0 0 24px rgba(255, 206, 92, .16), var(--shadow-sm);
}

/*
 * On its own scrim rather than on a text shadow: this sits over sunlit sand
 * and pale pavement as often as it sits over grass, and light grey on light
 * grey is invisible exactly where a new player is looking for it.
 */
#legend {
    position: absolute;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    gap: 13px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 11.5px;
    color: #ded7ea;
    background: linear-gradient(180deg, rgba(22, 18, 30, .78), rgba(9, 7, 14, .78));
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 99px;
    padding: 7px 16px;
    max-width: calc(100vw - 32px);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}

#legend span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

kbd {
    font: inherit;
    font-size: 10.5px;
    font-weight: 600;
    background: linear-gradient(180deg, #3a3248, #251f30);
    border: 1px solid rgba(255, 255, 255, .18);
    border-bottom: 2px solid rgba(0, 0, 0, .5);
    border-radius: 6px;
    padding: 2px 6px;
    color: var(--ink);
    box-shadow: var(--edge);
}

/* On a touch device the legend is a lie — there is no keyboard. */
@media (hover: none) {
    #legend {
        display: none;
    }

    #prompt {
        bottom: max(16px, env(safe-area-inset-bottom));
    }
}

#bar-energy[data-spent="yes"] .bar-fill {
    background: var(--bad);
}

#bar-energy[data-spent="yes"] .bar-label {
    color: var(--bad);
}

#btn-mute {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: 92px;
    pointer-events: auto;
    background: rgba(12, 16, 24, .72);
    font-size: 14px;
    padding: 7px 11px;
    line-height: 1;
}

#btn-quit {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: 16px;
    pointer-events: auto;
    background: rgba(12, 16, 24, .72);
    font-size: 13px;
    padding: 7px 12px;
}

/* --- floating text ------------------------------------------------------ */

#toasts {
    position: fixed;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    gap: 6px;
    justify-items: center;
    pointer-events: none;
    z-index: 6;
    width: min(560px, 92vw);
}

.toast {
    background: linear-gradient(180deg, rgba(26, 21, 34, .9), rgba(12, 9, 17, .9));
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 99px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm), var(--edge);
    animation: toast-in .26s cubic-bezier(.2, .9, .3, 1);
}

.toast-good {
    border-color: rgba(127, 212, 138, .5);
    color: var(--good);
}

.toast-bad {
    border-color: rgba(242, 112, 95, .5);
    color: var(--bad);
}

.toast-out {
    opacity: 0;
    transition: opacity .4s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.96);
    }
}

#popups {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 6;
}

.popup {
    position: absolute;
    top: 0;
    left: 0;
    font-weight: 800;
    font-size: 21px;
    letter-spacing: -.01em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .9), 0 0 18px currentColor;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* --- touch pad ---------------------------------------------------------- */

#pad {
    position: fixed;
    right: 16px;
    bottom: max(20px, env(safe-area-inset-bottom));
    display: grid;
    gap: 10px;
    z-index: 7;
}

#pad[hidden] {
    display: none;
}

.pad-btn {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: radial-gradient(70% 70% at 50% 30%, rgba(58, 50, 72, .9), rgba(16, 13, 22, .88));
    border: 2px solid rgba(255, 255, 255, .18);
    font-size: 12px;
    letter-spacing: .06em;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

/* --- narrow screens ----------------------------------------------------- */

@media (max-width: 860px) {

    .picker,
    .hub-grid {
        grid-template-columns: 1fr;
    }

    #preview {
        height: 220px;
    }

    .panel {
        padding: 20px;
    }

    #vitals {
        width: min(200px, 44vw);
    }

    .chip {
        min-width: 62px;
        padding: 4px 8px;
    }

    .chip-value {
        font-size: 15px;
    }
}
