/*==================================================
    Fish Fish - Rail menus, Chat & Pond Log layout
    and Themes
==================================================*/

[data-icon="backpack"] { --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='M9 6V4.5A1.5 1.5 0 0 1 10.5 3h3A1.5 1.5 0 0 1 15 4.5V6'/><rect x='5' y='6' width='14' height='15' rx='4'/><path d='M8.5 14h7v4.5h-7zM5 11.5h14'/></svg>"); }
[data-icon="hanger"] { --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='M10 5.5a2 2 0 1 1 2 2v2'/><path d='M12 9.5 3.3 15.6A1.5 1.5 0 0 0 4.2 18.4h15.6a1.5 1.5 0 0 0 .9-2.8z'/></svg>"); }
[data-icon="palette"] { --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 3a9 9 0 0 0 0 18c1.4 0 2-.9 2-1.8 0-1.3-1.2-1.7-1.2-2.8 0-1 .8-1.6 1.8-1.6H17a4 4 0 0 0 4-4C21 6.5 17 3 12 3z'/><circle cx='7.5' cy='11' r='1.2'/><circle cx='10' cy='7' r='1.2'/><circle cx='15' cy='7' r='1.2'/></svg>"); }
[data-set-icon="chat"] { --set-icon: var(--icon-chat); }
[data-icon="flag"] { --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='M5 21V4'/><path d='M5 4.5c3-1.8 5.5 1.6 8.5 0S17.5 3 19 4v9c-1.5-1-3 .5-5.5 1.5S8 12.7 5 14.5'/></svg>"); }
[data-icon="folder"] { --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='M3 7.5A1.5 1.5 0 0 1 4.5 6H9l2 2.5h8.5A1.5 1.5 0 0 1 21 10v8.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18.5z'/></svg>"); }
[data-icon="compass"] { --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'><circle cx='12' cy='12' r='9'/><path d='m15.5 8.5-2 5-5 2 2-5z'/></svg>"); }
[data-set-icon="sidebar"] { --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' width='18' height='16' rx='2'/><path d='M9 4v16M5.5 8h1.5M5.5 11.5h1.5M5.5 15h1.5'/></svg>"); }


/*==================================================
    Rail flyouts (Gear, Cosmetics, Progress,
    Homestead, Explore, Records)
==================================================*/

.ff-rail button[hidden] {
    display: none;
}

.ff-rail button.is-open {
    background: rgba(125, 196, 235, 0.1);
    color: var(--text);
}

.ff-rail-flyout {
    position: fixed;
    z-index: 60;
    display: grid;
    gap: 4px;
    min-width: 168px;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ff-r-lg, 14px);
    background: var(--panel-solid);
    box-shadow: var(--shadow);
    animation: ff-flyout-in 0.14s ease-out;
}

.ff-rail-flyout[hidden] {
    display: none;
}

.ff-rail-flyout.is-sheet {
    left: 16px !important;
    right: 16px;
    min-width: 0;
}

.ff-rail-flyout-title {
    padding: 2px 8px 4px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ff-rail-flyout button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: var(--ff-r-md, 10px);
    background: transparent;
    color: var(--text);
    font-size: 0.86rem;
    text-align: left;
    box-shadow: none;
}

.ff-rail-flyout button[hidden] {
    display: none;
}

.ff-rail-flyout button::before {
    content: "";
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--icon, var(--icon-pond)) center / contain no-repeat;
    mask: var(--icon, var(--icon-pond)) center / contain no-repeat;
}

.ff-rail-flyout button:hover:not(:disabled) {
    border-color: transparent;
    background: rgba(125, 196, 235, 0.1);
    box-shadow: none;
}

.ff-rail-flyout button.active {
    border-color: var(--line-strong);
    color: var(--accent);
}

.ff-rail-flyout button:disabled {
    color: var(--muted);
    opacity: 0.6;
}

/* The zone dropdown under the zone name in the top bar. */
.ff-zone-menu {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ff-zone-menu button::before {
    content: none;
}

.ff-zone-menu button {
    justify-content: space-between;
}

.ff-zone-menu .zone-menu-text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.ff-zone-menu .zone-menu-text small {
    color: var(--muted);
    font-size: 0.72rem;
}

.ff-zone-menu button.is-locked {
    cursor: not-allowed;
}

.ff-zone-menu button.is-locked strong {
    color: var(--muted);
}

.ff-zone-menu .zone-menu-badges {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
}

.ff-zone-menu .zone-menu-badges b {
    padding: 2px 7px;
    border-radius: var(--ff-r-pill, 999px);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ff-zone-menu .zone-menu-hot {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
}

.ff-zone-menu .zone-menu-here {
    background: rgba(56, 189, 248, 0.18);
    color: var(--accent);
}

.ff-zone-menu .zone-menu-lock {
    background: rgba(148, 163, 184, 0.16);
    color: var(--muted);
}

.ff-zone-menu .zone-menu-details {
    justify-content: center;
    min-height: 34px;
    margin-top: 2px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--ff-r-md, 10px) var(--ff-r-md, 10px);
    color: var(--muted);
    font-size: 0.76rem;
}

.ff-rail-flyout .equipment-full-label {
    margin-left: auto;
    color: var(--bad);
    font-size: 0.74rem;
}

.ff-rail-flyout #equipmentButton.has-new-equipment::after,
.ff-rail-flyout #petsButton.has-new-pet::after,
.ff-rail-flyout #achievementsButton.has-new-achievements::after,
.ff-rail-flyout #catalogButton.has-new-catalog::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-radius: 50%;
    background: #facc15;
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.75);
}

.ff-rail-flyout .equipment-full-label + ::after {
    margin-left: 6px;
}

.ff-rail-flyout .ff-dot {
    position: static;
    width: 7px;
    height: 7px;
    margin-left: auto;
    box-shadow: 0 0 6px var(--coral);
}

.ff-rail-flyout .ff-dot:not([hidden]) ~ .ff-dot {
    margin-left: 4px;
}

@keyframes ff-flyout-in {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: none; }
}


/*==================================================
    Chat & Pond Log together
==================================================*/

.ff-feed-split-title {
    display: none;
}

.ff-feed.is-split {
    padding-top: 0;
}

.ff-feed.is-split .ff-tabs {
    display: none;
}

.ff-feed.is-split .ff-feed-panel,
.ff-feed.is-split .ff-feed-panel[hidden] {
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    padding-top: 8px;
}

.ff-feed.is-split .ff-feed-panel + .ff-feed-panel {
    margin-top: 8px;
    border-top: 1px solid var(--line);
}

.ff-feed.is-split .ff-feed-split-title,
.ff-feed.is-split .pond-log-heading h2 {
    display: block;
    margin: 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 600;
}

.ff-feed.is-split .pond-log-heading {
    justify-content: space-between;
}


/*==================================================
    Themes menu
==================================================*/

.ff-themes-modal {
    width: min(640px, 100%);
}

.ff-themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.ff-theme-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 16px);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    text-align: left;
}

.ff-theme-card.is-current {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.ff-theme-card.is-locked {
    opacity: 0.55;
}

.ff-theme-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ff-theme-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.ff-theme-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.ff-theme-tag {
    padding: 2px 8px;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ff-theme-card.is-current .ff-theme-tag {
    background: var(--accent);
    color: var(--accent-ink);
}

.ff-theme-card button {
    justify-self: stretch;
    min-height: 38px;
}

/* A tiny mock of the game screen in the theme's colors. */
.ff-theme-preview {
    position: relative;
    display: grid;
    grid-template-columns: 16% 1fr 24%;
    grid-template-rows: 14% 1fr;
    gap: 5px;
    height: 128px;
    padding: 6px;
    border-radius: var(--ff-r-lg, 12px);
    overflow: hidden;
    background: var(--p-bg);
}

.ff-theme-preview i {
    border-radius: 5px;
    background: var(--p-panel);
}

.ff-theme-preview i:nth-child(1) {
    grid-column: 1 / -1;
}

.ff-theme-preview i:nth-child(3) {
    position: relative;
    background: var(--p-water);
}

.ff-theme-preview i:nth-child(3)::after {
    content: "";
    position: absolute;
    right: 14%;
    bottom: 12%;
    left: 14%;
    height: 16%;
    border-radius: var(--ff-r-md, 6px);
    background: var(--p-accent);
}

.ff-theme-preview i:nth-child(2)::before {
    content: "";
    display: block;
    width: 60%;
    height: 10px;
    margin: 8px auto 0;
    border-radius: 3px;
    background: var(--p-accent-2);
}

.ff-theme-preview svg {
    position: absolute;
    pointer-events: none;
}


/*==================================================
    Theme decorations (shared)
==================================================*/

.ff-theme-decor {
    position: absolute;
    pointer-events: none;
    user-select: none;
}

.ff-theme-decor svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

html:is(.ff-low-detail, .ff-motion-off) .ff-theme-decor,
html:is(.ff-low-detail, .ff-motion-off) .ff-theme-decor * {
    animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .ff-theme-decor,
    .ff-theme-decor * {
        animation: none !important;
    }
}


/*==================================================
    Halloween theme
==================================================*/

html[data-ff-theme="halloween"] {
    --bg-deep: #0b0510;
    --bg: #1a0c22;
    --panel: rgba(30, 14, 36, 0.88);
    --panel-solid: #211029;
    --panel-2: #2f1739;
    --panel-3: #40204c;
    --glass: rgba(24, 10, 30, 0.66);
    --line: rgba(251, 146, 60, 0.2);
    --line-strong: rgba(251, 146, 60, 0.4);
    --text: #fff3e6;
    --muted: #c7a6bb;
    --accent: #fb923c;
    --accent-2: #c084fc;
    --accent-ink: #2b1103;
    --lantern: #ff8a1f;
    --xp: #c084fc;
}

html[data-ff-theme="halloween"] body {
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(147, 51, 234, 0.22), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(234, 88, 12, 0.16), transparent 60%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='520' height='420' viewBox='0 0 520 420' fill='rgb(10,4,14)' fill-opacity='.55'><path d='M80 70c-3-6-9-8-13-5 0-6-9-11-18-7 4 3 4 7 3 10-5-3-12-3-18 2 8 1 12 6 14 12 4-5 12-5 17 0 3-5 9-5 12-2 1-3 2-7 3-10zM80 70c3-6 9-8 13-5 0-6 9-11 18-7-4 3-4 7-3 10 5-3 12-3 18 2-8 1-12 6-14 12-4-5-12-5-17 0-3-5-9-5-12-2-1-3-2-7-3-10z'/><path d='M360 260c-2-4-6-5-9-3 0-4-6-7-12-5 3 2 3 5 2 7-3-2-8-2-12 1 5 1 8 4 9 8 3-3 8-3 11 0 2-3 6-3 8-1 1-2 1-5 3-7zM360 260c2-4 6-5 9-3 0-4 6-7 12-5-3 2-3 5-2 7 3-2 8-2 12 1-5 1-8 4-9 8-3-3-8-3-11 0-2-3-6-3-8-1-1-2-1-5-3-7z'/></svg>"),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    background-attachment: fixed;
}

/* :where() keeps these at the base button rule's weight, so any button
   with its own colors (color swatches, rarity buttons) keeps them. */
:where(html[data-ff-theme="halloween"]) button {
    background: linear-gradient(180deg, rgba(76, 32, 92, 0.92), rgba(44, 18, 54, 0.96));
}

:where(html[data-ff-theme="halloween"]) button:hover:not(:disabled) {
    box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.25), 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* The bar under the pond: Keep Net, Aquarium, Quick Buy and the pickers. */
html[data-ff-theme="halloween"] .ff-dock button:not(.cast-button) {
    background: linear-gradient(180deg, rgba(76, 32, 92, 0.92), rgba(44, 18, 54, 0.96));
}

html[data-ff-theme="halloween"] .ff-dock button:not(.cast-button):hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(96, 42, 114, 0.95), rgba(54, 22, 66, 0.98));
}

html[data-ff-theme="halloween"] .ff-rail button,
html[data-ff-theme="halloween"] .ff-rail-flyout button,
html[data-ff-theme="halloween"] .ff-tabs button {
    background: transparent;
}

html[data-ff-theme="halloween"] .ff-rail button:hover:not(:disabled),
html[data-ff-theme="halloween"] .ff-rail button.is-open,
html[data-ff-theme="halloween"] .ff-rail-flyout button:hover:not(:disabled) {
    background: rgba(251, 146, 60, 0.1);
}

html[data-ff-theme="halloween"] .ff-rail button.active {
    border-color: rgba(251, 146, 60, 0.5);
    background: linear-gradient(180deg, rgba(251, 146, 60, 0.2), rgba(251, 146, 60, 0.06));
}

html[data-ff-theme="halloween"] .ff-tabs button[aria-selected="true"] {
    background: rgba(251, 146, 60, 0.1);
}

html[data-ff-theme="halloween"] .ff-topbar,
html[data-ff-theme="halloween"] .ff-feed {
    position: relative;
}

html[data-ff-theme="halloween"] .ff-topbar .zone-bar {
    background: rgba(14, 5, 18, 0.6);
}

html[data-ff-theme="halloween"] .ff-topbar .zone-select:hover,
html[data-ff-theme="halloween"] .ff-topbar .zone-select.is-open {
    background: rgba(251, 146, 60, 0.1);
}

html[data-ff-theme="halloween"] .ff-dock .cast-button:not([data-cast-state]),
html[data-ff-theme="halloween"] .ff-dock .cast-button[data-cast-state="idle"],
html[data-ff-theme="halloween"] .ff-dock .cast-button[data-cast-state="ready"] {
    border-color: rgba(253, 186, 116, 0.85);
    background:
        radial-gradient(ellipse at 50% -20%, rgba(255, 255, 255, 0.3), transparent 60%),
        linear-gradient(180deg, #f97316, #9a3412);
    color: #fff7ed;
    box-shadow: 0 12px 30px rgba(234, 88, 12, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

html[data-ff-theme="halloween"] .ff-dock .cast-button:not([data-cast-state]):hover:not(:disabled),
html[data-ff-theme="halloween"] .ff-dock .cast-button[data-cast-state="idle"]:hover:not(:disabled),
html[data-ff-theme="halloween"] .ff-dock .cast-button[data-cast-state="ready"]:hover:not(:disabled) {
    background:
        radial-gradient(ellipse at 50% -20%, rgba(255, 255, 255, 0.4), transparent 60%),
        linear-gradient(180deg, #fb923c, #c2410c);
}

html[data-ff-theme="halloween"] .ff-shell .mobile-game-nav {
    background: rgba(18, 7, 22, 0.96);
}

html[data-ff-theme="halloween"] .ff-shell .mobile-game-nav button.active {
    background: rgba(251, 146, 60, 0.12);
}

html[data-ff-theme="halloween"] .modal-backdrop {
    background: rgba(10, 3, 14, 0.7);
}

html[data-ff-theme="halloween"] .book-modal {
    background:
        radial-gradient(900px 300px at 0% 0%, rgba(147, 51, 234, 0.14), transparent 60%),
        radial-gradient(700px 300px at 100% 100%, rgba(234, 88, 12, 0.1), transparent 60%),
        #1b0c22;
}

/* Decorations */

/* A dusk tint over the pond, with mist rolling along the bottom. */
.ff-hw-tint {
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(76, 29, 149, 0.3) 0%, rgba(124, 45, 18, 0.12) 45%, transparent 70%),
        linear-gradient(0deg, rgba(88, 28, 135, 0.28) 0%, transparent 22%);
}

.ff-hw-bat {
    z-index: 5;
    width: 58px;
    height: 29px;
    animation: ff-hw-fly var(--dur, 16s) linear infinite;
    animation-delay: var(--delay, 0s);
}

.ff-hw-bat svg {
    animation: ff-hw-flap 0.32s ease-in-out infinite alternate;
    transform-origin: 50% 40%;
}

.ff-hw-ghost {
    z-index: 5;
    width: 40px;
    height: 48px;
    opacity: 0.7;
    animation: ff-hw-float 7s ease-in-out infinite;
}

.ff-hw-pumpkin {
    bottom: 3%;
    z-index: 4;
    width: 60px;
    height: 54px;
    filter: drop-shadow(0 0 12px rgba(251, 146, 60, 0.55));
    animation: ff-hw-flicker 2.6s ease-in-out infinite;
}

.ff-hw-pumpkin.left {
    left: 2%;
}

.ff-hw-pumpkin.right {
    right: 2%;
    width: 44px;
    height: 38px;
    animation-delay: -1.1s;
}

.ff-hw-web {
    width: 64px;
    height: 64px;
    opacity: 0.45;
}

.ff-hw-web.top-right {
    top: 0;
    right: 0;
    transform: scaleX(-1);
}

.ff-hw-web.bottom-left {
    bottom: 0;
    left: 0;
    transform: scaleY(-1);
}

.ff-hw-spider {
    top: 0;
    right: 30px;
    z-index: 2;
    width: 15px;
    height: 54px;
    animation: ff-hw-dangle 4.5s ease-in-out infinite;
    transform-origin: 50% 0;
}

@keyframes ff-hw-fly {
    0% { left: -60px; top: var(--y, 18%); }
    25% { top: calc(var(--y, 18%) - 6%); }
    50% { top: calc(var(--y, 18%) + 4%); }
    75% { top: calc(var(--y, 18%) - 3%); }
    100% { left: calc(100% + 60px); top: var(--y, 18%); }
}

@keyframes ff-hw-flap {
    from { transform: scaleY(1); }
    to { transform: scaleY(0.45); }
}

@keyframes ff-hw-float {
    0%, 100% { transform: translate(0, 0); opacity: 0.55; }
    50% { transform: translate(-18px, -12px); opacity: 0.8; }
}

@keyframes ff-hw-flicker {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(251, 146, 60, 0.55)); }
    40% { filter: drop-shadow(0 0 18px rgba(251, 146, 60, 0.8)); }
    55% { filter: drop-shadow(0 0 8px rgba(251, 146, 60, 0.4)); }
}

@keyframes ff-hw-dangle {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.72); }
}

