﻿/* ───────────────────────────────────────────────────
   GNOSIS - THE ULTIMATE HYPERSPACE COOKBOOK CSS
   ───────────────────────────────────────────────────

Design tokens: 
--bg-panel: #0f1520 panel/card backgrounds
--bg-surface: #141e2e elevated surfaces
--bg-chrome: #0d1829 nav bars / top bar
--border: #1e2e44 default borders
--border-bright:#2a4060 brighter border on hover
--accent-teal: #4fc97e primary accent (oxygen/atmosphere green)
--accent-amber: #e8a020 secondary accent (crafting/resources)
--accent-blue: #5b7fd4 tertiary accent (atmospheric blue)
--text-primary: #d8e8f0 main text
--text-muted: #6a8aaa muted/secondary text
--text-dim: #3a5070 very dim text
──────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: Arial, sans-serif;
    background: #0a0e14;
    color: #d8e8f0;
    font-size: 14px;
    overflow: hidden;
}

/* Main scroll container — sits below fixed top bar */
main {
    padding-top: 53px;
    height: 100%;
    overflow: hidden;
}

/* ── Top bar ─────────────────────────────────────── */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0d1829;
    padding: 10px 14px;
    border-bottom: 1px solid #1e2e44;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.top-bar h1 {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 700;
    color: #d8e8f0;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ── Hamburger ───────────────────────────────────── */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

    .hamburger-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background: #d8e8f0;
        border-radius: 2px;
        transition: background 0.15s;
    }

    .hamburger-btn:hover span {
        background: #4fc97e;
    }

/* ── Home icon button ────────────────────────────── */
.top-bar-home-btn {
    display: none;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
    padding: 2px;
    flex-shrink: 0;
}

/* ── Top-bar icon sizes ──────────────────────────── */
.nav-home-icon {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

/* ── Flyout nav icon alignment ───────────────────── */
.flyout-links a img {
    display: inline;
    vertical-align: middle;
}

.nav-game-icon {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.nav-cart-icon {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

/* ── Flyout backdrop ─────────────────────────────── */
.flyout-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 299;
}

    .flyout-backdrop.open {
        display: block;
    }

/* ── Flyout menu ─────────────────────────────────── */
.flyout-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px;
    background: #0d1829;
    border-right: 1px solid #1e2e44;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
}

    .flyout-menu.open {
        transform: translateX(0);
    }

.flyout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #1e2e44;
}

.flyout-title {
    font-size: 1rem;
    font-weight: 700;
    color: #d8e8f0;
}

