/* ═══════════════════════════════════════════════════════════════════════════
   REMILIA CHAT — HOT POT / WARHOLIAN SALON LAYER
   ---------------------------------------------------------------------------
   Design layer for the groupchat-as-culture mechanics:
     · Broth gauge      — the simmering pot, as a real instrument
     · Room ritual      — banner + gift-wrapped "veil" mode
     · Pot panel        — leaderboard, best-of, trophy case, ritual controls
     · Curator seal     — the scarce gilded reaction
     · Performance mode — "post hard and neverstop" focus skin
     · Exocortex        — clipped notes drawer
     · Salon ambience   — café-lineage empty states

   Loaded AFTER chat-premium.css and BEFORE dark-mode.css. Reuses the chat
   --rc-* tokens with hard fallbacks so every block also renders correctly on
   pages that never define them (profile, etc).
   ═══════════════════════════════════════════════════════════════════════════ */

/* The --rc-* tokens are declared on `body.theme-anime[data-page="chat"]`, i.e. a
   DESCENDANT of :root. Custom properties do not inherit upward, so aliasing them
   at :root would always resolve to the light fallback. Declare on `body` so the
   var() lookups see the real (light or dark) chat palette. */
:root,
body {
    --hp-ink:        var(--rc-ink, #2b2620);
    --hp-ink-soft:   var(--rc-ink-soft, #8b8272);
    --hp-surface:    var(--rc-surface, #fffdf8);
    --hp-surface-2:  var(--rc-surface-soft, #f6f2e9);
    --hp-inset:      var(--rc-surface-inset, #efe9db);
    --hp-border:     var(--rc-border, #e6ddcd);
    --hp-border-2:   var(--rc-border-strong, #d9cfbb);
    --hp-accent:     var(--rc-accent, #c0392b);
    --hp-accent-soft:var(--rc-accent-soft, rgba(192, 57, 43, 0.10));
    --hp-shadow:     var(--rc-shadow, 0 12px 30px rgba(60, 45, 30, 0.10));
    --hp-shadow-sm:  var(--rc-shadow-soft, 0 3px 12px rgba(60, 45, 30, 0.07));
    --hp-radius:     var(--rc-radius, 16px);
    --hp-radius-sm:  var(--rc-radius-sm, 11px);
    --hp-gold:       #b08b3f;
    --hp-gold-soft:  rgba(176, 139, 63, 0.13);
    --hp-glaze:      rgba(255, 255, 255, 0.55);
    --hp-glaze-soft: rgba(255, 255, 255, 0.34);
    --hp-lift:       #ffffff;
    --hp-depth:      #2a1c12;
}

/* Dark. The fallbacks here matter for pages that never define --rc-* (profile);
   on the chat page --rc-* already carries the dark palette. */
[data-theme="dark"] body {
    --hp-ink:        var(--rc-ink, #e5e8ee);
    --hp-ink-soft:   var(--rc-ink-soft, #a8b1c4);
    --hp-surface:    var(--rc-surface, #141a24);
    --hp-surface-2:  var(--rc-surface-soft, #1a2233);
    --hp-inset:      var(--rc-surface-inset, #232c40);
    --hp-border:     var(--rc-border, #2a3144);
    --hp-border-2:   var(--rc-border-strong, #384156);
    --hp-accent:     var(--rc-accent, #ff6b85);
    --hp-accent-soft:var(--rc-accent-soft, rgba(255, 107, 133, 0.14));
    --hp-shadow:     var(--rc-shadow, 0 12px 30px rgba(0, 0, 0, 0.50));
    --hp-shadow-sm:  var(--rc-shadow-soft, 0 3px 12px rgba(0, 0, 0, 0.40));
    --hp-gold:       #e0bc6a;
    --hp-gold-soft:  rgba(224, 188, 106, 0.16);
    --hp-glaze:      rgba(255, 255, 255, 0.16);
    --hp-glaze-soft: rgba(255, 255, 255, 0.10);
    --hp-lift:       #cfd6e4;
    --hp-depth:      #05080e;
}

/* Shared micro-typography: the letterspaced kicker used across the layer. */
.hp-kicker {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--hp-ink-soft);
    line-height: 1.2;
}

/* ═══════════════════════════════════════════════════════════════════════════
   1 · THE BROTH GAUGE
   A real vessel: liquid rises with the room's heat, surface ripples, bubbles
   break the surface once it simmers, steam lifts off once it boils.
   ═══════════════════════════════════════════════════════════════════════════ */

.hp-gauge {
    --hp-heat: 0;
    --hp-c: #8d9a94;
    --hp-c-soft: rgba(141, 154, 148, 0.12);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 5px 6px 5px 7px;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--hp-c) 26%, var(--hp-border-2));
    border-radius: 999px;
    background:
        radial-gradient(120% 160% at 14% 0%, color-mix(in srgb, var(--hp-c) 9%, transparent) 0%, transparent 62%),
        linear-gradient(180deg, color-mix(in srgb, var(--hp-surface) 92%, var(--hp-lift)) 0%, var(--hp-surface) 100%);
    box-shadow:
        inset 0 1px 0 var(--hp-glaze-soft),
        0 1px 2px rgba(60, 45, 30, 0.05),
        0 4px 14px color-mix(in srgb, var(--hp-c) 10%, transparent);
    cursor: pointer;
    font: inherit;
    color: var(--hp-ink);
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 260ms ease, box-shadow 260ms ease, transform 260ms ease;
}
.hp-gauge:hover,
.hp-gauge[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--hp-c) 55%, var(--hp-border-2));
    box-shadow:
        inset 0 1px 0 var(--hp-glaze-soft),
        0 2px 4px rgba(60, 45, 30, 0.06),
        0 8px 22px color-mix(in srgb, var(--hp-c) 22%, transparent);
}
.hp-gauge:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--hp-c) 62%, var(--hp-border-2));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hp-c) 26%, transparent), var(--hp-shadow-sm);
}

/* ── The vessel ─────────────────────────────────────────────────────────── */
/* A donabe seen head-on: flared rim, rounded belly, glaze highlight. */
.hp-pot {
    position: relative;
    flex: 0 0 auto;
    width: 30px;
    height: 28px;
    border-radius: 4px 4px 44% 44% / 4px 4px 58% 58%;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--hp-inset) 88%, var(--hp-lift)) 0%,
            var(--hp-inset) 46%,
            color-mix(in srgb, var(--hp-inset) 86%, var(--hp-border-2)) 100%);
    border: 1px solid color-mix(in srgb, var(--hp-c) 22%, var(--hp-border-2));
    overflow: hidden;
    isolation: isolate;
    box-shadow: inset 0 -3px 6px -3px rgba(60, 45, 30, 0.28);
    transition: border-color 500ms ease, box-shadow 500ms ease;
}
/* glaze: rim band + specular sheen, painted above the liquid */
.hp-pot::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--hp-border-2) 62%, transparent) 0px,
            color-mix(in srgb, var(--hp-border-2) 30%, transparent) 2.5px,
            transparent 3.5px),
        linear-gradient(100deg,
            var(--hp-glaze) 0%,
            color-mix(in srgb, var(--hp-glaze) 34%, transparent) 26%,
            transparent 46%);
    box-shadow: inset 0 0 0 1px var(--hp-glaze-soft);
}
/* the liquid — never fully empty, so a quiet room still reads as a bowl of broth */
.hp-broth {
    position: absolute;
    left: -2px;
    right: -2px;
    bottom: -1px;
    z-index: 1;
    height: calc(26% + (var(--hp-heat) * 62%));
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--hp-c) 74%, var(--hp-lift)) 0%,
        var(--hp-c) 48%,
        color-mix(in srgb, var(--hp-c) 72%, var(--hp-depth)) 100%);
    box-shadow: inset 0 6px 10px -6px color-mix(in srgb, var(--hp-glaze) 90%, transparent);
    transition: height 1100ms cubic-bezier(0.22, 1, 0.36, 1), background 700ms ease;
    will-change: height;
}
/* two offset ellipses riding the surface = a slow, non-cartoonish ripple */
.hp-broth::before,
.hp-broth::after {
    content: "";
    position: absolute;
    left: -30%;
    top: -3px;
    width: 160%;
    height: 7px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--hp-c) 48%, var(--hp-lift));
    opacity: 0.9;
    animation: hp-ripple 4.6s ease-in-out infinite;
}
.hp-broth::after {
    top: -2px;
    opacity: 0.45;
    animation-duration: 6.9s;
    animation-direction: reverse;
}
@keyframes hp-ripple {
    0%, 100% { transform: translateX(-8%) scaleY(0.85); }
    50%      { transform: translateX(8%)  scaleY(1.15); }
}