@media (max-width: 760px) {
    .ff-hw-pumpkin {
        width: 40px;
        height: 34px;
    }

    .ff-hw-pumpkin.right {
        display: none;
    }
}


/*==================================================
    Harvest theme (November)
==================================================*/

html[data-ff-theme="harvest"] {
    --bg-deep: #0d0803;
    --bg: #1e140a;
    --panel: rgba(38, 24, 12, 0.88);
    --panel-solid: #2a1a0d;
    --panel-2: #3a2512;
    --panel-3: #4d3218;
    --glass: rgba(30, 18, 8, 0.66);
    --line: rgba(251, 191, 36, 0.18);
    --line-strong: rgba(251, 191, 36, 0.38);
    --text: #fff7e8;
    --muted: #cdb498;
    --accent: #f59e0b;
    --accent-2: #ef6f52;
    --accent-ink: #2a1503;
    --lantern: #ffb020;
    --xp: #ef8354;
}

html[data-ff-theme="harvest"] body {
    background:
        radial-gradient(1200px 600px at 12% -10%, rgba(245, 158, 11, 0.16), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(194, 65, 12, 0.18), transparent 60%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='560' height='440' viewBox='0 0 560 440' fill='rgb(12,7,2)' fill-opacity='.5'><path transform='translate(70 50) rotate(-20) scale(1.6)' d='M20 2 L23 9 L27 6 L26.5 14 L33 11 L31.5 17.5 L38 18.5 L32 23.5 L34 27.5 L25 26.5 L21 30 L20.7 30 L20.7 38 L19.3 38 L19.3 30 L19 30 L15 26.5 L6 27.5 L8 23.5 L2 18.5 L8.5 17.5 L7 11 L13.5 14 L13 6 L17 9 Z'/><path transform='translate(380 270) rotate(24) scale(1.1)' d='M20 2 L23 9 L27 6 L26.5 14 L33 11 L31.5 17.5 L38 18.5 L32 23.5 L34 27.5 L25 26.5 L21 30 L20.7 30 L20.7 38 L19.3 38 L19.3 30 L19 30 L15 26.5 L6 27.5 L8 23.5 L2 18.5 L8.5 17.5 L7 11 L13.5 14 L13 6 L17 9 Z'/></svg>"),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    background-attachment: fixed;
}

:where(html[data-ff-theme="harvest"]) button {
    background: linear-gradient(180deg, rgba(92, 58, 26, 0.92), rgba(54, 33, 14, 0.96));
}

:where(html[data-ff-theme="harvest"]) button:hover:not(:disabled) {
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), 0 6px 16px rgba(0, 0, 0, 0.3);
}

