/*==================================================
    Fish Fish - Chart skin
    Loaded last. Restyles every screen as a harbor
    chart: square-cut corners, slab-serif titles, mono
    labels and readouts, flat buttons with a hard keel,
    framed panels and a faint chart grid. Colors still
    come from the theme tokens, so themes keep working;
    the layout is untouched. Corner radii elsewhere read
    --ff-r-lg / --ff-r-md / --ff-r-pill, falling back to
    their old values without this file.
==================================================*/

:root {
    --font-display: "Zilla Slab", Rockwell, Georgia, serif;
    --font-body: "Barlow", system-ui, "Segoe UI", sans-serif;
    --font-label: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    --radius: 4px;
    --radius-sm: 3px;
    --ff-r-lg: 4px;
    --ff-r-md: 3px;
    --ff-r-pill: 2px;
    --ff-keel: rgba(0, 0, 0, 0.42);
    --ff-frame: color-mix(in srgb, var(--line-strong) 70%, transparent);
    --shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 10px 10px 0 rgba(0, 0, 0, 0.32);
    --cast-fill: #0f9e8c;
    --cast-fill-hover: #13b4a0;
}

html[data-ff-theme="halloween"] {
    --cast-fill: #e2600f;
    --cast-fill-hover: #f27322;
}

html[data-ff-theme="harvest"] {
    --cast-fill: #c97a0a;
    --cast-fill-hover: #dd8c12;
}

/* The chart grid behind everything. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px),
        linear-gradient(color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
    background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
    opacity: 0.55;
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 80%);
    mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 80%);
}


/*==================================================
    Type
==================================================*/

/* Small caps-style labels read like instrument markings. */
.ff-subtitle span,
.ff-topbar .zone-name,
.ff-wallet span,
.ff-pond-hud-left .streak-display > span,
.ff-bounty-tracker > strong,
.ff-tracker-sub,
.ff-minigame-tag,
.ff-mutation-splash small,
.ff-level-banner small,
.ff-dock-tackle label,
.ff-mutation-tag,
.ff-mastery,
.ff-bounty-tier,
.ff-odd-tag,
.ff-bounty-weekly small,
.ff-weather-timer small,
.ff-whats-new-hero small,
.ff-angler-level small,
.signed-in-account span,
.phone-call-panel > div span,
.streak-display span,
.pond-streak-label,
.no-bait-warning,
.new-fish-badge,
.reward-opening-modal > header span,
.reward-opening-result > strong,
.aquarium-fish-summary > span span,
.hb-tag,
.hb-catch-value small,
.hb-ach-title small,
.hb-ach-done,
.hb-board-group small,
.hb-record small,
.hb-socket small,
.hb-glove-reveal-card > small,
.hb-rarity-pill,
.hb-compare-head,
.hb-pet-hero-copy > span,
.hb-fish-tags,
.hb-fish-value small,
.hb-upgrade-head small,
.hb-next-tier span,
.hb-building-effects em,
#catalogModal .catalog-filters legend,
.hb-reforge-list h5,
.hb-tip-sub,
.hb-lure-family,
.pond-log-filters legend,
.gear-control,
.hb-upgrade-stats > div > small,
.hb-upgrade-stats > div > span,
.avatar-meter > span,
.avatar-activate,
.ff-zone-card-top em,
.ff-zones-hot small,
.ff-zone-badges b,
.ff-season-title small,
.ff-rail-flyout-title,
.ff-zone-menu .zone-menu-badges b,
.ff-theme-tag,
.ff-rail-editor-list .rl-divider .rl-name,
.rd-node-tag,
.rd-asc-total span,
.fm-label,
.fm-active small,
.cs-heading,
.cs-buffs-title,
.cs-roster > strong,
.cs-cash-table thead th,
.dk-effects em {
    font-family: var(--font-label);
    font-weight: 600;
    letter-spacing: 0.06em;
}

