/*==================================================
    Fish Fish - The Farm
    Garden plots, the alchemy table, the Recipe Book,
    the Pearl upgrades, and the potion chip on the
    pond beside the Flow State meter.
==================================================*/

[data-icon="sprout"] { --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 21v-9'/><path d='M12 12C12 8 9 5.5 4.5 5.5 4.5 10 7.5 12 12 12z'/><path d='M12 14c0-4 3-6.5 7.5-6.5 0 4.5-3 6.5-7.5 6.5z'/><path d='M6 21h12'/></svg>"); }

.fm-modal {
    width: min(1180px, 100%);
}

.fm-modal .book-header {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.fm-modal .book-header > div:first-child {
    flex: 1 1 260px;
    min-width: 0;
}

.fm-muted {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.fm-label {
    display: block;
    margin: 12px 0 6px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fm-timer {
    color: #fde68a;
    font-variant-numeric: tabular-nums;
}

.fm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.fm-tabs[hidden] {
    display: none;
}

.fm-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--ff-r-pill, 999px);
}

.fm-tabs button.active {
    border-color: #84cc16;
    background: rgba(132, 204, 22, 0.18);
    color: var(--text);
}

.fm-tabs em {
    min-width: 18px;
    padding: 0 6px;
    border-radius: var(--ff-r-pill, 999px);
    background: #84cc16;
    color: #1a2e05;
    font-style: normal;
    font-weight: 800;
    font-size: 0.75rem;
    text-align: center;
}

.fm-tabs small {
    color: var(--muted);
    font-weight: 800;
}


/* Locked */
.fm-locked {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 24px 16px 30px;
    text-align: center;
}

.fm-locked h3 {
    margin: 6px 0 0;
}

.fm-locked p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
}

.fm-locked-art {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    filter: saturate(0.8);
}

.fm-locked-art svg {
    width: 76px;
    height: 72px;
}

.fm-locked-bar {
    width: min(320px, 100%);
    height: 10px;
    overflow: hidden;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(255, 255, 255, 0.08);
}

.fm-locked-bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #65a30d, #a3e635);
}


/* Garden */
.fm-seed-row .fm-label {
    margin-top: 0;
}

.fm-boss-herbs {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.fm-packets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}

.fm-packet {
    display: grid;
    justify-items: center;
    gap: 1px;
    padding: 6px 4px 7px;
    border: 1px solid color-mix(in srgb, var(--hc) 35%, transparent);
    border-radius: var(--ff-r-lg, 12px);
    background: linear-gradient(180deg, color-mix(in srgb, var(--hc) 12%, transparent), rgba(255, 255, 255, 0.03));
    color: var(--text);
    text-align: center;
}

.fm-packet svg {
    width: 44px;
    height: 40px;
}

.fm-packet b {
    font-size: 0.8rem;
}

.fm-packet small {
    color: var(--muted);
    font-size: 0.7rem;
}

.fm-packet {
    position: relative;
}

.fm-have {
    position: absolute;
    top: 4px;
    right: 5px;
    min-width: 18px;
    padding: 0 5px;
    border-radius: var(--ff-r-pill, 999px);
    background: color-mix(in srgb, var(--hc) 40%, rgba(0, 0, 0, 0.45));
    color: var(--text);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
    line-height: 16px;
}

.fm-have.none {
    opacity: 0.45;
}

.fm-packet.picked {
    border-color: var(--hc);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--hc) 45%, transparent);
}

.fm-packet.locked {
    opacity: 0.45;
    filter: grayscale(0.9) brightness(0.6);
}

.fm-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 12px 0;
}

.fm-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.fm-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
}