html[data-ff-theme="harvest"] .ff-dock button:not(.cast-button) {
    background: linear-gradient(180deg, rgba(92, 58, 26, 0.92), rgba(54, 33, 14, 0.96));
}

html[data-ff-theme="harvest"] .ff-dock button:not(.cast-button):hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(114, 72, 32, 0.95), rgba(66, 40, 17, 0.98));
}

html[data-ff-theme="harvest"] .ff-rail button,
html[data-ff-theme="harvest"] .ff-rail-flyout button,
html[data-ff-theme="harvest"] .ff-tabs button {
    background: transparent;
}

html[data-ff-theme="harvest"] .ff-rail button:hover:not(:disabled),
html[data-ff-theme="harvest"] .ff-rail button.is-open,
html[data-ff-theme="harvest"] .ff-rail-flyout button:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.1);
}

html[data-ff-theme="harvest"] .ff-rail button.active {
    border-color: rgba(245, 158, 11, 0.5);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.06));
}

html[data-ff-theme="harvest"] .ff-tabs button[aria-selected="true"] {
    background: rgba(245, 158, 11, 0.1);
}

html[data-ff-theme="harvest"] .ff-topbar,
html[data-ff-theme="harvest"] .ff-feed {
    position: relative;
}

html[data-ff-theme="harvest"] .ff-topbar .zone-bar {
    background: rgba(18, 10, 3, 0.6);
}