/* bubbles — only from SIMMERING upward */
.hp-bubbles { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 500ms ease; }
.hp-bubbles i {
    position: absolute;
    bottom: 4%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    animation: hp-bubble 2.4s ease-in infinite;
}
.hp-bubbles i:nth-child(1) { left: 22%; animation-delay: 0s;    }
.hp-bubbles i:nth-child(2) { left: 50%; animation-delay: 0.75s; width: 2px; height: 2px; }
.hp-bubbles i:nth-child(3) { left: 72%; animation-delay: 1.45s; }
@keyframes hp-bubble {
    0%   { transform: translateY(0) scale(0.6); opacity: 0; }
    20%  { opacity: 0.9; }
    100% { transform: translateY(calc(-1 * (2px + var(--hp-heat) * 20px))) scale(1); opacity: 0; }
}

/* steam — only from BOILING upward, drawn above the pot rim */
.hp-steam { position: absolute; left: 0; right: 0; top: -10px; height: 13px; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 600ms ease; }
.hp-steam i {
    position: absolute;
    bottom: 0;
    width: 2px;
    height: 10px;
    border-radius: 2px;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--hp-c) 45%, var(--hp-lift)));
    animation: hp-steam 3.1s ease-out infinite;
}
.hp-steam i:nth-child(1) { left: 28%; animation-delay: 0s; }
.hp-steam i:nth-child(2) { left: 50%; animation-delay: 1s; }
.hp-steam i:nth-child(3) { left: 70%; animation-delay: 2s; }
@keyframes hp-steam {
    0%   { transform: translateY(4px) scaleY(0.4); opacity: 0; }
    35%  { opacity: 0.75; }
    100% { transform: translateY(-8px) scaleY(1.25); opacity: 0; }
}

