:root {
    --ink: #29332f;
    --ink-soft: #55625c;
    --cream: #fffaf0;
    --paper: rgba(255, 253, 246, 0.94);
    --green: #3f7158;
    --green-dark: #28513d;
    --leaf: #7ca66f;
    --blush: #d98788;
    --gold: #d9ad55;
    --lavender: #8b78aa;
    --shadow: 0 18px 50px rgba(40, 81, 61, 0.14);
    --radius: 1.3rem;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Trebuchet MS", system-ui, sans-serif;
    background:
        radial-gradient(circle at 15% 5%, rgba(217, 173, 85, .18), transparent 24rem),
        radial-gradient(circle at 90% 12%, rgba(139, 120, 170, .18), transparent 28rem),
        linear-gradient(160deg, #f9f3df, #eaf3e6 52%, #eee7f5);
}

a { color: inherit; }

.site-header,
.site-footer,
main {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: var(--green-dark);
    font-family: Georgia, serif;
    font-size: 1.55rem;
    font-weight: 700;
    text-decoration: none;
}

.brand__mark {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 2px solid var(--leaf);
    border-radius: 50%;
    background: var(--cream);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.site-nav a,
.nav-group__toggle,
.nav-toggle {
    color: var(--green-dark);
    font-weight: 700;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.nav-group__toggle:hover,
.nav-group__toggle:focus-visible,
.nav-toggle:hover,
.nav-toggle:focus-visible {
    color: var(--blush);
}

.site-nav__home,
.nav-group__toggle { padding: .65rem .75rem; }

.nav-toggle,
.nav-group__toggle {
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: .45rem;
    padding: .65rem .8rem;
    border: 1px solid rgba(63, 113, 88, .3);
    border-radius: 999px;
}

.nav-group { position: relative; }

.nav-group__toggle::after {
    content: "▾";
    display: inline-block;
    margin-left: .35rem;
    font-size: .75em;
    transition: transform .15s ease;
}

.nav-group.is-open .nav-group__toggle::after { transform: rotate(180deg); }

.nav-dropdown {
    min-width: 12rem;
    padding: .45rem;
    border: 1px solid rgba(63, 113, 88, .18);
    border-radius: .85rem;
    background: #fffdf7;
    box-shadow: 0 .8rem 2rem rgba(40, 81, 61, .16);
}

.js .nav-dropdown {
    position: absolute;
    z-index: 100;
    top: calc(100% + .25rem);
    left: 0;
    display: none;
}

.js .nav-group.is-open .nav-dropdown { display: grid; }

.nav-dropdown--right {
    right: 0;
    left: auto !important;
}

.nav-dropdown a,
.nav-dropdown .logout-button {
    display: block;
    width: 100%;
    padding: .7rem .8rem;
    border-radius: .55rem;
    text-align: left;
}

.nav-dropdown a:hover,
.nav-dropdown a:focus-visible,
.nav-dropdown .logout-button:hover,
.nav-dropdown .logout-button:focus-visible {
    background: rgba(220, 238, 226, .55);
}
.nav-dropdown__heading { padding: .5rem .8rem .15rem; color: var(--green-dark); font-size: .85rem; font-weight: 700; }
.nav-dropdown__nested { padding-left: 1.4rem !important; }

.logout-form {
    margin: 0;
}

.logout-button {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--green-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.logout-button:hover,
.logout-button:focus-visible {
    color: var(--blush);
}

.hero {
    display: grid;
    grid-template-columns: 1.4fr .6fr;
    gap: 2rem;
    align-items: center;
    min-height: 31rem;
    padding: clamp(2rem, 7vw, 5rem);
    overflow: hidden;
    border: 1px solid rgba(63, 113, 88, .18);
    border-radius: calc(var(--radius) * 1.5);
    background: var(--paper);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 .65rem;
    color: var(--blush);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

h1, h2 {
    color: var(--green-dark);
    font-family: Georgia, serif;
    line-height: 1.08;
}

h1 {
    margin: 0;
    font-size: clamp(2.8rem, 8vw, 5.7rem);
}

h1 span { color: var(--lavender); }

.hero__lede {
    max-width: 42rem;
    margin: 1.3rem 0 2rem;
    color: var(--ink-soft);
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
}

.button {
    display: inline-block;
    padding: .85rem 1.2rem;
    border: 2px solid var(--green);
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(40, 81, 61, .16);
}

.button--primary {
    color: white;
    background: var(--green);
}

.button--quiet {
    color: var(--green-dark);
    background: transparent;
}

.hero__emblem {
    position: relative;
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    border: 2px solid rgba(124, 166, 111, .45);
    border-radius: 45% 55% 50% 50%;
    color: var(--green-dark);
    background: linear-gradient(145deg, #f5eabf, #cfe3c9);
    transform: rotate(4deg);
}

.hero__paw {
    font-size: clamp(3rem, 8vw, 6rem);
    transform: rotate(-4deg);
}

.hero__leaf {
    position: absolute;
    top: 4%;
    right: 10%;
    color: var(--green);
    font-size: 3rem;
}

.world-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 5rem clamp(1rem, 5vw, 4rem);
}

.world-intro h2,
.feature-card h2,
.page-card h1 {
    margin: 0 0 .8rem;
    font-size: clamp(1.65rem, 4vw, 2.4rem);
}

.world-intro p,
.feature-card p,
.page-card p {
    color: var(--ink-soft);
    line-height: 1.7;
}

blockquote {
    margin: 0;
    padding: 2rem;
    border-left: .4rem solid var(--gold);
    border-radius: .7rem;
    color: var(--green-dark);
    background: rgba(255, 250, 240, .65);
    font: italic 1.25rem/1.6 Georgia, serif;
}

blockquote cite {
    display: block;
    margin-top: .8rem;
    color: var(--ink-soft);
    font: normal .9rem/1.4 "Trebuchet MS", sans-serif;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-bottom: 5rem;
}

.feature-card,
.page-card {
    padding: 2rem;
    border: 1px solid rgba(63, 113, 88, .16);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 10px 30px rgba(40, 81, 61, .08);
}

.feature-card__icon {
    display: inline-grid;
    width: 3rem;
    height: 3rem;
    margin-bottom: .9rem;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--lavender);
    font-size: 1.35rem;
}

.feature-card h2 { font-size: 1.45rem; }

.narrow-page {
    max-width: 800px;
    padding: 4rem 0 7rem;
}

.blumes-balance {
    color: var(--green-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 700;
    line-height: 1;
    margin: 1rem 0;
}

.table-scroll {
    overflow-x: auto;
}

.currency-history {
    border-collapse: collapse;
    min-width: 36rem;
    width: 100%;
}

.currency-history th,
.currency-history td {
    border-bottom: 1px solid rgba(33, 91, 69, .2);
    padding: .7rem .5rem;
    text-align: left;
    vertical-align: top;
}

.currency-amount {
    font-weight: 700;
}

.daily-money-reward {
    color: var(--gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.2rem, 8vw, 4.5rem);
    font-weight: 700;
    line-height: 1;
    margin: 1.2rem 0;
}

.trait-library {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.trait-card {
    padding: 1.25rem;
    border: 1px solid rgba(63, 113, 88, .18);
    border-radius: 1rem;
    background: rgba(255, 250, 240, .7);
}

.trait-card h2 {
    margin-top: .2rem;
}

.trait-status {
    color: var(--green-dark);
    font-weight: 700;
}

.trait-status--complete::before {
    content: "✓ ";
    color: var(--green);
}

/* Player-facing feedback needs to be recognizable without relying on text alone. */
p[role="alert"],
p[role="status"] {
    margin: 1rem 0;
    padding: .85rem 1rem;
    border-radius: .8rem;
    font-weight: 700;
}

p[role="alert"] {
    border: 1px solid rgba(172, 72, 72, .55);
    border-left: .35rem solid #ac4848;
    background: rgba(248, 222, 217, .82);
    color: #6f2525;
}

p[role="alert"]::before {
    content: "⚠ ";
}

p[role="status"] {
    border: 1px solid rgba(63, 113, 88, .35);
    border-left: .35rem solid var(--green);
    background: rgba(220, 238, 226, .7);
    color: var(--green-dark);
}

.page-card h1 { font-size: clamp(2.2rem, 6vw, 4rem); }

.shop-balance { font-size: 1.1rem; }

.shop-notice {
    padding: .85rem 1rem;
    border: 1px solid rgba(63, 113, 88, .3);
    border-radius: .8rem;
    background: rgba(220, 238, 226, .65);
}

.shop-notice--error {
    border-color: rgba(172, 72, 72, .35);
    background: rgba(248, 222, 217, .7);
}

.shop-stock { display: grid; gap: 1rem; margin-top: 2rem; }

.shop-item {
    display: grid;
    grid-template-columns: 1fr minmax(14rem, .55fr);
    gap: 1.5rem;
    padding: 1.25rem;
    border: 1px solid rgba(63, 113, 88, .18);
    border-radius: 1rem;
    background: rgba(255, 250, 240, .7);
}

.shop-item h2 { margin: .2rem 0 .5rem; }
.shop-item p { margin-block: .35rem; }
.shop-item__image { display: block; width: min(100%, 12rem); max-height: 12rem; margin-bottom: .75rem; object-fit: contain; }
.shop-item__deal { padding-left: 1.25rem; border-left: 1px solid rgba(63, 113, 88, .18); }
.shop-price { color: var(--green-dark) !important; font: 700 2rem/1 Georgia, serif; }

.haggle-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-block: .8rem;
}

.haggle-summary div {
    padding: .6rem;
    border-radius: .65rem;
    background: rgba(220, 238, 226, .55);
}

.haggle-summary dt { color: var(--ink-soft); font-size: .78rem; }
.haggle-summary dd { margin: .2rem 0 0; color: var(--green-dark); font-weight: 800; }
.shopkeeper-line { color: var(--green-dark) !important; font-family: Georgia, serif; font-style: italic; }

.haggle-form { display: grid; gap: .55rem; margin-top: 1rem; }
.haggle-form label { font-weight: 700; }
.haggle-form input[type="number"] {
    width: 100%;
    padding: .75rem;
    border: 1px solid rgba(63, 113, 88, .35);
    border-radius: .65rem;
    color: var(--ink);
    background: #fffdf7;
    font: inherit;
}

/* Inventory */
.inventory-layout { width: min(1200px, calc(100% - 2rem)); max-width: 1200px; }
.inventory-list { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.inventory-category { border: 1px solid rgba(63, 113, 88, .22); border-radius: 1rem; background: rgba(255, 250, 240, .4); }
.inventory-category summary { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.2rem; color: var(--green-dark); font: 700 1.45rem/1.2 Georgia, serif; cursor: pointer; }
.inventory-category summary::marker { color: var(--green); }
.inventory-category summary small { margin-left: auto; color: var(--ink-soft); font: 600 .85rem/1.2 system-ui, sans-serif; }
.inventory-category[open] summary { border-bottom: 1px solid rgba(63, 113, 88, .18); }
.inventory-category__items { display: grid; gap: 1rem; padding: 1rem; }
.inventory-item { display: grid; grid-template-columns: 1fr minmax(13rem, .48fr); gap: 1.25rem; padding: 1.15rem; border: 1px solid rgba(63, 113, 88, .18); border-radius: 1rem; background: rgba(255, 250, 240, .72); }
.inventory-item h3 { margin: 0 0 .45rem; color: var(--green-dark); font: 700 1.35rem/1.2 Georgia, serif; }
.inventory-item p { margin: .35rem 0; }
.inventory-item__image { float: left; width: 5rem; height: 5rem; margin: 0 .85rem .3rem 0; object-fit: contain; }
.inventory-use-form { display: grid; align-content: center; gap: .55rem; padding-left: 1.25rem; border-left: 1px solid rgba(63, 113, 88, .18); }
.inventory-use-form label { font-weight: 700; }
.inventory-use-form select { width: 100%; padding: .7rem; border: 1px solid rgba(63, 113, 88, .35); border-radius: .65rem; background: #fffdf7; color: var(--ink); font: inherit; }
.inventory-item__future { align-self: center; padding-left: 1.25rem; border-left: 1px solid rgba(63, 113, 88, .18); color: var(--ink-soft); font-style: italic; }
.inventory-notice { padding: .85rem 1rem; border: 1px solid rgba(63, 113, 88, .3); border-radius: .8rem; background: rgba(220, 238, 226, .65); }
.inventory-notice--error { border-color: rgba(172, 72, 72, .35); background: rgba(248, 222, 217, .7); }

@media (max-width: 620px) { .inventory-layout { width: min(100% - 1rem, 1200px); } .inventory-category summary { padding: .9rem 1rem; } .inventory-category__items { padding: .65rem; } .inventory-item { grid-template-columns: 1fr; } .inventory-use-form, .inventory-item__future { padding-top: 1rem; padding-left: 0; border-top: 1px solid rgba(63, 113, 88, .18); border-left: 0; } }

@media (max-width: 620px) {
    .shop-item { grid-template-columns: 1fr; }
    .shop-item__deal { padding-top: 1rem; padding-left: 0; border-top: 1px solid rgba(63, 113, 88, .18); border-left: 0; }
}

.checklist {
    padding: 0;
    margin: 2rem 0;
    list-style: none;
}

.checklist li {
    padding: .75rem .9rem;
    border-bottom: 1px solid rgba(63, 113, 88, .13);
}

.checklist li::before {
    content: "○";
    display: inline-block;
    width: 1.6rem;
    color: var(--blush);
    font-weight: 900;
}

.checklist li.done::before {
    content: "✓";
    color: var(--green);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(63, 113, 88, .2);
    color: var(--ink-soft);
    font-size: .9rem;
}

.site-footer a:hover,
.site-footer a:focus-visible { color: var(--green-dark); }

@media (max-width: 760px) {
    .js .nav-toggle { display: inline-flex; }

    .js .site-nav {
        position: absolute;
        z-index: 90;
        top: calc(100% - .35rem);
        right: 0;
        display: none;
        width: min(22rem, 100%);
        align-items: stretch;
        padding: .65rem;
        border: 1px solid rgba(63, 113, 88, .18);
        border-radius: 1rem;
        background: #fffdf7;
        box-shadow: 0 1rem 2.5rem rgba(40, 81, 61, .18);
    }

    .js .site-nav.is-open {
        display: flex;
        flex-direction: column;
    }

    .site-nav__home,
    .nav-group__toggle,
    .site-nav > a {
        display: block;
        width: 100%;
        text-align: left;
    }

    .js .nav-dropdown,
    .js .nav-dropdown--right {
        position: static;
        margin: 0 .35rem .4rem;
        border: 0;
        border-left: .2rem solid var(--leaf);
        border-radius: 0 .6rem .6rem 0;
        background: rgba(220, 238, 226, .26);
        box-shadow: none;
    }

    .hero,
    .world-intro,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .hero__emblem {
        width: min(15rem, 70%);
        justify-self: center;
    }

    .world-intro { padding-block: 3.5rem; }
}

@media (max-width: 480px) {
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero { padding: 2rem 1.3rem; }
}

/* My Pets page */

.pet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.pet-card {
    overflow: hidden;
    padding: 1.4rem;
    border: 1px solid rgba(63, 113, 88, .18);
    border-radius: var(--radius);
    background: rgba(255, 250, 240, .72);
    box-shadow: 0 7px 20px rgba(40, 81, 61, .08);
}

.pet-card__colors {
    display: flex;
    gap: .65rem;
    margin-bottom: 1.1rem;
}

.pet-color {
    display: block;
    width: 2.6rem;
    height: 2.6rem;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow:
        0 0 0 1px rgba(40, 81, 61, .18),
        0 3px 8px rgba(40, 81, 61, .13);
}

.pet-card h2 {
    margin: 0;
    color: var(--green-dark);
    font: 700 1.7rem/1.2 Georgia, serif;
}

.pet-card h2 a {
    text-decoration: none;
}

.pet-card h2 a:hover,
.pet-card h2 a:focus-visible,
.pet-card__profile-link:hover,
.pet-card__profile-link:focus-visible {
    color: var(--blush);
}

.pet-card__profile-link {
    color: var(--green-dark);
    font-weight: 700;
}

.pet-card .pet-card__species {
    margin: .35rem 0 1.1rem;
    color: var(--ink-soft);
    font-size: .95rem;
}

.pet-trait-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: -.5rem 0 1.1rem;
}

.pet-trait-badge {
    display: inline-grid;
    place-items: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: .15rem;
    border: 1px solid rgba(63, 113, 88, .25);
    border-radius: 50%;
    background: rgba(255, 250, 240, .9);
    box-shadow: 0 2px 5px rgba(40, 81, 61, .1);
    font-size: 1.15rem;
    line-height: 1;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pet-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .55rem 1rem;
    margin: 0;
}

.pet-details dt {
    color: var(--green-dark);
    font-weight: 700;
}

.pet-details dd {
    margin: 0;
    color: var(--ink-soft);
}

@media (max-width: 600px) {
    .pet-grid {
        grid-template-columns: 1fr;
    }
}

/* Pet portraits */

.pet-card__portrait,
.pet-card__portrait-placeholder {
    display: block;
    width: min(100%, 18rem);
    aspect-ratio: 1;
    margin: 0 auto 1.25rem;
    border-radius: var(--radius);
}

.pet-card__portrait {
    object-fit: contain;
    background:
        radial-gradient(
            circle,
            rgba(255, 255, 255, .9),
            rgba(220, 238, 226, .65)
        );
}

.pet-card__portrait-placeholder {
    display: grid;
    place-content: center;
    gap: .5rem;
    border: 2px dashed rgba(63, 113, 88, .25);
    background: rgba(220, 238, 226, .35);
    color: var(--ink-soft);
    text-align: center;
}

.pet-card__portrait-placeholder span:first-child {
    font-size: 3rem;
}

/* Individual pet profiles */

.pet-profile {
    display: grid;
    grid-template-columns: minmax(15rem, 1fr) minmax(15rem, 1fr);
    gap: 2rem;
    align-items: start;
}

.pet-profile__portrait {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: var(--radius);
    background:
        radial-gradient(
            circle,
            rgba(255, 255, 255, .9),
            rgba(220, 238, 226, .65)
        );
}

.pet-profile__palette {
    display: flex;
    gap: .75rem;
    margin: 1rem 0;
}

.pet-profile__facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .7rem 1.1rem;
}

.pet-profile__facts dt {
    color: var(--green-dark);
    font-weight: 700;
}

.pet-profile__facts dd {
    margin: 0;
    color: var(--ink-soft);
}

.pet-profile__parents {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(63, 113, 88, .18);
}

@media (max-width: 650px) {
    .pet-profile {
        grid-template-columns: 1fr;
    }
}

/* Firebrand Foundations */

.potion-game-page,
.scores-page {
    width: min(72rem, calc(100% - 2rem));
    margin: 3rem auto;
}

.potion-summary,
.potion-mode-picker,
.potion-controls,
.potion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

.potion-summary {
    justify-content: space-between;
    padding: .85rem 1rem;
    border-radius: var(--radius);
    background: rgba(220, 238, 226, .42);
}

.potion-summary p {
    margin: 0;
}

.potion-mode-picker {
    margin-top: 1.5rem;
}

.potion-play-instructions {
    padding: .7rem 1rem;
    border-radius: var(--radius);
    background: rgba(235, 226, 247, .45);
}

.potion-recipe {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: .35rem solid #cb7b36;
    border-radius: .25rem var(--radius) var(--radius) .25rem;
    background: #fff8e9;
}

.potion-recipe li {
    margin: .45rem 0;
    transition: color .2s ease, opacity .2s ease;
}

.potion-recipe li.is-complete {
    color: var(--green-dark);
    opacity: .68;
    text-decoration: line-through;
}

.potion-workbench {
    display: grid;
    grid-template-columns: minmax(13rem, 19rem) 1fr;
    gap: 2rem;
    align-items: center;
    min-height: 22rem;
    padding: 1.5rem;
    overflow: hidden;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 25% 45%, rgba(242, 148, 63, .15), transparent 30%),
        linear-gradient(145deg, #eef6ee, #fdf7e9);
}

.potion-bottle {
    position: relative;
    width: 12rem;
    height: 19rem;
    margin: auto;
    filter: drop-shadow(0 1rem 1rem rgba(35, 48, 42, .15));
    transition: filter .18s ease, transform .18s ease;
}

.potion-bottle.is-drop-target {
    filter: drop-shadow(0 0 1.2rem rgba(242, 148, 63, .9));
    transform: scale(1.035);
}

.potion-bottle__stopper {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 50%;
    width: 5.4rem;
    height: 2.2rem;
    border: .22rem solid #76563d;
    border-radius: .55rem;
    background: #b98a5f;
    transform: translateX(-50%);
}

.potion-bottle__neck {
    position: absolute;
    z-index: 2;
    top: 1.6rem;
    left: 50%;
    width: 4.2rem;
    height: 5rem;
    border: .28rem solid rgba(62, 105, 92, .65);
    border-bottom: 0;
    background: rgba(255, 255, 255, .35);
    transform: translateX(-50%);
}

.potion-bottle__body {
    position: absolute;
    bottom: .5rem;
    left: 50%;
    width: 11rem;
    height: 13.4rem;
    overflow: hidden;
    border: .32rem solid rgba(62, 105, 92, .72);
    border-radius: 48% 48% 34% 34% / 32% 32% 25% 25%;
    background: rgba(255, 255, 255, .45);
    transform: translateX(-50%);
}

.potion-bottle__liquid {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 0;
    background: linear-gradient(#15121d, #050508);
    transition: height .45s ease, background .45s ease;
}

.potion-bottle[data-stage="1"] .potion-bottle__liquid { height: 28%; }
.potion-bottle[data-stage="2"] .potion-bottle__liquid { height: 40%; background: linear-gradient(#552019, #0c0810); }
.potion-bottle[data-stage="3"] .potion-bottle__liquid,
.potion-bottle[data-stage="4"] .potion-bottle__liquid,
.potion-bottle[data-stage="5"] .potion-bottle__liquid { height: 52%; background: linear-gradient(#9a311d, #130811); }
.potion-bottle[data-stage="6"] .potion-bottle__liquid { height: 66%; background: linear-gradient(#f29a35, #65171c 65%, #140810); }
.potion-bottle[data-stage="7"] .potion-bottle__liquid { height: 78%; background: linear-gradient(#ffd36b, #e45125 46%, #39101b); }

.potion-bottle__glow {
    position: absolute;
    inset: 25% 22%;
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 2.5rem 1.2rem #ffbd4a;
    transition: opacity .4s ease;
}

.potion-bottle[data-stage="6"] .potion-bottle__glow,
.potion-bottle[data-stage="7"] .potion-bottle__glow,
.potion-bottle.is-cooling .potion-bottle__glow,
.potion-bottle.is-success .potion-bottle__glow { opacity: .85; }

.potion-bubble {
    position: absolute;
    bottom: 12%;
    width: .8rem;
    height: .8rem;
    border: 2px solid rgba(255, 226, 142, .8);
    border-radius: 50%;
    opacity: 0;
}

.potion-bubble--one { left: 25%; }
.potion-bubble--two { left: 50%; animation-delay: .5s; }
.potion-bubble--three { left: 70%; animation-delay: 1s; }
.potion-bottle[data-stage="2"] .potion-bubble,
.potion-bottle[data-stage="3"] .potion-bubble,
.potion-bottle[data-stage="4"] .potion-bubble,
.potion-bottle[data-stage="5"] .potion-bubble,
.potion-bottle[data-stage="6"] .potion-bubble,
.potion-bottle[data-stage="7"] .potion-bubble { animation: potion-bubble 2s infinite ease-in; }

.potion-bottle.is-cooling { animation: potion-pulse 1s infinite alternate ease-in-out; }
.potion-bottle.is-success .potion-bottle__body { box-shadow: 0 0 2rem rgba(255, 145, 36, .65); }
.potion-bottle.is-failed .potion-bottle__liquid { height: 64%; background: linear-gradient(#96739f, #495264); }
.potion-bottle.is-failed { animation: potion-fwump .35s ease-out; }

.potion-narration {
    min-height: 5rem;
    font-size: 1.15rem;
    line-height: 1.65;
}

.potion-timer {
    font-variant-numeric: tabular-nums;
}

.potion-actions,
.potion-controls {
    justify-content: center;
    margin-top: 1rem;
}

.potion-actions button {
    position: relative;
    z-index: 5;
    padding: .7rem 1rem;
    border: 1px solid var(--green-dark);
    border-radius: 999px;
    background: #fffdf7;
    color: var(--green-dark);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.potion-actions button span {
    display: inline-grid;
    min-width: 1.4rem;
    place-items: center;
    color: #b44d29;
    font-size: 1.15rem;
}

.potion-actions [data-action="eye_of_snut"] span { color: #15121d; text-shadow: 0 0 .3rem #76508f; }
.potion-actions [data-action="sunstone"] span { color: #d79a17; }
.potion-actions [data-action="blumewillow_sap"] span { color: var(--green); }
.potion-actions button.is-dragging,
.potion-actions button.is-stirring {
    z-index: 20;
    cursor: grabbing;
    box-shadow: 0 .8rem 1.5rem rgba(40, 81, 61, .25);
}

.potion-actions button:hover:not(:disabled),
.potion-actions button:focus-visible {
    background: var(--green-dark);
    color: white;
}

.potion-actions button:disabled { cursor: not-allowed; opacity: .45; }
.potion-result { min-height: 2rem; text-align: center; font-weight: 700; }

.scores-page section + section { margin-top: 2rem; }
.score-table-wrap { overflow-x: auto; }
.score-table { width: 100%; border-collapse: collapse; }
.score-table th,
.score-table td { padding: .75rem; border-bottom: 1px solid rgba(63, 113, 88, .2); text-align: left; }
.score-table th { color: var(--green-dark); }
.score-table tbody tr:nth-child(odd) { background: rgba(220, 238, 226, .25); }

@keyframes potion-bubble {
    0% { opacity: 0; transform: translateY(0) scale(.6); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-7rem) scale(1.2); }
}

@keyframes potion-pulse { to { transform: scale(1.035); } }
@keyframes potion-fwump { 50% { transform: translateY(.7rem) scale(.94); } }

@media (max-width: 650px) {
    .potion-game-page,
    .scores-page { width: min(100% - 1rem, 72rem); margin: 1rem auto; }
    .potion-workbench { grid-template-columns: 1fr; gap: .5rem; padding: .75rem; }
    .potion-bottle { transform: scale(.86); margin-block: -1rem; }
    .potion-summary { align-items: flex-start; flex-direction: column; }
    .potion-actions button { flex: 1 1 9rem; }
}

@media (prefers-reduced-motion: reduce) {
    .potion-bottle,
    .potion-bubble { animation: none !important; }
    .potion-bottle__liquid,
    .potion-bottle__glow,
    .potion-recipe li { transition: none; }
}

/* Administrator tools */

.admin-page {
    padding: 3rem 0 6rem;
}

.admin-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.admin-tool-card,
.admin-editor {
    padding: 1.25rem;
    border: 1px solid rgba(63, 113, 88, .18);
    border-radius: 1rem;
    background: rgba(255, 250, 240, .72);
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(17rem, .75fr) minmax(28rem, 1.25fr);
    gap: 2rem;
    align-items: start;
    margin-top: 2rem;
}

.admin-form p {
    margin: 0 0 1rem;
}

.admin-form p:not(.admin-checkbox) > label {
    display: block;
    margin-bottom: .35rem;
    color: var(--green-dark);
    font-weight: 700;
}

.admin-form input[type="text"],
.admin-form input:not([type]),
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: .7rem .8rem;
    border: 1px solid rgba(63, 113, 88, .38);
    border-radius: .65rem;
    color: var(--ink);
    background: white;
    font: inherit;
}

.admin-form input[readonly] {
    color: var(--ink-soft);
    background: rgba(220, 238, 226, .36);
}

.admin-form small {
    display: block;
    margin-top: .3rem;
    color: var(--ink-soft);
}

.admin-checkbox label {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
}

.admin-notice,
.admin-errors {
    padding: .85rem 1rem;
    border-radius: .75rem;
}

.admin-notice {
    border-left: .3rem solid var(--green);
    background: rgba(220, 238, 226, .55);
}

.admin-errors {
    border-left: .3rem solid var(--blush);
    background: rgba(248, 222, 222, .45);
}

.admin-table {
    width: 100%;
    min-width: 37rem;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: .75rem .6rem;
    border-bottom: 1px solid rgba(63, 113, 88, .18);
    text-align: left;
    vertical-align: top;
}

.admin-table th { color: var(--green-dark); }
.admin-form input[type="number"], .admin-form input[type="file"] { width: 100%; font: inherit; }
.admin-fieldset { margin: 1.25rem 0; padding: 1rem; border: 1px solid rgba(63, 113, 88, .25); border-radius: .75rem; }
.admin-fieldset legend { padding: 0 .4rem; color: var(--green-dark); font-weight: 700; }
.admin-item-image { display: block; width: 9rem; max-height: 9rem; margin: .75rem 0; object-fit: contain; }
.admin-item-thumbnail { width: 2.5rem; height: 2.5rem; margin-right: .5rem; vertical-align: middle; object-fit: contain; }
.admin-inline-form { display: inline; }
.admin-navigation-list { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.admin-navigation-list li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .7rem; border: 1px solid rgba(63, 113, 88, .18); border-radius: .65rem; background: rgba(255, 253, 246, .66); }
.admin-navigation-list li span { flex: 1 1 12rem; font-weight: 700; }

@media (max-width: 850px) {
    .admin-layout { grid-template-columns: 1fr; }
}

/* Blumewillow world map */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.map-page { width: min(100% - 2rem, 76rem); margin: 0 auto; padding: 3.5rem 0 6rem; }
.map-page__intro { max-width: 46rem; margin-bottom: 2rem; }
.map-page__intro h1 { margin: .1rem 0 .55rem; font-size: clamp(3rem, 8vw, 5.5rem); }
.map-page__intro > p:last-child { max-width: 42rem; font-size: 1.15rem; }
.world-map-card { padding: clamp(.5rem, 2vw, 1.25rem); border: 1px solid rgba(44, 91, 74, .18); border-radius: 1.75rem; background: rgba(255, 253, 245, .72); box-shadow: 0 1.4rem 3.5rem rgba(41, 83, 70, .16); }
.world-map { display: block; width: 100%; height: auto; border-radius: 1.25rem; }
.reef { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.reef--outer { stroke: #f6e9ac; stroke-width: 23; stroke-dasharray: 2 15; opacity: .88; }
.reef--inner { stroke: #fff5c7; stroke-width: 8; stroke-dasharray: 1 11; opacity: .92; }
.continent { fill: url(#blumewillow-land); stroke: #376f5b; stroke-width: 6; stroke-linejoin: round; }
.continent-ridge { fill: none; stroke: #6d9e65; stroke-width: 9; stroke-linecap: round; opacity: .45; }
.biome { stroke: none; }
.biome--forest { fill: #4f9862; opacity: .58; }
.biome--grassland { fill: #b7d98a; opacity: .42; }
.biome--rocklands { fill: #cbb88e; opacity: .86; }
.biome--beach { fill: none; stroke: #efd88b; stroke-width: 16; stroke-linecap: round; opacity: .95; }
.continent-river, .lake-outlet, .river-delta { fill: none; stroke: #dff7ed; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.lake-outlet { stroke-width: 5; }
.river-delta { stroke-width: 4; }
.map-lake { fill: #b9e5d9; stroke: #edf9ef; stroke-width: 4; }
.mountain { stroke: #4d6e60; stroke-width: 3; stroke-linejoin: round; }
.mountain--back { fill: #829c82; opacity: .9; }
.mountain--main { fill: #6f8779; }
.mountain-snow { fill: #f9fff8; stroke: #dcece4; stroke-width: 2; }
.map-forest path { fill: #2f6f4c; stroke: #e0efc4; stroke-width: 2; stroke-linejoin: round; opacity: .88; }
.map-rocks path { fill: #8e8068; stroke: #ece0bd; stroke-width: 2; stroke-linejoin: round; opacity: .9; }
.map-islands path { fill: #84b978; stroke: #376f5b; stroke-width: 4; }
.map-label text { font-family: Georgia, serif; text-anchor: middle; }
.map-label--water text { fill: #235f64; font-size: 20px; font-style: italic; letter-spacing: 2px; transform: rotate(-78deg); transform-origin: 67px 352px; }
.map-label--land text { fill: #265d46; font-size: 24px; font-weight: 700; letter-spacing: 4px; opacity: .76; }
.map-label--gardenia text { fill: #315e4a; font-size: 18px; font-weight: 700; letter-spacing: 2px; }
.map-label--gardenia .map-label__note { font-size: 14px; font-style: italic; font-weight: 400; letter-spacing: 1px; }
.map-route { fill: none; stroke: #f8fff3; stroke-width: 3; stroke-dasharray: 6 9; opacity: .75; }
.map-place { color: #245a44; text-decoration: none; }
.map-place circle { fill: #fffaf0; stroke: #2f7057; stroke-width: 4; transition: fill .18s, stroke .18s; }
.map-place > text:not(.map-place__name) { fill: #285e49; font-family: Georgia, serif; font-size: 21px; font-weight: 700; text-anchor: middle; }
.map-place__name { fill: #214f3c; font-family: Georgia, serif; font-size: 16px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #d9edbe; stroke-width: 5px; stroke-linejoin: round; }
.map-place:hover circle, .map-place:focus circle { fill: #fff0b8; stroke: #8a542b; }
.map-place:focus { outline: none; }
.map-place:focus circle { stroke-width: 7; }
.map-compass circle { fill: rgba(255, 253, 236, .6); stroke: #357367; stroke-width: 2; }
.map-compass path { fill: #fffaf0; stroke: #32675b; stroke-width: 2; }
.map-compass text { fill: #27594f; font-family: Georgia, serif; font-size: 15px; font-weight: 700; text-anchor: middle; }
.map-destinations { display: grid; grid-template-columns: .75fr 1fr 1fr; gap: 1.5rem; align-items: start; margin-top: 2rem; }
.map-destinations h2 { margin-top: .1rem; }
.map-destinations nav { display: grid; gap: .65rem; }
.map-destinations nav a, .map-destinations aside { padding: .85rem 1rem; border: 1px solid rgba(47, 112, 87, .2); border-radius: .85rem; background: rgba(255, 253, 246, .66); }
.map-destinations nav a { display: flex; gap: .4rem; align-items: center; color: var(--green-dark); text-decoration: none; }
.map-destinations nav a:hover, .map-destinations nav a:focus-visible { border-color: var(--green-dark); background: #fffdf6; }
.map-destinations nav span { display: inline-grid; width: 1.6rem; place-items: center; }
.map-destinations nav a > span:last-child { width: auto; justify-items: start; }
.map-destinations nav strong { font-weight: 700; }
.map-destinations nav small { color: var(--ink-soft); font-weight: 400; }
.map-destinations aside h2 { font-size: 1.25rem; }
.map-destinations aside p { margin-bottom: 0; }
@media (max-width: 760px) {
    .map-page { width: min(100% - 1rem, 76rem); padding-top: 2rem; }
    .world-map-card { overflow-x: auto; }
    .world-map { min-width: 44rem; }
    .map-destinations { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .map-place circle { transition: none; } }

/* Harvest Grove */
.harvest-page { width: min(100% - 2rem, 72rem); margin: 2.5rem auto 5rem; }
.harvest-game { padding: clamp(1rem, 3vw, 2rem); border: 1px solid rgba(63, 113, 88, .2); border-radius: 1.5rem; background: rgba(255, 253, 246, .78); box-shadow: var(--shadow); }
.harvest-game__heading { display: flex; gap: 1rem; align-items: start; justify-content: space-between; }
.harvest-game__heading h1 { margin: .05rem 0 .5rem; font-family: Georgia, serif; font-size: clamp(2.25rem, 6vw, 4rem); color: var(--green-dark); }
.harvest-game__heading > div > p:last-child { max-width: 43rem; margin-bottom: 1.5rem; color: var(--ink-soft); font-size: 1.08rem; }
.harvest-stats { display: grid; min-width: 9.5rem; gap: .35rem; padding: .7rem .85rem; border-radius: 1rem; background: #edf5db; color: var(--green-dark); }
.harvest-stats p { margin: 0; }
.harvest-game__stage { overflow: hidden; border: .45rem solid #fff7de; border-radius: 1.25rem; background: #a9dce3; box-shadow: inset 0 0 0 1px rgba(40, 81, 61, .18); }
.harvest-canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; }
.harvest-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1.25rem; }
.harvest-seeds, .harvest-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.harvest-seeds button { padding: .65rem .8rem; border: 1px solid rgba(63, 113, 88, .35); border-radius: .8rem; background: #fffdf7; color: var(--green-dark); font: inherit; font-weight: 700; cursor: pointer; }
.harvest-seeds button small { display: block; margin-top: .1rem; color: var(--ink-soft); font-size: .78rem; font-weight: 400; }
.harvest-seeds button.is-selected, .harvest-seeds button:hover, .harvest-seeds button:focus-visible { border-color: var(--green-dark); background: #dceec9; outline: none; }
.harvest-seeds [data-seed="turnip"] span { color: #c97b9a; }.harvest-seeds [data-seed="berry"] span { color: #9c4a71; }.harvest-seeds [data-seed="sunflower"] span { color: #d79a17; }
.harvest-reset { padding: .45rem; border: 0; background: transparent; color: var(--ink-soft); font: inherit; text-decoration: underline; cursor: pointer; }
.harvest-message { min-height: 1.7rem; margin: 1.25rem 0 .35rem; color: var(--green-dark); font-weight: 700; }
.harvest-help { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.harvest-shop { display: grid; grid-template-columns: minmax(13rem, .7fr) 1.3fr; gap: 1.25rem; align-items: start; margin-top: 1.8rem; padding: 1.25rem; border-radius: 1.1rem; background: linear-gradient(135deg, #e6f1cf, #f9edce); }.harvest-shop h2 { margin: .1rem 0 .4rem; color: var(--green-dark); font-family: Georgia, serif; font-size: 1.7rem; }.harvest-shop > div > p:last-child { margin: 0; color: var(--ink-soft); }.harvest-shop__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }.harvest-shop__card { min-height: 9rem; padding: .85rem; border: 1px solid rgba(63,113,88,.22); border-radius: .85rem; background: rgba(255,253,246,.86); }.harvest-shop__card > span { font-size: 1.4rem; }.harvest-shop__card h3 { margin: .25rem 0; color: var(--green-dark); font-size: 1rem; }.harvest-shop__card p { min-height: 2.5rem; margin: 0 0 .55rem; color: var(--ink-soft); font-size: .84rem; }.harvest-shop__card button { padding: .42rem .6rem; border: 1px solid var(--green-dark); border-radius: .55rem; background: #fffdf7; color: var(--green-dark); font: inherit; font-size: .83rem; font-weight: 700; cursor: pointer; }.harvest-shop__card button:hover:not(:disabled), .harvest-shop__card button:focus-visible { background: var(--green-dark); color: white; }.harvest-shop__card button:disabled { cursor: default; opacity: .62; }.harvest-shop__card.is-owned { background: #eef7dd; }
@media (max-width: 650px) { .harvest-page { width: min(100% - 1rem, 72rem); margin: 1rem auto 3rem; }.harvest-game { padding: .75rem; }.harvest-game__heading { display: block; }.harvest-stats { grid-template-columns: 1fr 1fr; margin-bottom: 1rem; }.harvest-controls { align-items: stretch; }.harvest-seeds, .harvest-actions { width: 100%; }.harvest-seeds button { flex: 1 1 6.5rem; }.harvest-actions .button { flex: 1 1 11rem; }.harvest-reset { width: 100%; }.harvest-game__stage { border-width: .25rem; } }

.harvest-game [data-patches] { margin: .75rem 0 1rem; }
.harvest-game [data-patches] button { padding: .55rem .75rem; border: 1px solid var(--green-dark); border-radius: .5rem; background: #fffdf7; color: var(--green-dark); font: inherit; cursor: pointer; }
.harvest-game [data-patches] button:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 2px; }
.harvest-game [aria-label="Submit a Harvest Grove score"] { margin: 1rem 0; padding: 1rem; border-radius: .75rem; background: #edf5db; }
@media (max-width: 650px) {
    .harvest-shop { grid-template-columns: minmax(0, 1fr); padding: .75rem; }
    .harvest-shop__cards { grid-template-columns: minmax(0, 1fr); }
    .harvest-game [data-patches] button { flex: 1 1 9rem; }
}

/* Human-readable site map */
.site-map-page { width: min(100% - 2rem, 70rem); margin: 0 auto; padding: 3.5rem 0 6rem; }
.site-map-page > header { max-width: 46rem; }
.site-map-page__lede { max-width: 42rem; margin: 1rem 0 0; color: var(--ink-soft); font-size: 1.15rem; }
.site-map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-top: 2.5rem; }
.site-map-grid section { padding: 1.25rem; border: 1px solid rgba(63, 113, 88, .18); border-radius: 1rem; background: rgba(255, 250, 240, .72); }
.site-map-grid h2 { margin: 0 0 .85rem; font-size: 1.35rem; }
.site-map-grid ul { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.site-map-grid a { color: var(--green-dark); font-weight: 700; }
.site-map-grid a:hover, .site-map-grid a:focus-visible { color: var(--blush); }
