/* ── Fonts & Variables ── */
:root {
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', monospace;

    --bg-deep: #08080c;
    --bg-velvet: #0e0e15;
    --bg-slab: #14141d;
    --bg-label: #0c0c14;

    --gold: #c9a84c;
    --gold-dim: #8b7340;
    --gold-bright: #e2c66a;
    --brass: #b8935a;
    --brass-dark: #5c4a2e;

    --silver: #8a8fa0;
    --silver-dim: #565b6a;
    --silver-bright: #b0b5c4;

    --rose: #c08070;
    --rose-bright: #e0a090;

    --text-primary: #e8e0d5;
    --text-secondary: #948c80;
    --text-muted: #5c574e;

    --border-subtle: #1e1e2a;
    --border-active: #3d3525;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }

/* ── Noise texture overlay ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Header ── */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: linear-gradient(180deg, rgba(30,26,18,0.95) 0%, rgba(20,17,12,0.9) 100%);
    border-bottom: 1px solid var(--brass-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}
.header-nav {
    display: flex;
    gap: 4px;
}
.nav-link {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}
.nav-link-active {
    color: var(--gold-bright);
    background: rgba(201,168,76,0.08);
}
.header-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.03em;
}
.header-brand:hover { color: var(--gold-bright); }
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-avatar {
    border-radius: 50%;
    border: 2px solid var(--brass-dark);
}
.user-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.logout-form { margin: 0; }
.btn-logout, .btn-login {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    display: inline-block;
}
.btn-logout {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}
.btn-logout:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.btn-login {
    background: var(--gold);
    border: none;
    color: #0a0800;
}
.btn-login:hover { background: var(--gold-bright); }

/* ── Footer ── */
.app-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
}
.app-footer a {
    color: var(--gold-dim);
    text-decoration: none;
}
.app-footer a:hover { color: var(--gold); }

/* ── Container ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Stats Plaque ── */
.stats-plaque {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 28px 0 24px;
    background: linear-gradient(180deg, #1a1712 0%, #14110d 100%);
    border: 1px solid var(--brass-dark);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.stat-item {
    flex: 1 1 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}
.stat-item + .stat-item { border-left: 1px solid var(--brass-dark); }
.stat-number {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gold);
    line-height: 1.2;
}
.stat-number-sm {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold);
    line-height: 1.2;
}
.stat-label {
    font-family: var(--font-body);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: 2px;
}
@media (max-width: 600px) {
    .stats-plaque { border-radius: 0; border-left: none; border-right: none; }
    .stat-item + .stat-item { border-left: none; border-top: 1px solid var(--brass-dark); }
    .stat-number { font-size: 1.1rem; }
}

/* ── Filter Tray ── */
.filter-tray {
    margin-bottom: 24px;
    background: rgba(255,255,255,0.015);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}
.filter-row + .filter-row {
    border-top: 1px solid var(--border-subtle);
}
.filter-row-main {
    gap: 16px;
}
.filter-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 200px;
    min-width: 160px;
}
.search-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}
.filter-search {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-active);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    padding: 5px 0;
    outline: none;
    transition: border-color 0.2s;
}
.filter-search::placeholder { color: var(--text-muted); }
.filter-search:focus { border-bottom-color: var(--gold); }