/* heat gating */
.hp-gauge[data-hp-level="2"] .hp-bubbles,
.hp-gauge[data-hp-level="3"] .hp-bubbles,
.hp-gauge[data-hp-level="4"] .hp-bubbles,
.hp-gauge[data-hp-level="5"] .hp-bubbles { opacity: 0.85; }
.hp-gauge[data-hp-level="3"] .hp-steam,
.hp-gauge[data-hp-level="4"] .hp-steam,
.hp-gauge[data-hp-level="5"] .hp-steam { opacity: 1; }
/* the pot itself warms up as the broth climbs */
.hp-gauge[data-hp-level="3"] .hp-pot,
.hp-gauge[data-hp-level="4"] .hp-pot {
    box-shadow: inset 0 -3px 6px -3px rgba(60, 45, 30, 0.28),
                0 0 10px -2px color-mix(in srgb, var(--hp-c) 34%, transparent);
}
/* the top rung earns a gilded rim rather than louder animation */
.hp-gauge[data-hp-level="5"] .hp-pot {
    border-color: color-mix(in srgb, var(--hp-gold) 62%, var(--hp-c));
    box-shadow: inset 0 -3px 6px -3px rgba(60, 45, 30, 0.28),
                0 0 0 1px color-mix(in srgb, var(--hp-gold) 34%, transparent),
                0 0 14px -1px color-mix(in srgb, var(--hp-c) 40%, transparent);
    animation: hp-halo 5s ease-in-out infinite;
}
@keyframes hp-halo {
    0%, 100% { filter: saturate(1); }
    50%      { filter: saturate(1.25); }
}

