/* =========================================================
   SPELLFORGE — Mid-2000s Fantasy Theme
   Inspired by: Old Blizzard sites, MTG card frames, WoW Armory
   ========================================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Core palette */
    --bg-abyss: #07080c;
    --bg-deep: #0b0c14;
    --bg-panel: #111320;
    --bg-panel-mid: #161829;
    --bg-panel-light: #1c1e32;
    --bg-elevated: #24263d;
    --bg-hover: #2c2e4a;

    /* Gold / Bronze accent system */
    --gold: #c9a84c;
    --gold-bright: #e8cc5a;
    --gold-dim: #7b6530;
    --gold-dark: #4a3a18;
    --gold-border: #5c4a1e;
    --gold-glow: rgba(201, 168, 76, 0.3);

    /* Text */
    --text-primary: #e0d5c1;
    --text-secondary: #a89b84;
    --text-muted: #6b6050;
    --text-bright: #f5edd8;

    /* Accents */
    --purple: #7b4aa0;
    --purple-dim: #4a2d60;
    --blue: #3a6bc5;
    --red: #c43a3a;
    --green: #3a9a5c;

    /* Mana colors */
    --mana-w: #f9f5e3;
    --mana-u: #0a6bab;
    --mana-b: #48404a;
    --mana-r: #d4322c;
    --mana-g: #00734a;
    --mana-c: #a0979a;
    --mana-m: #c9a84c;

    /* Layout */
    --content-width: 1200px;
    --panel-radius: 4px;
    --font-heading: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', serif;
    --font-body: 'Crimson Text', 'Georgia', serif;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-abyss);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    /* Subtle radial vignette */
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(30, 25, 50, 0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(20, 15, 10, 0.4) 0%, transparent 50%);
    background-attachment: fixed;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-bright); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* --- Top Filigree --- */
.top-filigree {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    background: linear-gradient(180deg, #1a1520, var(--bg-abyss));
    border-bottom: 1px solid var(--gold-dark);
}
.filigree-line {
    height: 1px;
    width: 120px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.filigree-diamond {
    color: var(--gold-dim);
    font-size: 10px;
    margin: 0 12px;
    opacity: 0.7;
}

/* --- Header --- */
.site-header {
    text-align: center;
    padding: 40px 20px 0;
    background:
        linear-gradient(180deg,
            rgba(25, 20, 40, 0.9) 0%,
            rgba(15, 12, 25, 0.95) 60%,
            var(--bg-abyss) 100%);
    border-bottom: 2px solid var(--gold-dark);
    box-shadow:
        0 1px 0 var(--gold-border),
        0 4px 30px rgba(0,0,0,0.5);
    position: relative;
}
.site-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.header-inner {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* Emblem */
.header-emblem { margin-bottom: 16px; }
.emblem-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 2px solid var(--gold-dim);
    border-radius: 50%;
    background: radial-gradient(circle, var(--bg-panel-light) 40%, var(--bg-panel) 100%);
    box-shadow:
        0 0 20px rgba(201, 168, 76, 0.15),
        inset 0 0 15px rgba(0,0,0,0.5);
}
.emblem-icon {
    font-size: 28px;
    color: var(--gold);
    text-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
}

/* Title */
.site-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    color: var(--gold);
    text-shadow:
        0 0 30px rgba(201, 168, 76, 0.2),
        0 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 6px;
    background: linear-gradient(180deg, var(--gold-bright), var(--gold), var(--gold-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.site-tagline {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    margin-bottom: 28px;
}

/* --- Navigation --- */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 0;
}
.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.25s ease;
    position: relative;
}
.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(201, 168, 76, 0.05);
}
.nav-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
    text-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
}
.nav-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}
.nav-tab.active .nav-icon { opacity: 1; }

.armory-count {
    background: var(--red);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* --- Main Content --- */
.main-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 20px;
    min-height: 60vh;
}

.tab-panel { display: none; padding: 40px 0; }
.tab-panel.active { display: block; }

/* --- Panel Frame --- */
.panel-frame {
    background: linear-gradient(180deg, var(--bg-panel-mid), var(--bg-panel));
    border: 1px solid var(--gold-dark);
    border-radius: var(--panel-radius);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(201, 168, 76, 0.08),
        0 8px 32px rgba(0,0,0,0.4);
    overflow: hidden;
}
.panel-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--gold-dark);
    background: linear-gradient(180deg, rgba(201, 168, 76, 0.06), transparent);
}
.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 0.08em;
}
.header-accent {
    color: var(--gold);
    margin-right: 8px;
}
.panel-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 6px;
}
.panel-body { padding: 24px 28px; }