.flyout-close {
    background: none;
    border: none;
    color: #6a8aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}

    .flyout-close:hover {
        color: #d8e8f0;
    }

.flyout-links {
    list-style: none;
    padding: 12px 0;
}

    .flyout-links li a {
        display: block;
        padding: 12px 20px;
        color: #a0b8cc;
        text-decoration: none;
        font-size: 14px;
        transition: background 0.15s, color 0.15s;
    }

        .flyout-links li a:hover {
            background: #141e2e;
            color: #4fc97e;
        }

.flyout-links-divider {
    height: 1px;
    background: #1e2e44;
    margin: 8px 12px;
}

/* ── Search bar ──────────────────────────────────── */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box {
    background: #141e2e;
    border: 1px solid #1e2e44;
    color: #d8e8f0;
    padding: 6px 40px 6px 12px;
    border-radius: 4px;
    width: 220px;
    font-size: 13px;
}

    .search-box::placeholder {
        color: #3a5070;
    }

    .search-box:focus {
        outline: none;
        border-color: #4fc97e;
    }

/* Prevent iOS Safari auto-zoom on input focus (triggered when font-size < 16px).
   font-size: 16px is the threshold; we use `touch-action` media to scope this
   to touch devices only so the desktop layout is unchanged. */
@media (hover: none) and (pointer: coarse) {
    .search-box {
        font-size: 16px;
    }
}

.search-clear {
    position: absolute;
    right: 4px;
    background: none;
    border: none;
    color: #6a8aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 0 6px;
    min-width: 36px;
    min-height: 36px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

    .search-clear:hover {
        color: #d8e8f0;
    }

/* ── Bottom nav ──────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #0d1829;
    border-top: 1px solid #1e2e44;
    z-index: 100;
}

.bottom-nav-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 4px 20px;
    font-size: 10px;
    color: #3a5070;
    flex-wrap: wrap;
}

    .bottom-nav-footer a {
        color: #4fc97e;
        text-decoration: none;
        font-size: 10px;
    }

        .bottom-nav-footer a:hover {
            text-decoration: underline;
        }

/* ═══════════════════════════════════════════════════
   SINGLE-COLUMN VIEW SYSTEM
   ─────────────────────────────────────────────────
   .recipes-root is the clipping viewport.
   .view-layer        = the item list (default visible)
   .view-layer--detail = off-screen right; slides in
                         with .view-enter; list exits
                         left with .view-exit.
═══════════════════════════════════════════════════ */

.recipes-root {
    position: relative;
    height: calc(100vh - 53px - 27px);
    overflow: hidden;
}

/* Both layers share the same full-size slot */
.view-layer {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    background: #0a0e14;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
    will-change: transform;
}

    /* List layer: default = fully visible */
    .view-layer:not(.view-layer--detail) {
        transform: translateX(0);
        visibility: visible;
    }

        /* List layer EXITING: slides left off-screen */
        .view-layer:not(.view-layer--detail).view-exit {
            transform: translateX(-100%);
            visibility: hidden;
            transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
        }

/* Detail layer: default = off-screen right */
.view-layer--detail {
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
    /* overflow-y handled by the slots inside, not this wrapper */
    overflow-y: hidden;
    /* Remove default padding — slots have their own */
    padding: 0;
}

    /* Detail layer ENTERING: slides in from right */
    .view-layer--detail.view-enter {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
    }

/* ── Detail scroll container ─────────────────────── */
/* Clips the two animating slots; sits inside .view-layer--detail */
.detail-scroll {
    position: relative;
    /* Fill the full detail layer height */
    height: 100%;
    overflow: hidden;
}

/* ── Detail content slots ────────────────────────── */
/* Two absolutely-positioned peers — one visible, one staged off-screen */
.detail-slot {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 72px; /* bottom clears the fixed 27px bottom nav + breathing room */
    background: #0a0e14;
    transform: translateX(100%);
    visibility: hidden;
}

    /* The slot currently on screen */
    .detail-slot.slot-visible {
        transform: translateX(0);
        visibility: visible;
    }

    /* Starting positions before a transition fires */
    .detail-slot.slot-enter-right {
        transform: translateX(100%);
        visibility: visible;
    }

    .detail-slot.slot-enter-left {
        transform: translateX(-100%);
        visibility: visible;
    }

    /* Exit destinations */
    .detail-slot.slot-exit-left {
        transform: translateX(-100%);
    }

    .detail-slot.slot-exit-right {
        transform: translateX(100%);
    }

    /* Transition only fires while .slot-animating is present —
   prevents spurious animation on initial paint / cleanup   */
    .detail-slot.slot-animating {
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
    }

/* ── Filter tabs ─────────────────────────────────── */
/*.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tab {
    background: #141e2e;
    color: #6a8aaa;
    border: 1px solid #1e2e44;
    padding: 5px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s, color 0.15s;
}

    .tab:hover {
        background: #1a2a3e;
        color: #d8e8f0;
    }

    .tab.active {
        background: #4fc97e;
        color: #0a0e14;
        border-color: #4fc97e;
        font-weight: 600;
    }*/

/* ── Item list ───────────────────────────────────── */
.card-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

    .item-card:hover {
        background: #141e2e;
        border-color: #2a4060;
    }

    .item-card.active {
        border-color: #4fc97e;
        background: #0f1e18;
    }

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

    .card-icon img {
        width: 48px;
        height: 48px;
        object-fit: contain;
    }

.card-icon-fallback {
    font-size: 28px;
    color: #e8a020;
    line-height: 1;
}

.card-label {
    flex: 1;
    font-size: 14px;
    color: #c0d8e8;
    line-height: 1.3;
}

.card-raw-badge,
.card-usedby-badge {
    font-size: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.card-raw-badge {
    color: #6a8aaa;
    border: 1px solid #1e2e44;
    border-radius: 3px;
    padding: 1px 5px;
}

.card-usedby-badge {
    color: #4fc97e;
}

/* ── Detail view layout ──────────────────────────── */

/* Sticky breadcrumb — positioned inside .view-layer--detail,
   above .detail-scroll, so it stays fixed during slot swaps  */
.detail-breadcrumb {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 16px;
    background: #0d1829;
    border-bottom: 1px solid #1e2e44;
    font-size: 11px;
    min-height: 38px;
    flex-shrink: 0;
}

/* Scrollable detail content — inside a slot */
.detail-body {
    padding-bottom: 60px;
    max-width: 680px;
    margin: 0 auto;
}

/* Hero block: icon + title + cart button + description */
.detail-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 0 20px;
    border-bottom: 1px solid #1e2e44;
    margin-bottom: 20px;
}

/* ── Breadcrumb items ────────────────────────────── */
.breadcrumb-item {
    background: none;
    border: none;
    color: #4fc97e;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    transition: background 0.15s, color 0.15s;
}

    .breadcrumb-item:hover {
        background: #141e2e;
        color: #d8e8f0;
    }

.breadcrumb-current {
    color: #d8e8f0;
    font-size: 11px;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    font-weight: 600;
}

.breadcrumb-sep {
    color: #1e2e44;
    font-size: 11px;
    user-select: none;
}

.breadcrumb-collapsed {
    color: #3a5070;
    font-size: 11px;
    padding: 2px 4px;
    cursor: default;
}

/* ── Shared pane / detail styles ─────────────────── */
.pane-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
    margin-bottom: 10px;
    color: #e8a020;
}

.pane-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #d8e8f0;
    margin-bottom: 8px;
}

.pane-description {
    font-size: 12px;
    color: #6a8aaa;
    font-style: italic;
    margin-top: 8px;
}

.pane-section {
    margin-bottom: 20px;
}

.pane-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: #6a8aaa;
    text-transform: uppercase;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid #1e2e44;
}

    .pane-section-title::before {
        content: '';
        display: inline-block;
        width: 3px;
        height: 12px;
        border-radius: 2px;
        flex-shrink: 0;
        background: #3a5070;
    }

.pane-section--crafted .pane-section-title::before {
    background: #5b7fd4;
}

.pane-section--requires .pane-section-title::before {
    background: #e8a020;
}

.pane-section--usedby .pane-section-title::before {
    background: #4fc97e;
}