/* ── The readout ────────────────────────────────────────────────────────── */
.hp-gauge-text { display: flex; flex-direction: column; gap: 5px; width: 100px; }
.hp-gauge-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--hp-c) 78%, var(--hp-ink));
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 1px 0 color-mix(in srgb, var(--hp-glaze) 70%, transparent);
    transition: color 600ms ease;
}
/* six rungs of the ladder rather than an anonymous progress bar */
.hp-gauge-rail {
    position: relative;
    height: 5px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--hp-inset) 82%, var(--hp-border));
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(60, 45, 30, 0.12);
}
.hp-gauge-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--hp-progress, 0) * 100%);
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--hp-c) 52%, var(--hp-lift)),
        var(--hp-c) 78%,
        color-mix(in srgb, var(--hp-c) 84%, var(--hp-depth)));
    transition: width 900ms cubic-bezier(0.22, 1, 0.36, 1), background 700ms ease;
}
/* the notches are painted over the top so the fill reads as discrete rungs */
.hp-gauge-rail::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(90deg,
        transparent 0,
        transparent calc(100% / 6 - 1.5px),
        var(--hp-surface) calc(100% / 6 - 1.5px),
        var(--hp-surface) calc(100% / 6));
}
.hp-gauge-score {
    flex: 0 0 auto;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    min-width: 30px;
    justify-content: center;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hp-c) 13%, var(--hp-inset));
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: color-mix(in srgb, var(--hp-c) 72%, var(--hp-ink));
    line-height: 1;
    transition: background 600ms ease, color 600ms ease;
}
.hp-gauge[data-hp-level="5"] .hp-gauge-score {
    background: color-mix(in srgb, var(--hp-gold) 20%, var(--hp-inset));
    color: color-mix(in srgb, var(--hp-gold) 62%, var(--hp-ink));
}

/* a soft pulse each time the score climbs */
.hp-gauge.hp-stoked .hp-pot { animation: hp-stoke 900ms ease-out; }
@keyframes hp-stoke {
    0%   { transform: translateY(0) scale(1); }
    35%  { transform: translateY(-2px) scale(1.07); }
    100% { transform: translateY(0) scale(1); }
}

/* ── Breakdown popover ──────────────────────────────────────────────────── */
.hp-pop {
    position: absolute;
    z-index: 1200;
    width: 300px;
    max-width: calc(100vw - 24px);
    padding: 14px 15px 13px;
    border: 1px solid var(--hp-border-2);
    border-radius: var(--hp-radius-sm);
    background: var(--hp-surface);
    box-shadow: var(--hp-shadow);
    color: var(--hp-ink);
    font-size: 12px;
    line-height: 1.45;
}
.hp-pop[hidden] { display: none; }
.hp-pop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.hp-pop-title { font-size: 13px; font-weight: 800; letter-spacing: 0.02em; }
.hp-pop-sub { font-size: 10px; color: var(--hp-ink-soft); letter-spacing: 0.04em; }
.hp-pop-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--hp-border);
    border: 1px solid var(--hp-border);
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 12px;
}
.hp-pop-stat { background: var(--hp-surface-2); padding: 8px 4px; text-align: center; }
.hp-pop-stat b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hp-pop-stat span { display: block; margin-top: 2px; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hp-ink-soft); }

.hp-ladder { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.hp-rung {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 7px;
    border-radius: 7px;
    font-size: 11px;
    color: var(--hp-ink-soft);
    border: 1px solid transparent;
}
.hp-rung-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.45; flex: 0 0 auto; }
.hp-rung-name { flex: 1 1 auto; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; font-size: 9.5px; }
.hp-rung-min { font-variant-numeric: tabular-nums; opacity: 0.7; font-size: 10px; }
.hp-rung.is-reached { color: var(--hp-ink); }
.hp-rung.is-reached .hp-rung-dot { opacity: 1; }
.hp-rung.is-current {
    background: var(--hp-surface-2);
    border-color: var(--hp-border);
    color: var(--hp-ink);
}
.hp-rung.is-current .hp-rung-dot { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }

.hp-pop-note { margin: 0 0 10px; font-size: 11px; color: var(--hp-ink-soft); }
.hp-pop-note b { color: var(--hp-ink); font-variant-numeric: tabular-nums; }
.hp-pop-quote {
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid var(--hp-border);
    font-size: 11px;
    font-style: italic;
    line-height: 1.5;
    color: var(--hp-ink-soft);
}
.hp-pop-quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }

/* Hide the legacy plain chip once the gauge takes over. */
.room-identity-bar.hp-has-gauge #ribBoil { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   2 · ROOM RITUAL
   ═══════════════════════════════════════════════════════════════════════════ */

