:root {
    --color-bg: #f7f9f4;
    --color-card: #ffffff;
    --color-text: #2b3a2f;
    --color-muted: #6b7d6e;
    --color-border: #dde5d8;
    --color-water: #3b82c4;
    --color-wilt: #b08d57;
    --color-pesticide: #c0392b;
    --color-burn: #e67e22;
    --color-primary: #4a8c5b;
    --color-primary-dark: #386b46;
    --radius: 10px;
    --max-width: 640px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px;
}

/* Header */
.site-header {
    background: var(--color-primary);
    color: #fff;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

.site-header a {
    color: #fff;
    text-decoration: none;
}

.site-header .logo {
    font-size: 1.3rem;
    font-weight: 700;
}

.site-header nav a {
    margin-left: 14px;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Notification count pill */
.notif-count {
    background: #fff;
    color: var(--color-primary-dark);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 3px;
}

/* Collapsible nav menu */
.site-header .container {
    position: relative;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    padding: 2px 6px;
    margin-left: 12px;
    cursor: pointer;
    vertical-align: middle;
}

.nav-toggle:hover {
    background: var(--color-primary-dark);
    border-radius: 6px;
}

.nav-menu {
    display: inline;
}

@media (max-width: 767px) {
    .nav-toggle {
        display: inline-block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        right: 0;
        top: 46px;
        background: var(--color-primary-dark);
        border-radius: 10px;
        padding: 12px 18px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
        z-index: 50;
        min-width: 160px;
    }

    .nav-menu.open {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .nav-menu a {
        margin-left: 0 !important;
    }

    /* Logged-out nav (Guide / Log In / Sign Up) — a few Android phones
       render this text slightly wider than iPhone/desktop and wrap to a
       second line. nowrap + allowing nav to shrink fixes most cases
       without touching font size at all. */
    .site-header .container {
        flex-wrap: nowrap;
    }

    .site-header nav {
        display: flex;
        align-items: center;
        flex-shrink: 1;
        min-width: 0;
        justify-content: flex-end;
    }

    .site-header nav a {
        white-space: nowrap;
    }

    .site-header .logo {
        flex-shrink: 0;
    }
}

@media (max-width: 340px) {
    /* Only the narrowest phones need an actual size reduction */
    .site-header .logo {
        font-size: 1.15rem;
    }

    .site-header nav a {
        margin-left: 8px;
        font-size: 0.85rem;
    }
}

/* Cards */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 14px;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: #fff;
    color: var(--color-text);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button, .btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

button:hover, .btn:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-muted);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.alert-error {
    background: #fdecea;
    color: var(--color-pesticide);
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #e8f5e9;
    color: var(--color-primary-dark);
    border: 1px solid #c3e6cb;
}

/* Helper text */
.muted {
    color: var(--color-muted);
    font-size: 0.85rem;
}

.text-center {
    text-align: center;
}

a.link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

a.link:hover {
    text-decoration: underline;
}

/* Seed / Branch cards */
.seed-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.growth-badge {
    background: #eaf3ec;
    color: var(--color-primary-dark);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.contested-badge {
    background: #fff3e0;
    color: #d35400;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.new-activity-badge {
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Pinned branch styles are below .branch-card so they correctly override it */

.vote-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.vote-btn {
    background: #f0f4ee;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.vote-btn.water-btn.active {
    background: #e3f2fd;
    border-color: var(--color-water);
    color: var(--color-water);
}

.vote-btn.wilt-btn.active {
    background: #fdf3e7;
    border-color: var(--color-wilt);
    color: var(--color-wilt);
}

.branch-count {
    margin-left: auto;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.btn-link:hover {
    background: #eaf3ec;
    color: var(--color-primary-dark);
    border-radius: 4px;
}

.btn-link.burn-btn {
    color: var(--color-burn);
}

.btn-link.burn-btn:hover {
    background: #fff3e0;
    color: var(--color-burn);
}

.btn-link.save-btn.active {
    color: var(--color-primary-dark);
    font-weight: 600;
    text-decoration: none;
}

/* My Garden: per-card remove button (sits outside the card's link) */
.seed-preview-wrap {
    position: relative;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.seed-preview-wrap.removing {
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
}

.remove-from-garden-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-muted);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
}

.remove-from-garden-btn:hover {
    background: var(--color-pesticide);
    color: #fff;
    border-color: var(--color-pesticide);
}

.bookmark-toggle-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
}

.bookmark-toggle-btn:hover {
    opacity: 1;
}

.bookmark-toggle-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    opacity: 1;
}

.branch-card {
    margin-left: 12px;
    border-left: 3px solid var(--color-primary);
}

/* Pinned branch — full width + green top+left border. Must come after
   .branch-card in the stylesheet so margin-left:0 wins the cascade. */
.pinned-branch {
    margin-left: 0 !important;
    border-top: 3px solid var(--color-primary);
    border-left: 3px solid var(--color-primary);
}

/* Comments */
.comments {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

.comment {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.comment-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.comment-form input[type="text"] {
    flex: 1;
}

.comment-form button {
    padding: 8px 14px;
    font-size: 0.9rem;
}

/* Growth progress bar */
.growth-progress {
    margin: 10px 0;
}

.growth-progress-bar {
    background: #e8efe5;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-top: 4px;
}

.growth-progress-fill {
    background: linear-gradient(90deg, var(--color-primary), #7bc492);
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.growth-progress-label {
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* Profile badges */
.badge-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.badge {
    background: #eaf3ec;
    border-radius: var(--radius);
    padding: 10px 16px;
    text-align: center;
    min-width: 90px;
}

.badge .badge-icon {
    font-size: 1.6rem;
    display: block;
}

.badge .badge-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.badge .badge-label {
    font-size: 0.75rem;
    color: var(--color-muted);
}

/* Prominent plant CTA */
.plant-cta {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.plant-cta p {
    margin: 0;
    font-weight: 600;
}

.plant-cta .btn {
    background: #fff;
    color: var(--color-primary-dark);
    font-weight: 700;
    white-space: nowrap;
}

.plant-cta .btn:hover {
    background: #f0f4ee;
}

.nav-plant-btn {
    background: #fff !important;
    color: var(--color-primary-dark) !important;
    border-radius: 999px;
    padding: 4px 14px !important;
    font-weight: 700;
}

/* Homepage tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    overflow-x: auto;
}

.tab {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-muted);
    text-decoration: none;
    white-space: nowrap;
}

.tab.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.seed-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.seed-preview h3 {
    margin: 6px 0;
}

.seed-stats {
    font-size: 0.85rem;
}

.edit-form textarea, .edit-form input[type="text"] {
    margin-bottom: 8px;
}

.comment-edit-form {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.comment-edit-form input[type="text"] {
    flex: 1;
    margin-bottom: 0;
}

/* ============================================
   Desktop layout
   ============================================ */
@media (min-width: 768px) {
    :root {
        --max-width: 1100px;
    }

    body {
        font-size: 1.05rem;
    }

    .site-header .container {
        max-width: var(--max-width);
    }

    .site-header .logo {
        font-size: 1.5rem;
    }

    .site-header nav a {
        margin-left: 22px;
        font-size: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    /* Two-column layout for seed detail page */
    .page-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 24px;
        align-items: start;
    }

    .side-col {
        position: sticky;
        top: 20px;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    /* Homepage seed grid */
    .seed-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .card {
        padding: 22px;
    }

    .branch-card {
        margin-left: 24px;
    }

    .tabs {
        justify-content: flex-start;
    }
}

@media (min-width: 1100px) {
    :root {
        --max-width: 1280px;
    }

    .seed-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Formatting toolbar (seed/branch textareas)
   ============================================ */
.format-toolbar {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.format-btn {
    background: #eef2ec;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    width: 32px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    color: var(--color-text);
}

.format-btn:hover {
    background: #dde6da;
}

/* Inline code rendered from `backticks` */
code {
    background: #eef2ec;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

/* ============================================
   Notification badge — absolute so it doesn't
   push nav items or affect line height
   ============================================ */
.nav-notif-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notif-count {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #fff;
    color: var(--color-primary-dark);
    border-radius: 999px;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
    pointer-events: none;
}

/* ============================================
   Logged-in homepage greeting
   ============================================ */
.home-greeting {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0 14px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
}

.home-greeting > div {
    flex: 1;
    min-width: 0;
}

.home-greeting-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-primary-dark);
    word-break: break-word;
}

@media (max-width: 767px) {
    .home-greeting-title {
        font-size: 1.15rem;
    }
}

/* ============================================
   Hero section — logged-out homepage only
   ============================================ */
.hero {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.hero-text {
    flex: 1;
    min-width: 280px;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-primary-dark);
    margin: 0 0 10px;
    line-height: 1.15;
}

.hero-tagline {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 12px;
    line-height: 1.5;
}

.hero-body {
    color: var(--color-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0 0 20px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-btn-primary {
    font-size: 1rem;
    padding: 10px 22px;
}

.hero-btn-secondary {
    color: var(--color-primary-dark);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.hero-btn-secondary:hover {
    text-decoration: underline;
}

.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 140px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary-dark);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* How it works row */
.hero-how {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.hero-how-item {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-how-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.hero-how-item strong {
    font-size: 0.95rem;
}

.hero-how-item .muted {
    font-size: 0.82rem;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .hero {
        flex-direction: column;
        padding: 20px 0 16px;
        gap: 20px;
    }

    .hero-title {
        font-size: 1.7rem;
    }

    .hero-stats {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        padding: 14px 16px;
        min-width: unset;
    }

    .hero-stat {
        align-items: center;
        flex: 1;
        text-align: center;
    }

    .hero-stat-number {
        font-size: 1.4rem;
    }

    .hero-how {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Follow button
   ============================================ */
.follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    border: 2px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.follow-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

.follow-btn.active {
    background: var(--color-primary);
    color: #fff;
}

.follow-btn.active:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

/* ============================================
   Following page
   ============================================ */
.following-who {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.following-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 5px 12px 5px 6px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.88rem;
    font-weight: 600;
}

.following-pill:hover {
    border-color: var(--color-primary);
    background: #eaf3ec;
}

/* ============================================
   Pinned branch
   ============================================ */
.pinned-branch {
    margin-left: 0 !important;
    border-top: 3px solid var(--color-primary);
    border-left: 3px solid var(--color-primary);
}

/* ============================================
   New activity badge (My Garden)
   ============================================ */
.new-activity-badge {
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   Seed preview wrapper (for bookmark toggle
   and remove buttons)
   ============================================ */
.seed-preview-wrap {
    position: relative;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.seed-preview-wrap.removing {
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
}

.bookmark-toggle-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
}

.bookmark-toggle-btn:hover {
    opacity: 1;
}

.bookmark-toggle-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    opacity: 1;
}

.remove-from-garden-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-muted);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
}

.remove-from-garden-btn:hover {
    background: var(--color-pesticide);
    color: #fff;
    border-color: var(--color-pesticide);
}

.btn-link.save-btn.active {
    color: var(--color-primary-dark);
    font-weight: 600;
    text-decoration: none;
}

/* ============================================
   Formatting toolbar
   ============================================ */
.format-toolbar {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.format-btn {
    background: #eef2ec;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    width: 32px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    color: var(--color-text);
}

.format-btn:hover {
    background: #dde6da;
}

code {
    background: #eef2ec;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

/* ============================================
   Guidelines table of contents
   ============================================ */
.toc-card {
    scroll-margin-top: 70px;
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 24px;
}

.toc-link {
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--color-primary-dark);
    display: block;
    padding: 2px 0;
}

.toc-link:hover {
    text-decoration: underline;
}

/* Give each section breathing room when jumped to */
[id] {
    scroll-margin-top: 80px;
}

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

/* ============================================
   Seed Kingdom (/kingdom)
   ============================================ */
.kingdom-section-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--color-muted);
    margin: 20px 0 10px;
}

.featured-trees-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}

.featured-tree-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
}

.featured-tree-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 6px;
}

.featured-tree-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
}

.featured-tree-tier {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin: 2px 0 6px;
    text-transform: capitalize;
}

.forest-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.rarity-collection-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.rarity-slot {
    aspect-ratio: 1;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.rarity-slot.found img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rarity-slot.locked {
    opacity: 0.35;
}

.rarity-slot-lock {
    font-size: 1.2rem;
}

.full-forest-details {
    margin: 16px 0;
}

.full-forest-toggle {
    cursor: pointer;
    font-weight: 600;
    padding: 10px 0;
    color: var(--color-primary-dark);
}

.forest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 6px;
}

.forest-tile {
    aspect-ratio: 1;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.forest-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.forest-tile:hover {
    border-color: var(--color-primary);
}

.kingdom-footer-note {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

@media (max-width: 767px) {
    .featured-trees-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .featured-tree-img {
        width: 48px;
        height: 48px;
    }

    .rarity-collection-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .forest-grid {
        grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    }
}

.forest-search-box {
    margin: 12px 0 18px;
}

/* ============================================
   Rarity badges (seed_preview.php, Hall of Fame)
   ============================================ */
.rarity-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.rarity-badge-common {
    background: #eef2ec;
    color: #5a7a52;
}

.rarity-badge-uncommon {
    background: #e3f2e8;
    color: #2e7d4f;
}

.rarity-badge-rare {
    background: #e3edfa;
    color: #3a5a8a;
}

.rarity-badge-epic {
    background: #f0e6f7;
    color: #6a3f8a;
}

.rarity-badge-legendary {
    background: #fdf0d9;
    color: #a8762f;
}

.rarity-badge-mythical {
    background: #1a2340;
    color: #f3e4a8;
}

/* Legendary Grove — slightly richer card backdrop to set it apart
   from the regular Trees grid below it */
.legendary-grove-grid .seed-preview {
    background: linear-gradient(180deg, #fdf9ef 0%, var(--color-card) 60%);
    border-color: #ecdcab;
}