/* Rail captions in the label face too. */
.ff-rail button {
    font-family: var(--font-label);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ff-brand,
.ff-tabs button,
.shop-category-tabs button,
.book-modal h2,
.book-modal h3 {
    font-family: var(--font-display);
}

.ff-tabs button,
.shop-category-tabs button {
    font-weight: 700;
}


/*==================================================
    Panels: matte, with a hairline frame inside the
    border like a printed chart.
==================================================*/

.ff-topbar,
.ff-rail,
.ff-dock-tackle,
.ff-social > section,
.book-modal {
    outline: 1px solid var(--ff-frame);
    outline-offset: -5px;
}

.ff-topbar,
.ff-social > section,
.ff-dock-tackle {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.book-modal {
    box-shadow: var(--shadow);
}

/* Registration ticks in each corner of a menu. */
.book-modal {
    background-image:
        linear-gradient(var(--accent), var(--accent)),
        linear-gradient(var(--accent), var(--accent)),
        linear-gradient(var(--accent), var(--accent)),
        linear-gradient(var(--accent), var(--accent)),
        linear-gradient(var(--accent), var(--accent)),
        linear-gradient(var(--accent), var(--accent)),
        linear-gradient(var(--accent), var(--accent)),
        linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat;
    background-size: 14px 2px, 2px 14px, 14px 2px, 2px 14px, 14px 2px, 2px 14px, 14px 2px, 2px 14px;
    background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
    background-attachment: local;
}


/*==================================================
    Buttons: flat fill, hard keel underneath, press
    sinks it.
==================================================*/

:where(html[data-ff-theme]) button {
    background: var(--panel-2);
}

:where(html[data-ff-theme]) button:hover:not(:disabled) {
    box-shadow: none;
}

button {
    box-shadow: inset 0 -2px 0 var(--ff-keel);
    transition: background-color 0.12s, border-color 0.12s;
}

button:active:not(:disabled) {
    box-shadow: inset 0 2px 0 var(--ff-keel);
}

html[data-ff-theme] .ff-dock button:not(.cast-button) {
    background: var(--panel-2);
}

html[data-ff-theme] .ff-dock button:not(.cast-button):hover:not(:disabled) {
    background: var(--panel-3);
    border-color: var(--accent);
}

/* Cast Line: a flat signal-colored slab with dock-marking stripes. */
html[data-ff-theme] .ff-dock .cast-button {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.4);
}

html[data-ff-theme] .ff-dock .cast-button:is(:not([data-cast-state]), [data-cast-state="idle"], [data-cast-state="ready"]) {
    border-color: color-mix(in srgb, var(--cast-fill) 60%, #fff);
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 12px, transparent 12px 24px),
        var(--cast-fill);
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.4);
}

html[data-ff-theme] .ff-dock .cast-button:is(:not([data-cast-state]), [data-cast-state="idle"], [data-cast-state="ready"]):hover:not(:disabled) {
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0 12px, transparent 12px 24px),
        var(--cast-fill-hover);
}

html[data-ff-theme] .ff-dock .cast-button:active:not(:disabled) {
    box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.4);
}


/*==================================================
    Rail and tabs: a marker bar instead of a lit pill.
==================================================*/

html[data-ff-theme] .ff-rail button {
    box-shadow: none;
}

html[data-ff-theme] .ff-rail button.active {
    border-color: transparent;
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    box-shadow: inset 3px 0 0 var(--accent);
    color: var(--text);
}

html[data-ff-theme] .ff-tabs button {
    box-shadow: none;
}

html[data-ff-theme] .ff-tabs button[aria-selected="true"] {
    background: transparent;
    border-bottom-width: 3px;
}

html[data-ff-theme] .ff-rail-flyout button {
    box-shadow: none;
}


/*==================================================
    Scrollbars
==================================================*/

* {
    scrollbar-color: var(--line-strong) transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 0;
}


/*==================================================
    Small fixes
==================================================*/

/* "No bait!" on the Cast button sits on a dark tag so it reads over the stripes. */
.no-bait-warning {
    padding: 1px 6px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.55);
    font-family: var(--font-label);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-shadow: none;
}