.fm-field {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(132, 204, 22, 0.25);
    border-radius: var(--ff-r-lg, 16px);
    background:
        radial-gradient(circle at 15% 20%, rgba(190, 242, 100, 0.12), transparent 40%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0 6px, transparent 6px 14px),
        linear-gradient(180deg, #25451c, #1b3315);
}

.fm-plot {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 4px;
    min-height: 168px;
    padding: 8px 8px 10px;
    border: 3px solid #6b4423;
    border-radius: var(--ff-r-lg, 12px);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.3));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 3px 0 #3f2814;
    color: var(--text);
    font: inherit;
    text-align: center;
}

.fm-bed {
    position: relative;
    display: grid;
    place-items: end center;
    width: 100%;
    height: 92px;
    border-radius: var(--ff-r-md, 8px);
    background:
        repeating-linear-gradient(180deg, transparent 0 9px, rgba(0, 0, 0, 0.18) 9px 11px),
        linear-gradient(180deg, transparent 40%, #5b3a1f 40%, #4a2f18);
    overflow: hidden;
}

.fm-bed svg {
    width: 98px;
    height: 92px;
}

.fm-plot strong {
    font-size: 0.9rem;
}

.fm-plot small {
    color: var(--muted);
    font-size: 0.75rem;
}

.fm-plot.ready {
    border-color: color-mix(in srgb, var(--hc) 70%, #6b4423);
    box-shadow: 0 0 14px color-mix(in srgb, var(--hc) 40%, transparent), 0 3px 0 #3f2814;
}

.fm-plot.ready .fm-bed svg {
    animation: fm-sway 3.2s ease-in-out infinite;
    transform-origin: 50% 100%;
}

.fm-plot.empty {
    border-style: dashed;
    cursor: pointer;
}

.fm-plot.empty:hover {
    border-color: #a3e635;
}

.fm-plot.locked {
    border-color: rgba(107, 68, 35, 0.5);
    opacity: 0.55;
}

.fm-plus,
.fm-lock {
    align-self: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 2rem;
    font-weight: 800;
}

.fm-lock {
    font-size: 1.5rem;
}

.fm-bar {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: var(--ff-r-pill, 999px);
    background: rgba(0, 0, 0, 0.35);
}

.fm-bar i {
    display: block;
    height: 100%;
    background: var(--hc, #84cc16);
    transition: width 1s linear;
}

.fm-harvest {
    padding: 5px 14px;
    border-color: var(--hc);
    background: color-mix(in srgb, var(--hc) 30%, transparent);
    font-weight: 800;
}

.fm-dig {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
}

.fm-dig:hover {
    opacity: 1;
}

@keyframes fm-sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}


/* Alchemy */
.fm-alchemy {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 16px;
}

.fm-table,
.fm-shelf {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 16px);
    background: rgba(255, 255, 255, 0.03);
}

.fm-table {
    background:
        radial-gradient(circle at 50% 30%, rgba(168, 85, 247, 0.12), transparent 55%),
        linear-gradient(180deg, #2a1f17, #1d1611);
    border-color: rgba(161, 98, 7, 0.35);
}

.fm-cauldron {
    display: flex;
    justify-content: center;
}

.fm-cauldron svg {
    width: min(170px, 55%);
    height: auto;
}

.fm-bubble {
    animation: fm-bubble 2.2s ease-in infinite;
    animation-delay: var(--d, 0s);
    transform-box: fill-box;
    transform-origin: center;
}

.fm-flame {
    animation: fm-flame 0.9s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: 50% 100%;
}

@keyframes fm-bubble {
    0% { opacity: 0; transform: translateY(0) scale(0.4); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-36px) scale(1.1); }
}

@keyframes fm-flame {
    from { transform: scaleY(0.85); }
    to { transform: scaleY(1.12); }
}

.fm-slots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.fm-slot {
    display: grid;
    place-items: center;
    min-height: 58px;
    padding: 4px;
    border: 2px dashed rgba(255, 255, 255, 0.18);
    border-radius: var(--ff-r-lg, 12px);
    color: var(--muted);
    font-size: 0.8rem;
}

.fm-slot.filled {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.fm-herb-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: var(--text);
}

.fm-herb-chip svg {
    flex: none;
    width: 30px;
    height: 28px;
}

.fm-herb-chip b {
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-herb-chip em {
    color: var(--muted);
    font-size: 0.72rem;
    font-style: normal;
}

.fm-brew-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.fm-brew-row .primary {
    min-width: 120px;
}

.fm-result {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 12px);
    color: var(--muted);
    font-size: 0.85rem;
}

/* The status card above the cauldron and the result below it keep their
   room whatever they say, so the table doesn't jump as herbs go in. */
.fm-brew-status {
    display: grid;
    min-height: 104px;
    margin-bottom: 10px;
}

.fm-brew-status > * {
    margin: 0;
}

.fm-status-idle {
    display: grid;
    place-items: center;
    padding: 9px 12px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: var(--ff-r-lg, 12px);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.fm-result {
    min-height: 64px;
}

.fm-result svg {
    flex: none;
    width: 42px;
    height: 40px;
}

.fm-result.good {
    border-color: rgba(132, 204, 22, 0.45);
    background: rgba(132, 204, 22, 0.1);
    color: var(--text);
}

.fm-result.bad {
    border-color: rgba(120, 113, 108, 0.6);
    background: rgba(87, 83, 78, 0.25);
    color: var(--text);
}

.fm-tried-warning {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: center;
    gap: 4px 10px;
    margin-bottom: 10px;
    padding: 9px 12px;
    border: 1px solid rgba(251, 191, 36, 0.6);
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(146, 64, 14, 0.35);
    color: var(--text);
    font-size: 0.85rem;
}

.fm-makes {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 7px 12px;
    border: 1px solid color-mix(in srgb, var(--pc) 60%, transparent);
    border-radius: var(--ff-r-lg, 12px);
    background: color-mix(in srgb, var(--pc) 16%, transparent);
    font-size: 0.85rem;
}

.fm-makes svg {
    flex: none;
    width: 30px;
    height: 36px;
}

.fm-makes span {
    display: grid;
}

.fm-makes small,
.fm-makes em {
    color: var(--muted);
    font-size: 0.75rem;
    font-style: normal;
}

/* Heading and button share the top row, the text runs below. */
.fm-tried-warning strong {
    flex: 1 1 auto;
    color: #fcd34d;
}

.fm-tried-warning span {
    flex-basis: 100%;
    order: 3;
}

.fm-tried-warning button {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.8rem;
}

.fm-pantry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 6px;
}

.fm-pantry-item {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 3px 8px 3px 3px;
    border: 1px solid color-mix(in srgb, var(--hc) 40%, transparent);
    border-radius: var(--ff-r-md, 10px);
    background: color-mix(in srgb, var(--hc) 10%, transparent);
    color: var(--text);
    text-align: left;
}

.fm-pantry-item svg {
    flex: none;
    width: 32px;
    height: 30px;
}

.fm-pantry-item b {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-pantry-item em {
    font-style: normal;
    font-weight: 800;
}

.fm-pantry-item.none {
    opacity: 0.45;
}

.fm-active {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--pc) 55%, transparent);
    border-radius: var(--ff-r-lg, 14px);
    background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 20%, transparent), transparent);
}

