/*==================================================
    Fish Fish - Harbor theme
    Loaded after tides.css. Styles the redesigned
    menus (achievements, leaderboards, stats, settings,
    wardrobe, equipment, pets, keep net, aquarium, shop,
    catalog, lodge), the fisher character and the catch
    card. Older rules are overridden by scoping to the
    hb-* classes these screens now carry.
==================================================*/

.rarity-common { --rc: #cbd5e1; }
.rarity-uncommon { --rc: #4ade80; }
.rarity-rare { --rc: #38bdf8; }
.rarity-epic { --rc: #c084fc; }
.rarity-legendary { --rc: #facc15; }
.rarity-mythical { --rc: #fb7185; }
.rarity-eternal { --rc: #5eead4; }

:root {
    --icon-shirt: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 6.5c-1.4 0-2.6-.8-3.2-2L4 7l1.8 3.6L8 9.8V20h8V9.8l2.2.8L20 7l-4.8-2.5c-.6 1.2-1.8 2-3.2 2z'/><path d='M10 13h4'/></svg>");
    --hb-card: rgba(14, 34, 50, 0.92);
    --hb-card-2: rgba(20, 46, 66, 0.92);
    --hb-pearl: #e9d5ff;
}

[data-icon="shirt"] { --icon: var(--icon-shirt); }
[data-icon="fridge"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='5' y='2.5' width='14' height='19' rx='2'/><path d='M5 10h14'/><path d='M8.5 5.5v2M8.5 13v3'/></svg>"); }

.ff-art {
    display: block;
    width: 100%;
    height: 100%;
}


/*==================================================
    Shell fixes
==================================================*/

/* style.css pulled the first rail group up by 16px, clipping Fishing Area. */
.ff-rail .view-menu-section {
    margin: 0;
}

.ff-rail .menu-buttons button {
    min-height: 50px;
    border-radius: var(--ff-r-lg, 12px);
    border-top-width: 1px;
    font-size: 0.64rem;
}

.ff-rail .menu-buttons button.active {
    background: linear-gradient(180deg, rgba(94, 234, 212, 0.18), rgba(94, 234, 212, 0.06));
    box-shadow: none;
    color: var(--accent);
}

.hb-pearl-wallet {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 14px 6px 10px;
    border: 1px solid rgba(233, 213, 255, 0.35);
    border-radius: var(--ff-r-lg, 14px);
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.18), rgba(76, 29, 149, 0.18));
    color: var(--hb-pearl);
    font-family: var(--font-display);
    font-size: 1.15rem;
    box-shadow: none;
}

.hb-pearl-wallet i,
.hb-pearl-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fff 0 18%, #f5f3ff 30%, #d8b4fe 70%, #a78bfa);
    box-shadow: 0 0 10px rgba(216, 180, 254, 0.6), inset -2px -2px 3px rgba(91, 33, 182, 0.35);
}

.hb-pearl-icon {
    width: 14px;
    height: 14px;
    margin-right: 5px;
    vertical-align: -2px;
}

.hb-pearl-wallet:hover {
    border-color: rgba(233, 213, 255, 0.7);
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.28), rgba(76, 29, 149, 0.24));
}


/*==================================================
    The fisher (pond avatars)
==================================================*/

.pond-player .fisher-host {
    position: relative;
    display: block;
    width: var(--fisher-size);
    height: calc(var(--fisher-size) * 84 / 64);
    translate: calc(var(--fisher-size) * -0.1) 0;
    filter:
        brightness(var(--scene-brightness, 1))
        saturate(var(--scene-saturation, 1));
}

.pond-player.caught span,
.pond-player.caught .fisher-host {
    animation: none;
}

.fisher-shadow { fill: rgba(0, 0, 0, 0.3); }
.fisher-line { stroke: rgba(240, 244, 248, 0.85); stroke-width: 0.55; fill: none; }
.fisher-ripple,
.fisher-splash { fill: none; stroke: rgba(230, 244, 255, 0.8); stroke-width: 0.7; }
.fisher-ripple { transform-box: fill-box; transform-origin: center; animation: hb-ripple 1.8s ease-out infinite; }
.fisher-eyes-closed,
.fisher-mouth-open { display: none; }
.eyes-closed .fisher-eyes { display: none; }
.eyes-closed .fisher-eyes-closed { display: inline; }
.mouth-open .fisher-mouth { display: none; }
.mouth-open .fisher-mouth-open { display: inline; }
.fisher-catch-glow { animation: hb-glow 0.9s ease-in-out infinite alternate; }
.fisher-propeller { transform-box: fill-box; transform-origin: center; animation: hb-spin 0.5s linear infinite; }
.fisher-halo { animation: hb-float 2.4s ease-in-out infinite; }
.fisher-wings { transform-box: fill-box; transform-origin: 100% 40%; animation: hb-flap 2.6s ease-in-out infinite; }
.catch-sparkle .fisher-catch-glow { opacity: 0.5; }

.pond-player-level {
    display: inline-block;
    margin-right: 4px;
    padding: 0 5px;
    border-radius: var(--ff-r-md, 6px);
    background: rgba(139, 92, 246, 0.85);
    color: #fff;
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 900;
    vertical-align: 1px;
}

@keyframes hb-ripple {
    from { transform: scale(0.4); opacity: 0.9; }
    to { transform: scale(1.6); opacity: 0; }
}

@keyframes hb-glow {
    to { opacity: 0.55; }
}

@keyframes hb-spin {
    to { transform: rotate(360deg); }
}

@keyframes hb-float {
    50% { transform: translateY(-1.2px); }
}

@keyframes hb-flap {
    50% { transform: rotate(-8deg); }
}


/*==================================================
    Catch card: sits where the minigame bar was,
    right above the Cast button.
==================================================*/

.ff-shell .pond-scene .minigame.hb-resolved {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.98);
    pointer-events: none;
}

/* The catch card waits out the moment the bar shows where the needle landed. */
.ff-shell .pond-scene .result-banner.hb-card-held {
    visibility: hidden;
}

.ff-shell .pond-scene .result-banner {
    top: auto;
    bottom: calc(13% + 6px);
    max-width: min(620px, 86%);
    padding: 10px 16px;
}

.ff-shell .pond-scene .result-banner.success {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.ff-shell .pond-scene .result-banner.hb-card-in {
    animation: hb-card-in 0.42s cubic-bezier(.2, .9, .3, 1.25);
}

@keyframes hb-card-in {
    from { opacity: 0; transform: translate(-50%, 18px) scale(0.94); }
}

.hb-catch {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 14px;
    min-width: min(460px, 80vw);
    padding: 10px 16px 10px 10px;
    border: 1px solid color-mix(in srgb, var(--rc, #5eead4) 55%, transparent);
    border-radius: var(--ff-r-lg, 18px);
    background:
        linear-gradient(100deg, color-mix(in srgb, var(--rc, #5eead4) 20%, transparent), transparent 55%),
        rgba(5, 18, 28, 0.88);
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 26px color-mix(in srgb, var(--rc, #5eead4) 25%, transparent);
    color: var(--text);
    text-align: left;
}

.hb-catch-icon .fish-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--ff-r-lg, 16px);
    background: radial-gradient(circle, color-mix(in srgb, var(--rc, #5eead4) 30%, transparent), rgba(255, 255, 255, 0.04) 70%);
}

.hb-catch-icon .fish-icon-image {
    width: 54px;
    height: 54px;
    object-fit: contain;
    animation: hb-wiggle 0.9s ease-in-out 2;
}

@keyframes hb-wiggle {
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

.hb-catch-body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.hb-catch-body strong {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 1.25rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-catch-body small {
    color: var(--muted);
    font-weight: 700;
}

.hb-catch-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.hb-catch-rarity,
.hb-tag {
    padding: 1px 8px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hb-catch-rarity {
    background: color-mix(in srgb, var(--rc, #fff) 18%, transparent);
}

.hb-tag.new { background: #22c55e; color: #052e16; }
.hb-tag.perfect { background: rgba(192, 132, 252, 0.3); color: #f5d0fe; }
.hb-tag.shiny { background: rgba(255, 255, 255, 0.2); color: #fff; }
.hb-tag.foil { background: rgba(56, 189, 248, 0.25); color: #bae6fd; }
.hb-tag.crit { background: rgba(250, 204, 21, 0.28); color: #fde68a; }
.hb-tag.perfect-crit { background: linear-gradient(90deg, #7c3aed, #c026d3); color: #fff; }
.hb-tag.super-crit { background: linear-gradient(90deg, #1d4ed8, #3b82f6); color: #fff; box-shadow: 0 0 10px rgba(59, 130, 246, 0.6); }
.hb-tag.clutch { background: rgba(251, 113, 133, 0.3); color: #fecdd3; }

.hb-catch-value {
    display: grid;
    justify-items: end;
}

.hb-catch-value b {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1;
}

.hb-catch-value small {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hb-catch-extras {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hb-catch-extras span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px 2px 4px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.78rem;
    font-weight: 800;
}

.hb-catch-extras span .ff-art {
    width: 18px;
    height: 18px;
}

.hb-catch-extras .hb-mastery {
    padding-left: 9px;
    background: rgba(250, 204, 21, 0.2);
    color: #fde68a;
}

.hb-catch-note {
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(5, 18, 28, 0.85);
    color: #c7f9ee;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}


/*==================================================
    Shared building blocks
==================================================*/

.hb-empty {
    grid-column: 1 / -1;
    padding: 36px 16px;
    border: 1px dashed var(--line);
    border-radius: var(--ff-r-lg, 16px);
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.hb-subtle {
    color: var(--muted);
}

.hb-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 12px;
}

.hb-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 5px 13px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: none;
}

.hb-tabs button small {
    padding: 0 6px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
}

.hb-tabs button:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.hb-tabs button.active {
    border-color: rgba(94, 234, 212, 0.6);
    background: rgba(94, 234, 212, 0.14);
    color: var(--accent);
}

.hb-tabs button.has-ready {
    border-color: rgba(250, 204, 21, 0.6);
    color: #fde68a;
}

.hb-tabs-tight {
    margin: 0 0 10px;
}

.hb-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px 2px 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.hb-chip-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
}

.hb-chip-coins { color: #fde68a; }
.hb-chip-pearls { color: var(--hb-pearl); border-color: rgba(233, 213, 255, 0.25); }
.hb-chip-feature { color: #fde68a; background: rgba(250, 204, 21, 0.1); }
.hb-chip-cosmetic { color: #fbcfe8; background: rgba(244, 114, 182, 0.12); }
.hb-chip-oc { color: #a5f3fc; }
.hb-chip-mystery { padding-left: 9px; color: var(--muted); }

.hb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.hb-wallet {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.hb-wallet > span,
.hb-wallet-single {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 6px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.04);
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.hb-wallet .ff-art {
    width: 24px;
    height: 24px;
}

.hb-search input {
    min-width: 220px;
    min-height: 38px;
    border-radius: var(--ff-r-pill, 999px);
    padding-left: 16px;
}

.hb-avatar {
    display: inline-block;
    flex: 0 0 auto;
    overflow: hidden;
    border: 2px solid color-mix(in srgb, var(--player-color, #38bdf8) 70%, white);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--player-color, #38bdf8) 45%, transparent), transparent 70%),
        linear-gradient(#7cc4ea, #3d8bb5);
}

.hb-avatar .fisher {
    display: block;
    width: 150%;
    height: 150%;
    margin: -2% 0 0 -12%;
}

.hb-avatar-sm { width: 34px; height: 34px; }
.hb-avatar-md { width: 46px; height: 46px; }
.hb-avatar-lg { width: 74px; height: 74px; }
.hb-avatar-xl { width: 96px; height: 96px; }

.hb-primary,
.hb-buy,
.hb-claim,
.hb-build.affordable {
    border-color: rgba(94, 234, 212, 0.65) !important;
    background: linear-gradient(180deg, #2dd4bf, #0f9f8f) !important;
    color: #022c26 !important;
    font-weight: 900 !important;
}

.hb-buy:disabled,
.hb-primary:disabled {
    border-color: var(--line) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--muted) !important;
}

.hb-danger {
    border-color: rgba(251, 113, 133, 0.55) !important;
    background: rgba(251, 113, 133, 0.12) !important;
    color: #fecdd3 !important;
}

.hb-ghost {
    background: transparent !important;
}

.hb-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.hb-pager button {
    min-height: 34px;
    padding: 4px 14px;
}

.hb-type-badge {
    display: inline-block;
    padding: 0 7px;
    border-radius: var(--ff-r-md, 6px);
    background: rgba(255, 255, 255, 0.08);
    color: #dbeafe;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.hb-type-badge.type-coastal { background: rgba(56, 189, 248, 0.18); color: #bae6fd; }
.hb-type-badge.type-shallow { background: rgba(250, 204, 21, 0.16); color: #fef08a; }
.hb-type-badge.type-brackish { background: rgba(132, 204, 22, 0.16); color: #d9f99d; }
.hb-type-badge.type-midwater { background: rgba(59, 130, 246, 0.2); color: #bfdbfe; }
.hb-type-badge.type-luminous { background: rgba(190, 242, 100, 0.18); color: #ecfccb; }
.hb-type-badge.type-ruins { background: rgba(168, 162, 158, 0.2); color: #e7e5e4; }
.hb-type-badge.type-toxic { background: rgba(101, 163, 13, 0.24); color: #bef264; }
.hb-type-badge.type-abyssal { background: rgba(124, 58, 237, 0.24); color: #ddd6fe; }
.hb-type-badge.type-ice { background: rgba(165, 243, 252, 0.18); color: #cffafe; }
.hb-type-badge.type-hadal { background: rgba(30, 41, 59, 0.6); color: #cbd5e1; }

.hb-chip-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.hb-chip-filter button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: none;
}

.hb-chip-filter button small {
    color: var(--muted);
}

.hb-chip-filter button.active {
    border-color: var(--rc, var(--accent));
    background: color-mix(in srgb, var(--rc, #5eead4) 16%, transparent);
}

/* Pill checkboxes used across filters and settings. */
.hb-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
}

.hb-pill-grid legend {
    display: none;
}

.hb-pill-grid label {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.hb-pill-grid input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hb-pill-grid label > span {
    padding: 5px 13px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.hb-pill-grid input:checked + span {
    border-color: rgba(94, 234, 212, 0.55);
    background: rgba(94, 234, 212, 0.14);
    color: var(--text);
}

.hb-pill-grid input:checked + span[class*="rarity-"] {
    color: var(--rc);
    border-color: color-mix(in srgb, var(--rc) 60%, transparent);
    background: color-mix(in srgb, var(--rc) 14%, transparent);
}

.hb-pill-grid input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


/*==================================================
    Achievements
==================================================*/

.book-modal.hb-ach-modal {
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    height: min(860px, calc(100vh - 36px));
    overflow: hidden;
}

.hb-ach-modal .book-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hb-ach-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-right: auto;
}

.hb-ring {
    --ratio: 0;
    display: grid;
    place-items: center;
    align-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background:
        radial-gradient(closest-side, #0b1f2e 76%, transparent 78%),
        conic-gradient(var(--gold) calc(var(--ratio) * 360deg), rgba(255, 255, 255, 0.08) 0);
}

.hb-ring strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
    line-height: 1;
}

.hb-ring small {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
}

#hbAchievementSummary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 2px 0 0;
    font-size: 0.86rem;
}

#hbAchievementSummary b {
    color: var(--text);
}

.hb-ach-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hb-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.hb-claim-all:not(:disabled) {
    border-color: rgba(250, 204, 21, 0.7);
    background: linear-gradient(180deg, #fcd34d, #d97706);
    color: #3b2400;
    font-weight: 900;
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.3);
}

.hb-ach-modal .hb-ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    grid-auto-rows: min-content;
    align-content: start;
    gap: 10px;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 2px 4px 6px 2px;
}

.hb-ach {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 0;
    padding: 12px 14px 12px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 16px);
    background: var(--hb-card);
}

.hb-ach.done {
    background:
        linear-gradient(90deg, rgba(250, 204, 21, 0.06), transparent 60%),
        var(--hb-card);
}

.hb-ach.locked {
    background: rgba(10, 26, 38, 0.8);
}

.hb-ach.ready {
    border-color: rgba(250, 204, 21, 0.65);
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.2), 0 0 22px rgba(250, 204, 21, 0.14);
}

.hb-ach.is-new::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bad);
    box-shadow: 0 0 8px var(--bad);
}

.hb-medal {
    width: 52px;
    height: 52px;
}

.hb-medal.locked {
    opacity: 0.75;
}

.hb-ach-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.hb-ach-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.hb-ach-title strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.hb-ach-title small {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tier-1 .hb-ach-title small { color: #d9a066; }
.tier-2 .hb-ach-title small { color: #cbd5e1; }
.tier-3 .hb-ach-title small { color: #facc15; }
.tier-4 .hb-ach-title small { color: #a5f3fc; }

.hb-ach-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.3;
}

.hb-ach-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.hb-ach-progress div {
    height: 7px;
    overflow: hidden;
    border-radius: var(--ff-r-pill, 99px);
    background: rgba(255, 255, 255, 0.08);
}

.hb-ach-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #5eead4);
}

.hb-ach-progress span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.hb-ach-state {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.hb-ach-state .hb-claim {
    min-height: 36px;
    padding: 4px 16px;
}

.hb-ach-done {
    color: var(--good);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.hb-new-tag {
    padding: 0 7px;
    border-radius: var(--ff-r-pill, 999px);
    background: var(--bad);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 900;
}


/*==================================================
    Leaderboards
==================================================*/

.book-modal.hb-board-modal {
    display: flex;
    flex-direction: column;
    width: min(1100px, 100%);
    height: min(820px, calc(100vh - 36px));
    overflow: hidden;
}

.hb-board-periods {
    align-self: flex-start;
    margin: 0 0 12px;
}

.hb-board-periods button.active {
    background: rgba(94, 234, 212, 0.16);
    color: var(--accent);
}

.hb-board-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
}

.hb-board-nav {
    display: grid;
    align-content: start;
    gap: 14px;
    overflow-y: auto;
    padding-right: 4px;
}

.hb-board-group {
    display: grid;
    gap: 3px;
}

.hb-board-group small {
    padding: 0 10px 2px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hb-board-group button {
    justify-content: flex-start;
    min-height: 34px;
    padding: 5px 12px;
    border: 1px solid transparent;
    border-radius: var(--ff-r-md, 10px);
    background: transparent;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    text-align: left;
    box-shadow: none;
}

.hb-board-group button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.hb-board-group button.active {
    border-color: rgba(94, 234, 212, 0.45);
    background: rgba(94, 234, 212, 0.12);
    color: var(--accent);
}

.hb-board-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 18px);
    background:
        radial-gradient(600px 220px at 50% 0%, rgba(250, 204, 21, 0.08), transparent 70%),
        var(--hb-card);
    overflow-y: auto;
}

.hb-board-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.hb-board-head h3 {
    margin: 0;
    font-size: 1.4rem;
}

.hb-board-head small {
    color: var(--muted);
    font-weight: 700;
}

.hb-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
    margin: 16px 0 12px;
}

.hb-podium-spot {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 3px;
    min-width: 0;
    text-align: center;
}

.hb-podium-spot strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-podium-spot > small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.hb-podium-spot b {
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.hb-podium-spot b em {
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-style: normal;
}

.hb-place {
    position: absolute;
    top: 50px;
    left: calc(50% + 22px);
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 2px solid #1b2333;
    border-radius: 50%;
    font-weight: 900;
}

.place-1 .hb-place { background: #facc15; color: #3b2400; }
.place-2 .hb-place { background: #e2e8f0; color: #1e293b; }
.place-3 .hb-place { background: #d08b4c; color: #2a1505; }

.place-1 .hb-avatar { width: 92px; height: 92px; border-color: #facc15; box-shadow: 0 0 24px rgba(250, 204, 21, 0.4); }
.place-1 .hb-place { top: 66px; left: calc(50% + 28px); }

.hb-plinth {
    width: 100%;
    margin-top: 6px;
    border-radius: var(--ff-r-md, 10px) var(--ff-r-md, 10px) 4px 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
}

.place-1 .hb-plinth { height: 54px; background: linear-gradient(180deg, rgba(250, 204, 21, 0.4), rgba(250, 204, 21, 0.06)); }
.place-2 .hb-plinth { height: 38px; background: linear-gradient(180deg, rgba(226, 232, 240, 0.32), rgba(226, 232, 240, 0.04)); }
.place-3 .hb-plinth { height: 26px; background: linear-gradient(180deg, rgba(208, 139, 76, 0.36), rgba(208, 139, 76, 0.05)); }

.hb-podium-spot.is-me strong,
.hb-board-list li.is-me strong {
    color: var(--accent);
}

.hb-fish-line {
    color: var(--muted);
    font-size: 0.72rem;
}

.hb-board-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hb-board-list li {
    display: grid;
    grid-template-columns: 30px 34px minmax(0, 1.2fr) minmax(60px, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(255, 255, 255, 0.035);
}

.hb-board-list li.is-me {
    border-color: rgba(94, 234, 212, 0.45);
    background: rgba(94, 234, 212, 0.08);
}

.hb-rank {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.05rem;
    text-align: center;
}

.hb-row-name {
    display: grid;
    min-width: 0;
}

.hb-row-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-row-name small {
    color: var(--muted);
    font-size: 0.72rem;
}

.hb-row-bar {
    height: 8px;
    overflow: hidden;
    border-radius: var(--ff-r-pill, 99px);
    background: rgba(255, 255, 255, 0.06);
}

.hb-row-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #5eead4);
}

.hb-board-list li > b {
    font-family: var(--font-display);
    font-size: 1.05rem;
}


/*==================================================
    Your Stats
==================================================*/

.book-modal.hb-stats-modal {
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    height: min(880px, calc(100vh - 36px));
    overflow: hidden;
}

.hb-stats-modal .book-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hb-stats-modal .book-header > div:first-child {
    margin-right: auto;
}

.hb-stats-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.hb-stats-hero {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.hb-stats-me {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 18px);
    background:
        radial-gradient(240px 120px at 0% 50%, rgba(56, 189, 248, 0.16), transparent 70%),
        var(--hb-card);
}

.hb-stats-me > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.hb-stats-me small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.hb-stats-me strong {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 1.4rem;
    text-overflow: ellipsis;
}

.hb-level-pill {
    justify-self: start;
    padding: 1px 10px;
    border-radius: var(--ff-r-pill, 999px);
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    font-size: 0.78rem;
    font-weight: 900;
}

.hb-xp {
    height: 7px;
    overflow: hidden;
    border-radius: var(--ff-r-pill, 99px);
    background: rgba(255, 255, 255, 0.08);
}

.hb-xp i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #c4b5fd);
}

.hb-stats-big {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.hb-stats-big > div {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 18px);
    background: var(--hb-card);
}

.hb-stats-big i {
    width: 34px;
    height: 34px;
}

.hb-stats-big b {
    font-family: var(--font-display);
    font-size: 1.6rem;
    line-height: 1.1;
}

.hb-stats-big small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.hb-section-title {
    margin: 4px 0 10px;
    color: var(--accent);
    font-size: 1.1rem;
}

.hb-stats-section + .hb-stats-section {
    margin-top: 18px;
}

.hb-stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.hb-stat-card {
    display: grid;
    align-content: start;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 18px);
    background: var(--hb-card);
}

.hb-stat-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 1rem;
}

.hb-stat-card h3 i {
    width: 26px;
    height: 26px;
}

.hb-stat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 10px;
    padding: 6px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hb-stat-row span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.hb-stat-row b {
    font-size: 0.95rem;
}

.hb-stat-bar {
    grid-column: 1 / -1;
    height: 4px;
    overflow: hidden;
    border-radius: var(--ff-r-pill, 99px);
    background: rgba(255, 255, 255, 0.06);
}

.hb-stat-bar em {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #5eead4);
}

.hb-records {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.hb-record {
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: var(--ff-r-lg, 18px);
    background:
        linear-gradient(120deg, rgba(250, 204, 21, 0.1), transparent 60%),
        var(--hb-card);
}

.hb-record small {
    color: #fde68a;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hb-record strong {
    overflow: hidden;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-record b {
    font-family: var(--font-display);
    font-size: 1.3rem;
}

.hb-record.empty strong {
    color: var(--muted);
}

.hb-lifetime {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.hb-lifetime + .hb-lifetime {
    margin-top: 8px;
}

.hb-life {
    display: grid;
    gap: 1px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 14px);
    background: rgba(255, 255, 255, 0.03);
}

.hb-life b {
    font-family: var(--font-display);
    font-size: 1.3rem;
}

.hb-life small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}


/*==================================================
    Settings
==================================================*/

.book-modal.hb-settings-modal {
    display: flex;
    flex-direction: column;
    width: min(860px, 100%);
    max-height: min(860px, calc(100vh - 36px));
    overflow: hidden;
}

.hb-settings-scroll {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 4px 4px 2px;
}

.hb-settings-modal .hb-set-card {
    display: grid;
    align-content: start;
    gap: 12px;
    margin: 0;
    padding: 14px 16px 16px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 18px);
    background: var(--hb-card);
}

.hb-settings-modal .hb-set-wide {
    grid-column: 1 / -1;
}

.hb-set-card header {
    display: grid;
    gap: 2px;
    padding-left: 40px;
    position: relative;
}

.hb-set-card header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1px;
    width: 30px;
    height: 30px;
    border-radius: var(--ff-r-md, 10px);
    background: rgba(94, 234, 212, 0.14);
}

.hb-set-card header::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 7px;
    width: 18px;
    height: 18px;
    background: var(--accent);
    -webkit-mask: var(--set-icon, var(--icon-cog)) center / contain no-repeat;
    mask: var(--set-icon, var(--icon-cog)) center / contain no-repeat;
}

[data-set-icon="audio"] { --set-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 9.5h4l5-4v13l-5-4H4z'/><path d='M16.5 9a4 4 0 0 1 0 6M19 6.5a7.5 7.5 0 0 1 0 11'/></svg>"); }
[data-set-icon="you"] { --set-icon: var(--icon-shirt); }
[data-set-icon="play"] { --set-icon: var(--icon-pond); }
[data-set-icon="reveal"] { --set-icon: var(--icon-crate); }
[data-set-icon="graphics"] { --set-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='12' rx='2'/><path d='M8.5 20h7M12 16.5V20'/><path d='m7 13 3-3.5 2.5 2.5 2-2 2.5 3'/></svg>"); }
.hb-set-note { display: block; margin-top: 8px; color: var(--gold); font-size: 0.78rem; font-weight: 700; }
[data-set-icon="bell"] { --set-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z'/><path d='M10 20.5a2.2 2.2 0 0 0 4 0'/></svg>"); }
[data-set-icon="shield"] { --set-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l7.5 3v5.5c0 4.5-3.2 8-7.5 9.5-4.3-1.5-7.5-5-7.5-9.5V6z'/><path d='m8.8 12 2.2 2.2 4.4-4.4'/></svg>"); }

.hb-set-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.hb-set-card header small {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.hb-settings-modal .audio-settings {
    display: grid;
    gap: 10px;
}

.hb-settings-modal .audio-control {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0;
}

.hb-settings-modal .audio-control > span:first-child {
    font-weight: 800;
}

.hb-settings-modal .audio-control-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
}

.hb-settings-modal input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.hb-settings-modal .audio-control-row button {
    min-width: 70px;
    min-height: 30px;
    padding: 3px 10px;
    font-size: 0.76rem;
}

.hb-settings-modal .player-color-setting {
    display: grid;
    gap: 8px;
}

.hb-settings-modal .player-color-setting > span {
    font-weight: 800;
}

.hb-settings-modal .color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hb-open-wardrobe {
    justify-self: start;
}

.hb-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 0;
    margin: 0;
    padding: 6px 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.hb-toggle > span {
    display: grid;
    font-weight: 800;
}

.hb-toggle > span small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.hb-toggle input {
    order: 2;
    appearance: none;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--ff-r-pill, 99px);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s;
}

.hb-toggle input::after {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    margin: 2px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: transform 0.2s, background 0.2s;
}

.hb-toggle input:checked {
    border-color: rgba(94, 234, 212, 0.6);
    background: rgba(94, 234, 212, 0.35);
}

.hb-toggle input:checked::after {
    transform: translateX(20px);
    background: #fff;
}

.hb-toggle input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hb-settings-modal .reward-reveal-options {
    display: grid;
    gap: 0;
}


/*==================================================
    Wardrobe
==================================================*/

.book-modal.hb-wardrobe-modal {
    display: flex;
    flex-direction: column;
    width: min(1100px, 100%);
    height: min(780px, calc(100vh - 36px));
    overflow: hidden;
}

.hb-wardrobe-modal .book-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hb-wardrobe-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
}

.hb-wardrobe-stage-wrap {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 0;
}

.hb-wardrobe-stage {
    position: relative;
    display: grid;
    place-items: end center;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--ff-r-lg, 20px);
    background:
        radial-gradient(circle at 70% 18%, rgba(255, 244, 200, 0.9) 0 26px, rgba(255, 244, 200, 0) 60px),
        linear-gradient(180deg, #8fd3f5 0%, #c6ecfb 48%, #3f97c4 48.5%, #2a6f99 100%);
}

.hb-wardrobe-stage::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 22%;
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 46px),
        linear-gradient(180deg, #a7784b, #7c5530);
    border-top: 3px solid #5b3a24;
}

.hb-wardrobe-fisher {
    position: relative;
    z-index: 1;
    display: block;
    width: 62%;
    aspect-ratio: 64 / 84;
    margin-bottom: 6%;
}

.hb-tryon {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(250, 204, 21, 0.4);
    border-radius: var(--ff-r-lg, 14px);
    background: rgba(250, 204, 21, 0.08);
}

.hb-tryon span {
    flex: 1 1 100%;
    font-weight: 700;
}

.hb-tryon em {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.hb-wardrobe-picker {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hb-wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    grid-auto-rows: min-content;
    align-content: start;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 4px 4px 2px;
}

.hb-wr-item {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 0;
    padding: 8px 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 16px);
    background:
        radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc, #cbd5e1) 18%, transparent), transparent 70%),
        var(--hb-card);
    color: var(--text);
    text-align: center;
    box-shadow: none;
}

.hb-wr-item:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.hb-wr-item.equipped {
    border-color: rgba(94, 234, 212, 0.75);
    box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.35), 0 0 18px rgba(94, 234, 212, 0.2);
}

.hb-wr-item.trying {
    border-color: rgba(250, 204, 21, 0.75);
}

.hb-wr-item.locked .hb-wr-figure,
.hb-wr-item.locked .hb-wr-bobber {
    filter: saturate(0.5) brightness(0.8);
}

.hb-wr-item strong {
    color: var(--rc, var(--text));
    font-size: 0.84rem;
    line-height: 1.15;
}

.hb-wr-item small {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.2;
}

.hb-wr-lock {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    background: var(--muted);
    -webkit-mask: var(--icon-lock) center / contain no-repeat;
    mask: var(--icon-lock) center / contain no-repeat;
}

.hb-wr-figure {
    display: block;
    width: 100%;
    height: 96px;
    overflow: hidden;
}

.hb-wr-figure .fisher {
    display: block;
    width: 100%;
    height: 100%;
}

.hb-wr-figure.slot-hat .fisher,
.hb-wr-figure.slot-accessory .fisher {
    transform: scale(2.1) translate(-2%, 22%);
}

.hb-wr-figure.slot-outfit .fisher {
    transform: scale(1.15) translateY(2%);
}

.hb-wr-figure.slot-rod .fisher {
    transform: scale(1.1) translate(6%, 6%);
}

.hb-wr-bobber {
    width: 70px;
    height: 96px;
}

.hb-wr-item .hb-wr-game {
    color: var(--muted);
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1.15;
    opacity: 0.85;
}

.hb-wr-figure.slot-set {
    height: 132px;
}

.hb-wr-figure.slot-set .fisher {
    transform: scale(1.05) translateY(2%);
}

.hb-wardrobe-picker .hb-wr-search {
    width: 100%;
    margin: 0 0 10px;
}

.hb-wr-search[hidden] {
    display: none;
}

.hb-look-panel {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 6px 4px;
}

.hb-look-panel h4 {
    margin: 4px 0 0;
}

.hb-look-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.hb-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hb-swatch {
    width: 40px;
    height: 40px;
    min-height: 0;
    padding: 0;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

.hb-swatch.selected {
    border-color: #fff;
    box-shadow: 0 0 0 3px var(--accent), inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}


/*==================================================
    Equipment
==================================================*/

.ff-stage .center-view-panel.hb-gear,
.book-modal.hb-gear {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 18px;
}

.hb-gear .book-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hb-gear .book-header > div:first-child {
    margin-right: auto;
}

.hb-gear-header-actions {
    display: flex;
    gap: 8px;
}

.hb-full {
    color: var(--bad);
}

.hb-gear-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr) 270px;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
}

.hb-doll {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
}

.hb-gear .hb-doll-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /* Half-height rows, each slot spanning two: four clothing slots on the
       left, the pendant, rings and gloves level with them on the right. */
    grid-template-rows: repeat(8, minmax(0, 1fr));
    grid-template-areas:
        "hat figure pendant"
        "hat figure pendant"
        "shirt figure ring1"
        "shirt figure ring1"
        "trousers figure ring2"
        "trousers figure ring2"
        "footwear figure gloves"
        "footwear figure gloves";
    gap: 6px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 18px);
    background:
        radial-gradient(circle at 50% 55%, rgba(56, 189, 248, 0.18), transparent 60%),
        var(--hb-card);
}

.hb-doll-figure {
    grid-area: figure;
    display: grid;
    place-items: center;
}

.hb-doll-figure .fisher {
    width: 100%;
    max-height: 160px;
}

.hb-socket {
    display: grid;
    justify-items: center;
    gap: 1px;
    min-width: 0;
    min-height: 0;
    padding: 6px 4px;
    border: 1px solid color-mix(in srgb, var(--rc, #64748b) 55%, transparent);
    border-radius: var(--ff-r-lg, 14px);
    background: color-mix(in srgb, var(--rc, #64748b) 10%, rgba(5, 18, 28, 0.7));
    box-shadow: none;
}

.hb-socket.empty {
    border-style: dashed;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.hb-socket.empty .hb-socket-art {
    opacity: 0.25;
    filter: grayscale(1);
}

.hb-socket.selected {
    box-shadow: 0 0 0 2px var(--accent);
}

/* The slot filtering the inventory. */
.hb-gear .hb-socket.picked {
    border: 2px solid var(--gold);
    border-style: solid;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35), 0 0 14px rgba(250, 204, 21, 0.3);
}

.hb-socket-art {
    width: 36px;
    height: 36px;
}

.hb-socket small {
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hb-socket strong {
    max-width: 100%;
    overflow: hidden;
    color: var(--rc, var(--muted));
    font-size: 0.68rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.socket-hat { grid-area: hat; }
.socket-pendant { grid-area: pendant; }
.socket-shirt { grid-area: shirt; }
.socket-ring1 { grid-area: ring1; }
.socket-trousers { grid-area: trousers; }
.socket-ring2 { grid-area: ring2; }
.socket-footwear { grid-area: footwear; }
.socket-gloves { grid-area: gloves; }

/* Gloves: the float bar, wear line and the unboxing card. */
.hb-glove-float {
    position: relative;
    display: flex;
    width: 100%;
    height: 8px;
    margin: 4px 0 2px;
    overflow: visible;
    border-radius: var(--ff-r-pill, 999px);
}

.hb-glove-float i {
    display: block;
    height: 100%;
    opacity: 0.75;
}

.hb-glove-float i:first-child {
    border-radius: var(--ff-r-pill, 999px) 0 0 var(--ff-r-pill, 999px);
}

.hb-glove-float i:last-of-type {
    border-radius: 0 var(--ff-r-pill, 999px) var(--ff-r-pill, 999px) 0;
}

.hb-glove-float b {
    position: absolute;
    top: -4px;
    width: 3px;
    height: 16px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 0 0 1px #0f172a, 0 0 8px rgba(255, 255, 255, 0.8);
}

.hb-glove-wear {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 8px;
    font-size: 0.78rem;
}

.hb-glove-wear b {
    color: var(--glove, #5eead4);
}

.hb-glove-wear span {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.hb-glove-wear-line {
    color: #5eead4 !important;
    font-weight: 800;
}

.hb-glove-card .hb-inspector-art {
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--glove) 70%, transparent));
}

.hb-glove-lines span {
    color: #5eead4;
}

.hb-glove-found {
    color: #fde047;
}

.hb-glove-reveal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(2, 6, 12, 0.72);
    animation: hb-glove-fade 0.25s ease-out;
}

.hb-glove-reveal-card {
    display: grid;
    justify-items: center;
    gap: 8px;
    width: min(360px, 100%);
    padding: 20px 22px 18px;
    border: 1px solid color-mix(in srgb, var(--glove) 70%, #5eead4);
    border-radius: var(--ff-r-lg, 20px);
    background:
        radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--glove) 30%, transparent), transparent 60%),
        var(--hb-card, #0f2433);
    box-shadow: 0 0 40px color-mix(in srgb, var(--glove) 45%, transparent);
    color: var(--text) !important;
    -webkit-text-fill-color: currentColor;
    text-align: center;
    animation: hb-glove-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.hb-glove-reveal-card > small {
    color: var(--muted);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hb-glove-reveal-art {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 16px var(--glove));
}

.hb-glove-reveal-card strong {
    font-size: 1.15rem;
}

.hb-glove-reveal-card .buff-list {
    justify-content: center;
}

.hb-glove-reveal-card .buff-list span {
    color: #5eead4;
}

@keyframes hb-glove-fade {
    from { opacity: 0; }
}

@keyframes hb-glove-pop {
    from { opacity: 0; transform: scale(0.7); }
}

.hb-gear-totals {
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 16px);
    background: var(--hb-card);
}

.hb-gear-totals h4 {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.85rem;
}

.hb-gear-totals .buff-list,
.hb-gear-copy .buff-list {
    display: grid;
    gap: 1px;
}

.hb-gear-totals .buff-list span {
    color: #c7f9ee;
    font-size: 0.8rem;
    font-weight: 700;
}

.hb-gear-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hb-gear-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.hb-gear-toolbar input[type="search"] {
    flex: 1 1 180px;
    min-height: 36px;
    border-radius: var(--ff-r-pill, 999px);
}

.hb-gear-toolbar select {
    min-height: 36px;
}

.hb-gear-toolbar .bulk-delete-group {
    display: inline-flex;
    gap: 6px;
}

.hb-gear .hb-gear-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-rows: 96px;
    align-content: start;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.hb-gear-tile {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    min-height: 0;
    height: 96px;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--rc, #64748b) 45%, transparent);
    border-radius: var(--ff-r-lg, 14px);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--rc, #64748b) 14%, transparent), transparent 55%),
        var(--hb-card);
    color: var(--text);
    text-align: left;
    box-shadow: none;
}

.hb-gear-tile:hover {
    border-color: var(--rc);
    transform: translateY(-1px);
}

.hb-gear-tile.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.45);
}

.hb-gear-tile.equipped-item {
    background:
        linear-gradient(135deg, rgba(94, 234, 212, 0.18), transparent 55%),
        var(--hb-card);
}

.hb-gear-art {
    width: 44px;
    height: 44px;
}

.hb-gear-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.hb-gear-copy strong {
    overflow: hidden;
    color: var(--rc, var(--text));
    font-size: 0.82rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-gear-copy .buff-list span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-gear-badges {
    position: absolute;
    left: 8px;
    bottom: 6px;
    display: flex;
    gap: 3px;
}

.hb-gear-badges i {
    padding: 0 5px;
    border-radius: var(--ff-r-md, 6px);
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.58rem;
    font-style: normal;
    font-weight: 900;
}

.hb-gear-badges .eq { background: var(--accent); color: #022c26; }
.hb-gear-badges .oc { background: #22d3ee; color: #083344; }
.hb-gear-badges .nw { background: var(--bad); color: #fff; }

.hb-gear-badges .lk {
    width: 14px;
    height: 14px;
    padding: 0;
    background: #facc15;
    -webkit-mask: var(--icon-lock) center / 11px no-repeat;
    mask: var(--icon-lock) center / 11px no-repeat;
}

.hb-inspector {
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 18px);
    background: var(--hb-card);
}

.hb-inspector-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 30px 8px;
    color: var(--muted);
    text-align: center;
}

.hb-inspector-empty .ff-art {
    width: 72px;
    height: 72px;
    opacity: 0.5;
}

.hb-inspector-card {
    display: grid;
    gap: 8px;
}

.hb-inspector-art {
    justify-self: center;
    width: 96px;
    height: 96px;
    padding: 6px;
    border-radius: var(--ff-r-lg, 24px);
    background: radial-gradient(circle, color-mix(in srgb, var(--rc, #64748b) 30%, transparent), transparent 70%);
}

.hb-rarity-pill {
    justify-self: center;
    padding: 1px 10px;
    border-radius: var(--ff-r-pill, 999px);
    background: color-mix(in srgb, var(--rc, #64748b) 18%, transparent);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hb-inspector-card > strong {
    color: var(--rc, var(--text));
    font-family: var(--font-display);
    font-size: 1.2rem;
    line-height: 1.15;
    text-align: center;
}

.hb-inspector-flags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.hb-flag {
    padding: 0 8px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.66rem;
    font-weight: 900;
}

.hb-flag.on { background: var(--accent); color: #022c26; }
.hb-flag.oc { background: #22d3ee; color: #083344; }

.hb-compare {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(0, 0, 0, 0.2);
}

.hb-compare-head,
.hb-compare-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    font-size: 0.78rem;
}

.hb-compare-head {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hb-compare-row span {
    color: var(--muted);
    font-weight: 700;
}

.hb-compare-row em {
    min-width: 54px;
    font-style: normal;
    font-weight: 900;
    text-align: right;
}

.hb-compare-row em.up { color: var(--good); }
.hb-compare-row em.down { color: var(--bad); }

.hb-compare-note {
    color: var(--muted);
    font-size: 0.72rem;
}

.hb-inspector-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.hb-inspector-actions button {
    min-height: 36px;
}

.hb-inspector-actions .hb-primary:only-of-type,
.hb-inspector-actions button:first-child:nth-last-child(odd) {
    grid-column: 1 / -1;
}


/*==================================================
    Pets
==================================================*/

.ff-stage .center-view-panel.hb-pets {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hb-pets .pet-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 10px;
}

.hb-pets .pet-equipped {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ff-r-lg, 18px);
    background:
        radial-gradient(300px 140px at 0% 50%, rgba(94, 234, 212, 0.14), transparent 70%),
        var(--hb-card);
}

.hb-pet-habitat {
    position: relative;
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border: 2px solid color-mix(in srgb, var(--rc, #5eead4) 60%, transparent);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.25), transparent 50%),
        radial-gradient(circle, color-mix(in srgb, var(--rc, #38bdf8) 30%, #0e3a52), #0a2536);
    box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.35);
}

.hb-pet-habitat.empty {
    border-style: dashed;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.hb-pet-habitat .pet-icon {
    width: 84px;
    height: 84px;
    animation: hb-pet-bob 2.6s ease-in-out infinite;
}

.hb-pet-habitat.shiny .pet-icon {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 12px rgba(197, 108, 240, 0.8));
}

@keyframes hb-pet-bob {
    50% { transform: translateY(-4px) rotate(2deg); }
}

.hb-pet-level {
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    padding: 0 5px;
    border: 2px solid #0b1f2e;
    border-radius: var(--ff-r-pill, 999px);
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
}

.hb-pet-hero-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.hb-pet-hero-copy > span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hb-pet-hero-copy strong {
    font-family: var(--font-display);
    font-size: 1.35rem;
}

.hb-pet-hero-copy small {
    color: var(--muted);
    font-weight: 700;
}

.hb-pets .pet-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 18px);
    background: var(--hb-card);
}

.hb-pets .pet-toolbar .pet-search-control {
    flex: 1 1 160px;
}

.hb-pets .pet-toolbar input {
    width: 100%;
    border-radius: var(--ff-r-pill, 999px);
}

.hb-pets .pet-inventory {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 180px;
    align-content: start;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.hb-pets .pet-card {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 6px 10px;
    min-height: 0;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--rc, #64748b) 45%, transparent);
    border-radius: var(--ff-r-lg, 18px);
    background:
        radial-gradient(160px 120px at 0% 0%, color-mix(in srgb, var(--rc, #64748b) 18%, transparent), transparent 70%),
        var(--hb-card);
}

.hb-pets .pet-card.equipped-pet {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.35);
}

.hb-pet-portrait {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: var(--ff-r-lg, 20px);
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc, #38bdf8) 28%, transparent), rgba(255, 255, 255, 0.03) 72%);
}

.hb-pet-portrait .pet-icon {
    width: 76px;
    height: 76px;
}

.hb-pet-portrait .hb-pet-level {
    min-width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

.hb-pet-shiny {
    position: absolute;
    top: -4px;
    left: -4px;
    padding: 0 6px;
    border-radius: var(--ff-r-pill, 999px);
    background: linear-gradient(90deg, #f0abfc, #fff, #a5f3fc);
    color: #3b0764;
    font-size: 0.58rem;
    font-weight: 900;
}

.hb-pet-info {
    display: grid;
    align-content: start;
    gap: 3px;
    min-width: 0;
}

.hb-pet-info strong {
    overflow: hidden;
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-pet-info > span {
    font-size: 0.74rem;
    font-weight: 800;
}

.hb-pet-info .pet-xp {
    height: 6px;
    margin: 2px 0;
}

.hb-pet-info .buff-list {
    display: grid;
    gap: 0;
}

.hb-pet-info .buff-list span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-pets .pet-actions {
    display: grid;
    grid-template-columns: 36px 1fr 1fr;
    grid-column: 1 / -1;
    gap: 6px;
}

.hb-pets .pet-actions button {
    min-height: 32px;
    padding: 3px 8px;
    font-size: 0.78rem;
}

.hb-pets .pet-actions .pet-select-button {
    grid-column: 1 / -1;
}


/*==================================================
    Keep Net and Aquarium list
==================================================*/

.book-modal.hb-storage {
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    height: min(860px, calc(100vh - 36px));
    overflow: hidden;
}

.hb-storage .book-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hb-storage .book-header > div:first-child {
    margin-right: auto;
}

.hb-storage-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hb-storage-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 5px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.04);
}

.hb-storage-stats .ff-art {
    width: 24px;
    height: 24px;
}

.hb-storage-stats b {
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.hb-storage-stats small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.hb-storage .storage-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 16px);
    background: var(--hb-card);
}

.hb-storage .keep-net-action-divider {
    flex: 1 1 auto;
    border: 0;
}

.hb-storage .keep-net-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hb-storage .bulk-action-pair {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 12px);
}

.hb-storage .bulk-action-pair button {
    min-height: 36px;
    border: 0;
    border-radius: 0;
    font-size: 0.8rem;
}

.hb-storage .bulk-action-pair button + button {
    border-left: 1px solid var(--line);
}

.hb-select-toggle.active {
    border-color: rgba(94, 234, 212, 0.65);
    background: rgba(94, 234, 212, 0.18);
    color: var(--accent);
}

.hb-select-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(94, 234, 212, 0.45);
    border-radius: var(--ff-r-lg, 14px);
    background: rgba(94, 234, 212, 0.08);
}

.hb-select-bar span {
    margin-right: auto;
    font-weight: 700;
}

.hb-select-bar button {
    min-height: 32px;
    padding: 3px 12px;
    font-size: 0.8rem;
}

.hb-select-bar .hb-sell:not(:disabled) {
    border-color: rgba(250, 204, 21, 0.6);
    background: linear-gradient(180deg, #fcd34d, #d97706);
    color: #3b2400;
    font-weight: 900;
}

.hb-storage .storage-grid,
.hb-storage .aquarium-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 78px;
    align-content: start;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.hb-storage .fish-card.hb-fish-card,
.hb-storage .fish-card.hb-container-card {
    position: relative;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    min-height: 0;
    height: 78px;
    padding: 8px 10px 8px 8px;
    border: 1px solid color-mix(in srgb, var(--rc, #64748b) 40%, transparent);
    border-radius: var(--ff-r-lg, 16px);
    background:
        linear-gradient(100deg, color-mix(in srgb, var(--rc, #64748b) 14%, transparent), transparent 50%),
        var(--hb-card);
    color: var(--text);
}

.hb-storage .fish-card.selectable {
    cursor: pointer;
}

.hb-storage .fish-card.selectable::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    width: 16px;
    height: 16px;
    border: 2px solid var(--line-strong);
    border-radius: 5px;
    background: rgba(5, 18, 28, 0.85);
}

.hb-storage .fish-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.4);
}

.hb-storage .fish-card.selected::before {
    border-color: var(--accent);
    background: var(--accent) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23022c26' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><path d='m5 12 5 5 9-10'/></svg>") center / 12px no-repeat;
}

.hb-fish-thumb .fish-icon,
.hb-container-art {
    width: 54px;
    height: 54px;
    border-radius: var(--ff-r-lg, 14px);
    background: radial-gradient(circle, color-mix(in srgb, var(--rc, #38bdf8) 26%, transparent), rgba(255, 255, 255, 0.03) 72%);
}

.hb-fish-thumb .fish-icon-image {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.hb-container-art {
    padding: 5px;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.18), rgba(255, 255, 255, 0.03) 72%);
}

.hb-fish-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.hb-fish-copy strong {
    overflow: hidden;
    font-size: 0.92rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-fish-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-fish-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow: hidden;
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.hb-fish-tags .ff-mutation-tag {
    font-size: 0.6rem;
}

.hb-fish-value {
    display: grid;
    justify-items: end;
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.05;
}

.hb-fish-value small {
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hb-storage .fish-card .fish-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.hb-storage .fish-card .fish-actions button,
.hb-storage .hb-container-card .hb-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 28px;
    margin: 0;
    padding: 2px 9px 2px 5px;
    border-radius: var(--ff-r-md, 10px);
    font-size: 0.72rem;
}

.hb-storage .hb-container-card .hb-open {
    min-height: 36px;
    padding: 4px 16px;
    font-size: 0.85rem;
}

.hb-act i {
    display: inline-block;
    width: 18px;
    height: 18px;
}

.hb-storage .fish-card .fish-lock-button {
    width: 28px;
    padding: 0;
}

.hb-storage .fish-card .fish-actions:has(.fish-lock-button) {
    display: grid;
    grid-template-columns: 28px auto;
}

.hb-storage .fish-card .fish-actions:has(.fish-lock-button) .fish-lock-button {
    grid-row: span 2;
    height: 100%;
}

.hb-container-card .hb-fish-copy strong {
    color: #fde68a;
}

.hb-oc .hb-fish-copy strong {
    color: #a5f3fc;
}

.hb-basket .hb-fish-copy strong {
    color: #fbcfe8;
}


/*==================================================
    Aquarium tank
==================================================*/

.book-modal.hb-aquarium {
    width: min(1240px, 100%);
}

.hb-arrange.active {
    border-color: rgba(250, 204, 21, 0.7);
    background: rgba(250, 204, 21, 0.16);
    color: #fde68a;
}

.hb-aquarium .aquarium-tank {
    position: relative;
    overflow: hidden;
    border: 6px solid #22384a;
    border-radius: var(--ff-r-lg, 18px);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.aquarium-tank[data-theme] {
    background: linear-gradient(180deg, var(--tank-top), var(--tank-mid) 55%, var(--tank-deep));
}

.aquarium-tank[data-theme="lagoon"] { --tank-top: #7dd3fc; --tank-mid: #2ba6d6; --tank-deep: #116089; --floor: #e9cf96; --floor-dark: #c9a86a; --ray: rgba(255, 255, 255, 0.22); }
.aquarium-tank[data-theme="kelp"] { --tank-top: #6ec2a0; --tank-mid: #2f8a72; --tank-deep: #144a40; --floor: #6b5b3e; --floor-dark: #4b3f2a; --ray: rgba(240, 255, 200, 0.2); }
.aquarium-tank[data-theme="reef"] { --tank-top: #67e8f9; --tank-mid: #14b8c4; --tank-deep: #0b6d84; --floor: #fde3b0; --floor-dark: #f0b97a; --ray: rgba(255, 255, 255, 0.26); }
.aquarium-tank[data-theme="temple"] { --tank-top: #6b9b8e; --tank-mid: #3e6e64; --tank-deep: #1f3a35; --floor: #8a8a76; --floor-dark: #5f6152; --ray: rgba(255, 220, 150, 0.18); }
.aquarium-tank[data-theme="glacier"] { --tank-top: #e0f2fe; --tank-mid: #93c5fd; --tank-deep: #3b6aa6; --floor: #f1f5f9; --floor-dark: #cbd5e1; --ray: rgba(255, 255, 255, 0.3); }
.aquarium-tank[data-theme="abyss"] { --tank-top: #1e2b4f; --tank-mid: #111a36; --tank-deep: #050914; --floor: #1f2937; --floor-dark: #111827; --ray: rgba(103, 232, 249, 0.07); }

.hb-tank-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hb-tank-rays {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hb-tank-rays i {
    position: absolute;
    top: -20%;
    width: 9%;
    height: 120%;
    background: linear-gradient(180deg, var(--ray, rgba(255, 255, 255, 0.2)), transparent 80%);
    filter: blur(6px);
    transform: skewX(-14deg);
    animation: hb-ray 7s ease-in-out infinite;
}

.hb-tank-rays i:nth-child(1) { left: 12%; }
.hb-tank-rays i:nth-child(2) { left: 34%; width: 6%; animation-delay: -2s; }
.hb-tank-rays i:nth-child(3) { left: 58%; width: 11%; animation-delay: -4s; }
.hb-tank-rays i:nth-child(4) { left: 80%; width: 5%; animation-delay: -1s; }

@keyframes hb-ray {
    50% { opacity: 0.45; transform: skewX(-10deg) translateX(10px); }
}

.hb-tank-caustics {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60px 16px at 20% 20%, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(ellipse 80px 20px at 70% 35%, rgba(255, 255, 255, 0.07), transparent),
        radial-gradient(ellipse 50px 14px at 45% 60%, rgba(255, 255, 255, 0.05), transparent);
    animation: hb-caustic 9s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes hb-caustic {
    to { transform: translateX(30px) scaleY(1.2); }
}

.hb-tank-floor {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46px;
    border-radius: 50% 50% 0 0 / 14px 14px 0 0;
    background:
        radial-gradient(circle at 18% 40%, var(--floor-dark) 0 3px, transparent 4px),
        radial-gradient(circle at 62% 60%, var(--floor-dark) 0 2px, transparent 3px),
        radial-gradient(circle at 84% 30%, var(--floor-dark) 0 3px, transparent 4px),
        linear-gradient(180deg, var(--floor), var(--floor-dark));
    box-shadow: inset 0 6px 10px rgba(255, 255, 255, 0.15);
}

.hb-tank-bubbles i {
    position: absolute;
    bottom: 30px;
    left: var(--x);
    width: calc(8px * var(--s));
    height: calc(8px * var(--s));
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    animation: hb-bubble var(--d) linear var(--delay) infinite;
    pointer-events: none;
}

@keyframes hb-bubble {
    from { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    to { transform: translateY(-460px) translateX(14px); opacity: 0; }
}

.hb-tank-glass {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.06));
    pointer-events: none;
}

.aquarium-tank .hb-decor {
    position: absolute;
    z-index: 3;
    width: 84px;
    height: 84px;
    margin: 0;
    background: none;
    transform: translateX(-50%);
    filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.25));
}

.aquarium-tank .hb-decor::before,
.aquarium-tank .hb-decor::after {
    display: none;
}

.aquarium-tank.arranging .hb-decor {
    cursor: grab;
    outline: 2px dashed rgba(250, 204, 21, 0.7);
    outline-offset: 2px;
    border-radius: var(--ff-r-lg, 12px);
}

.aquarium-tank.arranging .hb-decor.dragging {
    z-index: 25;
    cursor: grabbing;
    transform: translateX(-50%) scale(1.08);
}

.aquarium-tank .aquarium-fish {
    z-index: 10;
}

.hb-tank-pet img {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));
}

.aquarium-tank[data-theme="abyss"] .aquarium-fish .fish-icon-image {
    filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.45));
}

/* Aquarium shop */

.book-modal.hb-aqshop {
    display: flex;
    flex-direction: column;
    width: min(1000px, 100%);
    max-height: min(820px, calc(100vh - 36px));
    overflow: hidden;
}

.hb-aqshop .aquarium-shop-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: min-content;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 2px;
}

.hb-aqshop .aquarium-shop-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 6px 10px;
    min-height: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 16px);
    background: var(--hb-card);
}

.hb-aqshop .aquarium-shop-item::before {
    display: none;
}

.hb-aqshop .aquarium-shop-item > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.hb-aqshop .aquarium-shop-item small {
    color: var(--muted);
    font-size: 0.74rem;
}

.hb-aqshop .aquarium-shop-item button {
    grid-column: 1 / -1;
    min-height: 32px;
}

.hb-decor-card.owned {
    border-color: rgba(94, 234, 212, 0.45);
}

.hb-decor-art {
    width: 64px;
    height: 64px;
    border-radius: var(--ff-r-lg, 14px);
    background: radial-gradient(circle at 50% 70%, rgba(56, 189, 248, 0.25), transparent 70%);
}

.hb-aqshop .aquarium-shop-list[data-tab="themes"] {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.hb-theme-card {
    grid-template-columns: 1fr !important;
}

.hb-theme-card.active {
    border-color: rgba(94, 234, 212, 0.7);
}

.hb-theme-swatch {
    position: relative;
    height: 110px;
    overflow: hidden;
    border: 3px solid #22384a;
    border-radius: var(--ff-r-lg, 12px);
}

.hb-theme-swatch .hb-tank-floor {
    height: 24px;
}


/*==================================================
    Shop
==================================================*/

.ff-stage .center-view-panel.hb-shop {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hb-shop .book-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hb-shop .book-header > div:first-child {
    margin-right: auto;
}

.hb-shop .shop-tabs {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-top: 10px;
    padding-right: 4px;
}

.hb-shop .shop-list {
    display: block;
    padding: 0;
    border: 0;
    background: none;
}

.hb-shop-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.hb-shop-intro p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.hb-qty {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--ff-r-lg, 12px);
}

.hb-qty button {
    min-height: 32px;
    padding: 3px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: none;
}

.hb-qty button + button {
    border-left: 1px solid var(--line);
}

.hb-qty button.active {
    background: rgba(94, 234, 212, 0.2);
    color: var(--accent);
}

.hb-owned-count {
    padding: 3px 12px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.06);
    font-weight: 800;
}

.hb-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

.hb-shop .shop-item.hb-shop-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 8px 12px;
    min-height: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 18px);
    background: var(--hb-card);
}

.hb-shop-card.in-use {
    border-color: rgba(94, 234, 212, 0.6);
    box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.25);
}

.hb-shop-card.unaffordable .hb-price {
    color: var(--bad);
}

.hb-shop-card.owned:not(.in-use) {
    opacity: 0.85;
}

.hb-shop-art {
    width: 72px;
    height: 72px;
    padding: 6px;
    border-radius: var(--ff-r-lg, 18px);
    background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.22), rgba(255, 255, 255, 0.03) 70%);
}

.hb-shop-copy {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
}

.hb-shop-copy strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
    line-height: 1.1;
}

.hb-shop-copy small {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

.hb-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.hb-in-use,
.hb-owned {
    padding: 0 7px;
    border-radius: var(--ff-r-md, 6px);
    background: var(--accent);
    color: #022c26;
    font-size: 0.64rem;
    font-weight: 900;
}

.hb-owned {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

.hb-stat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.hb-stat-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 1px 8px;
    border-radius: var(--ff-r-md, 8px);
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.hb-stat-chip b {
    color: #c7f9ee;
}

.hb-stat-chip.bad b {
    color: var(--bad);
}

.hb-shop-buy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    grid-column: 1 / -1;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hb-shop-buy > small {
    margin-right: auto;
    color: var(--muted);
    font-weight: 700;
}

.hb-price {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.hb-price .ff-art {
    width: 20px;
    height: 20px;
}

.hb-price em {
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 800;
}

.hb-shop-buy button {
    min-width: 92px;
    min-height: 34px;
}

.hb-upgrade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.hb-shop .shop-item.hb-upgrade-card {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--tier-color) 55%, transparent);
    border-radius: var(--ff-r-lg, 20px);
    background:
        radial-gradient(260px 120px at 0% 0%, color-mix(in srgb, var(--tier-color) 22%, transparent), transparent 70%),
        var(--hb-card);
}

.hb-upgrade-head {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.hb-upgrade-head > div {
    display: grid;
    gap: 2px;
}

.hb-upgrade-head small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hb-upgrade-head strong {
    font-family: var(--font-display);
    font-size: 1.3rem;
}

.hb-upgrade-head span {
    color: var(--muted);
    font-weight: 700;
}

.hb-prestige {
    color: #fde68a;
}

.hb-tier-ladder {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 3px;
}

.hb-tier-ladder i {
    height: 8px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
}

.hb-tier-ladder i.on {
    background: var(--c);
    box-shadow: 0 0 6px color-mix(in srgb, var(--c) 60%, transparent);
}

.hb-upgrade-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.hb-next-tier {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(0, 0, 0, 0.2);
}

.hb-next-tier span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.hb-next-tier.prestige b {
    color: #fde68a;
}

.hb-upgrade-card .prestige-detail {
    color: #fde68a;
    font-size: 0.76rem;
}


/*==================================================
    Catalog
==================================================*/

.catalog-modal .catalog-grid {
    grid-auto-rows: minmax(132px, auto);
    align-content: start;
}

.catalog-modal .catalog-card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    align-content: start;
    gap: 6px;
    min-height: 0;
    height: auto;
    padding: 10px 10px 9px;
    overflow: visible;
}

.hb-cat-top {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.catalog-modal .catalog-card .fish-icon {
    width: 40px;
    height: 40px;
}

.catalog-modal .catalog-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.catalog-modal .catalog-copy strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.86rem;
    line-height: 1.15;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}

.catalog-modal .catalog-copy span {
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-cat-count {
    align-self: start;
    padding: 0 6px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-size: 0.66rem;
}

.hb-cat-types {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.hb-cat-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: end;
    gap: 4px 6px;
    min-width: 0;
}

.hb-cat-foot .catalog-caught-tags {
    display: inline-flex;
    gap: 4px;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 900;
}

.hb-cat-foot .ff-catalog-extras {
    margin: 0;
}

.hb-cat-foot .evolve-fish-button,
.hb-cat-foot .evolved-label {
    margin: 0 0 0 auto;
    min-height: 0;
    padding: 1px 8px;
    font-size: 0.68rem;
}


/*==================================================
    Lodge
==================================================*/

.ff-lodge-modal .ff-lodge-scene {
    position: relative;
    height: 190px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--ff-r-lg, 18px);
}

.hb-lodge-sky {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 82% 22%, #fff4c4 0 18px, rgba(255, 244, 196, 0.35) 30px, transparent 70px),
        linear-gradient(180deg, #ffb878 0%, #f6a5c0 32%, #7aa7d8 70%, #4f86b8 100%);
}

.hb-lodge-hills {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 54px;
    height: 70px;
    background:
        radial-gradient(120px 60px at 10% 100%, #4b7a52 98%, transparent),
        radial-gradient(180px 70px at 38% 100%, #3f6b48 98%, transparent),
        radial-gradient(160px 60px at 70% 100%, #4b7a52 98%, transparent),
        radial-gradient(140px 64px at 95% 100%, #3f6b48 98%, transparent);
    opacity: 0.9;
}

.hb-lodge-row {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 44px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    padding: 0 10px;
}

/* Seven buildings around the Lodge itself. */
.hb-lodge-slot {
    display: block;
    width: 11.4%;
    max-width: 120px;
}

.hb-lodge-main {
    width: 20%;
    max-width: 190px;
}

.hb-lodge-slot svg {
    display: block;
    width: 100%;
    height: auto;
}

.hb-lodge-water {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46px;
    background: linear-gradient(180deg, #3f8fbf, #1b4f74);
    border-top: 2px solid rgba(255, 255, 255, 0.25);
}

.hb-lodge-water span {
    position: absolute;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    animation: hb-wave 6s ease-in-out infinite;
}

.hb-lodge-water span:nth-child(1) { left: 10%; top: 14px; width: 12%; }
.hb-lodge-water span:nth-child(2) { left: 45%; top: 26px; width: 16%; animation-delay: -2s; }
.hb-lodge-water span:nth-child(3) { left: 76%; top: 18px; width: 10%; animation-delay: -4s; }

@keyframes hb-wave {
    50% { transform: translateX(16px); opacity: 0.5; }
}

.hb-lodge-progress {
    position: absolute;
    top: 10px;
    left: 12px;
    padding: 3px 12px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(5, 18, 28, 0.7);
    font-size: 0.8rem;
    font-weight: 800;
}

.hb-lodge-progress b {
    color: var(--gold);
}

.lodge-smoke circle {
    animation: hb-smoke 3s ease-in-out infinite;
}

.lodge-smoke circle:nth-child(2) { animation-delay: -1s; }
.lodge-smoke circle:nth-child(3) { animation-delay: -2s; }

@keyframes hb-smoke {
    50% { transform: translate(2px, -3px); opacity: 0.3; }
}

.lodge-gear,
.lodge-mill {
    animation: hb-spin 6s linear infinite;
}

#lodgeCoins {
    display: inline-flex;
    align-items: center;
    border-color: rgba(233, 213, 255, 0.4);
    background: rgba(167, 139, 250, 0.16);
    color: var(--hb-pearl);
}

.ff-lodge-modal .ff-lodge-grid {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}

.hb-building {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--building-color) 35%, var(--line));
    border-radius: var(--ff-r-lg, 18px);
    background:
        radial-gradient(260px 140px at 0% 0%, color-mix(in srgb, var(--building-color) 16%, transparent), transparent 70%),
        var(--hb-card);
}

.hb-building.maxed {
    border-color: rgba(250, 204, 21, 0.6);
}

.hb-building-art {
    position: relative;
    align-self: start;
    width: 128px;
    padding: 6px 4px 0;
    overflow: hidden;
    border-radius: var(--ff-r-lg, 14px);
    background: linear-gradient(180deg, #a4d4f2, #d8eefb 70%);
}

.hb-building.unbuilt .hb-building-art {
    filter: saturate(0.6);
}

.hb-building-crown {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 0 6px;
    border-radius: var(--ff-r-md, 6px);
    background: #facc15;
    color: #3b2400;
    font-size: 0.62rem;
    font-weight: 900;
}

.hb-building-body {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
}

.hb-building-body header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.hb-building-body header strong {
    font-family: var(--font-display);
    font-size: 1.15rem;
}

.hb-building-level {
    color: var(--building-color);
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.hb-building-level small {
    color: var(--muted);
    font-size: 0.75rem;
}

.hb-building-desc {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.3;
}

.hb-building .ff-building-levels {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
}

.hb-building .ff-building-levels i {
    height: 7px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
}

.hb-building .ff-building-levels i.on {
    background: var(--building-color);
}

.hb-building .ff-building-levels i.milestone:not(.on) {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--building-color) 55%, transparent);
}

.hb-building-effects {
    display: grid;
    gap: 3px;
}

.hb-building-effects span {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 6px;
    font-size: 0.8rem;
}

.hb-building-effects em {
    color: var(--muted);
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
}

.hb-building-effects .ff-next b {
    color: var(--good);
}

.hb-building-hint {
    color: var(--muted);
    font-size: 0.72rem;
    font-style: italic;
}

.hb-building .ff-building-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.hb-build {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 36px;
}

.hb-build b {
    display: inline-flex;
    align-items: center;
}


/*==================================================
    Talents: per-point refunds
==================================================*/

.ff-talent-buttons {
    display: grid;
    gap: 4px;
}

.ff-talent .ff-talent-buttons button {
    width: 32px;
    height: 32px;
    min-height: 0;
    padding: 0;
}

.ff-talent .ff-talent-refund {
    border-color: rgba(251, 113, 133, 0.35);
    color: #fecdd3;
    font-weight: 900;
}

.ff-talent .ff-talent-refund:disabled {
    opacity: 0.25;
}


/*==================================================
    Narrow screens
==================================================*/

@media (max-width: 1280px) {
    .hb-gear-layout {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .hb-inspector {
        grid-column: 1 / -1;
        max-height: 260px;
    }
}

@media (max-width: 900px) {
    .hb-board-layout,
    .hb-wardrobe-layout,
    .hb-stats-hero,
    .hb-pets .pet-overview,
    .hb-gear-layout {
        grid-template-columns: 1fr;
    }

    /* The category strip keeps its height when a board has few rows. */
    .hb-board-layout {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .hb-board-nav {
        display: flex;
        gap: 6px;
        overflow-x: auto;
    }

    .hb-board-group {
        display: flex;
        gap: 4px;
    }

    .hb-board-group small {
        display: none;
    }

    .hb-board-group button {
        white-space: nowrap;
    }

    .hb-settings-scroll {
        grid-template-columns: 1fr;
    }

    .hb-stats-big,
    .hb-records {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hb-wardrobe-layout {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .hb-wardrobe-stage-wrap {
        grid-template-rows: auto auto;
        min-height: auto;
    }

    .hb-wardrobe-stage {
        min-height: 240px;
    }

    .hb-wardrobe-fisher {
        width: 160px;
    }

    .hb-gear .hb-gear-grid,
    .hb-storage .storage-grid,
    .hb-storage .aquarium-list,
    .hb-pets .pet-inventory {
        overflow-y: auto;
    }
}

@media (max-width: 760px) {
    .hb-pearl-wallet {
        min-height: 36px;
        padding: 4px 10px 4px 6px;
        font-size: 0.95rem;
    }

    .hb-catch {
        min-width: 0;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .hb-catch-value {
        grid-column: 1 / -1;
        justify-items: start;
    }

    .hb-ach-modal .hb-ach-grid {
        grid-template-columns: 1fr;
    }

    .hb-board-list li {
        grid-template-columns: 26px 30px minmax(0, 1fr) auto;
    }

    .hb-row-bar {
        display: none;
    }

    .hb-building {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .hb-building-art {
        width: 96px;
    }
}


/*==================================================
    Overrides for older shared card rules
==================================================*/

.hb-shop .shop-item::before {
    display: none;
}

.hb-shop .shop-item > span,
.hb-shop .shop-item > b,
.hb-shop .shop-item > button {
    grid-column: auto;
    justify-self: auto;
    width: auto;
}

.catalog-modal .catalog-card {
    grid-template-columns: minmax(0, 1fr);
}

/* Nine rail sections plus Wardrobe: keep every button on screen. */
.ff-rail {
    gap: 4px;
}

.ff-rail button,
.ff-rail .menu-buttons button {
    min-height: 44px;
    gap: 2px;
    padding: 4px 2px 3px;
}

.ff-rail button::before {
    width: 20px;
    height: 20px;
}

@media (min-width: 761px) and (max-height: 860px) {
    .ff-rail button,
    .ff-rail .menu-buttons button {
        min-height: 40px;
        font-size: 0.58rem;
    }

    .ff-rail button::before {
        width: 18px;
        height: 18px;
    }
}

.hb-tryon[hidden],
.hb-select-bar[hidden] {
    display: none;
}

.hb-check input {
    width: 16px !important;
    height: 16px !important;
    min-height: 0 !important;
    margin: 0;
    accent-color: var(--accent);
}

.hb-settings-modal .hb-toggle input {
    position: static;
    width: 44px !important;
    height: 24px !important;
    min-height: 0 !important;
    padding: 0 !important;
    opacity: 1;
}

.hb-settings-modal .reward-reveal-options {
    grid-template-columns: 1fr;
}

.hb-settings-modal .hb-toggle {
    width: 100%;
}

/* Gradient-text labels need a solid fill inside pills. */
.hb-pill-grid label > span.shiny-text,
.hb-pill-grid label > span.foil-text,
.hb-pill-grid label > span.perfect-fish-text,
.hb-pill-grid label > span.rarity-eternal {
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none !important;
    animation: none !important;
}

.hb-pill-grid label > span.shiny-text { color: #f5d0fe !important; }
.hb-pill-grid label > span.foil-text { color: #a5f3fc !important; }
.hb-pill-grid label > span.perfect-fish-text { color: #e9d5ff !important; }
.hb-pill-grid label > span.rarity-eternal { color: #5eead4 !important; }

.hb-pill-grid label > span.shiny-text,
.hb-pill-grid label > span.foil-text,
.hb-pill-grid label > span.perfect-fish-text,
.hb-pill-grid label > span.rarity-eternal {
    background: rgba(255, 255, 255, 0.03) !important;
}

.hb-pill-grid input:checked + span.shiny-text,
.hb-pill-grid input:checked + span.foil-text,
.hb-pill-grid input:checked + span.perfect-fish-text,
.hb-pill-grid input:checked + span.rarity-eternal {
    background: rgba(94, 234, 212, 0.14) !important;
}

/* Leaderboard and stats avatars show the fisher from the chest up. */
.hb-avatar .fisher {
    width: 100%;
    height: 100%;
    margin: 0;
    transform: scale(1.9) translate(4%, 24%);
}

/* Legacy storage-grid rules force the value and buttons onto new rows. */
.hb-storage .keep-net-toolbar {
    flex-direction: row;
    align-items: center;
}

.hb-storage .storage-grid .fish-card {
    grid-template-rows: none;
    align-items: center;
    align-content: center;
    overflow: visible;
}

.hb-storage .storage-grid .fish-card > b,
.hb-storage .storage-grid .fish-card > .fish-actions {
    grid-column: auto;
    align-self: center;
    width: auto;
}

.hb-storage .storage-grid .fish-actions button {
    flex: 0 0 auto;
    font-size: 0.72rem;
    white-space: nowrap;
}

/* Lodge panorama: building SVGs sit in a row, not stacked full-size. */
.ff-lodge-scene .hb-lodge-slot svg {
    position: static;
    width: 100%;
    height: auto;
}

/* Catalog: wider book, cards size to their content and the grid scrolls. */
.book-modal.catalog-modal {
    width: min(1240px, 100%);
}

@media (min-width: 901px) {
    .catalog-modal .catalog-grid {
        grid-template-rows: none;
        grid-auto-rows: auto;
        overflow-y: auto;
        padding-right: 4px;
    }

    .catalog-modal .catalog-card {
        overflow: visible;
    }

    .catalog-modal .catalog-card .catalog-copy strong {
        font-size: 0.86rem;
    }

    .catalog-modal .catalog-card .catalog-copy span {
        font-size: 0.72rem;
    }
}

/* The old #baitShop rules use an id, so match it here. */
.hb-shop #baitShop,
.hb-shop .shop-tabs .shop-list {
    display: block;
    padding: 0;
    border: 0;
    background: none;
}

.hb-shop .shop-tabs .shop-list[hidden] {
    display: none !important;
}

.hb-shop #baitShop .shop-item.hb-shop-card,
.hb-shop .shop-item.hb-shop-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 12px;
}

.hb-shop #baitShop .bait-item strong {
    font-size: 1.1rem;
}

.hb-shop #baitShop .bait-item small {
    font-size: 0.8rem;
}

.hb-shop #baitShop .bait-item .hb-shop-buy button {
    width: auto;
    min-height: 34px;
    padding: 0 16px;
    font-size: 0.9rem;
}

.hb-shop #baitShop .bait-item .hb-shop-buy > small {
    font-size: 0.78rem;
}

.hb-shop .shop-item.hb-upgrade-card {
    grid-template-columns: minmax(0, 1fr);
}

/* style.css sizes the catalog through #catalogModal, so these match it. */
#catalogModal > .book-modal.catalog-modal {
    width: min(1240px, calc(100vw - 24px));
}

#catalogModal .catalog-grid {
    grid-template-rows: none;
    grid-auto-rows: auto;
    overflow-y: auto;
}

#catalogModal .catalog-card {
    height: auto;
    min-height: 0;
    overflow: visible;
}

.hb-next-tier {
    flex-wrap: wrap;
}

.hb-next-tier span {
    flex: 0 0 auto;
}

/* Phones: the center panels become one scrolling column. */
@media (max-width: 900px) {
    .ff-stage .center-view-panel.hb-gear,
    .ff-stage .center-view-panel.hb-pets,
    .ff-stage .center-view-panel.hb-shop {
        overflow-y: auto;
    }

    .hb-gear-layout {
        display: flex;
        flex-direction: column;
        flex: none;
    }

    .hb-gear-main,
    .hb-doll {
        flex: none;
    }

    .hb-gear .hb-gear-grid,
    .hb-pets .pet-inventory {
        flex: none;
        overflow: visible;
    }

    .hb-inspector {
        max-height: none;
    }

    .hb-storage .storage-grid,
    .hb-storage .aquarium-list {
        grid-template-columns: 1fr;
    }
}

.hb-icon-art {
    display: block;
    width: 100%;
    height: 100%;
}


/*==================================================
    Catalog, v3: compact pill filters, the grid fills
    the book (script.js sizes the page to fit), and
    cards grow to their content so nothing clips.
==================================================*/

#catalogModal > .book-modal.catalog-modal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(1320px, calc(100vw - 24px));
    height: min(900px, calc(100dvh - 24px));
    max-height: none;
    padding: 16px 18px;
    overflow-x: hidden;
    overflow-y: auto;
}

#catalogModal .book-header {
    display: grid;
    grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    margin: 0;
}

#catalogModal .book-header h2 {
    margin: 0;
    line-height: 1.1;
}

#catalogModal #catalogPageLabel {
    margin: 2px 0 4px;
    font-size: 0.85rem;
}

#catalogModal .catalog-progress-summaries {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
}

#catalogModal .catalog-count-summary {
    font-size: 0.74rem;
}

#catalogModal .catalog-filters {
    display: grid;
    /* One column no wider than the space, so the chips wrap before Close. */
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    align-content: start;
    min-width: 0;
}

#catalogModal .catalog-filters fieldset {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

#catalogModal .catalog-filters legend {
    float: left;
    width: 46px;
    margin: 0;
    padding: 0;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#catalogModal .catalog-filters label {
    --rc: #cbd5e1;
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent);
    border-radius: var(--ff-r-pill, 999px);
    background: transparent;
    color: color-mix(in srgb, var(--rc) 60%, #64748b);
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

#catalogModal .catalog-filters label:has(input:checked) {
    background: color-mix(in srgb, var(--rc) 18%, transparent);
    color: var(--rc);
    border-color: color-mix(in srgb, var(--rc) 70%, transparent);
}

#catalogModal .catalog-filters label:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

#catalogModal .catalog-filters label input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

#catalogModal .catalog-filters label:has(input[value="Uncommon"]) { --rc: #4ade80; }
#catalogModal .catalog-filters label:has(input[value="Rare"]) { --rc: #38bdf8; }
#catalogModal .catalog-filters label:has(input[value="Epic"]) { --rc: #c084fc; }
#catalogModal .catalog-filters label:has(input[value="Legendary"]) { --rc: #facc15; }
#catalogModal .catalog-filters label:has(input[value="Mythical"]) { --rc: #fb7185; }
#catalogModal .catalog-filters label:has(input[value="Eternal"]) { --rc: #fdba74; }
#catalogModal .catalog-zone-checkboxes label { --rc: #5eead4; }

#catalogModal .catalog-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0;
}

#catalogModal .catalog-search {
    display: flex;
    flex: 1 1 260px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

#catalogModal .catalog-search > span {
    display: none;
}

#catalogModal .catalog-search input {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    border-radius: var(--ff-r-pill, 999px);
}

#catalogModal .catalog-search-row .compact-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    white-space: nowrap;
}

#catalogModal .catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
    grid-auto-rows: auto;
    align-content: stretch;
    gap: 8px;
    flex: 1 1 0;
    min-height: 150px;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#catalogModal .catalog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    text-align: left;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 10px 11px 9px;
    overflow: hidden;
}

#catalogModal .hb-cat-top {
    margin-top: auto;
    display: grid;
    justify-content: stretch;
    text-align: left;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
}

#catalogModal .catalog-card .fish-icon {
    width: 42px;
    height: 42px;
    margin: 0;
}

#catalogModal .catalog-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

#catalogModal .catalog-copy strong {
    display: block;
    overflow: visible;
    font-size: 0.9rem;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
    -webkit-line-clamp: unset;
}

#catalogModal .catalog-copy span {
    overflow: visible;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
    text-overflow: clip;
}

#catalogModal .hb-cat-types,
#catalogModal .hb-cat-meta {
    justify-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    min-width: 0;
}

#catalogModal .hb-cat-meta:empty {
    display: none;
}

#catalogModal .hb-cat-meta .ff-catalog-extras {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin: 0;
}

#catalogModal .hb-cat-meta .catalog-caught-tags {
    display: inline-flex;
    gap: 5px;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 900;
}

#catalogModal .hb-cat-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

#catalogModal .hb-cat-count {
    padding: 0;
    background: none;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

#catalogModal .hb-cat-foot .evolve-fish-button,
#catalogModal .hb-cat-foot .evolved-label {
    width: auto;
    min-height: 0;
    margin: 0 0 0 auto;
    padding: 2px 9px;
    font-size: 0.7rem;
    white-space: nowrap;
}

#catalogModal .book-controls {
    margin: 0;
}

@media (max-width: 1100px) {
    #catalogModal .book-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    #catalogModal .catalog-filters {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 900px) {
    #catalogModal .catalog-grid {
        flex: none;
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        overflow: visible;
    }

    #catalogModal .catalog-filters legend {
        width: 100%;
    }
}

/* Pets, v3: tighter cards so an extra row fits; when the row is stretched to
   fill the panel, the portrait and info centre in the space above the buttons. */
.hb-pets .pet-inventory {
    gap: 8px;
}

.hb-pets .pet-card {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 5px 10px;
    padding: 8px 9px;
}

.hb-pets .pet-card .hb-pet-portrait {
    align-self: center;
    width: 68px;
    height: 68px;
}

.hb-pets .pet-card .hb-pet-portrait .pet-icon {
    width: 68px;
    height: 68px;
}

.hb-pets .pet-card .hb-pet-info {
    align-content: center;
    gap: 2px;
}

.hb-pets .pet-card .hb-pet-info strong {
    font-size: 0.9rem;
    line-height: 1.15;
}

.hb-pets .pet-card .hb-pet-info > span {
    font-size: 0.7rem;
    line-height: 1.2;
}

.hb-pets .pet-card .hb-pet-info .pet-xp {
    height: 5px;
    margin: 2px 0 3px;
}

.hb-pets .pet-card .hb-pet-info .buff-list span {
    font-size: 0.67rem;
    line-height: 1.22;
}

.hb-pets .pet-card .pet-actions {
    align-self: end;
}

.hb-pets .pet-card .pet-actions button {
    min-height: 30px;
}

/* Equipment, v3 */
.hb-inspector-card {
    position: relative;
}

.hb-inspector-close {
    position: absolute;
    top: -4px;
    right: -4px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    min-height: 0;
    padding: 0;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
}

.hb-gear-toolbar input[type="search"] {
    flex: 2 1 200px;
    min-width: 0;
}

.hb-gear-toolbar select {
    flex: 1 1 120px;
    width: auto;
    min-width: 0;
}

.hb-gear-toolbar .bulk-delete-group {
    flex: 1 1 220px;
    justify-content: flex-end;
}

.hb-gear-toolbar .bulk-delete-group select {
    flex: 1 1 auto;
}

.hb-gear .hb-gear-grid {
    grid-auto-rows: minmax(96px, auto);
}

@media (min-width: 901px) and (max-width: 1280px) {
    .hb-gear-layout {
        grid-template-columns: 240px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }

    .hb-gear-layout > .hb-doll {
        grid-column: 1;
        grid-row: 1 / 3;
        overflow-y: auto;
    }

    .hb-gear-layout > .hb-gear-main {
        grid-column: 2;
        grid-row: 1 / 3;
    }

    .hb-gear-layout > .hb-inspector {
        grid-column: 1;
        grid-row: 2;
        max-height: none;
    }

    .hb-gear-layout:has(.hb-inspector-card) > .hb-doll {
        grid-row: 1;
        overflow: visible;
    }

    .hb-gear-layout:has(.hb-inspector-card) .hb-gear-totals,
    .hb-gear-layout:not(:has(.hb-inspector-card)) > .hb-inspector {
        display: none;
    }
}

@media (min-width: 901px) and (max-height: 760px) {
    .hb-gear .hb-doll-grid {
        gap: 4px;
        padding: 6px;
    }

    .hb-gear .hb-socket {
        padding: 3px 4px;
    }

    .hb-gear .hb-socket-art {
        width: 26px;
        height: 26px;
    }

    .hb-doll-figure .fisher {
        max-height: 110px;
    }
}

.hb-gear .hb-gear-grid .hb-gear-tile {
    align-content: center;
    height: auto;
    min-height: 92px;
    padding: 8px 10px 22px;
}

.hb-gear-tile .hb-gear-art {
    align-self: center;
}

.hb-gear-tile .hb-gear-copy strong,
.hb-gear-tile .hb-gear-copy .buff-list span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.hb-gear-reforged {
    color: #fbbf24;
    font-size: 0.68rem;
    font-weight: 800;
}

/* Wider tiles keep names and buffs on one line each, so rows stay even. */
.hb-gear .hb-gear-grid {
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}

.hb-gear-tile .hb-gear-copy .buff-list span {
    font-size: 0.68rem;
}

.hb-gear .hb-gear-grid .hb-gear-tile {
    align-items: center;
}


/*==================================================
    Rail, v3: the label and its notice dot share a
    line; the rail compacts itself (script.js
    fitRail) before it ever needs to scroll.
==================================================*/

.ff-rail {
    position: relative;
}

.ff-rail button,
.ff-rail .menu-buttons button {
    display: block;
    text-align: center;
    white-space: normal;
}

.ff-rail button::before {
    display: block;
    margin: 0 auto 3px;
}

/* The active marker moves to a shadow so ::after is free for notice dots. */
.ff-rail button.active::after,
.ff-rail .menu-buttons button.active::after {
    content: none;
}

.ff-rail button.active,
.ff-rail .menu-buttons button.active {
    box-shadow: -7px 0 0 -4px var(--accent);
}

.ff-rail .menu-buttons #equipmentButton.has-new-equipment::after,
.ff-rail .menu-buttons #petsButton.has-new-pet::after,
.ff-rail .pond-menu-bar #achievementsButton.has-new-achievements::after,
.ff-rail .pond-menu-bar #catalogButton.has-new-catalog::after,
.ff-rail #equipmentButton.has-new-equipment::after,
.ff-rail #petsButton.has-new-pet::after {
    content: "";
    position: static;
    display: inline-block;
    width: 7px;
    height: 7px;
    margin: 0 0 0 3px;
    border-radius: 50%;
    background: #facc15;
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.75);
    vertical-align: 1px;
    transform: none;
}

.ff-rail .ff-dot {
    position: static;
    display: inline-block;
    width: 7px;
    height: 7px;
    margin: 0 0 0 3px;
    vertical-align: 1px;
    box-shadow: 0 0 6px var(--coral);
}

.ff-rail .ff-dot[hidden] {
    display: none;
}

.ff-rail .equipment-full-label {
    display: block;
    margin: 0;
}

/* Compact: smaller buttons when the window is short. */
.ff-rail.is-compact {
    gap: 2px;
    padding: 6px 5px;
}

.ff-rail.is-compact .ff-rail-group + .ff-rail-group {
    padding-top: 3px;
}

.ff-rail.is-compact button,
.ff-rail.is-compact .menu-buttons button {
    min-height: 32px;
    padding: 2px 2px 1px;
    font-size: 0.55rem;
    line-height: 1.05;
}

.ff-rail.is-compact button::before {
    width: 16px;
    height: 16px;
    margin-bottom: 1px;
}

/* Icons: shorter still, a two-column grid of icons with tooltips. */
.ff-rail.is-icons .ff-rail-group,
.ff-rail.is-icons .pond-menu-bar {
    grid-template-columns: 1fr 1fr;
}

.ff-rail.is-icons button,
.ff-rail.is-icons .menu-buttons button {
    position: relative;
    min-height: 36px;
    padding: 0;
    font-size: 0;
    line-height: 0;
}

.ff-rail.is-icons button::before {
    width: 19px;
    height: 19px;
    margin: 0 auto;
}

.ff-rail.is-icons .equipment-full-label {
    display: none;
}

.ff-rail.is-icons .menu-buttons #equipmentButton.has-new-equipment::after,
.ff-rail.is-icons .menu-buttons #petsButton.has-new-pet::after,
.ff-rail.is-icons .pond-menu-bar #achievementsButton.has-new-achievements::after,
.ff-rail.is-icons .pond-menu-bar #catalogButton.has-new-catalog::after,
.ff-rail.is-icons .ff-dot {
    position: absolute;
    top: 5px;
    right: 6px;
    margin: 0;
}

.ff-rail.is-icons button.active,
.ff-rail.is-icons .menu-buttons button.active {
    box-shadow: none;
}

/* Scroll cues: only when even the icon grid can't fit. */
.ff-rail-more {
    position: sticky;
    z-index: 2;
    display: none;
    flex: 0 0 auto;
    place-items: center;
    height: 22px;
    margin: 0 -6px;
    color: var(--accent);
    cursor: pointer;
}

.ff-rail-more::before {
    content: "";
    width: 12px;
    height: 12px;
    border-right: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
}

.ff-rail-more.up {
    top: -8px;
    margin-top: -8px;
    background: linear-gradient(180deg, var(--panel-solid, #0c1d2b) 40%, transparent);
}

.ff-rail-more.up::before {
    transform: translateY(3px) rotate(-135deg);
}

.ff-rail-more.down {
    bottom: -8px;
    margin-bottom: -8px;
    background: linear-gradient(0deg, var(--panel-solid, #0c1d2b) 40%, transparent);
}

.ff-rail.can-scroll-up .ff-rail-more.up,
.ff-rail.can-scroll-down .ff-rail-more.down {
    display: grid;
}

.ff-rail.can-scroll-down .ff-rail-more.down::before {
    animation: hb-rail-nudge 1.4s ease-in-out infinite;
}

@keyframes hb-rail-nudge {
    0%, 100% { transform: translateY(-3px) rotate(45deg); }
    50% { transform: translateY(0) rotate(45deg); }
}

/* Dock on narrow or zoomed windows: keep tackle and the Cast button side by
   side so Cast never drops below the fold. */
@media (min-width: 761px) and (max-width: 1100px) {
    .ff-dock {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
        gap: 8px;
    }

    .ff-dock .cast-control-row {
        gap: 6px;
        padding: 8px;
    }
}

@media (min-width: 761px) and (max-height: 620px) {
    .ff-dock-tackle {
        grid-template-areas:
            "bait lure"
            "buy buy";
        gap: 4px 8px;
        padding: 6px 10px 8px;
    }

    .ff-dock-tackle .ff-gear-row {
        display: none;
    }

    .ff-dock-tackle select {
        min-height: 30px;
    }

    .ff-dock-tackle .quick-buy-bait {
        min-height: 28px;
    }

    .ff-dock .cast-button,
    .ff-dock .storage-access-button {
        min-height: 50px;
    }

    .ff-dock .cast-control-row {
        padding: 6px;
    }
}


@media (min-width: 761px) and (max-height: 700px) {
    .ff-stage #pondScene {
        min-height: 180px;
    }
}

/* The fisher is posed every frame by fisher-art.js through SVG transform
   attributes; the old CSS keyframes set `transform` too and would win,
   pulling the body off its arms and the caught fish off the line. */
.fisher .fisher-figure,
.fisher .fisher-head,
.fisher .fisher-catch,
.pond-player .fisher .fisher-figure,
.pond-player .fisher .fisher-head,
.pond-player .fisher .fisher-catch {
    animation: none;
}

.fisher .fisher-catch {
    transition: opacity 0.2s ease;
}

.fisher-arm-far,
.fisher-front {
    pointer-events: none;
}

/* transform-origin also applies to SVG transform attributes, so reset the
   old origins on everything the driver positions. */
.fisher .fisher-figure,
.fisher .fisher-head,
.fisher .fisher-catch,
.fisher .fisher-bobber,
.fisher .fisher-rig > g,
.pond-player .fisher .fisher-catch,
.pond-player .fisher .fisher-figure {
    transform-origin: 0 0;
    transform-box: view-box;
}

.pond-player .fisher .fisher-bobber,
.pond-player .fisher .fisher-splash {
    animation: none;
}


/*==================================================
    Boss fights
==================================================*/

.ff-shell .pond-scene .boss-announcement {
    top: 14px;
    gap: 6px;
    min-width: 260px;
    padding: 10px 18px 12px;
    border: 1px solid rgba(248, 113, 113, 0.7);
    border-radius: var(--ff-r-lg, 18px);
    background:
        radial-gradient(120% 140% at 50% 0%, rgba(220, 38, 38, 0.3), transparent 60%),
        rgba(8, 16, 24, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 26px rgba(248, 113, 113, 0.25);
    animation: hb-boss-drop 0.45s cubic-bezier(.2, .9, .3, 1.3);
}

@keyframes hb-boss-drop {
    from { opacity: 0; transform: translate(-50%, -16px) scale(0.94); }
}

.boss-announcement-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}

.ff-shell .boss-announcement-timer {
    color: #fecaca;
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1;
}

.boss-announcement.imminent .boss-announcement-timer {
    color: #fff;
    animation: hb-boss-tick 0.5s ease-in-out infinite alternate;
}

@keyframes hb-boss-tick {
    to { color: #f87171; transform: scale(1.08); }
}

.boss-announcement-crew {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.boss-announcement-hint {
    max-width: 260px;
    color: #fde68a;
    font-size: 0.72rem;
    font-weight: 800;
}

.boss-announcement-hint[hidden] {
    display: none;
}

.ff-shell .boss-join-button {
    min-height: 32px;
    padding: 4px 22px;
    border: 0;
    background: linear-gradient(180deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 0.85rem;
    box-shadow: 0 6px 16px rgba(185, 28, 28, 0.45);
}

.ff-shell .boss-join-button:not(:disabled) {
    animation: hb-boss-join 1.1s ease-in-out infinite;
}

@keyframes hb-boss-join {
    50% { box-shadow: 0 6px 22px rgba(239, 68, 68, 0.8); transform: translateY(-1px); }
}

.ff-shell .boss-join-button:disabled {
    background: rgba(34, 197, 94, 0.22);
    color: #bbf7d0;
    box-shadow: none;
    opacity: 1;
}

.boss-announcement.late .boss-announcement-text {
    font-size: 0.85rem;
}

/* Boss tiers: the lure line and the midnight vote */
.boss-announcement-tier {
    color: #fde68a;
    font-size: 0.74rem;
    font-weight: 800;
}

.boss-announcement-tier[hidden],
.boss-vote[hidden] {
    display: none;
}

.boss-vote {
    display: grid;
    justify-items: center;
    gap: 5px;
}

.boss-vote-label {
    max-width: 280px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.boss-vote-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.ff-shell .boss-vote-button {
    position: relative;
    min-width: 38px;
    min-height: 30px;
    padding: 2px 8px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: var(--ff-r-md, 10px);
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.ff-shell .boss-vote-button:hover {
    background: rgba(185, 28, 28, 0.5);
}

.ff-shell .boss-vote-button.picked {
    border-color: #fde68a;
    background: linear-gradient(180deg, #ef4444, #b91c1c);
    color: #fff;
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
}

.boss-vote-button b {
    position: absolute;
    top: -7px;
    right: -6px;
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: var(--ff-r-pill, 999px);
    background: #fde68a;
    color: #422006;
    font-size: 0.6rem;
}

/* Fight card */
.ff-shell .pond-scene .boss-card {
    top: 14px;
    gap: 12px;
    min-width: min(420px, 70%);
    padding: 10px 14px;
    border: 1px solid rgba(248, 113, 113, 0.6);
    border-radius: var(--ff-r-lg, 18px);
    background: rgba(8, 16, 24, 0.88);
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.boss-card.enraged {
    border-color: #ef4444;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 30px rgba(239, 68, 68, 0.5);
}

.ff-shell .boss-card .boss-image {
    width: 48px;
    height: 48px;
    border-radius: var(--ff-r-lg, 14px);
}

.ff-shell .boss-card .boss-info {
    flex: 1;
    gap: 5px;
    min-width: 180px;
}

.boss-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.ff-shell .boss-card .boss-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 1rem;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.boss-tier-badge {
    --tc: #94a3b8;
    flex: none;
    padding: 1px 7px;
    border: 1px solid color-mix(in srgb, var(--tc) 70%, transparent);
    border-radius: var(--ff-r-pill, 999px);
    background: color-mix(in srgb, var(--tc) 22%, transparent);
    color: var(--tc);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.boss-tier-badge[hidden] {
    display: none;
}

.boss-tier-badge[data-tier="2"] { --tc: #4ade80; }
.boss-tier-badge[data-tier="3"] { --tc: #38bdf8; }
.boss-tier-badge[data-tier="4"] { --tc: #c084fc; }
.boss-tier-badge[data-tier="5"] { --tc: #fbbf24; }

.boss-swarm {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    color: #a5f3fc;
    font-size: 0.64rem;
    font-weight: 900;
}

.boss-swarm[hidden],
.boss-shield[hidden] {
    display: none;
}

.boss-swarm-bar {
    height: 7px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(8, 145, 178, 0.25);
    overflow: hidden;
}

.boss-swarm-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #06b6d4, #a5f3fc);
    transition: width 0.18s ease;
}

.boss-shield {
    overflow: hidden;
    color: #fde68a;
    font-size: 0.66rem;
    font-weight: 900;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.boss-card.shielded {
    border-color: #facc15;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 24px rgba(250, 204, 21, 0.45);
}

.boss-card.shielded .boss-health-fill {
    background: linear-gradient(90deg, #a16207, #facc15);
}

.boss-card.enraged .boss-name::after {
    content: " ENRAGED";
    color: #f87171;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.ff-shell .boss-card .boss-timer {
    font-size: 0.85rem;
}

.ff-shell .boss-card .boss-timer.low {
    color: #f87171;
    animation: hb-boss-tick 0.5s ease-in-out infinite alternate;
}

.ff-shell .boss-card .boss-health-bar {
    height: 14px;
    overflow: hidden;
}

.boss-health-text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 900;
    text-shadow: 0 1px 2px #000;
}

.boss-you {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.boss-you b {
    color: var(--text);
}

.boss-you-bar {
    position: relative;
    height: 5px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Where Bronze and Silver fall on the way to Gold. */
.boss-medal-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: rgba(255, 255, 255, 0.55);
}

.boss-you-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #5eead4);
    transition: width 0.2s ease;
}

.boss-card.reward-earned .boss-you-bar i {
    background: linear-gradient(90deg, #facc15, #fde68a);
}

.boss-card.reward-earned .boss-you {
    color: #fde68a;
}

.boss-card[data-medal="bronze"] .boss-you-bar i {
    background: linear-gradient(90deg, #b45309, #f59e0b);
}

.boss-card[data-medal="bronze"] .boss-you {
    color: #fdba74;
}

.boss-card[data-medal="silver"] .boss-you-bar i {
    background: linear-gradient(90deg, #94a3b8, #e2e8f0);
}

.boss-card[data-medal="silver"] .boss-you {
    color: #e2e8f0;
}

/* Ink Cloud (Tier 2+): the zones vanish under ink for a moment. */
.minigame.boss-ink .green-zone,
.minigame.boss-ink .gold-zone,
.minigame.boss-ink .perfect-zone {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.minigame.boss-mode .minigame-track::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at 50% 50%, rgba(15, 23, 42, 0.92), rgba(30, 27, 75, 0.75) 60%, transparent 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.minigame.boss-mode.boss-ink .minigame-track::after {
    opacity: 1;
}

/* Riptide (Tier 5): a flash as the needle turns. */
.catch-needle.riptide {
    animation: hb-riptide 0.4s ease-out;
}

@keyframes hb-riptide {
    from { box-shadow: 0 0 16px 4px #22d3ee; }
}

.boss-damage-floater.blocked {
    color: #fde68a;
    text-shadow: 0 0 6px rgba(250, 204, 21, 0.7);
}

.boss-board {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 0 0 0 10px;
    border-left: 1px solid var(--line);
    list-style: none;
    min-width: 110px;
}

.boss-board:empty {
    display: none;
}

.boss-board li {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 800;
}

.boss-board li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.boss-board li i {
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--player-color, #38bdf8);
    color: #021018;
    font-size: 0.6rem;
    font-style: normal;
}

.boss-board li.me {
    color: var(--accent);
}

.ff-shell .boss-arrived-popup {
    top: 36%;
    border-radius: var(--ff-r-lg, 18px);
    font-family: var(--font-display);
    background: rgba(8, 16, 24, 0.9);
}

.ff-shell .boss-arrived-popup.enraged {
    border-color: #ef4444;
    color: #fecaca;
    background: rgba(69, 10, 10, 0.92);
}

.boss-damage-floater.combo {
    color: #5eead4;
    text-shadow: 0 0 8px rgba(94, 234, 212, 0.8);
}

/* The minigame bar in boss mode */
.minigame.boss-mode {
    border-color: rgba(248, 113, 113, 0.55);
    box-shadow: 0 0 24px rgba(248, 113, 113, 0.25);
}

.pond-scene.boss-enraged .minigame.boss-mode {
    border-color: #ef4444;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

.pond-scene.boss-active::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(120% 90% at 50% 70%, transparent 55%, rgba(127, 29, 29, 0.28));
    pointer-events: none;
}

.pond-scene.boss-enraged::after {
    background: radial-gradient(120% 90% at 50% 70%, transparent 45%, rgba(185, 28, 28, 0.4));
    animation: hb-boss-throb 1.2s ease-in-out infinite alternate;
}

@keyframes hb-boss-throb {
    to { opacity: 0.6; }
}

/* Cast button while the boss is seconds away */
.ff-dock .cast-button.boss-locked {
    background: linear-gradient(180deg, #7f1d1d, #450a0a);
    color: #fecaca;
    opacity: 1;
    cursor: wait;
}

.ff-dock .cast-button[data-cast-state="boss"] {
    background: linear-gradient(180deg, #ef4444, #991b1b);
    color: #fff;
    box-shadow: 0 0 26px rgba(239, 68, 68, 0.45);
}

/* The boss in the water */
.hb-boss-sprite {
    position: absolute;
    left: 58%;
    bottom: 24%;
    z-index: 4;
    width: clamp(120px, 22%, 260px);
    aspect-ratio: 200 / 170;
    transform: translateX(-50%);
    pointer-events: none;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.35));
}

.hb-boss-sprite[hidden] {
    display: none;
}

.hb-boss-sprite svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.hb-boss-sprite .hb-boss-body {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: hb-boss-idle 2.4s ease-in-out infinite;
}

.hb-boss-sprite.rising {
    animation: hb-boss-rise 1.1s cubic-bezier(.2, .9, .3, 1.15);
}

@keyframes hb-boss-rise {
    from { opacity: 0; transform: translate(-50%, 55%); }
    60% { opacity: 1; }
}

@keyframes hb-boss-idle {
    50% { transform: translateY(4px) rotate(-1.5deg); }
}

.hb-boss-sprite .hb-boss-foam {
    transform-box: fill-box;
    transform-origin: center;
    animation: hb-boss-foam 1.6s ease-in-out infinite alternate;
}

@keyframes hb-boss-foam {
    to { transform: scaleX(1.06); opacity: 0.8; }
}

.hb-boss-sprite.hit svg,
.hb-boss-sprite.hit-big svg {
    filter: brightness(1.8) saturate(0.6);
}

.hb-boss-sprite.hit .hb-boss-body {
    animation: hb-boss-hit 0.36s ease-out;
}

.hb-boss-sprite.hit-big .hb-boss-body {
    animation: hb-boss-hit-big 0.36s ease-out;
}

@keyframes hb-boss-hit {
    30% { transform: translate(6px, 2px) rotate(3deg); }
    60% { transform: translate(-4px, 0) rotate(-2deg); }
}

@keyframes hb-boss-hit-big {
    25% { transform: translate(10px, 4px) rotate(6deg) scale(0.96); }
    55% { transform: translate(-7px, 0) rotate(-4deg); }
}

.hb-boss-sprite.taunt .hb-boss-body {
    animation: hb-boss-taunt 0.7s ease-in-out;
}

@keyframes hb-boss-taunt {
    30% { transform: translateY(-8px) scale(1.04); }
}

.hb-boss-sprite.enraged {
    --boss-eye: #ef4444;
}

.hb-boss-sprite.enraged .hb-boss-body > path:first-child {
    fill: #5b1d24;
}

.hb-boss-sprite.enraged .hb-boss-eyes {
    filter: drop-shadow(0 0 6px #ef4444);
}

.hb-boss-sprite.roar .hb-boss-body {
    animation: hb-boss-roar 0.9s ease-in-out;
}

@keyframes hb-boss-roar {
    20%, 60% { transform: translateY(-10px) scale(1.08) rotate(-3deg); }
    40%, 80% { transform: translateY(-10px) scale(1.08) rotate(3deg); }
}

.hb-boss-sprite.sinking {
    animation: hb-boss-sink 1.5s ease-in forwards;
}

@keyframes hb-boss-sink {
    20% { transform: translate(-50%, -6%) rotate(-6deg); }
    to { opacity: 0; transform: translate(-50%, 70%) rotate(14deg); }
}

.hb-boss-sprite.diving {
    animation: hb-boss-dive 1.2s ease-in forwards;
}

@keyframes hb-boss-dive {
    to { opacity: 0; transform: translate(-50%, 60%) scaleY(0.8); }
}

/* Result card */
.hb-boss-result {
    --rc: #f87171;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.hb-boss-result.won {
    --rc: #facc15;
}

.hb-boss-result-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: var(--ff-r-lg, 16px);
    background: radial-gradient(circle, color-mix(in srgb, var(--rc) 35%, transparent), rgba(255, 255, 255, 0.04) 70%);
    color: var(--rc);
    font-size: 1.9rem;
}

.hb-boss-result-board {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0 0 0 12px;
    border-left: 1px solid var(--line);
    list-style: none;
    font-size: 0.72rem;
    font-weight: 800;
}

.hb-boss-result-board li i {
    margin-right: 4px;
    color: var(--muted);
    font-style: normal;
}

.hb-boss-result-board li.me {
    color: var(--accent);
}

.hb-tag.pearl {
    background: rgba(233, 213, 255, 0.22);
    color: #f3e8ff;
}

.hb-tag.boss-medal.bronze {
    background: rgba(245, 158, 11, 0.22);
    color: #fdba74;
}

.hb-tag.boss-medal.silver {
    background: rgba(226, 232, 240, 0.2);
    color: #f1f5f9;
}

.hb-tag.boss-medal.gold {
    background: rgba(250, 204, 21, 0.25);
    color: #fde68a;
}

.hb-tag.boss-herb {
    background: rgba(45, 212, 191, 0.2);
    color: #99f6e4;
}

.hb-tag.boss-herb.key {
    box-shadow: inset 0 0 0 1px #5eead4;
}

.hb-tag.boss-unlock {
    background: rgba(248, 113, 113, 0.25);
    color: #fecaca;
}

.hb-tag.boss-recipe {
    background: rgba(192, 132, 252, 0.22);
    color: #e9d5ff;
}

@media (max-width: 760px) {
    .ff-shell .pond-scene .boss-card {
        min-width: 0;
        width: calc(100% - 20px);
    }

    .boss-board {
        display: none;
    }

    /* A boss result lists its rewards in full, past the usual one-line cap. */
    .fish-room-active .ff-shell .pond-scene .result-banner:has(.hb-boss-result) {
        max-height: none;
    }

    .hb-boss-result {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 6px 10px;
    }

    .hb-boss-result-icon {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }

    .hb-boss-result-board {
        display: none;
    }
}

/* Short screens: the leaderboard gives its room to the bars, which keep
   the card clear of the needle. */
@media (max-height: 560px) {
    .boss-board {
        display: none;
    }

    .ff-shell .pond-scene .boss-card {
        padding: 7px 12px;
    }

    .ff-shell .boss-card .boss-info {
        gap: 3px;
    }
}

.hb-stat-row.long {
    grid-template-columns: minmax(0, 1fr);
}

.hb-stat-row.long b {
    font-size: 0.8rem;
    line-height: 1.35;
    text-align: left;
    overflow-wrap: break-word;
}

/* Keep each label and its dot on one line. */
.ff-rail button,
.ff-rail .menu-buttons button {
    white-space: nowrap;
    letter-spacing: -0.01em;
}

@media (max-width: 900px) {
    #catalogModal > .book-modal.catalog-modal > * {
        flex: none;
    }

    #catalogModal .catalog-search-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 12px;
    }

    #catalogModal .catalog-search {
        display: flex;
        grid-column: 1 / -1;
        width: 100%;
    }

    #catalogModal .catalog-filters fieldset {
        min-height: 0;
    }
}


/*==================================================
    Overclocking: the parts grid fills the book.
==================================================*/

#overclockModal > .book-modal.overclock-modal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(1100px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100dvh - 24px);
    max-height: none;
    overflow-y: auto;
}

#overclockModal .book-header {
    margin: 0;
}

#overclockModal .book-header p {
    margin: 4px 0 0;
}

/* The ladder of rarities on the left, rules and overclocked gear beside it. */
.hb-oc-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
}

.hb-oc-ladder-wrap {
    min-height: 0;
    overflow-y: auto;
}

.hb-oc-ladder {
    display: grid;
    gap: 6px;
    counter-reset: oc;
}

.hb-oc-row {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, var(--rc, #64748b) 45%, transparent);
    border-radius: var(--ff-r-lg, 14px);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--rc, #64748b) 14%, transparent), transparent 55%),
        var(--hb-card);
}

/* The merge path: a short connector from each rung to the next. */
.hb-oc-row:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 33px;
    bottom: -8px;
    width: 2px;
    height: 10px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--rc, #64748b) 60%, transparent);
}

.hb-oc-row.empty {
    border-color: var(--line);
    background: var(--hb-card);
}

.hb-oc-row.empty .hb-oc-art {
    opacity: 0.35;
    filter: grayscale(1);
}

.hb-oc-row .hb-oc-copy strong {
    color: var(--rc);
}

.hb-oc-row.empty .hb-oc-copy strong {
    color: var(--muted);
}

.hb-oc-count {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-width: 46px;
}

.hb-oc-count b {
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.hb-oc-row.empty .hb-oc-count b {
    color: var(--muted);
}

.hb-oc-pips {
    display: flex;
    gap: 3px;
}

.hb-oc-pips i {
    width: 8px;
    height: 8px;
    border: 1px solid color-mix(in srgb, var(--rc, #64748b) 70%, transparent);
    border-radius: 50%;
}

.hb-oc-pips i.on {
    background: var(--rc);
}

.hb-oc-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hb-oc-actions button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.hb-oc-actions button span {
    font-weight: 900;
}

.hb-oc-actions button small {
    color: var(--muted);
    font-size: 0.72rem;
}

.hb-oc-actions .hb-oc-apply:not(:disabled) {
    border-color: color-mix(in srgb, var(--rc) 70%, transparent);
    background: color-mix(in srgb, var(--rc) 16%, var(--panel-2));
}

.hb-oc-max {
    padding: 0 8px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.hb-oc-empty {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

.hb-oc-side {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
}

.hb-oc-rules,
.hb-oc-done {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 14px);
    background: var(--hb-card);
}

.hb-oc-side h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.hb-oc-side h3 span {
    padding: 1px 8px;
    border-radius: var(--ff-r-pill, 999px);
    background: var(--panel-2);
    color: var(--muted);
    font-size: 0.75rem;
}

.hb-oc-rules p {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.hb-oc-rules p b {
    color: var(--text);
}

.hb-oc-rules .overclock-warning {
    margin: 8px 0 0;
    padding: 6px 8px;
    border-radius: var(--ff-r-md, 8px);
    background: rgba(251, 113, 133, 0.1);
}

.hb-oc-done {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hb-oc-done-list {
    display: grid;
    gap: 4px;
    min-height: 0;
    overflow-y: auto;
}

.hb-oc-done-item {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: var(--ff-r-md, 8px);
    background: color-mix(in srgb, var(--rc) 9%, transparent);
}

.hb-oc-done-art {
    width: 26px;
    height: 26px;
}

.hb-oc-done-art svg {
    width: 100%;
    height: 100%;
}

.hb-oc-done-item strong {
    overflow: hidden;
    color: var(--rc);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .hb-oc-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .hb-oc-row {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 8px 10px;
    }

    .hb-oc-row .hb-oc-art {
        width: 38px;
        height: 38px;
    }

    .hb-oc-actions {
        grid-column: 1 / -1;
    }

    .hb-oc-actions button {
        flex: 1;
    }

    .hb-oc-row:not(:last-child)::after {
        display: none;
    }
}

.hb-oc-part {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: 8px 10px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--rc, #64748b) 50%, transparent);
    border-radius: var(--ff-r-lg, 16px);
    background:
        radial-gradient(140px 90px at 0% 0%, color-mix(in srgb, var(--rc, #64748b) 18%, transparent), transparent 70%),
        var(--hb-card);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.hb-oc-part:hover {
    border-color: var(--rc);
    transform: translateY(-1px);
}

.hb-oc-part.overclock-part-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.45);
}

.hb-oc-art {
    width: 46px;
    height: 46px;
}

.hb-oc-art svg {
    width: 100%;
    height: 100%;
}

.hb-oc-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.hb-oc-copy strong {
    color: var(--rc, var(--text));
    font-size: 0.95rem;
}

.hb-oc-copy small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.hb-oc-part > button {
    grid-column: 1 / -1;
    min-height: 32px;
    font-size: 0.8rem;
}

.hb-oc-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
}

.hb-oc-check::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 4px;
    height: 8px;
    border-right: 2px solid #022c26;
    border-bottom: 2px solid #022c26;
    transform: rotate(45deg);
}

#overclockModal .book-controls {
    margin: 0;
}

@media (max-width: 900px) {
    #overclockModal #overclockPartsGrid {
        flex: none;
        overflow: visible;
    }
}

.hb-pets .pet-card .hb-pet-info strong,
.hb-pets .pet-card .hb-pet-info .buff-list span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

/* Short windows: a slimmer companion strip so at least two rows of pets fit. */
@media (min-width: 901px) and (max-height: 760px) {
    .hb-pets .pet-overview {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        gap: 8px;
        margin-bottom: 8px;
    }

    .hb-pets .pet-equipped {
        gap: 10px;
        padding: 8px 12px;
    }

    .hb-pets .hb-pet-habitat {
        width: 60px;
        height: 60px;
    }

    .hb-pets .hb-pet-habitat .pet-icon {
        width: 52px;
        height: 52px;
    }

    .hb-pets .hb-pet-habitat .hb-pet-level {
        min-width: 22px;
        height: 22px;
        font-size: 0.66rem;
    }

    .hb-pets .hb-pet-hero-copy > span,
    .hb-pets .hb-pet-hero-copy > div:not(:first-child),
    .hb-pets .hb-pet-hero-copy > p,
    .hb-pets .hb-pet-hero-copy .buff-list {
        display: none;
    }

    .hb-pets .hb-pet-hero-copy strong {
        font-size: 1.1rem;
    }

    .hb-pets .pet-toolbar {
        gap: 6px;
        padding: 6px 10px;
    }

    .hb-pets .pet-toolbar .hb-chip-filter button {
        min-height: 24px;
        padding: 0 8px;
        font-size: 0.68rem;
    }

    .hb-pets .pet-toolbar input,
    .hb-pets .pet-toolbar select {
        min-height: 30px;
    }

    .hb-pets > .book-header p,
    .hb-pets .book-header p {
        display: none;
    }
}

@media (min-width: 901px) and (max-height: 760px) {
    .hb-pets .hb-pet-hero-copy > :not(strong):not(small) {
        display: none;
    }

    .hb-pets .hb-pet-hero-copy small {
        font-size: 0.75rem;
    }
}


/*==================================================
    Aquarium, v3: a display tank with depth
==================================================*/

.hb-aquarium .aquarium-tank {
    border: 0;
    border-radius: var(--ff-r-md, 10px);
    box-shadow:
        0 0 0 3px #0b1620,
        0 0 0 7px #1f3446,
        0 0 0 9px #0b1620,
        0 22px 44px rgba(0, 0, 0, 0.5);
    isolation: isolate;
}

.aquarium-tank[data-theme] {
    background:
        radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--tank-top) 80%, #fff) 0%, transparent 55%),
        linear-gradient(180deg, var(--tank-top), var(--tank-mid) 50%, var(--tank-deep));
}

.aquarium-tank .hb-tank-backdrop {
    z-index: 0;
    opacity: 0.85;
}

/* Collection backdrops sit far back, softened by the water. */
.hb-tank-sets {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hb-set-art {
    filter: saturate(0.75) brightness(0.88);
    opacity: 0.82;
}

.hb-sway {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: hb-tank-sway 5.5s ease-in-out infinite;
    animation-delay: var(--sway-delay, 0s);
}

@keyframes hb-tank-sway {
    50% { transform: rotate(4deg); }
}

.hb-wreck-light {
    animation: hb-tank-flicker 3.2s ease-in-out infinite;
}

@keyframes hb-tank-flicker {
    40% { opacity: 0.35; }
    45% { opacity: 0.9; }
}

.hb-ruin-runes path {
    filter: drop-shadow(0 0 6px #5eead4);
    animation: hb-tank-rune 2.8s ease-in-out infinite alternate;
}

@keyframes hb-tank-rune {
    to { opacity: 0.45; }
}

/* Distance haze over the back row. */
.aquarium-tank .hb-tank-haze {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    height: 62%;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--tank-deep) 38%, transparent) 70%, transparent);
    pointer-events: none;
}

.aquarium-tank .hb-tank-rays {
    z-index: 3;
}

.aquarium-tank .hb-tank-caustics {
    z-index: 5;
}

/* Gravel bed */
#aquariumTank .hb-tank-floor {
    display: none;
}

.hb-tank-substrate {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    width: 100%;
    height: 27%;
    pointer-events: none;
}

/* Decorations: sized by row, back row hazed by distance. */
.aquarium-tank .hb-decor {
    width: auto;
    aspect-ratio: 1;
    filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.28));
    pointer-events: auto;
}

.aquarium-tank .hb-decor svg {
    display: block;
    width: 100%;
    height: 100%;
}

.aquarium-tank .hb-decor[data-row="2"] {
    filter: saturate(0.72) brightness(0.86) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.2));
}

.aquarium-tank .hb-decor[data-row="1"] {
    filter: saturate(0.9) brightness(0.95) drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}

.aquarium-tank .hb-decor[data-row="0"] {
    filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.32));
}

/* Fish swim between the middle and front rows. */
.aquarium-tank .aquarium-fish {
    z-index: 6;
}

.aquarium-tank .hb-tank-bubbles i {
    z-index: 7;
    bottom: 12%;
}

.hb-tank-bubbles {
    position: absolute;
    inset: 0;
    z-index: 7;
    pointer-events: none;
}

/* Glow collection: drifting motes and a softer, darker water tint. */
.hb-tank-motes {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.hb-tank-motes i {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: calc(5px * var(--s));
    height: calc(5px * var(--s));
    border-radius: 50%;
    background: #a5f3fc;
    box-shadow: 0 0 8px 2px rgba(103, 232, 249, 0.75);
    animation: hb-tank-mote var(--d) ease-in-out infinite;
    animation-delay: var(--delay);
}

.hb-tank-motes i:nth-child(3n) {
    background: #f0abfc;
    box-shadow: 0 0 8px 2px rgba(240, 171, 252, 0.7);
}

.hb-tank-motes i:nth-child(4n) {
    background: #fde68a;
    box-shadow: 0 0 8px 2px rgba(253, 230, 138, 0.7);
}

@keyframes hb-tank-mote {
    0%, 100% { opacity: 0.2; transform: translate(0, 0); }
    50% { opacity: 1; transform: translate(14px, -18px); }
}

.aquarium-tank[data-glow="2"]::after,
.aquarium-tank[data-glow="3"]::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    background: radial-gradient(80% 60% at 50% 60%, rgba(103, 232, 249, 0.12), transparent 70%);
    pointer-events: none;
}

/* Reef collection complete: a small school of reef fish. */
.hb-tank-school {
    position: absolute;
    left: 0;
    top: 30%;
    z-index: 5;
    width: 120px;
    height: 50px;
    animation: hb-tank-school 26s linear infinite;
    pointer-events: none;
}

.hb-tank-school i {
    position: absolute;
    left: calc(var(--o) * 15px);
    top: calc(mod(var(--o) * 13, 40) * 1px);
    width: 14px;
    height: 8px;
    border-radius: 60% 40% 40% 60%;
    background: linear-gradient(90deg, #fb923c 60%, #fff 60% 72%, #fb923c 72%);
    animation: hb-tank-dart 1.6s ease-in-out infinite;
    animation-delay: calc(var(--o) * -0.23s);
}

.hb-tank-school i::after {
    content: "";
    position: absolute;
    left: -5px;
    top: 1px;
    border: 3px solid transparent;
    border-right: 5px solid #fb923c;
}

@keyframes hb-tank-school {
    0% { transform: translate(-140px, 0); }
    48% { transform: translate(calc(100cqw + 20px), 30px) scaleX(1); }
    50% { transform: translate(calc(100cqw + 20px), 30px) scaleX(-1); }
    98% { transform: translate(-140px, -10px) scaleX(-1); }
    100% { transform: translate(-140px, 0) scaleX(1); }
}

@keyframes hb-tank-dart {
    50% { transform: translate(3px, -3px); }
}

.hb-aquarium .aquarium-tank {
    container-type: inline-size;
}

/* Frame: hood light, waterline, stand. */
.hb-tank-hood {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 31;
    height: 16px;
    background: linear-gradient(180deg, #2b3d4d, #0f1b25);
    box-shadow: 0 2px 0 rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.hb-tank-hood i {
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: -2px;
    height: 3px;
    border-radius: 3px;
    background: #fdf6d8;
    box-shadow: 0 0 14px 4px rgba(253, 246, 216, 0.55), 0 8px 40px 14px rgba(253, 246, 216, 0.18);
}

.hb-tank-waterline {
    position: absolute;
    left: 0;
    right: 0;
    top: 26px;
    z-index: 29;
    height: 8px;
    background:
        radial-gradient(ellipse 20px 4px at 10px 4px, rgba(255, 255, 255, 0.35), transparent) 0 0 / 40px 8px repeat-x;
    opacity: 0.7;
    animation: hb-tank-ripple 6s linear infinite;
    pointer-events: none;
}

@keyframes hb-tank-ripple {
    to { background-position-x: 40px; }
}

.hb-tank-stand {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 31;
    height: 12px;
    background: linear-gradient(180deg, #0f1b25, #22384a 60%, #0f1b25);
    pointer-events: none;
}

.aquarium-tank .hb-tank-glass {
    background:
        linear-gradient(105deg, transparent 6%, rgba(255, 255, 255, 0.1) 8%, transparent 13%),
        linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, 0.05) 16%, transparent 19%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 20%);
}

.aquarium-tank.arranging .hb-decor {
    outline-offset: 0;
}

.aquarium-tank .hb-arrange-hint {
    position: absolute;
    left: 50%;
    top: 26px;
    z-index: 32;
    padding: 6px 14px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(8, 16, 24, 0.85);
    color: #fde68a;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

/* Aquarium shop: collections */
.hb-collection {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 14px;
    margin-top: 6px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 14px);
    background: linear-gradient(90deg, rgba(94, 234, 212, 0.1), transparent 60%), var(--hb-card);
}

.hb-collection h4 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.hb-collection p {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.hb-collection-pips {
    display: flex;
    gap: 4px;
}

.hb-collection-pips i {
    width: 10px;
    height: 10px;
    border: 1px solid rgba(94, 234, 212, 0.6);
    border-radius: 50%;
}

.hb-collection-pips i.on {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

.hb-collection.complete {
    border-color: rgba(250, 204, 21, 0.6);
    background: linear-gradient(90deg, rgba(250, 204, 21, 0.14), transparent 60%), var(--hb-card);
}

.hb-collection.complete .hb-collection-pips i.on {
    background: #facc15;
    border-color: #facc15;
    box-shadow: 0 0 6px #facc15;
}

.hb-collection-stage {
    grid-column: 2 / -1;
    color: #a5f3fc;
    font-size: 0.78rem;
    font-weight: 800;
}

/* Stacking: sets 1, gravel 2, back row 3, haze 4, middle row 5,
   light 6, fish 7, bubbles and motes 8, front row 9. */
.hb-tank-substrate { z-index: 2; }
.aquarium-tank .hb-tank-haze { z-index: 4; height: 70%; }
.aquarium-tank .hb-tank-rays,
.aquarium-tank .hb-tank-caustics { z-index: 6; }
.aquarium-tank .aquarium-fish { z-index: 7; }
.hb-tank-bubbles,
.hb-tank-motes,
.hb-tank-school { z-index: 8; }
.aquarium-tank[data-glow="2"]::after,
.aquarium-tank[data-glow="3"]::after { z-index: 6; }

.aquarium-tank[data-theme="lagoon"] { --rock: #6e7f86; }
.aquarium-tank[data-theme="kelp"] { --rock: #4e5a45; }
.aquarium-tank[data-theme="reef"] { --rock: #b08a6a; }
.aquarium-tank[data-theme="temple"] { --rock: #6b7065; }
.aquarium-tank[data-theme="glacier"] { --rock: #9fb3c8; }
.aquarium-tank[data-theme="abyss"] { --rock: #273244; }

.hb-hardscape {
    filter: brightness(0.92);
}

.hb-aqshop .hb-theme-swatch.aquarium-tank {
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--ff-r-md, 8px);
    box-shadow: 0 0 0 3px #0b1620, 0 0 0 5px #1f3446;
}

.hb-theme-swatch .hb-tank-hood {
    height: 8px;
}

.hb-theme-swatch .hb-tank-stand {
    height: 6px;
}

.hb-theme-swatch .hb-tank-waterline {
    display: none;
}

.hb-aqshop .aquarium-shop-list[data-tab="themes"] {
    grid-auto-rows: min-content;
}

#aquariumShopModal .hb-theme-swatch.aquarium-tank {
    flex: none;
    width: 100%;
    height: 130px;
    min-height: 0;
    max-height: 130px;
    aspect-ratio: auto;
}

/* The old zig-zag sand floor (style.css pseudo-elements) is replaced by the
   gravel bed. The glow tint reuses ::after with its own settings. */
.aquarium-tank::before,
.aquarium-tank::after {
    content: none;
}

.aquarium-tank[data-glow="2"]::after,
.aquarium-tank[data-glow="3"]::after {
    content: "";
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    clip-path: none;
}

.aquarium-tank.arranging::before {
    content: none;
}


/*==================================================
    Ultimate: the one off-catalog fish.
==================================================*/

.rarity-ultimate {
    --rc: #fde68a;
    background: linear-gradient(90deg, #fde68a, #f0abfc, #a5f3fc, #bbf7d0, #fde68a);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    font-weight: 900;
    animation: hb-ultimate-flow 3.2s linear infinite;
}

@keyframes hb-ultimate-flow {
    to { background-position: 300% 0; }
}

.fish-icon.rarity-ultimate {
    position: relative;
    background: none;
    color: inherit !important;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    animation: none;
    isolation: isolate;
}

/* A slow prismatic halo behind the sprite. */
.fish-icon.rarity-ultimate::before {
    content: "";
    position: absolute;
    inset: 4%;
    z-index: -1;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #fde68a, #f0abfc, #a5f3fc, #bbf7d0, #fde68a);
    filter: blur(6px);
    opacity: 0.75;
    animation: hb-ultimate-spin 6s linear infinite;
}

.fish-icon.rarity-ultimate .fish-icon-image {
    filter:
        drop-shadow(0 0 2px #fff)
        drop-shadow(0 0 6px rgba(253, 230, 138, 0.9))
        saturate(1.25);
}

@keyframes hb-ultimate-spin {
    to { transform: rotate(360deg); }
}

.catalog-card.hb-cat-ultimate {
    border-color: #fde68a;
    background:
        radial-gradient(240px 140px at 0% 0%, rgba(253, 230, 138, 0.2), transparent 70%),
        radial-gradient(240px 140px at 100% 100%, rgba(240, 171, 252, 0.16), transparent 70%),
        var(--hb-card, #0f2433);
    box-shadow: 0 0 0 1px rgba(253, 230, 138, 0.35), 0 0 22px rgba(240, 171, 252, 0.2);
}

.hb-cat-anything {
    padding: 2px 8px;
    border: 1px solid rgba(253, 230, 138, 0.5);
    border-radius: var(--ff-r-pill, 999px);
    color: #fde68a;
    font-size: 0.7rem;
    font-weight: 800;
}

/* The pond banner when it's landed. */
.hb-ultimate-banner {
    position: absolute;
    left: 50%;
    top: 34%;
    z-index: 40;
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 16px 28px 14px;
    border: 2px solid #fde68a;
    border-radius: var(--ff-r-lg, 18px);
    background:
        radial-gradient(circle at 50% 0%, rgba(253, 230, 138, 0.3), transparent 70%),
        rgba(8, 16, 28, 0.92);
    box-shadow: 0 0 40px rgba(253, 230, 138, 0.45), 0 0 90px rgba(240, 171, 252, 0.25);
    text-align: center;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: hb-ultimate-banner 7s ease forwards;
}

.hb-ultimate-banner img {
    width: 96px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px #fde68a);
}

.hb-ultimate-banner strong {
    background: linear-gradient(90deg, #fde68a, #f0abfc, #a5f3fc, #bbf7d0, #fde68a);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: var(--font-display, sans-serif);
    font-size: clamp(1.3rem, 3vw, 2.2rem);
    letter-spacing: 0.06em;
    animation: hb-ultimate-flow 2.4s linear infinite;
}

.hb-ultimate-banner small {
    color: #e0f2fe;
    font-weight: 800;
}

@keyframes hb-ultimate-banner {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.6); }
    8% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
    14% { transform: translate(-50%, -50%) scale(1); }
    88% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -56%) scale(0.98); }
}

/* The name floating over the fisher: keep its float-away animation and swap
   the text shadow (which muddies gradient text) for a drop shadow. */
.pond-catch-effect.rarity-ultimate {
    text-shadow: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.95));
    animation:
        pond-catch-float 2.1s ease-out forwards,
        hb-ultimate-flow 3.2s linear infinite;
}


/*==================================================
    Equipment loadouts, under the paper doll.
==================================================*/

.hb-loadouts {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 14px);
    background: var(--hb-card);
}

.hb-loadouts header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.hb-loadouts h4 {
    margin: 0;
    color: var(--accent);
    font-size: 0.85rem;
}

.hb-loadouts header small {
    color: var(--muted);
    font-size: 0.7rem;
}

.hb-loadout-chips {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
}

.hb-loadout-chip {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 1px;
    min-width: 0;
    min-height: 0;
    padding: 4px 3px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 9px);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: none;
}

.hb-loadout-chip b {
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1;
}

.hb-loadout-chip span {
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-loadout-chip.empty {
    border-style: dashed;
}

.hb-loadout-chip.empty b {
    color: var(--muted);
}

.hb-loadout-chip.selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}

/* The set you're wearing right now. */
.hb-loadout-chip.worn::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80;
}

.hb-loadout-items {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
}

.hb-loadout-item {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 7px);
    background: rgba(5, 18, 28, 0.6);
    color: var(--muted);
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 900;
}

.hb-loadout-item svg {
    width: 80%;
    height: 80%;
}

.hb-loadout-item.none {
    border-style: dashed;
    opacity: 0.5;
}

.hb-loadout-item.missing {
    border-color: rgba(251, 113, 133, 0.6);
    color: var(--bad);
}

.hb-loadout-actions {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr 32px;
    gap: 4px;
}

.hb-loadout-actions button,
.hb-loadout-empty button {
    min-height: 30px;
    padding: 0 6px;
    font-size: 0.74rem;
    white-space: nowrap;
}

.hb-loadout-actions .hb-loadout-equip:not(:disabled),
.hb-loadout-empty .hb-loadout-equip {
    border-color: rgba(94, 234, 212, 0.7);
    background: rgba(13, 148, 136, 0.3);
    color: #ccfbf1;
}

.hb-loadout-empty {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.76rem;
}

@media (min-width: 901px) and (max-height: 760px) {
    .hb-loadouts {
        gap: 5px;
        padding: 7px 8px;
    }

    .hb-loadout-items {
        display: none;
    }
}


/*==================================================
    Reforge: gear list on the left, the picked item's
    buffs and locks on the right.
==================================================*/

#reforgeModal > .book-modal.hb-reforge {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(980px, calc(100vw - 24px));
    height: min(680px, calc(100dvh - 24px));
    max-height: none;
    overflow: hidden;
}

.hb-reforge .book-header {
    align-items: center;
    margin: 0;
}

.hb-reforge .book-header p {
    margin: 4px 0 0;
}

.hb-reforge-wallet {
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid rgba(250, 204, 21, 0.45);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(250, 204, 21, 0.1);
    color: var(--gold);
    font-weight: 900;
    white-space: nowrap;
}

.hb-reforge-body {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
}

.hb-reforge-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.hb-reforge-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.hb-reforge-list h5 {
    margin: 6px 2px 2px;
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hb-reforge-list h5:first-child {
    margin-top: 0;
}

.hb-reforge-row {
    display: grid;
    flex: none;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--rc) 30%, transparent);
    border-radius: var(--ff-r-md, 11px);
    background: var(--hb-card);
    text-align: left;
    box-shadow: none;
}

.hb-reforge-row:hover {
    border-color: var(--rc);
}

.hb-reforge-row.selected {
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 8%, var(--hb-card));
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}

.hb-reforge-row-art {
    width: 36px;
    height: 36px;
}

.hb-reforge-row-art svg,
.hb-reforge-art svg {
    width: 100%;
    height: 100%;
}

.hb-reforge-row-copy {
    display: grid;
    min-width: 0;
}

.hb-reforge-row-copy strong {
    overflow: hidden;
    color: var(--rc);
    font-size: 0.85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-reforge-row-copy small {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.hb-worn {
    color: #4ade80;
    font-style: normal;
    font-weight: 900;
}

.hb-reforge-none {
    margin: 8px 2px;
    color: var(--muted);
    font-size: 0.85rem;
}

.hb-reforge-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 14px 16px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 16px);
    background: var(--hb-card);
}

.hb-reforge-head {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.hb-reforge-art {
    width: 72px;
    height: 72px;
    padding: 8px;
    border: 1px solid color-mix(in srgb, var(--rc, #64748b) 50%, transparent);
    border-radius: var(--ff-r-lg, 16px);
    background: radial-gradient(circle, color-mix(in srgb, var(--rc, #64748b) 22%, transparent), transparent 70%);
}

.hb-reforge-head strong {
    font-family: var(--font-display);
    font-size: 1.3rem;
}

.hb-reforge-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.hb-reforge-tag {
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-pill, 999px);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

/* Big and green: it's obvious when the gear is on you. */
.hb-reforge-tag.worn {
    border-color: rgba(74, 222, 128, 0.6);
    background: rgba(74, 222, 128, 0.14);
    color: #4ade80;
    font-size: 0.8rem;
}

.hb-reforge-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.hb-reforge-section-title span {
    font-weight: 900;
}

.hb-reforge-section-title small {
    color: var(--muted);
    font-size: 0.72rem;
}

.hb-reforge-buffs {
    display: grid;
    gap: 6px;
}

.hb-reforge-buff {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 11px);
    background: rgba(5, 18, 28, 0.55);
    cursor: pointer;
}

.hb-reforge-buff input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hb-reforge-buff-text {
    font-weight: 800;
}

.hb-reforge-lock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-pill, 999px);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
}

.hb-reforge-lock::before {
    content: "";
    width: 12px;
    height: 12px;
    background: currentColor;
    -webkit-mask: var(--icon-lock) center / contain no-repeat;
    mask: var(--icon-lock) center / contain no-repeat;
}

.hb-reforge-buff:hover .hb-reforge-lock {
    border-color: var(--accent);
    color: var(--text);
}

.hb-reforge-buff.locked {
    border-color: rgba(250, 204, 21, 0.6);
    background: rgba(250, 204, 21, 0.08);
}

.hb-reforge-buff.locked .hb-reforge-lock {
    border-color: var(--gold);
    background: rgba(250, 204, 21, 0.18);
    color: var(--gold);
}

.hb-reforge-buff.blocked {
    cursor: not-allowed;
    opacity: 0.6;
}

.hb-reforge-buff:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.hb-reforge-result {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border: 1px dashed var(--line);
    border-radius: var(--ff-r-lg, 12px);
}

.hb-reforge-diff {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.hb-reforge-diff i {
    color: var(--muted);
    font-style: normal;
}

.hb-reforge-diff em {
    padding: 1px 8px;
    border-radius: var(--ff-r-pill, 999px);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 900;
}

.hb-reforge-diff.up em { background: rgba(74, 222, 128, 0.16); color: #4ade80; }
.hb-reforge-diff.down em { background: rgba(251, 113, 133, 0.16); color: #fb7185; }
.hb-reforge-diff.same em,
.hb-reforge-diff.kept em { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.hb-reforge-diff.up span:nth-of-type(2) { color: #4ade80; }
.hb-reforge-diff.down span:nth-of-type(2) { color: #fb7185; }

.hb-reforge-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.hb-reforge-footer span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.hb-short {
    color: var(--bad);
}

.hb-reforge-go {
    min-height: 42px;
    padding: 0 20px;
    border-color: rgba(250, 204, 21, 0.7);
    background: linear-gradient(180deg, rgba(250, 204, 21, 0.28), rgba(234, 179, 8, 0.16));
    color: #fef3c7;
    font-weight: 900;
}

.hb-reforge-go b {
    margin-left: 6px;
    color: var(--gold);
}

@media (max-width: 760px) {
    #reforgeModal > .book-modal.hb-reforge {
        height: calc(100dvh - 24px);
        overflow-y: auto;
    }

    .hb-reforge-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
    }

    .hb-reforge-list {
        max-height: 220px;
    }

    .hb-reforge .book-header {
        flex-wrap: wrap;
    }
}


/*==================================================
    Your Stats: hover a bonus to see where it comes
    from.
==================================================*/

.hb-stat-row.has-tip {
    cursor: help;
    border-radius: var(--ff-r-md, 6px);
}

.hb-stat-row.has-tip:hover,
.hb-stat-row.has-tip:focus-visible {
    background: rgba(94, 234, 212, 0.06);
    outline: none;
}

.hb-stat-row.has-tip:focus-visible {
    box-shadow: 0 0 0 2px var(--accent);
}

.hb-stat-tip {
    position: fixed;
    z-index: 12000;
    width: min(320px, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--line-strong, #3b6a88);
    border-radius: var(--ff-r-lg, 12px);
    background: #0c1b27;
    color: var(--text);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    font-size: 0.82rem;
    pointer-events: none;
}

.hb-stat-tip header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.hb-stat-tip header strong {
    font-family: var(--font-display);
    font-size: 0.98rem;
}

.hb-stat-tip header b {
    color: var(--gold);
    font-size: 1rem;
}

.hb-stat-tip p {
    margin: 4px 0;
    color: var(--muted);
    line-height: 1.35;
}

.hb-stat-tip ul {
    display: grid;
    gap: 2px;
    margin: 6px 0;
    padding: 0;
    list-style: none;
}

.hb-stat-tip li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 3px 0 3px 10px;
    border-left: 3px solid var(--tip-color, #64748b);
}

.hb-stat-tip li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-stat-tip li b {
    font-variant-numeric: tabular-nums;
}

/* Colors match the kind of source. */
.hb-stat-tip li.kind-gear { --tip-color: #38bdf8; }
.hb-stat-tip li.kind-gloves { --tip-color: #5eead4; }
.hb-stat-tip li.kind-pet { --tip-color: #f472b6; }
.hb-stat-tip li.kind-prestige { --tip-color: #facc15; }
.hb-stat-tip li.kind-talents { --tip-color: #c084fc; }
.hb-stat-tip li.kind-lodge { --tip-color: #fb923c; }
.hb-stat-tip li.kind-weather { --tip-color: #5eead4; }
.hb-stat-tip li.kind-bait { --tip-color: #84cc16; }
.hb-stat-tip li.kind-lure { --tip-color: #22d3ee; }
.hb-stat-tip li.kind-upgrade { --tip-color: #e2e8f0; }
.hb-stat-tip li.kind-pond { --tip-color: #60a5fa; }
.hb-stat-tip li.kind-base,
.hb-stat-tip li.kind-catalog,
.hb-stat-tip li.kind-streak,
.hb-stat-tip li.kind-achievements { --tip-color: #94a3b8; }

.hb-tip-sub {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hb-stat-tip .hb-tip-cap {
    color: var(--gold);
    font-weight: 700;
}

.hb-stat-tip .hb-tip-note {
    padding-top: 6px;
    border-top: 1px solid var(--line);
    font-size: 0.76rem;
}

.hb-stat-tip .hb-tip-empty {
    font-style: italic;
}


/*==================================================
    Galactic: the fish rarity above Eternal.
==================================================*/

:root {
    --rg-galactic: linear-gradient(100deg, #8b5cf6 0%, #a78bfa 22%, #ddd6fe 40%, #faf5ff 50%, #ddd6fe 60%, #a78bfa 78%, #8b5cf6 100%);
    --rg-intergalactic: linear-gradient(100deg, #ec4899 0%, #f472b6 22%, #fbcfe8 40%, #fff1f7 50%, #fbcfe8 60%, #f472b6 78%, #ec4899 100%);
    --rg-universal: linear-gradient(100deg, #10b981 0%, #34d399 22%, #a7f3d0 40%, #f0fdf4 50%, #a7f3d0 60%, #34d399 78%, #10b981 100%);
    --rg-multiversal: linear-gradient(100deg, #94a3b8 0%, #cbd5e1 18%, #ffffff 32%, #bae6fd 44%, #ffffff 56%, #e2e8f0 70%, #cbd5e1 86%, #94a3b8 100%);
}

/* Galactic: violet nebula. Intergalactic: magenta plasma. Universal:
   emerald aurora. Multiversal: platinum with an icy glint. Each is one
   color family with a bright sweep; rainbows are kept for Shiny. */
.rarity-galactic {
    --rc: #a78bfa;
    --rg: var(--rg-galactic);
    background: var(--rg);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    border-color: #a78bfa;
    font-weight: 900;
    animation: hb-ultimate-flow 4.5s linear infinite;
}

/* Cards and tabs that carry a rarity class but paint their own background.
   The Eternal and Galactic styles turn text transparent to show a gradient
   through it, which the card covers, so names on these vanished. */
.rarity-eternal:is(.fish-card, .pet-card),
.rarity-galactic:is(.fish-card, .pet-card),
.rarity-intergalactic:is(.fish-card, .pet-card),
.rarity-universal:is(.fish-card, .pet-card),
.rarity-multiversal:is(.fish-card, .pet-card),
.rarity-ultimate:is(.fish-card, .pet-card) {
    color: var(--text) !important;
    -webkit-text-fill-color: currentColor;
    animation: none;
}

/* Ultimate also paints its gradient as the background, clipped to the text;
   on a card that has to go back to the card's own. */
.rarity-ultimate:is(.fish-card, .pet-card) {
    -webkit-background-clip: border-box;
    background-clip: border-box;
}

[data-pet-rarity].rarity-eternal {
    color: #facc15 !important;
    -webkit-text-fill-color: currentColor;
    animation: none;
}

.fish-icon.rarity-galactic {
    --fish-icon-glow: rgba(167, 139, 250, 0.7);
    --fish-icon-glow-soft: rgba(34, 211, 238, 0.32);
    position: relative;
    background: none;
    color: inherit !important;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    animation: none;
    isolation: isolate;
}

/* A starfield halo behind the sprite. */
.fish-icon.rarity-galactic::before {
    content: "";
    position: absolute;
    inset: 6%;
    z-index: -1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, #fff 0 1px, transparent 2px),
        radial-gradient(circle at 70% 60%, #fff 0 1px, transparent 2px),
        radial-gradient(circle at 45% 80%, #e0f2fe 0 1px, transparent 2px),
        conic-gradient(from 0deg, #4c1d95, #1e3a8a, #0e7490, #7e22ce, #4c1d95);
    filter: blur(1px);
    opacity: 0.8;
    animation: hb-ultimate-spin 9s linear infinite;
}

.fish-icon.rarity-galactic .fish-icon-image {
    filter:
        drop-shadow(0 0 2px #e0e7ff)
        drop-shadow(0 0 6px rgba(167, 139, 250, 0.85));
}

.reward-reel-card.rarity-galactic { border-color: rgba(167, 139, 250, 0.92); }

/* Rarity pills keep their shimmering text over the pill's own fill: one
   background layer clipped to the text, one to the pill. */
.hb-pill-grid label > span:is(.rarity-galactic, .rarity-intergalactic, .rarity-universal, .rarity-multiversal) {
    --pill: rgba(255, 255, 255, 0.03);
    background-image: var(--rg), linear-gradient(var(--pill), var(--pill)) !important;
    background-size: 300% 100%, auto !important;
    -webkit-background-clip: text, padding-box !important;
    background-clip: text, padding-box !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    animation: hb-ultimate-flow 4.5s linear infinite !important;
}

.hb-pill-grid input:checked + span.rarity-galactic { --pill: rgba(167, 139, 250, 0.18); }
.hb-pill-grid input:checked + span.rarity-intergalactic { --pill: rgba(244, 114, 182, 0.18); }
.hb-pill-grid input:checked + span.rarity-universal { --pill: rgba(52, 211, 153, 0.18); }
.hb-pill-grid input:checked + span.rarity-multiversal { --pill: rgba(224, 242, 254, 0.14); }

/* Catalog rarity filters: the label is the pill. */
#catalogModal .catalog-filters label:has(input[value="Galactic"]) { --rc: #a78bfa; --rg: var(--rg-galactic); }
#catalogModal .catalog-filters label:has(input[value="Intergalactic"]) { --rc: #f472b6; --rg: var(--rg-intergalactic); }
#catalogModal .catalog-filters label:has(input[value="Universal"]) { --rc: #34d399; --rg: var(--rg-universal); }
#catalogModal .catalog-filters label:has(input[value="Multiversal"]) { --rc: #e0f2fe; --rg: var(--rg-multiversal); }

#catalogModal .catalog-filters label:has(input:is([value="Galactic"], [value="Intergalactic"], [value="Universal"], [value="Multiversal"])),
#catalogModal .catalog-filters label:has(input:checked:is([value="Galactic"], [value="Intergalactic"], [value="Universal"], [value="Multiversal"])) {
    --pill: transparent;
    background-image: var(--rg), linear-gradient(var(--pill), var(--pill));
    background-size: 300% 100%, auto;
    -webkit-background-clip: text, padding-box;
    background-clip: text, padding-box;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: hb-ultimate-flow 4.5s linear infinite;
}

#catalogModal .catalog-filters label:has(input:not(:checked):is([value="Galactic"], [value="Intergalactic"], [value="Universal"], [value="Multiversal"])) {
    opacity: 0.6;
}

#catalogModal .catalog-filters label:has(input:checked:is([value="Galactic"], [value="Intergalactic"], [value="Universal"], [value="Multiversal"])) {
    --pill: color-mix(in srgb, var(--rc) 18%, transparent);
}

/* Plain rarity checkboxes elsewhere (Aquarium, Pond Log filters). */
.rarity-checkboxes:not(.catalog-rarity-checkboxes) label:has(input[value="Galactic"]) { --rg: var(--rg-galactic); }
.rarity-checkboxes:not(.catalog-rarity-checkboxes) label:has(input[value="Intergalactic"]) { --rg: var(--rg-intergalactic); }
.rarity-checkboxes:not(.catalog-rarity-checkboxes) label:has(input[value="Universal"]) { --rg: var(--rg-universal); }
.rarity-checkboxes:not(.catalog-rarity-checkboxes) label:has(input[value="Multiversal"]) { --rg: var(--rg-multiversal); }

.rarity-checkboxes:not(.catalog-rarity-checkboxes) label:has(input:is([value="Galactic"], [value="Intergalactic"], [value="Universal"], [value="Multiversal"])) {
    background-image: var(--rg);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    animation: hb-ultimate-flow 4.5s linear infinite;
}

.pond-catch-effect.rarity-galactic {
    text-shadow: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.95));
    animation:
        pond-catch-float 2.1s ease-out forwards,
        hb-ultimate-flow 4.5s linear infinite;
}

.hb-galactic-banner {
    border-color: #a78bfa;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
        radial-gradient(circle at 50% 0%, rgba(167, 139, 250, 0.35), transparent 70%),
        rgba(10, 8, 30, 0.92);
    box-shadow: 0 0 40px rgba(167, 139, 250, 0.45), 0 0 90px rgba(34, 211, 238, 0.2);
    animation-duration: 6s;
}

.hb-galactic-banner img {
    filter: drop-shadow(0 0 10px #a78bfa);
}

.hb-galactic-banner strong {
    background-image: var(--rg-galactic);
}


/*==================================================
    Intergalactic: the fish rarity above Galactic.
==================================================*/

.rarity-intergalactic {
    --rc: #f472b6;
    --rg: var(--rg-intergalactic);
    background: var(--rg);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    border-color: #f472b6;
    font-weight: 900;
    animation: hb-ultimate-flow 3.6s linear infinite;
}

.fish-icon.rarity-intergalactic {
    --fish-icon-glow: rgba(244, 114, 182, 0.75);
    --fish-icon-glow-soft: rgba(190, 24, 93, 0.35);
    position: relative;
    background: none;
    color: inherit !important;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    animation: none;
    isolation: isolate;
}

/* Two galaxies turning behind the sprite. */
.fish-icon.rarity-intergalactic::before {
    content: "";
    position: absolute;
    inset: 4%;
    z-index: -1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 25% 30%, #fff 0 1px, transparent 2px),
        radial-gradient(circle at 75% 25%, #fef9c3 0 1px, transparent 2px),
        radial-gradient(circle at 60% 75%, #fff 0 1px, transparent 2px),
        radial-gradient(circle at 30% 70%, rgba(250, 204, 21, 0.55), transparent 32%),
        radial-gradient(circle at 70% 35%, rgba(34, 211, 238, 0.5), transparent 30%),
        conic-gradient(from 0deg, #831843, #be185d, #4a044e, #9d174d, #831843);
    filter: blur(1px);
    opacity: 0.85;
    animation: hb-ultimate-spin 7s linear infinite;
}

.fish-icon.rarity-intergalactic .fish-icon-image {
    filter:
        drop-shadow(0 0 2px #fdf2f8)
        drop-shadow(0 0 7px rgba(244, 114, 182, 0.9));
}

.reward-reel-card.rarity-intergalactic { border-color: rgba(244, 114, 182, 0.92); }



.pond-catch-effect.rarity-intergalactic {
    text-shadow: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.95));
    animation:
        pond-catch-float 2.1s ease-out forwards,
        hb-ultimate-flow 3.6s linear infinite;
}

.hb-intergalactic-banner {
    border-color: #f472b6;
    background:
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px),
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px),
        radial-gradient(circle at 30% 0%, rgba(244, 114, 182, 0.35), transparent 60%),
        radial-gradient(circle at 75% 0%, rgba(157, 23, 77, 0.3), transparent 60%),
        rgba(18, 6, 26, 0.92);
    box-shadow: 0 0 44px rgba(244, 114, 182, 0.5), 0 0 100px rgba(190, 24, 93, 0.25);
}

.hb-intergalactic-banner img {
    filter: drop-shadow(0 0 10px #f472b6);
}

.hb-intergalactic-banner strong {
    background-image: var(--rg-intergalactic);
}


/*==================================================
    Universal: above Intergalactic. Multiversal: above Universal,
    the rarest rarity in the catalog.
==================================================*/

.rarity-universal {
    --rc: #34d399;
    --rg: var(--rg-universal);
    background: var(--rg);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    border-color: #34d399;
    font-weight: 900;
    animation: hb-ultimate-flow 3.2s linear infinite;
}

.rarity-multiversal {
    --rc: #e0f2fe;
    --rg: var(--rg-multiversal);
    background: var(--rg);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    border-color: #e0f2fe;
    font-weight: 900;
    animation: hb-ultimate-flow 2.6s linear infinite;
}

.fish-icon.rarity-universal,
.fish-icon.rarity-multiversal {
    position: relative;
    background: none;
    color: inherit !important;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    animation: none;
    isolation: isolate;
}

.fish-icon.rarity-universal {
    --fish-icon-glow: rgba(52, 211, 153, 0.8);
    --fish-icon-glow-soft: rgba(34, 211, 238, 0.35);
}

.fish-icon.rarity-multiversal {
    --fish-icon-glow: rgba(224, 242, 254, 0.85);
    --fish-icon-glow-soft: rgba(148, 163, 184, 0.4);
}

/* A whole sky of stars turning behind the sprite. */
.fish-icon.rarity-universal::before {
    content: "";
    position: absolute;
    inset: 2%;
    z-index: -1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 2px),
        radial-gradient(circle at 80% 22%, #ccfbf1 0 1px, transparent 2px),
        radial-gradient(circle at 65% 78%, #fff 0 1px, transparent 2px),
        radial-gradient(circle at 35% 72%, #fef9c3 0 1px, transparent 2px),
        radial-gradient(circle at 50% 50%, rgba(240, 253, 250, 0.55), transparent 30%),
        conic-gradient(from 0deg, #064e3b, #047857, #134e4a, #065f46, #064e3b);
    filter: blur(0.6px);
    opacity: 0.9;
    animation: hb-ultimate-spin 6s linear infinite;
}

.fish-icon.rarity-universal .fish-icon-image {
    filter:
        drop-shadow(0 0 2px #f0fdfa)
        drop-shadow(0 0 8px rgba(52, 211, 153, 0.95));
}

/* Overlapping worlds: two platinum rings turning opposite ways. */
.fish-icon.rarity-multiversal::before,
.fish-icon.rarity-multiversal::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #94a3b8, #f8fafc, #7dd3fc, #e2e8f0, #64748b, #f8fafc, #94a3b8);
    -webkit-mask: radial-gradient(circle, transparent 52%, #000 56%, #000 68%, transparent 72%);
    mask: radial-gradient(circle, transparent 52%, #000 56%, #000 68%, transparent 72%);
    opacity: 0.85;
}

.fish-icon.rarity-multiversal::before {
    inset: 0 12% 6% 0;
    animation: hb-ultimate-spin 5s linear infinite;
}

.fish-icon.rarity-multiversal::after {
    inset: 6% 0 0 12%;
    animation: hb-ultimate-spin 7s linear infinite reverse;
}

.fish-icon.rarity-multiversal .fish-icon-image {
    filter:
        drop-shadow(0 0 2px #fff)
        drop-shadow(0 0 8px rgba(226, 232, 240, 0.85))
        drop-shadow(0 0 14px rgba(125, 211, 252, 0.5));
}

.reward-reel-card.rarity-universal { border-color: rgba(52, 211, 153, 0.92); }
.reward-reel-card.rarity-multiversal { border-color: rgba(224, 242, 254, 0.92); }



.pond-catch-effect.rarity-universal {
    text-shadow: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.95));
    animation:
        pond-catch-float 2.1s ease-out forwards,
        hb-ultimate-flow 3.2s linear infinite;
}

.pond-catch-effect.rarity-multiversal {
    text-shadow: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.95));
    animation:
        pond-catch-float 2.1s ease-out forwards,
        hb-ultimate-flow 2.6s linear infinite;
}

.hb-universal-banner {
    border-color: #34d399;
    background:
        radial-gradient(circle at 12% 30%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
        radial-gradient(circle at 88% 22%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
        radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
        radial-gradient(circle at 25% 0%, rgba(52, 211, 153, 0.38), transparent 60%),
        radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.28), transparent 60%),
        rgba(3, 20, 22, 0.93);
    box-shadow: 0 0 48px rgba(52, 211, 153, 0.55), 0 0 110px rgba(34, 211, 238, 0.22);
}

.hb-universal-banner img {
    filter: drop-shadow(0 0 12px #34d399);
}

.hb-universal-banner strong {
    background-image: var(--rg-universal);
}

.hb-multiversal-banner {
    border-color: #e0f2fe;
    background:
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
        radial-gradient(circle at 30% 0%, rgba(226, 232, 240, 0.28), transparent 55%),
        radial-gradient(circle at 70% 0%, rgba(186, 230, 253, 0.26), transparent 55%),
        rgba(10, 14, 24, 0.94);
    box-shadow: 0 0 52px rgba(226, 232, 240, 0.45), 0 0 120px rgba(125, 211, 252, 0.25);
}

.hb-multiversal-banner img {
    filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 16px #bae6fd);
}

.hb-multiversal-banner strong {
    background-image: var(--rg-multiversal);
}

/* A Multiversal in the Keep Net: a pocket of deep space with a platinum
   rim that flows, a slow light sweep and a breathing icy glow. */
.hb-storage .fish-card.hb-fish-card.rarity-multiversal {
    --mv-glow: rgba(224, 242, 254, 0.5);
    border-color: transparent;
    background:
        linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.1) 46%, rgba(224, 242, 254, 0.22) 50%, rgba(255, 255, 255, 0.1) 54%, transparent 62%),
        radial-gradient(circle at 10% 50%, rgba(186, 230, 253, 0.38), transparent 45%),
        radial-gradient(ellipse 60% 90% at 55% 120%, rgba(125, 211, 252, 0.22), transparent 70%),
        radial-gradient(circle at 82% 10%, rgba(226, 232, 240, 0.2), transparent 42%),
        radial-gradient(circle at 26% 18%, #fff 0 1px, transparent 1.6px),
        radial-gradient(circle at 44% 84%, #e0f2fe 0 1px, transparent 1.6px),
        radial-gradient(circle at 63% 26%, #fff 0 0.8px, transparent 1.4px),
        radial-gradient(circle at 76% 76%, #bae6fd 0 1px, transparent 1.6px),
        radial-gradient(circle at 92% 46%, #fff 0 0.8px, transparent 1.4px),
        linear-gradient(100deg, #1b2537, #0b1120 55%, #111a2c);
    background-size: 260% 100%, auto, auto, auto, auto, auto, auto, auto, auto, auto;
    background-repeat: no-repeat;
    box-shadow: 0 0 14px var(--mv-glow), inset 0 0 16px rgba(186, 230, 253, 0.1);
    animation:
        hb-mv-sheen 5s ease-in-out infinite,
        hb-mv-breathe 3.2s ease-in-out infinite alternate;
}

/* The flowing platinum rim, drawn as a masked ring over the border. */
.hb-storage .fish-card.hb-fish-card.rarity-multiversal::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 1;
    padding: 2px;
    border-radius: inherit;
    background: var(--rg-multiversal);
    background-size: 300% 100%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
    animation: hb-ultimate-flow 2.6s linear infinite;
}

.hb-storage .fish-card.hb-fish-card.rarity-multiversal.selected {
    --mv-glow: rgba(94, 234, 212, 0.45);
}

.hb-storage .fish-card.hb-fish-card.rarity-multiversal.selected::after {
    background: var(--accent);
    animation: none;
}

.hb-storage .fish-card.hb-fish-card.rarity-multiversal .hb-fish-copy > strong {
    background: linear-gradient(100deg, #e2e8f0 0%, #ffffff 20%, #bae6fd 38%, #ffffff 50%, #e0f2fe 64%, #ffffff 80%, #e2e8f0 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(186, 230, 253, 0.8));
    animation: hb-ultimate-flow 2.6s linear infinite;
}

.hb-storage .fish-card.hb-fish-card.rarity-multiversal .hb-fish-value {
    text-shadow: 0 0 8px rgba(253, 224, 71, 0.55);
}

.hb-storage .fish-card.hb-fish-card.rarity-multiversal .hb-fish-thumb .fish-icon {
    background: radial-gradient(circle, rgba(224, 242, 254, 0.42), rgba(125, 211, 252, 0.12) 60%, transparent 75%);
    box-shadow: 0 0 12px rgba(186, 230, 253, 0.35);
}

@keyframes hb-mv-sheen {
    0%, 15% { background-position: 0% 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    65%, 100% { background-position: 100% 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
}

@keyframes hb-mv-breathe {
    from { box-shadow: 0 0 12px var(--mv-glow), 0 0 26px rgba(125, 211, 252, 0.14), inset 0 0 14px rgba(186, 230, 253, 0.12); }
    to { box-shadow: 0 0 22px var(--mv-glow), 0 0 48px rgba(125, 211, 252, 0.32), inset 0 0 24px rgba(186, 230, 253, 0.22); }
}


/*==================================================
    Fish types from the Volcano, Sky Islands and Cosmos.
==================================================*/

.hb-type-badge.type-magma { background: rgba(234, 88, 12, 0.24); color: #fdba74; }
.hb-type-badge.type-crystal { background: rgba(232, 121, 249, 0.18); color: #f5d0fe; }
.hb-type-badge.type-storm { background: rgba(250, 204, 21, 0.14); color: #fde047; box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.25); }
.hb-type-badge.type-aerial { background: rgba(224, 242, 254, 0.16); color: #f0f9ff; }
.hb-type-badge.type-cosmic { background: rgba(129, 140, 248, 0.24); color: #c7d2fe; }
.hb-type-badge.type-void { background: rgba(15, 10, 30, 0.75); color: #c4b5fd; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.35); }


/*==================================================
    Lure shop: families, perks and home waters.
==================================================*/

.hb-lure-filters {
    margin: -4px 0 10px;
}

.hb-lure-family {
    display: inline-block;
    padding: 0 7px;
    border-radius: var(--ff-r-md, 6px);
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hb-lure-family.family-spinner { background: rgba(45, 212, 191, 0.2); color: #99f6e4; }
.hb-lure-family.family-jig { background: rgba(96, 165, 250, 0.22); color: #bfdbfe; }
.hb-lure-family.family-spoon { background: rgba(251, 191, 36, 0.18); color: #fde68a; }
.hb-lure-family.family-plug { background: rgba(248, 113, 113, 0.18); color: #fecaca; }
.hb-lure-family.family-glow { background: rgba(190, 242, 100, 0.18); color: #ecfccb; }
.hb-lure-family.family-prism { background: rgba(196, 181, 253, 0.2); color: #ede9fe; }

.hb-stat-chip.perk {
    background: rgba(94, 234, 212, 0.1);
    color: #99f6e4;
}

.hb-lure-home {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.hb-lure-home.here {
    color: #a7f3d0;
}

.hb-lure-home b {
    color: #5eead4;
}

.hb-empty-note {
    grid-column: 1 / -1;
    margin: 12px 0;
    color: var(--muted);
    font-style: italic;
    text-align: center;
}


/*==================================================
    Quick Buy: one bait, or 5 / 25 / 100.
==================================================*/

/* The main button on top, the bulk amounts in a row beneath it. */
.quick-buy-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
}

.ff-dock-tackle .quick-buy-group #quickBuyBaitButton,
.quick-buy-group #quickBuyBaitButton {
    grid-column: 1 / -1;
}

.ff-dock-tackle .quick-buy-group {
    grid-area: buy;
}

/* The dock places .quick-buy-bait in its "buy" area; inside the group the
   buttons take their own cells. */
.ff-dock-tackle .quick-buy-group .quick-buy-bait,
.quick-buy-group .quick-buy-bait {
    grid-area: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    border-top: 1px solid #29404e;
    border-radius: var(--ff-r-md, 7px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-buy-group .quick-buy-multi {
    width: auto;
    padding: 0 4px;
    font-size: 0.74rem;
}

.quick-buy-group .quick-buy-multi:disabled {
    opacity: 0.45;
}

/* Short screens give Quick Buy a full-width row: keep it to one line. */
@media (min-width: 761px) and (max-height: 620px) {
    .quick-buy-group {
        grid-template-columns: minmax(0, 1fr) repeat(3, auto);
    }

    .ff-dock-tackle .quick-buy-group #quickBuyBaitButton {
        grid-column: auto;
    }

    .quick-buy-group .quick-buy-multi {
        padding: 0 10px;
    }
}


/*==================================================
    Pond Log: filters and boss reports.
==================================================*/

.pond-log-filter-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    margin-left: auto;
    padding: 2px 10px;
    border-radius: var(--ff-r-md, 8px);
    font-size: 0.74rem;
    font-weight: 800;
}

.pond-log-filter-button.active {
    border-color: var(--accent, #5eead4);
    color: var(--accent, #5eead4);
}

.pond-log-filter-button span {
    min-width: 18px;
    padding: 0 5px;
    border-radius: var(--ff-r-pill, 999px);
    background: var(--accent, #5eead4);
    color: #062a2a;
    font-size: 0.66rem;
    line-height: 18px;
    text-align: center;
}

.pond-log-filters {
    display: grid;
    gap: 8px;
    margin: 6px 0 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 10px);
    background: rgba(8, 20, 30, 0.7);
}

.pond-log-filters[hidden] {
    display: none;
}

.pond-log-filters fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 0;
}

.pond-log-filters legend {
    width: 100%;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pond-log-filters .settings-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-pill, 999px);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.pond-log-filters .settings-checkbox:has(input:not(:checked)) {
    opacity: 0.45;
}

.pond-log-filters input {
    width: 13px;
    height: 13px;
    margin: 0;
}

.pond-log-specials {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 6px;
    font-size: 0.78rem;
    font-weight: 800;
}

.pond-log-specials small {
    grid-column: 2;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
}

.pond-log-filter-reset {
    justify-self: start;
    min-height: 26px;
    padding: 2px 10px;
    font-size: 0.72rem;
}

.activity-entry.boss-report {
    border-left: 3px solid #f87171;
    background: rgba(248, 113, 113, 0.08);
}

.boss-report-title {
    display: block;
    color: #fca5a5;
}

.boss-report-time {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
}

.boss-report-damage {
    display: grid;
    gap: 3px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.boss-report-damage li {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 1px 6px;
    border-radius: 5px;
    overflow: hidden;
    font-size: 0.76rem;
}

.boss-report-damage li i {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 0;
    background: rgba(248, 113, 113, 0.18);
}

.boss-report-damage li span,
.boss-report-damage li b {
    position: relative;
    z-index: 1;
}

.boss-report-damage li.rewarded b::after {
    content: " \2713";
    color: #86efac;
}

.boss-report-damage li.medal-bronze b::after {
    content: " \25CF";
    color: #f59e0b;
}

.boss-report-damage li.medal-silver b::after {
    content: " \25CF";
    color: #e2e8f0;
}

.boss-report-damage li.medal-gold b::after {
    content: " \25CF";
    color: #facc15;
}

.boss-report-damage li small {
    color: var(--muted);
    font-size: 0.66rem;
}

.mutated-text {
    color: #bef264 !important;
}


/*==================================================
    Achievements: search.
==================================================*/

.hb-ach-search {
    width: min(220px, 40vw);
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 8px);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
}

@media (max-width: 640px) {
    .hb-ach-tools {
        flex-wrap: wrap;
    }

    .hb-ach-search {
        width: 100%;
    }
}

.hb-odds-none {
    color: var(--muted) !important;
    font-size: 0.74rem;
    font-weight: 700;
}

/* Settings pills are roomy; the log panel wants them compact. */
.pond-log-filters label.settings-checkbox {
    min-height: 0;
    padding: 2px 8px;
    gap: 4px;
    font-size: 0.72rem;
}

.pond-log-filters label.pond-log-specials {
    padding: 0;
}

.pond-log-filters label.pond-log-specials small {
    line-height: 1.2;
}


/*==================================================
    Shimmer layers
    Shimmering text and rainbow borders repaint every
    frame. Inside a big menu grid one of them makes the
    browser re-raster the whole grid, so each gets its
    own small layer and only that repaints.
==================================================*/

/* Short shimmering words: Evolved, Shiny, Foil, Perfect, Eternal. */
:where(span, em, b, strong, small, i):where(.evolved-label, .foil-text, .perfect-fish-text, .shiny-text, .rarity-eternal) {
    display: inline-block;
}

:where(span, em, b, strong, small, i):where(.evolved-label, .foil-text, .perfect-fish-text, .shiny-text, .rarity-eternal),
.evolve-fish-button.evolution-ready,
.catalog-count-summary.evolved-count-summary,
.catalog-perfect-sheen::before {
    will-change: transform;
}

/* These draw their own background over the Eternal gradient text style, so
   the flowing background has nothing to move: it only cost a repaint. */
.rarity-eternal:is(.hb-gear-tile, .equipment-cell, .hb-socket, .pet-card, .hb-wr-item, .hb-pet-habitat) {
    animation: none;
}

/* Shiny cards: the rainbow border slides on a layer of its own, so the
   card and its fish art are not re-rastered every frame. */
.catalog-card.shiny-cataloged,
.pet-card.shiny-pet {
    animation: none;
}

.catalog-card.shiny-cataloged::before,
.pet-card.shiny-pet::before {
    content: "";
    position: absolute;
    inset: -2px;
    padding: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff5f6d, #ffc371, #7bed9f, #70a1ff, #c56cf0, #ff5f6d);
    background-size: 240% 100%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
    will-change: transform;
    animation: shiny-flow 2.4s linear infinite;
}

/* Fishers posed every frame sit on their own layer, so re-posing one does
   not repaint the menu or pond around it. */
.pond-player .fisher-host,
.hb-wardrobe-fisher {
    will-change: transform;
}

/*==================================================
    Fishers: ripple and catch glow only animate while
    they are on screen (still previews never show them).
==================================================*/

.fisher:not(.is-rippling) .fisher-ripple,
.fisher:not(.is-showing-catch) .fisher-catch-glow {
    animation: none;
}

/*==================================================
    A menu covers the pond: the pond behind it, dimmed
    and blurred, holds still instead of being redrawn
    for nobody. It picks up where it would be on close.
==================================================*/

html.ff-menu-open .pond-scene *,
html.ff-menu-open .pond-scene *::before,
html.ff-menu-open .pond-scene *::after {
    animation-play-state: paused;
}


/*==================================================
    Bait and lure pickers, gear stats
==================================================*/

.gear-control {
    display: grid;
    gap: 3px;
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gear-native-select {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.gear-select-wrap:has(.gear-picker-button)::after {
    content: none;
}

.gear-picker-button {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding: 4px 10px 4px 6px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 10px);
    background: rgba(4, 14, 22, 0.55);
    color: var(--text);
    font-size: 0.85rem;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
}

.gear-picker-button::after {
    content: "\25B4";
    color: var(--muted);
    font-size: 0.7rem;
}

.gear-picker-button[aria-expanded="true"] {
    border-color: var(--accent);
}

.gear-picker-button .gear-picker-art,
.gear-picker-item .gear-picker-art {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
}

.gear-picker-button .gear-picker-art svg,
.gear-picker-item .gear-picker-art svg {
    width: 100%;
    height: 100%;
}

.gear-picker-name {
    display: grid;
    gap: 1px;
    min-width: 0;
    line-height: 1.15;
}

.gear-picker-name b {
    overflow: hidden;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gear-picker-name small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gear-picker-name small i {
    color: #a3e635;
    font-style: normal;
}

.gear-picker-name small .home {
    color: #5eead4;
}

.gear-picker {
    position: fixed;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 640px);
    overflow: hidden;
    border: 1px solid var(--line-strong, #3b6a88);
    border-radius: var(--ff-r-lg, 14px);
    background: #0c1b27;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
}

.gear-picker[hidden] {
    display: none;
}

.gear-picker header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--line);
}

.gear-picker header strong {
    font-family: var(--font-display);
    font-size: 1rem;
}

.gear-picker header small {
    grid-column: 1;
    color: var(--muted);
    font-size: 0.74rem;
}

.gear-picker header button {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    min-height: 30px;
    padding: 4px 12px;
}

.gear-picker header .gear-picker-search {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 34px;
    margin-top: 6px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 9px);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
}

.gear-picker header .gear-picker-search:focus {
    outline: none;
    border-color: var(--accent, #2dd4bf);
}

.gear-picker-item[hidden] {
    display: none;
}

.gear-picker-empty {
    margin: 0;
    padding: 14px 12px 16px;
    color: var(--muted);
    text-align: center;
}

.gear-picker-empty[hidden] {
    display: none;
}

.gear-picker-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    padding: 8px;
    overflow-y: auto;
}

.gear-picker-item {
    flex: 0 0 auto;
    height: auto;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    text-align: left;
}

.gear-picker-item:hover,
.gear-picker-item:focus-visible {
    border-color: var(--line-strong);
    background: rgba(94, 234, 212, 0.07);
}

.gear-picker-item.selected {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.35);
}

.gear-picker-item.empty {
    opacity: 0.6;
}

.gear-picker-item .gear-picker-art {
    width: 40px;
    height: 40px;
}

.gear-picker-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.gear-picker-copy strong {
    font-size: 0.9rem;
}

.gear-picker-copy small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.gear-picker-copy .hb-badges,
.gear-picker-copy .hb-stat-chips {
    margin: 0;
}

.gear-picker-count {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.gear-picker-home {
    background: rgba(94, 234, 212, 0.16);
    color: #5eead4;
}

@media (max-width: 640px) {
    .gear-picker {
        max-height: 72vh;
    }
}

/* Rod, Reel and Line on the dock open their stats card. */
.ff-gear-row .gear-summary [data-gear-stat] {
    cursor: help;
}

.ff-gear-row .gear-summary [data-gear-stat]:hover,
.ff-gear-row .gear-summary [data-gear-stat]:focus-visible {
    border-color: var(--line-strong);
    color: var(--text);
}

.gear-stat-tip {
    width: min(300px, calc(100vw - 16px));
}

/* Shop upgrade cards: what this level does, and what's next. */
.hb-upgrade-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 2px;
}

.hb-upgrade-stats > div {
    display: grid;
    align-content: start;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 10px);
    background: rgba(255, 255, 255, 0.03);
}

.hb-upgrade-stats > div.next {
    border-color: rgba(94, 234, 212, 0.35);
    background: rgba(94, 234, 212, 0.05);
}

.hb-upgrade-stats > div > small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    opacity: 0.8;
    text-transform: uppercase;
}

.hb-upgrade-stats > div > span {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hb-upgrade-stats p {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    font-size: 0.78rem;
}

.hb-upgrade-stats p em {
    color: var(--muted);
    font-style: normal;
}

.hb-upgrade-stats p b {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hb-upgrade-stats > div.next p b {
    color: #5eead4;
}


/*==================================================
    Recover The Streak
==================================================*/

/* Beside the Pond Streak box, on its left. */
.streak-recovery {
    position: absolute;
    top: 0;
    right: calc(100% + 8px);
    display: grid;
    justify-items: end;
    gap: 4px;
    width: max-content;
    max-width: min(260px, 60vw);
}

.streak-recovery[hidden],
.streak-recovery [hidden] {
    display: none;
}

.recover-streak-button {
    position: relative;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
        "label timer"
        "amount timer";
    align-items: center;
    gap: 0 10px;
    min-height: 0;
    padding: 6px 12px;
    overflow: hidden;
    border: 1px solid #fde047;
    border-radius: var(--ff-r-lg, 12px);
    background: linear-gradient(135deg, #b45309, #f59e0b 55%, #fde047);
    color: #1c1003;
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.7), 0 8px 20px rgba(0, 0, 0, 0.35);
    font-family: var(--font-display);
    text-align: left;
    animation: recover-streak-pulse 1.1s ease-in-out infinite;
}

.recover-streak-button span {
    grid-area: label;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.1;
}

.recover-streak-button b {
    grid-area: amount;
    font-size: 1.05rem;
    line-height: 1.1;
}

.recover-streak-button b::before {
    content: "+";
}

.recover-streak-button i {
    grid-area: timer;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(28, 16, 3, 0.85);
    color: #fde047;
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 900;
}

.recover-streak-button:disabled {
    filter: saturate(0.6);
    animation: none;
}

@keyframes recover-streak-pulse {
    50% {
        box-shadow: 0 0 0 6px rgba(250, 204, 21, 0), 0 8px 20px rgba(0, 0, 0, 0.35);
        transform: scale(1.03);
    }
}

.streak-recovery-status {
    padding: 4px 10px;
    border-radius: var(--ff-r-md, 8px);
    background: var(--glass, rgba(5, 16, 26, 0.8));
    color: #fde68a;
    font-size: 0.74rem;
    font-weight: 800;
    text-align: right;
}

.ff-shell .pond-scene .minigame.streak-recovery-game[hidden] {
    display: none;
}

.ff-shell .pond-scene .minigame.streak-recovery-game {
    z-index: 32;
    border-color: rgba(253, 224, 71, 0.55);
    box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.2), 0 18px 40px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    touch-action: manipulation;
}

.streak-recovery-game .minigame-header strong {
    color: #fde047;
}

.streak-recovery-zone {
    transition: filter 0.2s, opacity 0.2s;
}

.streak-recovery-zone.hit {
    border-color: #bbf7d0;
    background: linear-gradient(90deg, #15803d, #4ade80, #bbf7d0, #16a34a);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
}

.streak-recovery-game.won .minigame-header strong {
    color: #4ade80;
}

.streak-recovery-game.lost .minigame-header strong {
    color: #fb7185;
}

.streak-recovery-game.lost .catch-needle {
    background: #fb7185;
    box-shadow: 0 0 12px #fb7185;
}

@media (max-width: 640px) {
    .streak-recovery {
        top: calc(100% + 6px);
        right: 0;
        max-width: calc(100vw - 32px);
    }
}


/*==================================================
    Fridge: the secret drinks.
==================================================*/

.hb-fridge-modal {
    width: min(720px, calc(100vw - 32px));
}

.hb-fridge {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 4px 0 2px;
    padding: 10px;
    border: 3px solid #cbd5e1;
    border-radius: var(--ff-r-lg, 18px);
    background: linear-gradient(180deg, #e2e8f0, #f8fafc 40%, #e2e8f0);
    box-shadow: inset 0 0 24px rgba(148, 163, 184, 0.55), 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hb-fridge-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 16px 8px 18px;
    text-align: center;
    color: #0f172a;
}

/* Glass shelves under each row. */
.hb-fridge-slot::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 4px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(186, 230, 253, 0.9), rgba(125, 211, 252, 0.45));
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.25);
}

.hb-fridge-slot img,
.hb-fridge-slot > i {
    display: block;
    width: 72px;
    height: 96px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 4px rgba(15, 23, 42, 0.35));
}

.hb-fridge-slot strong {
    font-size: 0.86rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.hb-fridge-slot small {
    font-weight: 800;
    color: #475569;
}

/* Undiscovered: only the outline shows. */
.hb-fridge-slot.is-unknown img {
    filter: brightness(0) drop-shadow(0 0 1px #94a3b8) drop-shadow(0 0 1px #94a3b8);
    opacity: 0.35;
}

.hb-fridge-slot.is-unknown strong,
.hb-fridge-slot.is-unknown small {
    color: #94a3b8;
}

.hb-drink-banner img {
    image-rendering: pixelated;
    object-fit: contain;
}

.hb-drink-text {
    background: linear-gradient(90deg, #fde68a, #f0abfc, #a5f3fc, #bbf7d0, #fde68a);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 900;
}

@media (max-width: 560px) {
    .hb-fridge {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

#fridgeButton[hidden] {
    display: none !important;
}


/*==================================================
    Fishing assists: the AUTO switch and the Flow State.
==================================================*/

.auto-recast-toggle {
    position: absolute;
    top: 6px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px 2px 5px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(0, 0, 0, 0.32);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    cursor: pointer;
    pointer-events: auto;
}

.auto-recast-toggle[hidden] {
    display: none;
}

.auto-recast-toggle i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
}

.auto-recast-toggle.on {
    border-color: rgba(74, 222, 128, 0.7);
    color: #bbf7d0;
}

.auto-recast-toggle.on i {
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80;
}

.cast-button[data-cast-state="avatar"] {
    border-color: rgba(125, 249, 255, 0.85);
    background: linear-gradient(135deg, #0e7490, #1e3a8a);
    color: #ecfeff;
}

.avatar-meter {
    display: grid;
    gap: 4px;
    width: 100%;
    min-width: 150px;
    padding: 6px 10px 7px;
    border: 1px solid rgba(125, 249, 255, 0.28);
    border-radius: var(--ff-r-md, 10px);
    background: var(--glass);
    backdrop-filter: blur(8px);
    pointer-events: auto;
}

.avatar-meter[hidden] {
    display: none;
}

.avatar-meter > span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #cffafe;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.avatar-meter small {
    color: var(--muted);
    letter-spacing: 0;
    text-transform: none;
}

.avatar-meter i {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.12);
}

.avatar-meter b {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22d3ee, #a5f3fc, #fde68a);
    transition: width 0.3s ease;
}

.avatar-meter.ready,
.avatar-meter.active {
    border-color: rgba(125, 249, 255, 0.75);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
}

.avatar-meter.ready small,
.avatar-meter.active small {
    color: #a5f3fc;
    font-weight: 900;
}

/* Full (or paused): the bar gives way to a button that starts it. */
.avatar-meter.can-activate {
    padding: 4px;
}

.avatar-meter.can-activate > span,
.avatar-meter.can-activate > i {
    display: none;
}

.avatar-activate {
    width: 100%;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(165, 243, 252, 0.85);
    border-radius: var(--ff-r-md, 7px);
    background: linear-gradient(135deg, #0e7490, #1e3a8a);
    color: #ecfeff;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
    animation: avatar-activate-pulse 1.6s ease-in-out infinite alternate;
}

.avatar-activate small {
    margin-left: 4px;
    color: #a5f3fc;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.avatar-activate[hidden] {
    display: none;
}

.avatar-activate:hover {
    filter: brightness(1.15);
}

.avatar-activate:disabled {
    cursor: wait;
    opacity: 0.7;
}

@keyframes avatar-activate-pulse {
    from { box-shadow: 0 0 8px rgba(34, 211, 238, 0.35); }
    to { box-shadow: 0 0 18px rgba(34, 211, 238, 0.7); }
}

.minigame.avatar-mode {
    border-color: rgba(125, 249, 255, 0.8);
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.45);
}

.minigame.avatar-mode.avatar-hit .minigame-track {
    animation: avatar-hit-flash 0.3s ease-out;
}

.minigame.avatar-mode.avatar-miss .minigame-track {
    animation: avatar-miss-shake 0.3s ease-out;
}

@keyframes avatar-hit-flash {
    from { box-shadow: 0 0 0 2px rgba(165, 243, 252, 0.9), 0 0 18px rgba(34, 211, 238, 0.8); }
    to { box-shadow: none; }
}

@keyframes avatar-miss-shake {
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.avatar-title {
    background: linear-gradient(90deg, #67e8f9, #e0f2fe, #fde68a, #67e8f9);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 900;
    letter-spacing: 0.06em;
    animation: hb-ultimate-flow 2.5s linear infinite;
}

.pond-scene.avatar-active {
    box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.35);
}

.hb-avatar-banner {
    border-color: #67e8f9;
    background:
        radial-gradient(circle at 50% 0%, rgba(103, 232, 249, 0.35), transparent 70%),
        rgba(4, 20, 32, 0.92);
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.5);
}

.hb-avatar-banner strong {
    background-image: linear-gradient(90deg, #67e8f9, #e0f2fe, #fde68a, #67e8f9);
}

.hb-avatar-result {
    border-color: rgba(103, 232, 249, 0.6);
}

/* Keep Net sort order. */
.keep-net-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.keep-net-sort select {
    min-height: 34px;
    padding: 4px 8px;
    border-radius: var(--ff-r-md, 9px);
}

/* Keep Net and aquarium list: reverse order and the Filter panel. */
.keep-net-sort .keep-net-order {
    height: 34px;
    min-height: 34px;
    margin-left: -6px;
    border-left-width: 1px;
    border-radius: 0 var(--ff-r-md, 9px) var(--ff-r-md, 9px) 0;
}

.keep-net-sort select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.hb-filter-toggle {
    min-height: 34px;
    white-space: nowrap;
}

.hb-filter-toggle.active {
    border-color: rgba(250, 204, 21, 0.55);
    background: rgba(113, 63, 18, 0.42);
    color: #fde68a;
}

.aquarium-sort-control .hb-filter-toggle {
    height: 42px;
    min-height: 42px;
    margin-left: 8px;
}

.hb-fish-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    padding: 9px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(7, 16, 23, 0.42);
}

.hb-fish-filters[hidden] {
    display: none;
}

.hb-fish-filters input,
.hb-fish-filters select {
    flex: 1 1 140px;
    min-width: 0;
    min-height: 34px;
    margin: 0;
    padding: 4px 8px;
    border-radius: var(--ff-r-md, 9px);
}

.hb-fish-filters input {
    flex-basis: 180px;
}

.hb-fish-filters button {
    flex: 0 0 auto;
    min-height: 34px;
}

/* On short screens (200% zoom) an open Filter panel leaves the list less
   than a card; it keeps one row and the menu scrolls to the pager. */
@media (max-height: 560px) {
    .book-modal.hb-storage {
        overflow-y: auto;
    }

    .hb-storage .storage-grid,
    .hb-storage .aquarium-list {
        min-height: 92px;
    }
}

/* Sell All: keep plain low-rarity fish for the Dock. */
.sell-all-keep-plain {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.sell-all-keep-plain span {
    display: grid;
    gap: 3px;
    font-weight: 800;
}

.sell-all-keep-plain small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
}


/* Motion & Particles: three choices in one bar. */
.hb-motion-setting {
    display: grid;
    gap: 8px;
    padding-top: 6px;
}

.hb-motion-setting > span {
    display: grid;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.hb-motion-setting > span small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.hb-seg {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(255, 255, 255, 0.05);
}

.hb-seg label {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.hb-settings-modal .hb-seg input {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.hb-seg span {
    display: block;
    padding: 7px 6px;
    border-radius: var(--ff-r-md, 9px);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}

.hb-seg label:hover span {
    color: var(--text);
}

.hb-seg input:checked + span {
    background: rgba(94, 234, 212, 0.3);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.6);
}

.hb-seg input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}


/*==================================================
    Catalog cards
    A glass card lit in its rarity's color, the fish
    in a round medallion. Perfect catches get a pearl
    edge, a passing sheen and a crest in the corner.
==================================================*/

#catalogModal .catalog-card {
    --cat-tint: color-mix(in srgb, var(--cat-rarity, #f8fafc) 24%, transparent);
    --cat-edge: color-mix(in srgb, var(--cat-rarity, #f8fafc) 30%, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--cat-edge);
    border-radius: var(--ff-r-lg, 14px);
    background:
        radial-gradient(130% 90% at 0% 0%, var(--cat-tint), transparent 58%),
        linear-gradient(170deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, rgba(14, 30, 44, 0.94), rgba(7, 16, 26, 0.97));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 6px 16px -10px rgba(0, 0, 0, 0.8);
    overflow: visible;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

#catalogModal .catalog-card.discovered:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--cat-rarity, #f8fafc) 55%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 10px 22px -12px color-mix(in srgb, var(--cat-rarity, #f8fafc) 60%, #000);
}

/* A thin rarity line along the top edge. */
#catalogModal .catalog-card::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 18px;
    right: 18px;
    bottom: auto;
    width: auto;
    height: 2px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, transparent, var(--cat-rarity, #f8fafc), transparent);
    box-shadow: none;
    opacity: 0.75;
    pointer-events: none;
}

/* The fish sits in a medallion. */
#catalogModal .hb-cat-top .fish-icon {
    border: 1px solid color-mix(in srgb, var(--cat-rarity, #f8fafc) 38%, transparent);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--cat-rarity, #f8fafc) 26%, transparent), transparent 70%),
        rgba(4, 12, 20, 0.6);
    box-shadow:
        inset 0 -3px 8px rgba(0, 0, 0, 0.45),
        0 0 0 3px rgba(255, 255, 255, 0.025);
}

#catalogModal .hb-cat-top .fish-icon .fish-icon-image {
    width: 78%;
    height: 78%;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}

#catalogModal .catalog-copy strong {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.01em;
}

#catalogModal .hb-cat-foot {
    border-top: 1px dashed rgba(255, 255, 255, 0.09);
}

/* Not caught yet: a faded outline of a card. */
#catalogModal .catalog-card.undiscovered {
    border-style: dashed;
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(8, 18, 28, 0.6);
    box-shadow: none;
}

#catalogModal .catalog-card.undiscovered::after {
    opacity: 0.25;
}

#catalogModal .catalog-card.undiscovered .hb-cat-types {
    opacity: 0.6;
}

#catalogModal .hb-cat-top .fish-icon.mystery-fish {
    border-style: dashed;
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: none;
    color: rgba(148, 163, 184, 0.7);
    font-size: 1.1rem;
}

/* Evolved: a gold ring on the medallion and a warm corner, not a gold slab. */
#catalogModal .catalog-card.evolved-fish {
    border-color: color-mix(in srgb, #fcd34d 34%, var(--cat-edge));
    background:
        radial-gradient(70% 60% at 100% 100%, rgba(252, 211, 77, 0.11), transparent 70%),
        radial-gradient(130% 90% at 0% 0%, var(--cat-tint), transparent 58%),
        linear-gradient(170deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, rgba(14, 30, 44, 0.94), rgba(7, 16, 26, 0.97));
}

#catalogModal .catalog-card.evolved-fish .hb-cat-top .fish-icon {
    border-color: rgba(252, 211, 77, 0.75);
    box-shadow:
        inset 0 -3px 8px rgba(0, 0, 0, 0.45),
        0 0 0 2px rgba(252, 211, 77, 0.14),
        0 0 10px rgba(252, 211, 77, 0.25);
}

#catalogModal .hb-cat-foot .evolved-label {
    padding: 1px 9px;
    border: 1px solid rgba(252, 211, 77, 0.4);
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(252, 211, 77, 0.1);
    text-shadow: 0 0 6px rgba(250, 204, 21, 0.55);
}

/* Shiny keeps its rainbow edge (drawn by ::before), inside the new shape. */
#catalogModal .catalog-card.shiny-cataloged {
    border: 1px solid transparent;
}

/* New: a small tab hanging from the top edge. */
#catalogModal .catalog-card.new-catalog-entry {
    border-color: rgba(250, 204, 21, 0.6);
}

#catalogModal .catalog-card.new-catalog-entry::after {
    content: "NEW";
    top: -1px;
    left: 14px;
    right: auto;
    width: auto;
    height: auto;
    padding: 1px 7px 2px;
    border-radius: 0 0 var(--ff-r-md, 7px) var(--ff-r-md, 7px);
    background: #facc15;
    color: #1c1405;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.4;
    opacity: 1;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
    z-index: 5;
}

/* Perfect: a pearl edge, a sheen that passes now and then, and a crest. */
#catalogModal .catalog-card.perfect-cataloged {
    box-shadow:
        inset 0 0 0 1px rgba(233, 213, 255, 0.45),
        inset 0 0 22px rgba(224, 231, 255, 0.08),
        0 0 16px -4px rgba(196, 181, 253, 0.4);
}

.catalog-perfect-sheen {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}

.catalog-perfect-sheen::before {
    content: "";
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: 0;
    width: 38%;
    background: linear-gradient(100deg,
        transparent 0%,
        rgba(255, 255, 255, 0) 20%,
        rgba(253, 242, 248, 0.14) 42%,
        rgba(255, 255, 255, 0.26) 50%,
        rgba(224, 242, 254, 0.14) 58%,
        transparent 80%);
    transform: translateX(-120%) skewX(-12deg);
    animation: catalog-perfect-sheen 5.5s ease-in-out infinite;
}

.catalog-card:nth-child(3n + 1) .catalog-perfect-sheen::before { animation-delay: -1.8s; }
.catalog-card:nth-child(3n + 2) .catalog-perfect-sheen::before { animation-delay: -3.6s; }

@keyframes catalog-perfect-sheen {
    0%, 55% { transform: translateX(-120%) skewX(-12deg); }
    100% { transform: translateX(330%) skewX(-12deg); }
}

/* A pearl gem tucked into the top-right corner. */
.catalog-perfect-crest {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 4;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: linear-gradient(135deg, #ffffff 0%, #f5d0fe 35%, #c7d2fe 65%, #a5f3fc 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.6),
        0 0 8px rgba(233, 213, 255, 0.85);
    transform: rotate(45deg);
}

.catalog-perfect-crest::after {
    content: "";
    position: absolute;
    inset: 2px 5px 5px 2px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.85);
}

/* The name clears the crest. */
#catalogModal .catalog-card.perfect-cataloged .hb-cat-top {
    padding-right: 12px;
}

@media (hover: none) {
    #catalogModal .catalog-card.discovered:hover {
        transform: none;
    }
}


/*==================================================
    Glove Case in the Keep Net
    An Eternal card: a gold-and-ember ring turns
    around it, the case floats in a warm glow and
    sparkles wink beside it.
==================================================*/

@property --hb-gc-turn {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.hb-storage .fish-card.hb-container-card.hb-glovecase {
    border-color: transparent;
    background:
        radial-gradient(60% 130% at 0% 50%, rgba(251, 146, 60, 0.24), transparent 70%),
        radial-gradient(40% 90% at 100% 0%, rgba(250, 204, 21, 0.1), transparent 70%),
        linear-gradient(100deg, rgba(250, 204, 21, 0.08), transparent 55%),
        var(--hb-card);
    box-shadow:
        0 0 9px -2px rgba(251, 146, 60, 0.6),
        inset 0 0 18px rgba(250, 204, 21, 0.07);
    animation: hb-gc-breathe 3.2s ease-in-out infinite;
}

/* The turning ring. */
.hb-storage .hb-glovecase::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 1;
    padding: 2px;
    border-radius: var(--ff-r-lg, 17px);
    background: conic-gradient(from var(--hb-gc-turn),
        #fde047, #fb923c 18%, #7c2d12 32%, #fde68a 50%,
        #fb923c 66%, #92400e 82%, #fde047);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: hb-gc-turn 4s linear infinite;
    pointer-events: none;
}

/* The case floats in its own glow. */
.hb-storage .hb-glovecase .hb-container-art {
    position: relative;
    overflow: visible;
    background:
        radial-gradient(circle, rgba(251, 146, 60, 0.42), rgba(250, 204, 21, 0.12) 52%, transparent 74%);
}

.hb-storage .hb-glovecase .hb-container-art svg {
    filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.55));
    animation: hb-gc-float 3s ease-in-out infinite;
}

/* Two sparkles wink beside the case, out of step. */
.hb-storage .hb-glovecase .hb-container-art::before,
.hb-storage .hb-glovecase .hb-container-art::after {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    background: #fef9c3;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    filter: drop-shadow(0 0 3px #fde047);
    animation: hb-gc-twinkle 2.4s ease-in-out infinite;
    pointer-events: none;
}

.hb-storage .hb-glovecase .hb-container-art::before {
    top: 0;
    right: -2px;
}

.hb-storage .hb-glovecase .hb-container-art::after {
    bottom: 3px;
    left: -1px;
    width: 8px;
    height: 8px;
    animation-delay: -1.2s;
}

.hb-storage .hb-glovecase .hb-fish-copy strong {
    background: linear-gradient(90deg, #fde68a, #fb923c 45%, #fef3c7 55%, #fde68a);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: hb-gc-shimmer 4.5s linear infinite;
}

.hb-storage .hb-glovecase .hb-fish-copy small {
    color: #fdba74;
}

.hb-storage .hb-glovecase .hb-open:not(:disabled) {
    border-color: rgba(253, 186, 116, 0.7);
    background: linear-gradient(180deg, #fbbf24, #ea580c);
    color: #1c0f02;
    box-shadow: 0 0 10px -2px rgba(251, 146, 60, 0.7);
}

@keyframes hb-gc-turn {
    to { --hb-gc-turn: 360deg; }
}

@keyframes hb-gc-breathe {
    0%, 100% { box-shadow: 0 0 8px -3px rgba(251, 146, 60, 0.45), inset 0 0 16px rgba(250, 204, 21, 0.05); }
    50% { box-shadow: 0 0 10px -1px rgba(251, 146, 60, 0.75), inset 0 0 24px rgba(250, 204, 21, 0.13); }
}

@keyframes hb-gc-float {
    0%, 100% { transform: translateY(1px); }
    50% { transform: translateY(-2px); }
}

@keyframes hb-gc-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
    45%, 55% { opacity: 1; transform: scale(1) rotate(45deg); }
}

@keyframes hb-gc-shimmer {
    to { background-position: -220% 0; }
}


/*==================================================
    Glove Case reel
    Every pair is Eternal, so each card shows its
    wear instead: the band's colour on the border,
    a stripe along the bottom and the label.
==================================================*/

.reward-reel-card.reward-reel-glove {
    position: relative;
    border-color: color-mix(in srgb, var(--wear) 70%, transparent);
    background:
        radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--glove) 28%, transparent), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 55%),
        #132530;
}

.reward-reel-card.reward-reel-glove::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 5px;
    background: var(--wear);
    box-shadow: 0 0 10px var(--wear);
}

.reward-reel-glove .equipment-icon,
.reward-opening-result .equipment-icon:has(> .hb-icon-art svg) {
    overflow: visible;
    border: 0;
    background: transparent;
}

.reward-reel-glove .equipment-icon-image {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--glove) 75%, transparent));
}

.reward-reel-glove strong {
    color: #fed7aa;
}

.reward-reel-card.reward-reel-glove .reward-reel-wear {
    padding: 1px 9px;
    border: 1px solid color-mix(in srgb, var(--wear) 55%, transparent);
    border-radius: var(--ff-r-pill, 999px);
    background: color-mix(in srgb, var(--wear) 18%, transparent);
    color: var(--wear);
    font-weight: 900;
    letter-spacing: 0.02em;
}

.reward-reel-card.reward-reel-glove > small {
    color: #94a3b8;
}

.reward-opening-wear b {
    color: var(--wear);
}

/* Pet prestige */
.hb-pet-prestige {
    position: absolute;
    left: -2px;
    bottom: -2px;
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding: 0 5px;
    border: 2px solid #0b1f2e;
    border-radius: var(--ff-r-pill, 999px);
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    color: #451a03;
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 1;
}

.pet-prestige-text,
.pet-prestige-line b {
    color: #fbbf24;
}

.pet-prestige-line {
    display: block;
}

.hb-pet-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

.pet-prestige-button {
    border-color: #f59e0b !important;
    background: linear-gradient(180deg, #fcd34d, #d97706) !important;
    color: #451a03 !important;
    font-weight: 900;
}

.pet-prestige-button:disabled {
    opacity: 0.55;
}

/* +5 Levels and Max Level share the row under the XP sessions. */
.training-session-grid .pet-training-levels {
    grid-column: span 2;
}

.training-session-grid .pet-training-max {
    border-color: rgba(250, 204, 21, 0.75) !important;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(250, 204, 21, 0.22), transparent 60%),
        rgba(30, 20, 5, 0.6) !important;
}

.training-session-grid .pet-training-max strong {
    color: #fde68a;
}

@media (max-width: 620px) {
    .training-session-grid .pet-training-levels {
        grid-column: auto;
    }
}

.hb-pet-hero-actions button {
    min-width: 88px;
}


/*==================================================
    Keep Net and Aquarium: roomier fish cards. Wider
    columns and taller rows, so names, weight and
    length show in full and mutation tags wrap onto
    more lines instead of being cut off. On narrow
    screens the tags get a full-width row of their own.
==================================================*/

.hb-storage .storage-grid,
.hb-storage .aquarium-list {
    grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
    grid-auto-rows: minmax(92px, auto);
}

.hb-storage .fish-card.hb-fish-card,
.hb-storage .fish-card.hb-container-card {
    grid-template-columns: 64px minmax(0, 1fr) auto auto;
    height: auto;
    min-height: 92px;
}

.hb-storage .hb-fish-thumb .fish-icon,
.hb-storage .hb-container-art {
    width: 64px;
    height: 64px;
}

.hb-storage .hb-fish-thumb .fish-icon-image {
    width: 56px;
    height: 56px;
}

.hb-storage .hb-fish-copy {
    gap: 3px;
}

.hb-storage .hb-fish-tags {
    flex-wrap: wrap;
    gap: 3px 4px;
}

@media (max-width: 520px) {
    .hb-storage .storage-grid,
    .hb-storage .aquarium-list {
        grid-auto-rows: auto;
    }

    .hb-storage .fish-card.hb-fish-card {
        grid-template-columns: 64px minmax(0, 1fr) auto auto;
        grid-template-areas:
            "thumb name value actions"
            "thumb info value actions"
            "tags tags tags tags";
        align-items: center;
        row-gap: 4px;
        min-height: auto;
    }

    .hb-storage .fish-card.hb-fish-card .hb-fish-copy {
        display: contents;
    }

    .hb-storage .fish-card.hb-fish-card .hb-fish-thumb { grid-area: thumb; }
    .hb-storage .fish-card.hb-fish-card .hb-fish-copy > strong { grid-area: name; align-self: end; }
    .hb-storage .fish-card.hb-fish-card .hb-fish-copy > small { grid-area: info; align-self: start; }

    .hb-storage .fish-card.hb-fish-card .hb-fish-copy > :is(strong, small) {
        overflow: visible;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .hb-storage .fish-card.hb-fish-card .hb-fish-tags { grid-area: tags; }
    .hb-storage .fish-card.hb-fish-card .hb-fish-value { grid-area: value; }
    .hb-storage .fish-card.hb-fish-card .fish-actions { grid-area: actions; }
}

/* The catch shown the moment the reel lands, until the server's card arrives. */
.hb-catch-pending .hb-catch-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: var(--ff-r-lg, 16px);
    background: radial-gradient(circle, color-mix(in srgb, var(--rc, #5eead4) 30%, transparent), rgba(255, 255, 255, 0.04) 70%);
}

.hb-catch-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid color-mix(in srgb, var(--rc, #5eead4) 35%, transparent);
    border-top-color: var(--rc, #5eead4);
    border-radius: 50%;
    animation: hb-catch-spin 0.8s linear infinite;
}

@keyframes hb-catch-spin {
    to { transform: rotate(360deg); }
}