.hp-ritual {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 10px;
    padding: 9px 12px;
    border: 1px solid var(--hp-border);
    border-left: 3px solid var(--hp-gold);
    border-radius: 4px var(--hp-radius-sm) var(--hp-radius-sm) 4px;
    background: linear-gradient(90deg, var(--hp-gold-soft), transparent 62%), var(--hp-surface-2);
    color: var(--hp-ink);
}
.hp-ritual[hidden] { display: none; }
.hp-ritual-glyph { flex: 0 0 auto; font-size: 17px; line-height: 1; filter: saturate(0.9); }
.hp-ritual-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hp-ritual-kicker { font-size: 9px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--hp-gold); }
.hp-ritual-title { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.hp-ritual-text { font-size: 11.5px; color: var(--hp-ink-soft); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-ritual-time {
    flex: 0 0 auto;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hp-ink-soft);
    padding: 3px 8px;
    border: 1px solid var(--hp-border);
    border-radius: 999px;
    background: var(--hp-surface);
    white-space: nowrap;
}

/* ── Veil mode: messages arrive wrapped, clicking unwraps them ───────────── */
.hp-veil {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border: 1px dashed var(--hp-gold);
    border-radius: 999px;
    background: var(--hp-gold-soft);
    color: var(--hp-gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: inherit;
    transition: transform 160ms ease, background 160ms ease;
}
.hp-veil:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--hp-gold) 20%, transparent); }
.hp-veil-glyph { font-size: 12px; }
.history-message.hp-veiled .message-text > *:not(.hp-veil) { display: none; }
.history-message.hp-unwrapped .message-text { animation: hp-unwrap 420ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes hp-unwrap {
    0%   { opacity: 0; transform: scale(0.96) translateY(3px); }
    100% { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   3 · CURATOR SEAL
   ═══════════════════════════════════════════════════════════════════════════ */

.reaction-pill.hp-seal-pill,
.rc-reaction-pill.hp-seal-pill,
.hp-seal-pill {
    border-color: var(--hp-gold) !important;
    background: linear-gradient(180deg, var(--hp-gold-soft), transparent) !important;
    color: var(--hp-gold) !important;
    box-shadow: 0 0 0 1px var(--hp-gold-soft), 0 2px 8px var(--hp-gold-soft);
}
.mar-emoji.hp-seal-option {
    position: relative;
    border-radius: 8px;
    background: var(--hp-gold-soft) !important;
    box-shadow: inset 0 0 0 1px var(--hp-gold);
}
.mar-emoji.hp-seal-option::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 10px;
    pointer-events: none;
}

/* Seal badge, reused on profiles + the leaderboard. */
.hp-seal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border: 1px solid var(--hp-gold);
    border-radius: 999px;
    background: var(--hp-gold-soft);
    color: var(--hp-gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4 · POT PANEL (right-column tab): leaderboard · best of · trophies · ritual
   ═══════════════════════════════════════════════════════════════════════════ */

.hp-section { padding: 14px 14px 4px; }
.hp-section + .hp-section { border-top: 1px solid var(--hp-border); }
.hp-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.hp-section-title { font-size: 11px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--hp-ink); }
.hp-section-note { font-size: 10px; color: var(--hp-ink-soft); letter-spacing: 0.03em; }

/* Leaderboard */
.hp-board { display: flex; flex-direction: column; gap: 5px; }
.hp-board-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 1px solid var(--hp-border);
    border-radius: 10px;
    background: var(--hp-surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.hp-board-row:hover { border-color: var(--hp-border-2); transform: translateX(2px); box-shadow: var(--hp-shadow-sm); }
.hp-board-rank {
    flex: 0 0 auto;
    width: 18px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--hp-ink-soft);
}
.hp-board-row:nth-child(1) .hp-board-rank { color: var(--hp-gold); }
.hp-board-avatar {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--hp-border);
    background: var(--hp-inset);
}
.hp-board-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hp-board-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-board-meta { font-size: 10px; color: var(--hp-ink-soft); letter-spacing: 0.03em; }
.hp-board-score {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--hp-accent);
}
.hp-board-score small { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hp-ink-soft); }
/* the top three get a laurel tint */
.hp-board-row.is-podium { background: linear-gradient(90deg, var(--hp-gold-soft), transparent 55%), var(--hp-surface); }