.fm-active.none {
    border-color: var(--line);
    background: none;
    color: var(--muted);
    font-size: 0.85rem;
}

.fm-active svg {
    flex: none;
    width: 52px;
    height: 48px;
}

.fm-active > span {
    display: grid;
    flex: 1;
    min-width: 0;
}

.fm-active small {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fm-active em {
    color: var(--muted);
    font-size: 0.82rem;
    font-style: normal;
}

.fm-potions {
    display: grid;
    gap: 8px;
}

.fm-potion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent);
    border-radius: var(--ff-r-lg, 12px);
    background: color-mix(in srgb, var(--pc) 8%, transparent);
}

.fm-potion svg {
    flex: none;
    width: 46px;
    height: 44px;
}

.fm-potion > span {
    display: grid;
    flex: 1;
    min-width: 0;
}

.fm-potion strong em {
    color: var(--muted);
    font-style: normal;
}

.fm-potion small {
    color: var(--muted);
    font-size: 0.78rem;
}


/* Recipe Book */
.fm-book > .fm-muted {
    margin: 0 0 12px;
}

.fm-recipes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.fm-recipe {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 4px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--pc, #475569) 40%, transparent);
    border-radius: var(--ff-r-lg, 14px);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--pc, #475569) 12%, transparent), transparent 60%),
        #241c14;
    text-align: center;
}