/* --- Search Section --- */
.search-section {
    text-align: center;
    padding: 30px 0 10px;
    position: relative;
}
.search-frame {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    position: relative;
}
.search-ornament {
    color: var(--gold-dim);
    font-size: 18px;
    opacity: 0.5;
}
.search-input-wrap {
    position: relative;
    width: 520px;
}
#commander-search {
    width: 100%;
    padding: 16px 50px 16px 24px;
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--text-primary);
    background: var(--bg-panel);
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.3),
        0 0 0 1px rgba(0,0,0,0.2);
}
#commander-search:focus {
    border-color: var(--gold);
    box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.3),
        0 0 15px rgba(201, 168, 76, 0.15),
        0 0 0 1px var(--gold-dark);
}
#commander-search::placeholder {
    color: var(--text-muted);
    font-style: italic;
}
.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
}
.search-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 12px;
    font-style: italic;
}

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 520px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--bg-panel);
    border: 1px solid var(--gold-dark);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    display: none;
    z-index: 100;
}
.autocomplete-dropdown.open { display: block; }
.autocomplete-item {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(92, 74, 30, 0.2);
    transition: all 0.15s;
}
.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: rgba(201, 168, 76, 0.1);
    color: var(--gold-bright);
    padding-left: 26px;
}
.autocomplete-item:last-child { border-bottom: none; }

/* --- Commander Display --- */
.commander-display {
    margin: 30px 0;
}
.commander-card-area {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}
.commander-image-wrap {
    flex-shrink: 0;
    position: relative;
}
.commander-image-wrap img {
    width: 280px;
    border-radius: 12px;
    box-shadow:
        0 0 0 2px var(--gold-dark),
        0 0 30px rgba(201, 168, 76, 0.15),
        0 10px 40px rgba(0,0,0,0.6);
    transition: transform 0.3s;
}
.commander-image-wrap img:hover {
    transform: scale(1.03);
}
.commander-info {
    flex: 1;
    padding-top: 8px;
}
.commander-name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}
.commander-type {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 16px;
}
.commander-oracle {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
    padding: 16px 20px;
    background: var(--bg-panel);
    border-left: 3px solid var(--gold-dark);
    border-radius: 0 4px 4px 0;
    margin-bottom: 16px;
}
.commander-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.commander-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-panel);
    border: 1px solid rgba(92, 74, 30, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-ui);
}
.commander-stat .stat-val {
    color: var(--text-bright);
    font-weight: 600;
}
.color-identity-dots {
    display: flex;
    gap: 4px;
}
.mana-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.4);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3);
}
.mana-dot.W { background: var(--mana-w); }
.mana-dot.U { background: var(--mana-u); }
.mana-dot.B { background: var(--mana-b); }
.mana-dot.R { background: var(--mana-r); }
.mana-dot.G { background: var(--mana-g); }
.mana-dot.C { background: var(--mana-c); }

/* --- Recommendations Grid --- */
.recommendations-grid { margin-top: 20px; }

.rec-category {
    margin-bottom: 32px;
}
.rec-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(90deg, rgba(201, 168, 76, 0.08), transparent);
    border-left: 3px solid var(--gold);
    margin-bottom: 16px;
    border-radius: 0 4px 4px 0;
}
.rec-category-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.06em;
}
.rec-category-count {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-panel);
    padding: 2px 8px;
    border-radius: 10px;
}

.rec-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 0 4px;
}

.rec-card {
    background: linear-gradient(180deg, var(--bg-panel-light), var(--bg-panel));
    border: 1px solid rgba(92, 74, 30, 0.25);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}
.rec-card:hover {
    border-color: var(--gold-dim);
    transform: translateY(-3px);
    box-shadow:
        0 8px 25px rgba(0,0,0,0.4),
        0 0 15px rgba(201, 168, 76, 0.1);
}
.rec-card-img {
    width: 100%;
    aspect-ratio: 488/680;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid rgba(92, 74, 30, 0.2);
}
.rec-card-body {
    padding: 10px 12px;
}
/* Skeleton loading animation for cards */
.rec-card-img-skeleton {
    width: 100%;
    aspect-ratio: 488/680;
    background: linear-gradient(110deg, var(--bg-panel) 30%, var(--bg-panel-light) 50%, var(--bg-panel) 70%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-bottom: 1px solid rgba(92, 74, 30, 0.2);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card .rec-card-name {
    color: var(--gold);
}

/* Load More button */
.load-more-wrap {
    text-align: center;
    padding: 12px 0 8px;
}
.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-panel);
    border: 1px solid rgba(92, 74, 30, 0.25);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-load-more:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold-dim);
    color: var(--gold);
}
.btn-load-more:disabled {
    opacity: 0.4;
    cursor: default;
}