/* Best of (top reacted) */
.hp-bestof { display: flex; flex-direction: column; gap: 6px; }
.hp-bestof-item {
    padding: 9px 11px;
    border: 1px solid var(--hp-border);
    border-radius: 10px;
    background: var(--hp-surface);
    cursor: pointer;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.hp-bestof-item:hover { border-color: var(--hp-accent); box-shadow: var(--hp-shadow-sm); }
.hp-bestof-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.hp-bestof-author { font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; color: var(--hp-ink); }
.hp-bestof-count {
    font-size: 10px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--hp-accent);
    background: var(--hp-accent-soft);
    border-radius: 999px;
    padding: 1px 7px;
}
.hp-bestof-text {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--hp-ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   5 · TROPHY CASE (chat panel + profile page)
   ═══════════════════════════════════════════════════════════════════════════ */

.hp-trophy-case {
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-sm);
    background: var(--hp-surface);
    overflow: hidden;
}
.hp-trophy-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    background: linear-gradient(180deg, var(--hp-gold-soft), transparent);
    border-bottom: 1px solid var(--hp-border);
}
.hp-trophy-tier-glyph {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-size: 20px;
    border-radius: 12px;
    background: var(--hp-surface);
    border: 1px solid var(--hp-gold);
    box-shadow: inset 0 0 0 3px var(--hp-gold-soft);
}
.hp-trophy-tier-main { flex: 1 1 auto; min-width: 0; }
.hp-trophy-tier-name { font-size: 14px; font-weight: 800; letter-spacing: 0.01em; color: var(--hp-ink); line-height: 1.25; }
.hp-trophy-tier-sub { font-size: 10.5px; color: var(--hp-ink-soft); margin-top: 1px; }
.hp-trophy-total {
    flex: 0 0 auto;
    text-align: right;
}
.hp-trophy-total b { display: block; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; color: var(--hp-accent); }
.hp-trophy-total span { display: block; margin-top: 2px; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hp-ink-soft); }

.hp-trophy-progress { height: 3px; background: var(--hp-inset); position: relative; }
.hp-trophy-progress i {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--hp-tier-progress, 0) * 100%);
    background: linear-gradient(90deg, color-mix(in srgb, var(--hp-gold) 55%, #ffffff), var(--hp-gold));
    transition: width 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-trophy-shelf {
    display: grid;
    /* auto-fit (not auto-fill) so the earned trophies stretch to fill the shelf —
       auto-fill leaves phantom tracks that expose the container background as a
       dead beige gap on the right. */
    grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
    gap: 1px;
    background: var(--hp-border);
}
.hp-trophy-slot {
    background: var(--hp-surface);
    padding: 11px 4px 9px;
    text-align: center;
    transition: background 200ms ease;
}
.hp-trophy-slot:hover { background: var(--hp-surface-2); }
.hp-trophy-slot em { display: block; font-style: normal; font-size: 18px; line-height: 1.1; filter: saturate(0.95); }
.hp-trophy-slot b { display: block; margin-top: 4px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--hp-ink); }
.hp-trophy-slot.is-seal { background: var(--hp-gold-soft); }
.hp-trophy-slot.is-seal b { color: var(--hp-gold); }

.hp-trophy-foot {
    display: flex;
    gap: 14px;
    padding: 10px 14px;
    border-top: 1px solid var(--hp-border);
    background: var(--hp-surface-2);
}
.hp-trophy-foot div { flex: 1 1 0; }
.hp-trophy-foot b { display: block; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--hp-ink); line-height: 1.2; }
.hp-trophy-foot span { display: block; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hp-ink-soft); margin-top: 1px; }

/* profile-page placement */
.hp-profile-trophies { margin: 18px 0; }
.hp-profile-trophies .hp-section-title { margin-bottom: 9px; display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   6 · PERFORMANCE MODE — "post hard and neverstop"
   ═══════════════════════════════════════════════════════════════════════════ */

body.hp-perf .chat-history-panel,
body.hp-perf .main-stage { position: relative; }

/* Quiet the surrounding chrome so the stream is the only bright thing. */
body.hp-perf #toolbarPanel,
body.hp-perf .rc-top-actions,
body.hp-perf .rc-top-search,
body.hp-perf .user-corner {
    opacity: 0.34;
    filter: saturate(0.5);
    transition: opacity 400ms ease, filter 400ms ease;
}
body.hp-perf #toolbarPanel:hover,
body.hp-perf .rc-top-actions:hover,
body.hp-perf .rc-top-search:hover,
body.hp-perf .user-corner:hover { opacity: 1; filter: none; }

/* A warm vignette pulled over the page. */
body.hp-perf::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 45%, transparent 46%, rgba(60, 25, 20, 0.16) 100%);
}