.fm-recipe > svg {
    width: 70px;
    height: 66px;
}

.fm-recipe small {
    color: var(--muted);
    font-size: 0.8rem;
}

.fm-recipe.unknown {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
}

.fm-recipe-herbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px 4px;
    margin-top: 4px;
}

.fm-plus-sign {
    color: var(--muted);
    font-style: normal;
    font-weight: 800;
}

.fm-recipe-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.82rem;
}


/* Failed Experiments tab */
.fm-failed > .fm-muted {
    margin: 0 0 10px;
}

.fm-failed-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}

.fm-failed-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
    padding: 8px 10px;
    border: 1px dashed rgba(248, 113, 113, 0.3);
    border-radius: var(--ff-r-lg, 12px);
    background: rgba(127, 29, 29, 0.12);
}


/* Upgrades */
.fm-upgrade-groups {
    display: grid;
    gap: 14px;
}

.fm-upgrade-groups h3 {
    margin: 0 0 8px;
}

.fm-upgrades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.fm-upgrade {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--ff-r-lg, 14px);
    background: rgba(255, 255, 255, 0.03);
}

.fm-upgrade-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.fm-upgrade-top span {
    color: var(--muted);
    font-weight: 800;
}

.fm-upgrade > small {
    color: var(--muted);
}

.fm-upgrade p {
    margin: 0;
    font-size: 0.85rem;
}

.fm-upgrade p b {
    color: #bef264;
}

.fm-upgrade button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 800;
}

.fm-pips {
    display: flex;
    gap: 3px;
}

.fm-pips i {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.fm-pips i.on {
    background: linear-gradient(90deg, #65a30d, #a3e635);
}

.fm-upgrade.maxed {
    border-color: rgba(250, 204, 21, 0.4);
}

.fm-max {
    color: #facc15;
    font-weight: 800;
    text-align: center;
}


/* The potion chip on the pond, under the Flow State meter */
.fm-hud {
    --pc: #84cc16;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 150px;
    max-width: 230px;
    padding: 4px 10px 5px 4px;
    border: 1px solid color-mix(in srgb, var(--pc) 50%, transparent);
    border-radius: var(--ff-r-md, 10px);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--pc) 22%, transparent), transparent 85%),
        var(--glass);
    backdrop-filter: blur(8px);
    color: var(--text);
    text-align: left;
    box-shadow: none;
    pointer-events: auto;
    cursor: pointer;
}

.fm-hud[hidden] {
    display: none;
}

.fm-hud svg {
    flex: none;
    width: 30px;
    height: 28px;
}

.fm-hud > span {
    display: grid;
    flex: 1;
    min-width: 0;
}

.fm-hud-top {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.fm-hud-top b {
    overflow: hidden;
    color: var(--pc);
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-hud .fm-timer {
    font-size: 0.74rem;
}

.fm-hud small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}


@media (max-width: 760px) {
    .fm-alchemy {
        grid-template-columns: 1fr;
    }

    .fm-brew-status {
        min-height: 124px;
    }

    .fm-field {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        padding: 10px;
        gap: 10px;
    }
}

html:is(.ff-low-detail, .ff-motion-off) .fm-bubble,
html:is(.ff-low-detail, .ff-motion-off) .fm-flame,
html:is(.ff-low-detail, .ff-motion-off) .fm-plot.ready .fm-bed svg {
    animation: none !important;
}