.pane-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pane-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f1520;
    border: 1px solid #1e2e44;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
}

    .pane-row.clickable {
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s, color 0.15s;
    }

        .pane-row.clickable:hover {
            background: #141e2e;
            border-color: #4fc97e;
            color: #4fc97e;
        }

.pane-row-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pane-row-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pane-row-qty,
.pane-row-arrow {
    color: #6a8aaa;
    font-size: 12px;
}

.pane-row--station {
    border-color: #1e3a5a;
    background: #0f1828;
    color: #5b7fd4;
}

.pane-row--recycle {
    border-color: #1a4a28;
    background: #0a1e12;
    color: #4fc97e;
}

.pane-row-note {
    font-size: 11px;
    color: #3a5070;
    font-style: italic;
}

.pane-empty {
    color: #3a5070;
    font-size: 12px;
    padding: 6px 0;
}

/* ── Icons inside rows ───────────────────────────── */
.pane-row-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.ing-depth-badge {
    font-size: 11px;
    flex-shrink: 0;
}

.ing-depth-badge--craftable {
    color: #5b7fd4;
}

.ing-depth-badge--raw {
    color: #3a5070;
}

/* ── Unlock condition ────────────────────────────── */
.pane-unlock {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1828;
    border: 1px solid #1e3a5a;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    color: #5b7fd4;
}

.pane-unlock--always {
    background: #0a1e12;
    border-color: #1a4a28;
    color: #4fc97e;
}

.pane-unlock--terra {
    background: #0f1828;
    border-color: #1e3a5a;
    color: #5b7fd4;
}

.pane-unlock--blueprint {
    background: #1a1408;
    border-color: #5a4010;
    color: #c8941e;
}

.pane-unlock--trade {
    background: #0e1a20;
    border-color: #1a4a5a;
    color: #3ab8d4;
}

.pane-unlock--story {
    background: #1a0e28;
    border-color: #4a1a7a;
    color: #a060e0;
}

.pane-unlock-sub {
    display: block;
    font-size: 11px;
    opacity: 0.75;
    margin-top: 2px;
}

.pane-unlock-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.pane-unlock-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
}

.pane-unlock strong {
    color: #d8e8f0;
}

/* ── Add-to-cart button ──────────────────────────── */
.add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #1e2e44;
    border-radius: 4px;
    color: #6a8aaa;
    font-size: 14px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    margin-left: 6px;
}

    .add-to-cart-btn:hover {
        background: #141e2e;
        color: #e8a020;
        border-color: #e8a020;
    }

    .add-to-cart-btn.in-cart {
        background: #1a2a10;
        color: #4fc97e;
        border-color: #4fc97e;
    }

/* Detail-view cart button: wider pill style */
.detail-cart-btn {
    width: auto !important;
    padding: 0 18px !important;
    height: 34px !important;
    font-size: 13px !important;
    gap: 6px;
    margin: 10px 0 0;
}

/* ── Cart button in top bar ──────────────────────── */
.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #d8e8f0;
    font-size: 20px;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
    transition: color 0.15s;
}

    .cart-btn:hover {
        color: #4fc97e;
    }

.cart-badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -6px;
    background: #e8a020;
    color: #0a0e14;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    line-height: 16px;
    text-align: center;
    padding: 0 3px;
}

/* ── Cart panel ──────────────────────────────────── */
.cart-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 360px;
    background: #0d1829;
    border-left: 1px solid #1e2e44;
    z-index: 500;
    flex-direction: column;
    overflow: hidden;
}

    .cart-panel.open {
        display: flex;
    }

.cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #1e2e44;
    flex-shrink: 0;
}

.cart-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #d8e8f0;
}

.cart-panel-close {
    background: none;
    border: none;
    color: #6a8aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}

    .cart-panel-close:hover {
        color: #d8e8f0;
    }

.cart-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.cart-empty-msg {
    color: #3a5070;
    font-size: 13px;
    text-align: center;
    margin-top: 40px;
}

.cart-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: #6a8aaa;
    text-transform: uppercase;
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #1e2e44;
}

    .cart-section-title::before {
        content: '';
        display: inline-block;
        width: 3px;
        height: 12px;
        border-radius: 2px;
        flex-shrink: 0;
        background: #e8a020;
    }

.cart-section-title--gather::before {
    background: #4fc97e;
}

.cart-section {
    margin-bottom: 24px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 4px;
    padding: 7px 10px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #c0d8e8;
}

.cart-item-row.clickable,
.gather-row.clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.cart-item-row.clickable:hover,
.gather-row.clickable:hover {
    background: #141e2e;
    border-color: #4fc97e;
}

.cart-item-row.clickable:hover .cart-item-name,
.gather-row.clickable:hover .gather-row-name {
    color: #4fc97e;
}

.cart-item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.cart-item-name {
    flex: 1;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #3a5070;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

    .cart-item-remove:hover {
        color: #e05050;
        background: #1a1020;
    }

.gather-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 4px;
    padding: 7px 10px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #c0d8e8;
}

.gather-row-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.gather-row-name {
    flex: 1;
}

.gather-row-qty {
    font-weight: 700;
    color: #e8a020;
    font-size: 13px;
    flex-shrink: 0;
}