/* The HUD */
.hp-perf-hud {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1400;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 13px;
    border: 1px solid var(--hp-accent);
    border-radius: 999px;
    background: var(--hp-surface);
    box-shadow: var(--hp-shadow);
    color: var(--hp-ink);
    font-size: 11px;
}
.hp-perf-hud[hidden] { display: none; }
.hp-perf-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hp-accent);
    box-shadow: 0 0 0 0 var(--hp-accent-soft);
    animation: hp-pulse 1.8s ease-out infinite;
}
@keyframes hp-pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hp-accent) 45%, transparent); }
    70%  { box-shadow: 0 0 0 9px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.hp-perf-stat { display: flex; flex-direction: column; line-height: 1.15; }
.hp-perf-stat b { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hp-perf-stat span { font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hp-ink-soft); }
.hp-perf-motto {
    max-width: 150px;
    font-size: 9.5px;
    font-style: italic;
    line-height: 1.35;
    color: var(--hp-ink-soft);
    border-left: 1px solid var(--hp-border);
    padding-left: 10px;
}
.hp-perf-exit {
    border: 1px solid var(--hp-border);
    background: var(--hp-surface-2);
    color: var(--hp-ink-soft);
    border-radius: 999px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
}
.hp-perf-exit:hover { border-color: var(--hp-accent); color: var(--hp-accent); }

@media (prefers-reduced-motion: reduce) {
    .hp-broth::before, .hp-broth::after,
    .hp-bubbles i, .hp-steam i, .hp-perf-pulse,
    .hp-gauge[data-hp-level="5"] .hp-pot { animation: none !important; }
    .hp-broth, .hp-gauge-fill, .hp-trophy-progress i { transition: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   7 · EXOCORTEX — clipped notes drawer
   ═══════════════════════════════════════════════════════════════════════════ */

.hp-exo {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 92vw;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    background: var(--hp-surface);
    border-left: 1px solid var(--hp-border-2);
    box-shadow: -18px 0 44px rgba(40, 30, 20, 0.18);
    transform: translateX(100%);
    transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-exo.is-open { transform: none; }
.hp-exo-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 16px 13px;
    border-bottom: 1px solid var(--hp-border);
    background: linear-gradient(180deg, var(--hp-surface-2), var(--hp-surface));
}
.hp-exo-head-main { flex: 1 1 auto; min-width: 0; }
.hp-exo-title { font-size: 14px; font-weight: 800; letter-spacing: 0.02em; color: var(--hp-ink); line-height: 1.2; }
.hp-exo-sub { font-size: 10.5px; color: var(--hp-ink-soft); margin-top: 2px; line-height: 1.35; }
.hp-exo-close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--hp-border);
    background: var(--hp-surface);
    color: var(--hp-ink-soft);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: grid;
    place-items: center;
    padding: 0;
}
.hp-exo-close:hover { border-color: var(--hp-accent); color: var(--hp-accent); }
.hp-exo-body { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px 22px; display: flex; flex-direction: column; gap: 8px; }
.hp-exo-note {
    position: relative;
    padding: 11px 12px;
    border: 1px solid var(--hp-border);
    border-radius: 10px;
    background: var(--hp-surface-2);
}
.hp-exo-note-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.hp-exo-note-author { font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; color: var(--hp-ink); }
.hp-exo-note-room { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hp-ink-soft); }
.hp-exo-note-body { font-size: 12px; line-height: 1.5; color: var(--hp-ink); white-space: pre-wrap; word-break: break-word; }
.hp-exo-note-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.hp-exo-note-date { font-size: 9.5px; color: var(--hp-ink-soft); }
.hp-exo-del {
    border: 1px solid var(--hp-border);
    background: var(--hp-surface);
    color: var(--hp-ink-soft);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    font-weight: 700;
}
.hp-exo-del:hover { border-color: var(--hp-accent); color: var(--hp-accent); }