html[data-ff-theme="harvest"] .ff-topbar .zone-select:hover,
html[data-ff-theme="harvest"] .ff-topbar .zone-select.is-open {
    background: rgba(245, 158, 11, 0.1);
}

html[data-ff-theme="harvest"] .ff-dock .cast-button:not([data-cast-state]),
html[data-ff-theme="harvest"] .ff-dock .cast-button[data-cast-state="idle"],
html[data-ff-theme="harvest"] .ff-dock .cast-button[data-cast-state="ready"] {
    border-color: rgba(253, 224, 138, 0.85);
    background:
        radial-gradient(ellipse at 50% -20%, rgba(255, 255, 255, 0.3), transparent 60%),
        linear-gradient(180deg, #f59e0b, #9a4a0c);
    color: #fffbeb;
    box-shadow: 0 12px 30px rgba(217, 119, 6, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

html[data-ff-theme="harvest"] .ff-dock .cast-button:not([data-cast-state]):hover:not(:disabled),
html[data-ff-theme="harvest"] .ff-dock .cast-button[data-cast-state="idle"]:hover:not(:disabled),
html[data-ff-theme="harvest"] .ff-dock .cast-button[data-cast-state="ready"]:hover:not(:disabled) {
    background:
        radial-gradient(ellipse at 50% -20%, rgba(255, 255, 255, 0.4), transparent 60%),
        linear-gradient(180deg, #fbbf24, #b45309);
}

html[data-ff-theme="harvest"] .ff-shell .mobile-game-nav {
    background: rgba(22, 13, 5, 0.96);
}

html[data-ff-theme="harvest"] .ff-shell .mobile-game-nav button.active {
    background: rgba(245, 158, 11, 0.12);
}

html[data-ff-theme="harvest"] .modal-backdrop {
    background: rgba(12, 7, 2, 0.7);
}

html[data-ff-theme="harvest"] .book-modal {
    background:
        radial-gradient(900px 300px at 0% 0%, rgba(245, 158, 11, 0.12), transparent 60%),
        radial-gradient(700px 300px at 100% 100%, rgba(194, 65, 12, 0.12), transparent 60%),
        #22160a;
}

/* Decorations */

/* Golden-hour light over the pond, with a haze along the bottom. */
.ff-hv-tint {
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(234, 140, 30, 0.24) 0%, rgba(194, 65, 12, 0.1) 45%, transparent 70%),
        linear-gradient(0deg, rgba(120, 53, 15, 0.26) 0%, transparent 22%);
}

/* A V of geese heading south (right to left), wings beating. */
.ff-hv-geese {
    z-index: 5;
    width: 138px;
    height: 60px;
    opacity: 0.95;
    animation: ff-hv-migrate var(--dur, 40s) linear infinite;
    animation-delay: var(--delay, 0s);
}

.ff-hv-geese svg {
    transform: scaleX(-1);
}

.ff-hv-geese .w {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: ff-hv-flap 0.5s ease-in-out infinite alternate;
}

.ff-hv-leaf {
    left: var(--x, 50%);
    z-index: 5;
    width: 22px;
    height: 22px;
    animation: ff-hv-fall var(--dur, 14s) linear infinite;
    animation-delay: var(--delay, 0s);
}

.ff-hv-leaf svg {
    animation: ff-hv-sway calc(var(--dur, 14s) / 3) ease-in-out infinite alternate;
    animation-delay: var(--delay, 0s);
}

/* Bottom right, beside the corn shock: the player stands bottom left. */
.ff-hv-bale {
    right: calc(2% + 40px);
    bottom: 2%;
    z-index: 4;
    width: 92px;
    height: 61px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.ff-hv-corn {
    right: 2%;
    bottom: 2%;
    z-index: 4;
    width: 44px;
    height: 70px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
    transform-origin: 50% 100%;
    animation: ff-hv-rustle 6s ease-in-out infinite;
}

.ff-hv-sprig {
    top: 0;
    z-index: 2;
    width: 82px;
    height: 42px;
    opacity: 0.55;
}

.ff-hv-sprig.top-left {
    left: 0;
}

.ff-hv-sprig.top-right {
    right: 0;
    transform: scaleX(-1);
}

@keyframes ff-hv-migrate {
    0% { left: calc(100% + 20px); top: var(--y, 8%); }
    50% { top: calc(var(--y, 8%) + 3%); }
    100% { left: -160px; top: var(--y, 8%); }
}

@keyframes ff-hv-flap {
    from { transform: scaleY(1); }
    to { transform: scaleY(-0.6); }
}

@keyframes ff-hv-fall {
    0% { top: -8%; opacity: 0; }
    6% { opacity: 1; }
    88% { opacity: 1; }
    100% { top: 96%; opacity: 0; }
}

@keyframes ff-hv-sway {
    0% { transform: translateX(0) rotate(-35deg); }
    100% { transform: translateX(var(--sway, 36px)) rotate(55deg); }
}

@keyframes ff-hv-rustle {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(1.6deg); }
}

@media (max-width: 760px) {
    .ff-hv-bale {
        width: 62px;
        height: 41px;
    }

    .ff-hv-corn {
        width: 30px;
        height: 48px;
    }

    .ff-hv-leaf:nth-of-type(even) {
        display: none;
    }
}


/*==================================================
    Controller focus
    While a controller is in use (gamepad.js), the
    focused control gets a ring you can see from the
    couch.
==================================================*/

html.ff-pad :focus {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.35), 0 0 18px var(--accent);
}

html.ff-pad svg :focus {
    outline: none;
    filter: drop-shadow(0 0 6px var(--accent));
}


/*==================================================
    Customize Sidebar (Settings)
==================================================*/

.hb-rail-layout-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 6px;
}

.hb-rail-layout-setting > span {
    display: grid;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.hb-rail-layout-setting > span small {
    font-size: 0.76rem;
    font-weight: 700;
}

.hb-rail-layout-setting button {
    flex: 0 0 auto;
}

.ff-rail-editor-shell {
    z-index: 70;
}

.ff-rail-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(560px, 100%);
    max-height: min(820px, calc(100vh - 36px));
}

.ff-rail-editor-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ff-rail-editor-tools #railEditorReset {
    margin-left: auto;
}