.cart-clear-btn {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid #3a2020;
    color: #6a3a3a;
    border-radius: 4px;
    padding: 8px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

    .cart-clear-btn:hover {
        background: #1a0f0f;
        border-color: #e05050;
        color: #e05050;
    }

/* ── Cart qty controls ───────────────────────────── */
.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.cart-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #141e2e;
    border: 1px solid #2a4060;
    border-radius: 4px;
    color: #d8e8f0;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

    .cart-qty-btn:hover {
        background: #1a2e48;
        border-color: #4fc97e;
        color: #4fc97e;
    }

.cart-qty-value {
    min-width: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #e8a020;
}

/* ── Steam links ─────────────────────────────────── */
.top-bar-steam-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #1b2838;
    color: #c7d5e0;
    border: 1px solid #2a475e;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

    .top-bar-steam-btn:hover {
        background: #2a475e;
        color: #fff;
    }

.flyout-steam-link {
    color: #c7d5e0 !important;
    font-weight: 600;
}

    .flyout-steam-link:hover {
        background: #1b2838 !important;
        color: #fff !important;
    }

/* ── Legacy cards (Dashboard etc.) ──────────────── */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.card {
    background: #0f1520;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #1e2e44;
    transition: border-color 0.15s;
}

    .card:hover {
        border-color: #4fc97e;
    }

/* ── Content wrapper (non-recipe pages) ──────────── */
.content {
    padding: 15px;
    padding-bottom: 90px;
}

/* ── Build ID ────────────────────────────────────── */
.build-id {
    font-size: 10px;
    color: #1e2e44;
    margin-left: auto;
}

/* ── About page ──────────────────────────────────── */
.about-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 16px 80px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    height: calc(100vh - 53px);
}

.about-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 12px;
    padding: 20px 18px;
}

.about-hero-icon {
    font-size: 2.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.about-hero-text {
    flex: 1;
    min-width: 0;
}

.about-hero-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #d8e8f0;
    margin-bottom: 3px;
}

.about-hero-sub {
    font-size: 0.8rem;
    color: #6a8aaa;
}

.about-version-badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #4fc97e;
    background: rgba(79, 201, 126, 0.1);
    border: 1px solid rgba(79, 201, 126, 0.3);
    border-radius: 20px;
    padding: 3px 10px;
}

.about-card {
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 12px;
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.about-card--warning {
    border-color: rgba(232, 160, 32, 0.35);
    background: linear-gradient(135deg, #0f1520 85%, rgba(232, 160, 32, 0.06) 100%);
}

.about-card-heading {
    font-size: 0.9rem;
    font-weight: 700;
    color: #d8e8f0;
    letter-spacing: 0.3px;
    padding-bottom: 10px;
    border-bottom: 1px solid #1e2e44;
    margin-bottom: 2px;
}

.about-card p {
    font-size: 0.82rem;
    color: #a8c4d8;
    line-height: 1.65;
}

.about-card strong {
    color: #d8e8f0;
    font-weight: 600;
}

.about-link {
    color: #4fc97e;
    text-decoration: none;
    font-weight: 600;
}

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

.about-steam-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 8px 16px;
    background: #1b2838;
    border: 1px solid #2a475e;
    border-radius: 8px;
    color: #c7d5e0;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    align-self: flex-start;
}

    .about-steam-btn img {
        width: 18px;
        height: 18px;
        object-fit: contain;
    }

    .about-steam-btn:hover {
        background: #2a3f52;
        border-color: #4fc97e;
        color: #fff;
    }

/* ── Mobile (≤ 600px) ────────────────────────────── */
@media (max-width: 600px) {

    .top-bar {
        padding: 8px 10px;
        gap: 8px;
    }

        .top-bar h1 {
            font-size: 1rem;
        }

    /* Hide the Steam button on mobile — accessible via the flyout menu */
    .top-bar-steam-btn {
        display: none;
    }

    /* Cap search width so cart button is never pushed off-screen */
    .search-box {
        width: 120px;
    }

    /* Cart button is always visible, even when cart is empty */
    .cart-btn {
        display: flex !important;
    }

    .recipes-root {
        height: calc(100vh - 53px - 27px);
    }

    .view-layer {
        padding: 10px;
    }

    .detail-breadcrumb {
        padding: 8px 10px;
    }

    .detail-slot {
        padding: 10px 10px 72px; /* keep bottom clearance on mobile too */
    }

    .item-card {
        padding: 7px 10px;
        gap: 12px;
    }

    .card-icon,
    .card-icon img {
        width: 40px;
        height: 40px;
    }

    .card-icon-fallback {
        font-size: 24px;
    }

    .card-label {
        font-size: 13px;
    }

    .cart-panel {
        width: 100%;
    }
}

/* ── Hide search when item detail is open ────────── */
body.detail-active .search-wrapper {
    display: none;
}

/* ── Tips & Tricks page ──────────────────────────── */
.tips-root {
    position: relative;
    height: calc(100vh - 53px - 27px);
    overflow: hidden;
}

.tips-page-header {
    margin-bottom: 16px;
}

.tips-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #d8e8f0;
    margin-bottom: 4px;
}

.tips-page-subtitle {
    font-size: 12px;
    color: #6a8aaa;
}