/* Pill-style toggles */
.filter-pills {
    display: flex;
    gap: 6px;
    align-items: center;
}
.filter-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    padding: 3px 10px 3px 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    background: rgba(255,255,255,0.02);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter-pill:hover {
    color: var(--text-secondary);
    border-color: var(--border-active);
    background: rgba(255,255,255,0.04);
}
.filter-pill input[type="checkbox"] {
    display: none;
}
.filter-pill .pill-track {
    width: 22px;
    height: 12px;
    background: rgba(60,50,35,0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.filter-pill .pill-knob {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 8px;
    height: 8px;
    background: var(--silver-dim);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.filter-pill:has(input:checked) {
    color: var(--gold-bright);
    border-color: var(--gold-dim);
    background: rgba(201,168,76,0.06);
}
.filter-pill:has(input:checked) .pill-track {
    background: rgba(201,168,76,0.2);
    border-color: var(--gold-dim);
}
.filter-pill:has(input:checked) .pill-knob {
    transform: translateX(10px);
    background: var(--gold);
}
.filter-count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Category row: set + rarity */
.filter-row-cats {
    gap: 20px;
}
.filter-cat {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-cat-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    flex-shrink: 0;
}
.filter-dropdown {
    background: rgba(20,20,30,0.8);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    padding: 5px 26px 5px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5'%3E%3Cpath d='M0 0l4.5 5L9 0z' fill='%235c574e'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    outline: none;
    transition: border-color 0.2s;
    min-width: 100px;
}
.filter-dropdown:focus { border-color: var(--gold-dim); }

/* Type grid row */
.filter-row-types {
    gap: 10px;
}
.type-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    flex: 1;
}
.type-filter-grid .type-chip {
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.58rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: opacity 0.15s, filter 0.15s, box-shadow 0.15s, border-color 0.15s;
    opacity: 0.45;
    line-height: 1.5;
}
.type-filter-grid .type-chip.active {
    opacity: 1;
    filter: none;
    border-color: currentColor;
    box-shadow: 0 0 8px currentColor;
}
.type-filter-grid .type-chip:hover {
    opacity: 0.55;
    filter: none;
}
.type-filter-grid .type-chip.active:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .filter-row { flex-direction: column; align-items: stretch; }
    .filter-row-cats { gap: 10px; }
    .filter-cat { flex-direction: column; align-items: stretch; gap: 4px; }
    .filter-dropdown { width: 100%; }
    .filter-pills { flex-wrap: wrap; }
}

/* ── Slab Card Grid ── */
.slab-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-bottom: 40px;
}
@media (max-width: 900px) { .slab-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 650px) { .slab-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .slab-grid { grid-template-columns: 1fr; } }

.slab-case {
    background: var(--bg-slab);
    border: 2px solid var(--silver-dim);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.03),
        0 2px 12px rgba(0,0,0,0.4);
}
.slab-case:hover {
    transform: translateY(-3px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        0 6px 24px rgba(0,0,0,0.5);
}
.slab-case.slab-holo {
    border-color: var(--gold-dim);
    box-shadow:
        inset 0 1px 0 rgba(201,168,76,0.08),
        0 2px 16px rgba(0,0,0,0.4);
}
.slab-case.slab-holo:hover {
    border-color: var(--gold);
    box-shadow:
        inset 0 1px 0 rgba(201,168,76,0.12),
        0 6px 28px rgba(0,0,0,0.5);
}
.slab-case.slab-psa10 {
    border-color: var(--rose);
    box-shadow:
        inset 0 1px 0 rgba(192,128,112,0.1),
        0 2px 16px rgba(0,0,0,0.4);
}
.slab-case.slab-psa10:hover {
    border-color: var(--rose-bright);
    box-shadow:
        inset 0 1px 0 rgba(192,128,112,0.15),
        0 6px 28px rgba(0,0,0,0.5);
}

.slab-case.slab-missing {
    opacity: 0.4;
    cursor: default;
}
.slab-case.slab-missing:hover {
    opacity: 0.65;
    transform: translateY(-2px);
    border-color: var(--silver-dim);
}

/* ── Slab Chamber (Card Image Area) ── */
.slab-chamber {
    position: relative;
    aspect-ratio: 200 / 280;
    background: #060608;
    margin: 10px 10px 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
}
.slab-chamber img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
}
.slab-chamber .no-img-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2a2a35;
    font-size: 0.6rem;
    padding: 8px;
    text-align: center;
    line-height: 1.3;
    z-index: 0;
}