.rec-card-name {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rec-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-ui);
    font-size: 0.75rem;
}
.rec-card-price {
    color: var(--green);
    font-weight: 600;
}
.rec-card-actions {
    display: flex;
    gap: 4px;
}
.rec-card-btn {
    padding: 3px 8px;
    font-size: 0.7rem;
    font-family: var(--font-ui);
    border: 1px solid rgba(92, 74, 30, 0.3);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: var(--text-secondary);
}
.rec-card-btn:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold-dim);
    color: var(--gold);
}
.rec-card-btn.buy-btn {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold-dark);
    color: var(--gold);
}
.rec-card-btn.buy-btn:hover {
    background: var(--gold-dark);
    color: var(--text-bright);
}
.rec-card-btn.added {
    background: rgba(58, 154, 92, 0.2);
    border-color: var(--green);
    color: var(--green);
    pointer-events: none;
}

/* Synergy reason tooltip */
.rec-card-reason {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    border-top: 1px solid rgba(92, 74, 30, 0.15);
    background: rgba(0,0,0,0.15);
    line-height: 1.4;
}

/* --- Loading State --- */
.loading-state {
    text-align: center;
    padding: 60px 20px;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gold-dark);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1rem;
}

/* --- Buttons --- */
.btn-forge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-bright);
    background: linear-gradient(180deg, var(--gold-dim), var(--gold-dark));
    border: 1px solid var(--gold);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow:
        inset 0 1px 0 rgba(201, 168, 76, 0.3),
        0 2px 8px rgba(0,0,0,0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.btn-forge:hover {
    background: linear-gradient(180deg, var(--gold), var(--gold-dim));
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 0 20px rgba(201, 168, 76, 0.3),
        0 4px 12px rgba(0,0,0,0.4);
}
.btn-forge:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.btn-icon { font-size: 1.1rem; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-panel);
    border: 1px solid rgba(92, 74, 30, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: var(--bg-panel-light);
    color: var(--text-primary);
    border-color: var(--gold-dark);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--red);
    background: transparent;
    border: 1px solid rgba(196, 58, 58, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover {
    background: rgba(196, 58, 58, 0.1);
    border-color: var(--red);
}

/* --- Form Fields --- */
.field-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
    margin-top: 18px;
}
.field-label:first-child { margin-top: 0; }

.field-input,
.field-select {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-deep);
    border: 1px solid rgba(92, 74, 30, 0.3);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
    border-color: var(--gold-dim);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.1);
}

.field-textarea {
    width: 100%;
    padding: 14px 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-deep);
    border: 1px solid rgba(92, 74, 30, 0.3);
    border-radius: 4px;
    outline: none;
    resize: vertical;
    min-height: 200px;
    line-height: 1.5;
    transition: border-color 0.2s;
}
.field-textarea.short { min-height: 80px; }
.field-textarea::placeholder,
.field-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}
.field-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c9a84c' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 40px;
}
.field-select option {
    background: var(--bg-panel);
    color: var(--text-primary);
}

/* --- Deck Doctor --- */
.doctor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}
.doctor-input-panel .btn-forge {
    margin-top: 24px;
    width: 100%;
    justify-content: center;
}
.doctor-results-panel { min-height: 400px; }

/* Doctor results */
.doctor-result-section {
    margin-bottom: 24px;
}
.doctor-section-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 10px 16px;
    margin-bottom: 12px;
    border-radius: 4px;
}
.doctor-section-title.cuts {
    color: #ff8080;
    background: rgba(196, 58, 58, 0.1);
    border-left: 3px solid var(--red);
}
.doctor-section-title.adds {
    color: #80ff80;
    background: rgba(58, 154, 92, 0.1);
    border-left: 3px solid var(--green);
}
.doctor-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(92, 74, 30, 0.1);
    transition: background 0.15s;
}
.doctor-card-row:hover {
    background: rgba(201, 168, 76, 0.05);
}
.doctor-card-row img {
    width: 50px;
    border-radius: 4px;
}
.doctor-card-info { flex: 1; }
.doctor-card-name-link {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
}
.doctor-card-reason-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 2px;
}