.hp-exo-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1490;
    background: rgba(30, 22, 16, 0.30);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}
.hp-exo-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   8 · SALON AMBIENCE — café-lineage empty states + toasts
   ═══════════════════════════════════════════════════════════════════════════ */

.hp-empty {
    padding: 26px 20px;
    text-align: center;
    color: var(--hp-ink-soft);
}
.hp-empty-glyph { font-size: 22px; opacity: 0.55; display: block; margin-bottom: 9px; }
.hp-empty-title { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hp-ink); display: block; margin-bottom: 6px; }
.hp-empty-text { font-size: 11.5px; line-height: 1.6; margin: 0 auto; max-width: 260px; }
.hp-empty-lineage {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--hp-border);
    font-size: 10px;
    font-style: italic;
    line-height: 1.6;
    color: var(--hp-ink-soft);
    opacity: 0.9;
}

.hp-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 14px);
    z-index: 1600;
    padding: 9px 16px;
    border: 1px solid var(--hp-border-2);
    border-radius: 999px;
    background: var(--hp-surface);
    box-shadow: var(--hp-shadow);
    color: var(--hp-ink);
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.hp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.hp-toast.is-warn { border-color: var(--hp-accent); color: var(--hp-accent); }

/* ── Ritual composer dialog (curators) ──────────────────────────────────── */
.hp-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1700;
    display: grid;
    place-items: center;
    background: rgba(30, 22, 16, 0.42);
    padding: 20px;
}
.hp-dialog {
    width: 420px;
    max-width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 20px 22px;
    border: 1px solid var(--hp-border-2);
    border-radius: var(--hp-radius);
    background: var(--hp-surface);
    box-shadow: var(--hp-shadow);
    color: var(--hp-ink);
}
.hp-dialog h3 { margin: 0 0 4px; font-size: 15px; font-weight: 800; letter-spacing: 0.01em; }
.hp-dialog p.hp-dialog-lead { margin: 0 0 16px; font-size: 11.5px; line-height: 1.55; color: var(--hp-ink-soft); }
.hp-field { display: block; margin-bottom: 12px; }
.hp-field > span { display: block; margin-bottom: 5px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--hp-ink-soft); }
.hp-field input[type="text"],
.hp-field textarea,
.hp-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 11px;
    border: 1px solid var(--hp-border-2);
    border-radius: 9px;
    background: var(--hp-surface-2);
    color: var(--hp-ink);
    font: inherit;
    font-size: 12.5px;
}
.hp-field textarea { min-height: 66px; resize: vertical; line-height: 1.5; }
.hp-field input:focus, .hp-field textarea:focus, .hp-field select:focus {
    outline: none;
    border-color: var(--hp-accent);
    box-shadow: 0 0 0 3px var(--hp-accent-soft);
}
.hp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hp-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.hp-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--hp-border-2);
    background: var(--hp-surface-2);
    color: var(--hp-ink);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.hp-btn:hover { border-color: var(--hp-border); background: var(--hp-inset); }
.hp-btn-primary { background: var(--hp-accent); border-color: var(--hp-accent); color: #fff; }
.hp-btn-primary:hover { background: color-mix(in srgb, var(--hp-accent) 85%, #000); border-color: transparent; color: #fff; }
.hp-btn-ghost { background: transparent; border-color: transparent; color: var(--hp-ink-soft); }
.hp-btn-ghost:hover { color: var(--hp-accent); background: var(--hp-accent-soft); }

/* ── Room-menu additions ────────────────────────────────────────────────── */
.rc-menu-item.hp-menu-on .rc-menu-txt { color: var(--hp-accent); font-weight: 700; }

/* ── Message rail: clip button ──────────────────────────────────────────── */
.mar-btn.mar-clip svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════════════════════════════════════
   9 · RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .hp-gauge-score { display: none; }
    .hp-gauge-text { min-width: 62px; }
    .hp-ritual-text { display: none; }
    .hp-perf-hud { right: 10px; bottom: 10px; padding: 7px 10px; gap: 9px; }
    .hp-perf-motto { display: none; }
}
@media (max-width: 620px) {
    .hp-gauge { padding-right: 9px; }
    .hp-pop { width: 270px; }
    .hp-exo { width: 100%; }
}