/* ── Corner Badges ── */
.grade-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 12;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}
.grade-10 { background: #FFD700; color: #000; }
.grade-9  { background: #1E90FF; }
.grade-8  { background: #2ECC71; color: #000; }
.grade-7, .grade-6, .grade-5, .grade-4, .grade-3, .grade-2, .grade-1 { background: #718096; }

.fav-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 12;
    font-size: 1rem;
}

/* ── Caravan Badge ── */
.caravan-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    z-index: 12;
    font-family: var(--font-body);
    font-size: 0.5rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.8);
    line-height: 1.4;
}
.caravan-ready { color: #2ecc71; }
.caravan-cd { color: #e67e22; }

/* ── Holo Effects ── */
.slab-holo .slab-chamber {
    position: relative;
    overflow: hidden;
}
.slab-holo .holo-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 9;
    pointer-events: none;
    background: linear-gradient(110deg,
        transparent 20%, rgba(255,255,255,0.2) 30%, rgba(255,255,255,0.35) 40%,
        rgba(255,255,255,0.2) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: holo-sheen 6s linear infinite;
    mix-blend-mode: overlay;
    opacity: 0.6;
}
.slab-holo .holo-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%),
        rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 30%, transparent 60%);
    mix-blend-mode: overlay;
    opacity: 0.3;
    transition: opacity 0.3s;
}
.slab-holo:hover .holo-overlay::after { opacity: 0.85; }

.slab-holo .holo-sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 8px 2px rgba(255,255,255,0.7);
    pointer-events: none;
    z-index: 11;
    opacity: 0;
    animation: sparkle-twinkle 2s infinite ease-in-out;
}
.slab-holo .holo-sparkle:nth-child(2) { top: 15%; left: 25%; animation-delay: 0s; }
.slab-holo .holo-sparkle:nth-child(3) { top: 65%; left: 75%; animation-delay: 0.5s; }
.slab-holo .holo-sparkle:nth-child(4) { top: 35%; left: 15%; animation-delay: 1s; }
.slab-holo .holo-sparkle:nth-child(5) { top: 80%; left: 50%; animation-delay: 1.5s; }
.slab-holo .holo-sparkle:nth-child(6) { top: 20%; left: 70%; animation-delay: 0.2s; }
.slab-holo .holo-sparkle:nth-child(7) { top: 55%; left: 30%; animation-delay: 0.7s; }
.slab-holo .holo-sparkle:nth-child(8) { top: 10%; left: 55%; animation-delay: 1.2s; }
.slab-holo .holo-sparkle:nth-child(9) { top: 72%; left: 12%; animation-delay: 1.7s; }

@keyframes holo-sheen {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@keyframes sparkle-twinkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50%      { opacity: 1; transform: scale(1.3); }
}

/* ── Slab Label Plate ── */
.slab-label {
    padding: 10px 12px 12px;
    border-top: 1px solid var(--gold-dim);
    background: var(--bg-label);
}
.slab-label .label-name-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}
.slab-label .label-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    line-height: 1.2;
    word-break: break-word;
}
.slab-label .label-dupe {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gold);
    white-space: nowrap;
}
.slab-label .label-rarity {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.slab-label .label-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
}