.ff-rail-editor-list,
.ff-rail-editor-list ol {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ff-rail-editor-list {
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.ff-rail-editor-list .rl-row {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 5px 6px 5px 10px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-md, 10px);
    background: rgba(255, 255, 255, 0.03);
}

.ff-rail-editor-list .rl-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--icon, var(--icon-pond)) center / contain no-repeat;
    mask: var(--icon, var(--icon-pond)) center / contain no-repeat;
}

.ff-rail-editor-list .rl-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ff-rail-editor-list .rl-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
}

.ff-rail-editor-list button,
.ff-rail-editor-list select {
    min-height: 32px;
    padding: 4px 9px;
    font-size: 0.78rem;
}

.ff-rail-editor-list select {
    max-width: 150px;
}

.ff-rail-editor-list .rl-folder {
    display: grid;
    flex: 0 0 auto;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(125, 196, 235, 0.06);
}

.ff-rail-editor-list .rl-folder > .rl-row {
    padding-left: 6px;
    border-color: transparent;
    background: transparent;
}

.ff-rail-editor-list .rl-icon-pick {
    max-width: 110px;
}

.ff-rail-editor-list .rl-folder-name {
    flex: 1 1 120px;
    width: 0;
    min-width: 0;
    min-height: 32px;
    padding: 4px 8px;
    font-weight: 800;
}

.ff-rail-editor-list .rl-folder-items {
    padding-left: 22px;
}

.ff-rail-editor-list .rl-empty {
    padding: 8px 10px;
    border: 1px dashed var(--line);
    border-radius: var(--ff-r-md, 10px);
    color: var(--muted);
    font-size: 0.78rem;
}

.ff-rail-editor-list .rl-divider {
    border-style: dashed;
    background: transparent;
}

.ff-rail-editor-list .rl-divider .rl-name {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 560px) {
    .ff-rail-editor-list .rl-row {
        flex-wrap: wrap;
    }

    .ff-rail-editor-list .rl-item .rl-actions,
    .ff-rail-editor-list .rl-folder > .rl-row .rl-actions {
        width: 100%;
    }

    .ff-rail-editor-list .rl-item select {
        flex: 1 1 auto;
        max-width: none;
    }

    .ff-rail-editor-list .rl-folder-items {
        padding-left: 10px;
    }
}