.tips-card-emoji {
    font-size: 22px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.tips-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tips-card-summary {
    font-size: 11px;
    color: #6a8aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tips-card-category {
    font-size: 10px;
    color: #3a5070;
    border: 1px solid #1e2e44;
    border-radius: 3px;
    padding: 1px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Tip detail content ──────────────────────────── */
.tip-detail {
    padding: 8px 0;
}

.tip-detail-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
    line-height: 1;
}

.tips-detail-category {
    display: inline-block;
    font-size: 10px;
    color: #4fc97e;
    border: 1px solid #1a4a28;
    border-radius: 3px;
    padding: 2px 8px;
    margin-top: 6px;
    margin-bottom: 4px;
    background: #0a1e12;
}

/* ── Cart full-screen view ───────────────────────── */
.cart-root {
    position: fixed;
    inset: 53px 0 27px; /* below top-bar, above bottom-nav */
    z-index: 200;
    display: flex;
    flex-direction: column;
    background: #0a0e14;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
    will-change: transform;
}

body.cart-active .cart-root {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

/* Hide search box when cart is open (mirrors detail-active behaviour) */
body.cart-active .search-wrapper {
    display: none;
}

.cart-root-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 72px;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

.cart-empty-msg {
    color: #3a5070;
    font-size: 13px;
    text-align: center;
    margin-top: 40px;
}

.cart-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: #6a8aaa;
    text-transform: uppercase;
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #1e2e44;
}

    .cart-section-title::before {
        content: '';
        display: inline-block;
        width: 3px;
        height: 12px;
        border-radius: 2px;
        flex-shrink: 0;
        background: #e8a020;
    }

.cart-section-title--gather::before {
    background: #4fc97e;
}

.cart-section {
    margin-bottom: 24px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 4px;
    padding: 7px 10px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #c0d8e8;
}

.cart-item-row.clickable,
.gather-row.clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.cart-item-row.clickable:hover,
.gather-row.clickable:hover {
    background: #141e2e;
    border-color: #4fc97e;
}

.cart-item-row.clickable:hover .cart-item-name,
.gather-row.clickable:hover .gather-row-name {
    color: #4fc97e;
}

.cart-item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.cart-item-name {
    flex: 1;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #3a5070;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

    .cart-item-remove:hover {
        color: #e05050;
        background: #1a1020;
    }

.gather-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 4px;
    padding: 7px 10px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #c0d8e8;
}

.gather-row-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.gather-row-name {
    flex: 1;
}

.gather-row-qty {
    font-weight: 700;
    color: #e8a020;
    font-size: 13px;
    flex-shrink: 0;
}

.cart-clear-btn {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid #3a2020;
    color: #6a3a3a;
    border-radius: 4px;
    padding: 8px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

    .cart-clear-btn:hover {
        background: #1a0f0f;
        border-color: #e05050;
        color: #e05050;
    }

/* ── Cart qty controls ───────────────────────────── */
.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.cart-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #141e2e;
    border: 1px solid #2a4060;
    border-radius: 4px;
    color: #d8e8f0;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

    .cart-qty-btn:hover {
        background: #1a2e48;
        border-color: #4fc97e;
        color: #4fc97e;
    }

.cart-qty-value {
    min-width: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #e8a020;
}

/* ── Steam links ─────────────────────────────────── */
.top-bar-steam-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #1b2838;
    color: #c7d5e0;
    border: 1px solid #2a475e;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

    .top-bar-steam-btn:hover {
        background: #2a475e;
        color: #fff;
    }

.flyout-steam-link {
    color: #c7d5e0 !important;
    font-weight: 600;
}

    .flyout-steam-link:hover {
        background: #1b2838 !important;
        color: #fff !important;
    }

/* ── Legacy cards (Dashboard etc.) ──────────────── */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.card {
    background: #0f1520;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #1e2e44;
    transition: border-color 0.15s;
}

    .card:hover {
        border-color: #4fc97e;
    }

/* ── Content wrapper (non-recipe pages) ──────────── */
.content {
    padding: 15px;
    padding-bottom: 90px;
}

/* ── Build ID ────────────────────────────────────── */
.build-id {
    font-size: 10px;
    color: #1e2e44;
    margin-left: auto;
}

/* ── About page ──────────────────────────────────── */
.about-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ── Mobile (≤ 600px) ────────────────────────────── */
@media (max-width: 600px) {

    .top-bar {
        padding: 8px 10px;
        gap: 8px;
    }

        .top-bar h1 {
            font-size: 1rem;
        }

    /* Hide the Steam button on mobile — accessible via the flyout menu */
    .top-bar-steam-btn {
        display: none;
    }

    /* Cap search width so cart button is never pushed off-screen */
    .search-box {
        width: 120px;
    }

    /* Cart button is always visible, even when cart is empty */
    .cart-btn {
        display: flex !important;
    }

    .recipes-root {
        height: calc(100vh - 53px - 27px);
    }

    .view-layer {
        padding: 10px;
    }

    .detail-breadcrumb {
        padding: 8px 10px;
    }

    .detail-slot {
        padding: 10px 10px 72px; /* keep bottom clearance on mobile too */
    }

    .item-card {
        padding: 7px 10px;
        gap: 12px;
    }

    .card-icon,
    .card-icon img {
        width: 40px;
        height: 40px;
    }

    .card-icon-fallback {
        font-size: 24px;
    }

    .card-label {
        font-size: 13px;
    }

    .cart-panel {
        width: 100%;
    }
}

/* ── Hide search when item detail is open ────────── */
body.detail-active .search-wrapper {
    display: none;
}

/* ── Tips & Tricks page ──────────────────────────── */
.tips-root {
    position: relative;
    height: calc(100vh - 53px - 27px);
    overflow: hidden;
}

.tips-page-header {
    margin-bottom: 16px;
}

.tips-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #d8e8f0;
    margin-bottom: 4px;
}

.tips-page-subtitle {
    font-size: 12px;
    color: #6a8aaa;
}

.tips-card-emoji {
    font-size: 22px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.tips-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tips-card-summary {
    font-size: 11px;
    color: #6a8aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tips-card-category {
    font-size: 10px;
    color: #3a5070;
    border: 1px solid #1e2e44;
    border-radius: 3px;
    padding: 1px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Tip detail content ──────────────────────────── */
.tip-detail {
    padding: 8px 0;
}

.tip-detail-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
    line-height: 1;
}

.tips-detail-category {
    display: inline-block;
    font-size: 10px;
    color: #4fc97e;
    border: 1px solid #1a4a28;
    border-radius: 3px;
    padding: 2px 8px;
    margin-top: 6px;
    margin-bottom: 4px;
    background: #0a1e12;
}

/* ── Cart full-screen view ───────────────────────── */
.cart-root {
    position: fixed;
    inset: 53px 0 27px; /* below top-bar, above bottom-nav */
    z-index: 200;
    display: flex;
    flex-direction: column;
    background: #0a0e14;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
    will-change: transform;
}

body.cart-active .cart-root {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

/* Hide search box when cart is open (mirrors detail-active behaviour) */
body.cart-active .search-wrapper {
    display: none;
}

.cart-root-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 72px;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

.cart-empty-msg {
    color: #3a5070;
    font-size: 13px;
    text-align: center;
    margin-top: 40px;
}

.cart-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: #6a8aaa;
    text-transform: uppercase;
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #1e2e44;
}

    .cart-section-title::before {
        content: '';
        display: inline-block;
        width: 3px;
        height: 12px;
        border-radius: 2px;
        flex-shrink: 0;
        background: #e8a020;
    }

.cart-section-title--gather::before {
    background: #4fc97e;
}

.cart-section {
    margin-bottom: 24px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 4px;
    padding: 7px 10px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #c0d8e8;
}

.cart-item-row.clickable,
.gather-row.clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.cart-item-row.clickable:hover,
.gather-row.clickable:hover {
    background: #141e2e;
    border-color: #4fc97e;
}

.cart-item-row.clickable:hover .cart-item-name,
.gather-row.clickable:hover .gather-row-name {
    color: #4fc97e;
}

.cart-item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.cart-item-name {
    flex: 1;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #3a5070;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

    .cart-item-remove:hover {
        color: #e05050;
        background: #1a1020;
    }

.gather-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 4px;
    padding: 7px 10px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #c0d8e8;
}

.gather-row-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.gather-row-name {
    flex: 1;
}

.gather-row-qty {
    font-weight: 700;
    color: #e8a020;
    font-size: 13px;
    flex-shrink: 0;
}

.cart-clear-btn {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid #3a2020;
    color: #6a3a3a;
    border-radius: 4px;
    padding: 8px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

    .cart-clear-btn:hover {
        background: #1a0f0f;
        border-color: #e05050;
        color: #e05050;
    }

/* ── Cart qty controls ───────────────────────────── */
.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.cart-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #141e2e;
    border: 1px solid #2a4060;
    border-radius: 4px;
    color: #d8e8f0;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

    .cart-qty-btn:hover {
        background: #1a2e48;
        border-color: #4fc97e;
        color: #4fc97e;
    }

.cart-qty-value {
    min-width: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #e8a020;
}

/* ── Steam links ─────────────────────────────────── */
.top-bar-steam-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #1b2838;
    color: #c7d5e0;
    border: 1px solid #2a475e;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

    .top-bar-steam-btn:hover {
        background: #2a475e;
        color: #fff;
    }

.flyout-steam-link {
    color: #c7d5e0 !important;
    font-weight: 600;
}

    .flyout-steam-link:hover {
        background: #1b2838 !important;
        color: #fff !important;
    }

/* ── Legacy cards (Dashboard etc.) ──────────────── */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.card {
    background: #0f1520;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #1e2e44;
    transition: border-color 0.15s;
}

    .card:hover {
        border-color: #4fc97e;
    }

/* ── Content wrapper (non-recipe pages) ──────────── */
.content {
    padding: 15px;
    padding-bottom: 90px;
}

/* ── Build ID ────────────────────────────────────── */
.build-id {
    font-size: 10px;
    color: #1e2e44;
    margin-left: auto;
}

/* ── About page ──────────────────────────────────── */
.about-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ── Mobile (≤ 600px) ────────────────────────────── */
@media (max-width: 600px) {

    .top-bar {
        padding: 8px 10px;
        gap: 8px;
    }

        .top-bar h1 {
            font-size: 1rem;
        }

    /* Hide the Steam button on mobile — accessible via the flyout menu */
    .top-bar-steam-btn {
        display: none;
    }

    /* Cap search width so cart button is never pushed off-screen */
    .search-box {
        width: 120px;
    }

    /* Cart button is always visible, even when cart is empty */
    .cart-btn {
        display: flex !important;
    }

    .recipes-root {
        height: calc(100vh - 53px - 27px);
    }

    .view-layer {
        padding: 10px;
    }

    .detail-breadcrumb {
        padding: 8px 10px;
    }

    .detail-slot {
        padding: 10px 10px 72px; /* keep bottom clearance on mobile too */
    }

    .item-card {
        padding: 7px 10px;
        gap: 12px;
    }

    .card-icon,
    .card-icon img {
        width: 40px;
        height: 40px;
    }

    .card-icon-fallback {
        font-size: 24px;
    }

    .card-label {
        font-size: 13px;
    }

    .cart-panel {
        width: 100%;
    }
}

/* ── Hide search when item detail is open ────────── */
body.detail-active .search-wrapper {
    display: none;
}

/* ── Tips & Tricks page ──────────────────────────── */
.tips-root {
    position: relative;
    height: calc(100vh - 53px - 27px);
    overflow: hidden;
}

.tips-page-header {
    margin-bottom: 16px;
}

.tips-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #d8e8f0;
    margin-bottom: 4px;
}

.tips-page-subtitle {
    font-size: 12px;
    color: #6a8aaa;
}

.tips-card-emoji {
    font-size: 22px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.tips-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tips-card-summary {
    font-size: 11px;
    color: #6a8aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tips-card-category {
    font-size: 10px;
    color: #3a5070;
    border: 1px solid #1e2e44;
    border-radius: 3px;
    padding: 1px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Tip detail content ──────────────────────────── */
.tip-detail {
    padding: 8px 0;
}

.tip-detail-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
    line-height: 1;
}

.tips-detail-category {
    display: inline-block;
    font-size: 10px;
    color: #4fc97e;
    border: 1px solid #1a4a28;
    border-radius: 3px;
    padding: 2px 8px;
    margin-top: 6px;
    margin-bottom: 4px;
    background: #0a1e12;
}

/* ── Cart full-screen view ───────────────────────── */
.cart-root {
    position: fixed;
    inset: 53px 0 27px; /* below top-bar, above bottom-nav */
    z-index: 200;
    display: flex;
    flex-direction: column;
    background: #0a0e14;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
    will-change: transform;
}

body.cart-active .cart-root {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

/* Hide search box when cart is open (mirrors detail-active behaviour) */
body.cart-active .search-wrapper {
    display: none;
}

.cart-root-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 72px;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

.cart-empty-msg {
    color: #3a5070;
    font-size: 13px;
    text-align: center;
    margin-top: 40px;
}

.cart-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: #6a8aaa;
    text-transform: uppercase;
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #1e2e44;
}

    .cart-section-title::before {
        content: '';
        display: inline-block;
        width: 3px;
        height: 12px;
        border-radius: 2px;
        flex-shrink: 0;
        background: #e8a020;
    }

.cart-section-title--gather::before {
    background: #4fc97e;
}

.cart-section {
    margin-bottom: 24px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 4px;
    padding: 7px 10px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #c0d8e8;
}

.cart-item-row.clickable,
.gather-row.clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.cart-item-row.clickable:hover,
.gather-row.clickable:hover {
    background: #141e2e;
    border-color: #4fc97e;
}

.cart-item-row.clickable:hover .cart-item-name,
.gather-row.clickable:hover .gather-row-name {
    color: #4fc97e;
}

.cart-item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.cart-item-name {
    flex: 1;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #3a5070;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

    .cart-item-remove:hover {
        color: #e05050;
        background: #1a1020;
    }

.gather-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1520;
    border: 1px solid #1e2e44;
    border-radius: 4px;
    padding: 7px 10px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #c0d8e8;
}

.gather-row-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.gather-row-name {
    flex: 1;
}

.gather-row-qty {
    font-weight: 700;
    color: #e8a020;
    font-size: 13px;
    flex-shrink: 0;
}

.cart-clear-btn {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid #3a2020;
    color: #6a3a3a;
    border-radius: 4px;
    padding: 8px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

    .cart-clear-btn:hover {
        background: #1a0f0f;
        border-color: #e05050;
        color: #e05050;
    }

/* ── Cart qty controls ───────────────────────────── */
.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.cart-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #141e2e;
    border: 1px solid #2a4060;
    border-radius: 4px;
    color: #d8e8f0;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

    .cart-qty-btn:hover {
        background: #1a2e48;
        border-color: #4fc97e;
        color: #4fc97e;
    }

.cart-qty-value {
    min-width: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #e8a020;
}

/* ── Steam links ─────────────────────────────────── */
.top-bar-steam-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #1b2838;
    color: #c7d5e0;
    border: 1px solid #2a475e;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

    .top-bar-steam-btn:hover {
        background: #2a475e;
        color: #fff;
    }

.flyout-steam-link {
    color: #c7d5e0 !important;
    font-weight: 600;
}

    .flyout-steam-link:hover {
        background: #1b2838 !important;
        color: #fff !important;
    }

/* ── Legacy cards (Dashboard etc.) ──────────────── */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.card {
    background: #0f1520;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #1e2e44;
    transition: border-color 0.15s;
}

    .card:hover {
        border-color: #4fc97e;
    }

/* ── Content wrapper (non-recipe pages) ──────────── */
.content {
    padding: 15px;
    padding-bottom: 90px;
}

/* ── Build ID ────────────────────────────────────── */
.build-id {
    font-size: 10px;
    color: #1e2e44;
    margin-left: auto;
}

/* ── About page ──────────────────────────────────── */
.about-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ── Mobile (≤ 600px) ────────────────────────────── */
@media (max-width: 600px) {

    .top-bar {
        padding: 8px 10px;
        gap: 8px;
    }

        .top-bar h1 {
            font-size: 1rem;
        }

    /* Hide the Steam button on mobile — accessible via the flyout menu */
    .top-bar-steam-btn {
        display: none;
    }

    /* Cap search width so cart button is never pushed off-screen */
    .search-box {
        width: 120px;
    }

    /* Cart button is always visible, even when cart is empty */
    .cart-btn {
        display: flex !important;
    }

    .recipes-root {
        height: calc(100vh - 53px - 27px);
    }

    .view-layer {
        padding: 10px;
    }

    .detail-breadcrumb {
        padding: 8px 10px;
    }

    .detail-slot {
        padding: 10px 10px 72px; /* keep bottom clearance on mobile too */
    }

    .item-card {
        padding: 7px 10px;
        gap: 12px;
    }

    .card-icon,
    .card-icon img {
        width: 40px;
        height: 40px;
    }

    .card-icon-fallback {
        font-size: 24px;
    }

    .card-label {
        font-size: 13px;
    }

    .cart-panel {
        width: 100%;
    }
}

/* ── Hide search when item detail is open ────────── */
body.detail-active .search-wrapper {
    display: none;
}

/* ── Tips & Tricks page ──────────────────────────── */
.tips-root {
    position: relative;
    height: calc(100vh - 53px - 27px);
    overflow: hidden;
}

.tips-page-header {
    margin-bottom: 16px;
}

.tips-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #d8e8f0;
    margin-bottom: 4px;
}

.tips-page-subtitle {
    font-size: 12px;
    color: #6a8aaa;
}

.tips-card-emoji {
    font-size: 22px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.tips-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tips-card-summary {
    font-size: 11px;
    color: #6a8aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tips-card-category {
    font-size: 10px;
    color: #3a5070;
    border: 1px solid #1e2e44;
    border-radius: 3px;
    padding: 1px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Tip detail content ──────────────────────────── */
.tip-detail {
    padding: 8px 0;
}

.tip-detail-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
    line-height: 1;
}

.tips-detail-category {
    display: inline-block;
    font-size: 10px;
    color: #4fc97e;
    border: 1px solid #1a4a28;
    border-radius: 3px;
    padding: 2px 8px;
    margin-top: 6px;
    margin-bottom: 4px;
    background: #0a1e12;
}

/* ── Cart tab bar ────────────────────────────────── */
.cart-tab-bar {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid #1e2e44;
    background: #0d1829;
}

.cart-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6a8aaa;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: color 0.15s, border-color 0.15s;
}

    .cart-tab:hover {
        color: #d8e8f0;
    }

    .cart-tab.active {
        color: #4fc97e;
        border-bottom-color: #4fc97e;
    }

/* ── Cart tree view ──────────────────────────────── */
.cart-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 16px;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
    padding-right: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 40px;
}

    .tree-node:hover {
        background: #141e2e;
    }

.tree-node--craftable > .tree-node-name {
    color: #c0d8e8;
}

.tree-node--raw > .tree-node-name {
    color: #6a8aaa;
}

.tree-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    color: #4fc97e;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

    .tree-toggle:hover {
        color: #d8e8f0;
    }

.tree-toggle-spacer {
    display: inline-block;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.tree-node-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.tree-node-name {
    flex: 1;
    font-size: 13px;
    line-height: 1.3;
}

.tree-node-qty {
    font-size: 12px;
    font-weight: 700;
    color: #e8a020;
    flex-shrink: 0;
}

/* ── Large-screen portrait framing (≥1600px) ─────── */
@media (min-width: 1600px) {
    :root {
        --frame-width: 1100px;
        --frame-offset: calc((100vw - var(--frame-width)) / 2);
    }

    body {
        background: #070a10; /* darker letterbox surround */
    }

    /* Main content wrapper sits between the fixed top-bar and bottom-nav */
    main {
        max-width: var(--frame-width);
        margin: 0 auto;
    }

    /* Top bar: span only the frame */
    .top-bar {
        left: var(--frame-offset);
        right: var(--frame-offset);
        /* Preserve GPU compositing hint */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    /* Flyout: slide in from the left edge of the frame */
    .flyout-menu {
        left: var(--frame-offset);
    }

    /* Flyout backdrop: keep it covering full viewport so outside click still works */
    /* (no change needed for .flyout-backdrop) */

    /* Cart overlay: constrain to frame */
    .cart-root {
        left: var(--frame-offset);
        right: var(--frame-offset);
    }

    /* Bottom nav (if present) */
    .bottom-nav {
        left: var(--frame-offset);
        right: var(--frame-offset);
    }
}

/* ── Persistent sidebar on large screens (≥ 900px) ── */
/*@media (min-width: 900px) {*/

    /* Sidebar: always visible, anchored below the top bar */
    /*.flyout-menu {
        transform: translateX(0) !important;
        top: 53px;
        height: calc(100% - 53px);
        z-index: 100;
        border-top: none;
    }*/

    /* Hide toggle controls — sidebar is always open */
    /*.hamburger-btn,
    .flyout-close,
    .flyout-backdrop {
        display: none !important;
    }*/

    /* Remove the "Menu" header row since close button is hidden */
    /*.flyout-header {
        display: none;
    }*/

    /* Top bar: shift right so it doesn't overlap the sidebar */
    /*.top-bar {
        left: 260px;
    }*/

    /* Main content area: push right of the sidebar */
    /*main {
        margin-left: 260px;
    }*/

    /* Bottom nav: also shift right to match */
    /*.bottom-nav {
        left: 260px;
        width: calc(100% - 260px);
    }*/

    /* Cart overlay: also shift right so it sits in the content area */
    /*.cart-root {
        left: 260px;
    }
}*/