/* ── Type Chips ── */
.type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.type-chip {
    font-family: var(--font-body);
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.type-fire      { background: #e74c3c33; color: #e74c3c; }
.type-water     { background: #3498db33; color: #3498db; }
.type-grass     { background: #2ecc7133; color: #2ecc71; }
.type-electric  { background: #f1c40f33; color: #f1c40f; }
.type-psychic   { background: #e91e8c33; color: #e91e8c; }
.type-fighting  { background: #c0392b33; color: #c0392b; }
.type-darkness  { background: #2c3e5033; color: #95a5a6; }
.type-dark      { background: #2c3e5033; color: #95a5a6; }
.type-metal     { background: #7f8c8d33; color: #bdc3c7; }
.type-steel     { background: #7f8c8d33; color: #bdc3c7; }
.type-fairy     { background: #fd79a833; color: #fd79a8; }
.type-dragon    { background: #8e44ad33; color: #8e44ad; }
.type-colorless { background: #bdc3c733; color: #7f8c8d; }
.type-normal    { background: #bdc3c733; color: #7f8c8d; }
.type-lightning { background: #f1c40f33; color: #f1c40f; }
.type-leaf      { background: #2ecc7133; color: #2ecc71; }

.slab-label .label-price {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
    white-space: nowrap;
}
.slab-label .label-grade {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.slab-label .label-instance {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}
.label-grade.grade-text-10 { background: rgba(255,215,0,0.15); color: #FFD700; }
.label-grade.grade-text-9  { background: rgba(30,144,255,0.15); color: #1E90FF; }
.label-grade.grade-text-8  { background: rgba(46,204,113,0.15); color: #2ECC71; }
.label-grade.grade-text-7,
.label-grade.grade-text-6,
.label-grade.grade-text-5,
.label-grade.grade-text-4,
.label-grade.grade-text-3,
.label-grade.grade-text-2,
.label-grade.grade-text-1 { background: rgba(148,163,184,0.15); color: #94a3b8; }

/* ── Missing Card ── */
.slab-missing .slab-chamber img {
    filter: grayscale(100%) brightness(0.3);
}
.slab-missing .slab-label .label-name { color: var(--text-muted); }
.slab-missing .slab-label .label-rarity { color: #4a4540; }
.slab-missing-tag {
    font-family: var(--font-body);
    font-size: 0.55rem;
    color: #ef4444;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4,4,8,0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-slab {
    background: var(--bg-slab);
    border: 2px solid var(--gold-dim);
    border-radius: var(--radius-lg);
    padding: 0 0 20px;
    max-width: 420px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 40px rgba(0,0,0,0.6);
}
.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 5;
    line-height: 1;
    padding: 4px;
}
.modal-close:hover { color: var(--text-primary); }
.modal-img-wrap {
    padding: 16px;
    background: #060608;
    border-radius: 6px;
    margin: 0 0 16px;
}
.modal-img-wrap img {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    display: block;
    border-radius: 4px;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 20px;
}
.page-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gold);
}
.balance-display {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--gold-bright);
}

/* ── Auction Price/Timer Badges (on card chamber) ── */
.price-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    z-index: 12;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 3px;
    background: rgba(0,0,0,0.82);
    color: var(--gold-bright);
    line-height: 1.3;
    letter-spacing: 0.02em;
}
.timer-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    z-index: 12;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.82);
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Gold Buy Button (modal) ── */
.btn-gold {
    width: 100%;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 0;
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    background: linear-gradient(180deg, #c9a84c 0%, #a88830 100%);
    color: #0a0800;
    letter-spacing: 0.04em;
}
.btn-gold:hover {
    background: linear-gradient(180deg, #e2c66a 0%, #c9a84c 100%);
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(201,168,76,0.25);
}
.btn-gold:active {
    transform: translateY(1px);
}

/* ── Owned Badge (modal) ── */
.owned-badge {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    padding: 8px 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.btn-cancel {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 7px 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    background: rgba(255,255,255,0.02);
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
.btn-cancel:hover {
    background: rgba(231,76,60,0.08);
    border-color: #e74c3c44;
    color: #e74c3c;
}

/* ── Sell Section (binder modal) ── */
.sell-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    display: none;
    animation: sell-slide 0.25s ease-out;
}
@keyframes sell-slide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.sell-header {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.sell-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.sell-input-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
    min-width: 0;
}
.sell-input-wrap:focus-within {
    border-color: var(--gold-dim);
}
.sell-prefix {
    font-size: 0.8rem;
    padding: 0 0 0 10px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.sell-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 7px 10px 7px 6px;
    outline: none;
    min-width: 0;
}
.sell-input::placeholder { color: var(--text-muted); }
.sell-input::-webkit-outer-spin-button,
.sell-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sell-input[type=number] { -moz-appearance: textfield; }

.btn-sell {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 7px 14px;
    border: 1px solid var(--brass-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
    background: linear-gradient(180deg, #c9a84c 0%, #a88830 100%);
    color: #0a0800;
}
.btn-sell:hover {
    background: linear-gradient(180deg, #e2c66a 0%, #c9a84c 100%);
    border-color: var(--gold-dim);
}
.btn-sell:disabled {
    background: var(--border-subtle);
    border-color: var(--border-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
}
.sell-status {
    font-size: 0.72rem;
    color: var(--text-secondary);
    min-height: 1.2em;
    line-height: 1.4;
}
.sell-ok {
    color: var(--gold);
    font-weight: 700;
    margin-right: 2px;
}
.sell-err {
    color: #e74c3c;
    font-weight: 700;
    margin-right: 2px;
}

/* ── Grade Panel ── */
.grade-panel {
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid var(--border-subtle);
    display: none;
    animation: sell-slide 0.25s ease-out;
}
.grade-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.grade-panel-title {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.grade-panel-cost {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
}
.grade-panel-cost .gold {
    color: var(--gold-dim);
}

/* ── Material Chips ── */
.mat-chips {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-bottom: 12px;
}
.mat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 9px 3px 7px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: border-color 0.2s;
}
.mat-chip-icon {
    font-size: 0.7rem;
    line-height: 1;
}
.mat-chip-count {
    min-width: 0.6em;
    text-align: center;
}
.mat-chip-empty {
    color: #e74c3c;
    border-color: #e74c3c33;
    background: rgba(231,76,60,0.06);
}
.mat-chip-label {
    font-family: var(--font-body);
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-left: 2px;
}

/* ── Grade Button ── */
.btn-grade {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 9px 0;
    border: 1px solid #3a3a60;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
    background: linear-gradient(180deg, #2e2e50 0%, #1e1e38 100%);
    color: #c8c0e0;
    letter-spacing: 0.04em;
}
.btn-grade:hover {
    background: linear-gradient(180deg, #40406a 0%, #2e2e50 100%);
    border-color: #6a6a90;
    box-shadow: 0 0 18px rgba(120,120,200,0.15);
    color: #e0d8f0;
}
.btn-grade:active {
    transform: translateY(1px);
}
.btn-grade:disabled {
    background: var(--border-subtle);
    border-color: var(--border-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ── Grade Result ── */
.grade-result {
    margin-top: 10px;
    min-height: 1.2em;
    text-align: center;
}
.grade-result-err {
    color: #e74c3c;
    font-size: 0.72rem;
    line-height: 1.5;
}
.grade-reveal {
    animation: grade-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes grade-pop {
    0%   { opacity: 0; transform: scale(0.7); }
    100% { opacity: 1; transform: scale(1); }
}
.grade-reveal-label {
    font-family: var(--font-body);
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.grade-reveal-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 800;
    padding: 5px 16px;
    border-radius: 5px;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.grade-reveal-badge.grade-big-10 { background: rgba(255,215,0,0.2); color: #FFD700; }
.grade-reveal-badge.grade-big-9  { background: rgba(30,144,255,0.2); color: #1E90FF; }
.grade-reveal-badge.grade-big-8  { background: rgba(46,204,113,0.2); color: #2ECC71; }
.grade-reveal-badge.grade-big-7  { background: rgba(39,174,96,0.2); color: #27AE60; }
.grade-reveal-badge.grade-big-6,
.grade-reveal-badge.grade-big-5,
.grade-reveal-badge.grade-big-4,
.grade-reveal-badge.grade-big-3,
.grade-reveal-badge.grade-big-2,
.grade-reveal-badge.grade-big-1 { background: rgba(148,163,184,0.15); color: #94a3b8; }
.grade-reveal-xp {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gold-dim);
}

/* ── Success Banner ── */
.success-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 18px;
    background: linear-gradient(180deg, #1a2e1a 0%, #0f1f0f 100%);
    border: 1px solid #2ecc71;
    border-radius: var(--radius-md);
    color: #2ecc71;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    animation: banner-slide 0.35s ease-out;
}
@keyframes banner-slide {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2ecc71;
    color: #0a0a0a;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 24px;
    background: linear-gradient(180deg, #1a2e1a 0%, #0f1f0f 100%);
    border: 1px solid #2ecc71;
    border-radius: var(--radius-md);
    color: #2ecc71;
    z-index: 2000;
    opacity: 0;
    transition: transform 0.35s ease-out, opacity 0.35s ease-out;
    pointer-events: none;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Empty State ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 8px;
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    opacity: 0.4;
}
.empty-heading {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.empty-sub {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
}
.empty-link {
    color: var(--gold);
    text-decoration: none;
}
.empty-link:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}