/* --- Armory / Buy List --- */
.armory-layout {
    max-width: 800px;
    margin: 0 auto;
}
.armory-list {
    padding: 16px;
    min-height: 200px;
}
.armory-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(92, 74, 30, 0.15);
    transition: background 0.15s;
}
.armory-item:hover { background: rgba(201, 168, 76, 0.04); }
.armory-item:last-child { border-bottom: none; }
.armory-item img {
    width: 50px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.armory-item-info { flex: 1; }
.armory-item-name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-bright);
}
.armory-item-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}
.armory-item-price {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green);
    min-width: 60px;
    text-align: right;
}
.armory-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}
.armory-qty-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid rgba(92, 74, 30, 0.3);
    border-radius: 3px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.armory-qty-btn:hover {
    background: var(--bg-hover);
    color: var(--gold);
    border-color: var(--gold-dim);
}
.armory-remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    transition: color 0.15s;
}
.armory-remove-btn:hover { color: var(--red); }

.armory-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gold-dark);
    background: linear-gradient(180deg, rgba(201, 168, 76, 0.04), transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.armory-total {
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 0.04em;
}
.total-label { color: var(--text-secondary); }
.total-amount {
    color: var(--gold-bright);
    font-weight: 700;
    font-size: 1.3rem;
    margin-left: 8px;
}
.armory-actions { display: flex; gap: 10px; align-items: center; }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}
.empty-sub {
    font-size: 0.85rem;
    margin-top: 8px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Card Preview Tooltip --- */
.card-preview {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.15s;
}
.card-preview img {
    width: 250px;
    border-radius: 12px;
    box-shadow:
        0 0 0 2px var(--gold-dark),
        0 12px 40px rgba(0,0,0,0.7),
        0 0 30px rgba(201, 168, 76, 0.15);
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--gold-dark);
    background: linear-gradient(180deg, var(--bg-deep), var(--bg-abyss));
}
.footer-inner { max-width: var(--content-width); margin: 0 auto; }
.footer-ornament {
    color: var(--gold-dark);
    font-size: 12px;
    letter-spacing: 8px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.footer-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 4px;
}
.footer-disclosure {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 12px;
    opacity: 0.7;
}
.footer-copy {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 12px;
    opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .site-title { font-size: 1.8rem; letter-spacing: 0.15em; }
    .nav-tab { padding: 10px 16px; font-size: 0.75rem; }
    .nav-icon { display: none; }
    .search-ornament { display: none; }
    .search-input-wrap { width: 100%; }
    .autocomplete-dropdown { width: 100%; left: 0; transform: none; }
    .commander-card-area { flex-direction: column; align-items: center; }
    .commander-image-wrap img { width: 220px; }
    .rec-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .doctor-layout { grid-template-columns: 1fr; }
    .armory-footer { flex-direction: column; text-align: center; }
    .armory-actions { justify-content: center; }
}

@media (max-width: 480px) {
    .site-title { font-size: 1.4rem; }
    .site-tagline { font-size: 0.85rem; }
    .main-nav { flex-wrap: wrap; }
    .rec-cards { grid-template-columns: repeat(2, 1fr); }
    .emblem-ring { width: 48px; height: 48px; }
    .emblem-icon { font-size: 22px; }
}

/* --- Deck stats bar (Deck Doctor results) --- */
.deck-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.deck-stat-card {
    text-align: center;
    padding: 12px;
    background: var(--bg-panel);
    border: 1px solid rgba(92, 74, 30, 0.2);
    border-radius: 4px;
}
.deck-stat-val {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
}
.deck-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* --- AI Analysis Text --- */
.ai-analysis-text {
    padding: 16px 20px;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.7;
    background: var(--bg-panel);
    border-left: 3px solid var(--purple);
    border-radius: 0 4px 4px 0;
    margin: 16px;
}

/* Mana curve mini chart */
.mana-curve {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
    padding: 0 16px 16px;
}
.mana-curve-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    position: relative;
}
.mana-curve-bar::after {
    content: attr(data-count);
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-ui);
}
.mana-curve-label {
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    padding-top: 4px;
    font-family: var(--font-ui);
}
