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

:root {
    /* Backgrounds */
    --bg:        #08080f;
    --bg-card:   #0f0f1c;
    --bg-surface:#16162a;
    --bg-hover:  #1c1c35;

    /* Brand */
    --primary:       #7c3aed;
    --primary-hover: #6d28d9;
    --primary-glow:  rgba(124, 58, 237, 0.25);
    --primary-light: #a78bfa;
    --gradient:      linear-gradient(135deg, #7c3aed 0%, #db2777 100%);

    /* Accents */
    --gold:  #f59e0b;
    --green: #10b981;
    --red:   #ef4444;

    /* Text */
    --text:       #f1f5f9;
    --text-soft:  #94a3b8;
    --text-muted: #4b5563;
    --white:      #ffffff;

    /* Borders */
    --border:       rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.14);

    /* Radius */
    --radius:    10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .nav-brand {
    font-family: 'Space Grotesk', sans-serif;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--white); }

code {
    background: var(--bg-surface);
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    font-size: 0.82em;
    color: var(--primary-light);
    border: 1px solid var(--border);
}

/* === Navbar === */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 2rem;
    background: rgba(8, 8, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo {
    height: 30px;
    width: auto;
    flex-shrink: 0;
    /* SVG has transparent bg so it drops onto the dark nav naturally */
    filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.5));
}

.nav-links { display: flex; gap: 0.25rem; }

.nav-links a {
    color: var(--text-soft);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    transition: all 0.15s;
}

.nav-links a:hover {
    color: var(--white);
    background: var(--bg-surface);
}

/* === Container === */
.container {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    width: 100%;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 0 var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-soft);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--white);
    border-color: var(--border-hover);
}

.btn-gold {
    background: var(--gold);
    color: #1a0e00;
    font-weight: 700;
}
.btn-gold:hover {
    background: #fbbf24;
    color: #1a0e00;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.btn-xl {
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
}

/* === Flash Messages === */
.flash-messages { max-width: 700px; margin: 0 auto 1.5rem; }
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}
.flash-success { background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.flash-error   { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.flash-warning { background: rgba(245,158,11,0.1); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }

/* ================================================
   LANDING PAGE
   ================================================ */

.lp-hero {
    text-align: center;
    padding: 5rem 1rem 4rem;
    max-width: 780px;
    margin: 0 auto;
}

.lp-hero-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.lp-hero-title {
    font-size: 3.6rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.08;
    letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
}

.lp-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lp-hero-sub {
    font-size: 1.1rem;
    color: var(--text-soft);
    line-height: 1.65;
    max-width: 560px;
    margin: 0 auto 0;       /* path cards follow directly — no bottom gap */
}

/* ── Two-path entry cards ─────────────────────────────────────── */
.lp-path-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    max-width: 900px;
    margin: 2.75rem auto 4rem;
    padding: 0 1rem;
}

.lp-path-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 2px solid #7c3aed;
    border-radius: 16px;
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.lp-path-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 36px rgba(124, 58, 237, 0.18);
    border-color: rgba(124, 58, 237, 0.5);
}

.lp-path-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.lp-path-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.lp-path-card-head {
    font-size: 1.4rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 0;
}

.lp-path-card-desc {
    font-size: 0.88rem;
    color: var(--text-soft);
    line-height: 1.65;
    flex: 1;
    margin: 0.15rem 0 0.5rem;
}

.lp-path-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
}

.lp-path-card-note {
    font-size: 0.73rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 640px) {
    .lp-path-grid { grid-template-columns: 1fr; }
}
/* ── end path cards ────────────────────────────────────────────── */

.lp-cta { padding: 1rem 2.5rem; font-size: 1rem; }

.lp-how {
    max-width: 960px;
    margin: 0 auto 4rem;
    padding: 0 1rem;
}

.lp-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    text-align: center;
}

.lp-steps {
    display: flex;
    align-items: flex-start;
}

.lp-step {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}

.lp-step-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.5;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
}

.lp-step h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.lp-step p {
    font-size: 0.85rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.lp-step-arrow {
    font-size: 1.25rem;
    color: var(--border);
    padding: 0 0.75rem;
    margin-top: 1.75rem;
    flex-shrink: 0;
}

.lp-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 960px;
    margin: 0 auto 4rem;
    padding: 0 1rem;
}

.lp-feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.lp-feature-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }

.lp-feature h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.lp-feature p {
    font-size: 0.82rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.lp-bottom-cta {
    text-align: center;
    padding: 3.5rem 1rem 4rem;
    max-width: 600px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
}

.lp-bottom-cta h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.lp-bottom-cta p {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 1.75rem;
}

@media (max-width: 768px) {
    .lp-hero-title { font-size: 2.4rem; }
    .lp-steps { flex-direction: column; gap: 0.75rem; }
    .lp-step-arrow { display: none; }
    .lp-features { grid-template-columns: 1fr; }
}

/* ================================================
   ONBOARDING (first-time user)
   ================================================ */
.onboarding {
    text-align: center;
    padding: 5rem 1rem 3rem;
}

.onboarding-hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
}

.onboarding-hero h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.onboarding-hero p {
    font-size: 1.1rem;
    color: var(--text-soft);
    margin-bottom: 3rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.onboarding-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 3rem;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.step { flex: 1; text-align: center; }

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--primary-light);
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.6rem;
}

.step h3 {
    font-size: 0.9rem;
    color: var(--white);
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.step p {
    font-size: 0.78rem;
    color: var(--text-soft);
    line-height: 1.4;
}

.step-connector {
    width: 40px;
    height: 1px;
    background: var(--border);
    margin: 0 0.25rem;
    margin-bottom: 2.8rem;
}

/* ================================================
   COLLECTION (returning user)
   ================================================ */
.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.collection-header h1 {
    font-size: 2rem;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.collection-summary {
    color: var(--text-soft);
    font-size: 0.875rem;
    margin-top: 0.2rem;
}

.collection-actions {
    display: flex;
    gap: 0.75rem;
}

/* === Deck Grid === */
.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.deck-tile {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.deck-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(124,58,237,0.2);
    border-color: rgba(124,58,237,0.3);
}

.deck-tile-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    color: var(--white);
    margin: 0.5rem 0 0.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.deck-tile-commander {
    font-size: 0.78rem;
    color: var(--text-soft);
    margin-bottom: 0.4rem;
}

.deck-tile-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green);
}

/* === Color Pips === */
.color-pips { display: flex; gap: 0.3rem; }

.mana-pip {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.mana-pip.mana-W { background: #f0ede0; }
.mana-pip.mana-U { background: #1a6fb5; color: #fff; }
.mana-pip.mana-B { background: #1a1a1a; color: #aaa; border: 1px solid #333; }
.mana-pip.mana-R { background: #d32f2f; color: #fff; }
.mana-pip.mana-G { background: #2e7d32; color: #fff; }

/* ================================================
   WIZARD (import flow)
   ================================================ */
.wizard {
    max-width: 620px;
    margin: 0 auto;
}

/* Progress bar */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2.5rem;
    padding-top: 0.5rem;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.wizard-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.wizard-step.active .wizard-dot {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}

.wizard-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.wizard-step.active .wizard-label {
    color: var(--text-soft);
}

.wizard-line {
    width: 80px;
    height: 2px;
    background: var(--border);
    margin: 0 1rem;
    margin-bottom: 1.2rem;
    border-radius: 1px;
    transition: background 0.3s;
}

.wizard-line.filled {
    background: var(--primary);
}

/* Panels */
.wizard-panel { display: none; }

.wizard-panel.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wizard-panel h1 {
    font-size: 1.9rem;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.3rem;
}

.wizard-desc {
    color: var(--text-soft);
    font-size: 0.875rem;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.wizard-next,
.wizard-buttons .btn-xl { width: 100%; margin-top: 0.5rem; }

.wizard-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.wizard-buttons .btn-secondary { flex: 0 0 auto; padding: 1rem 1.5rem; }
.wizard-buttons .btn-xl        { flex: 1; }

/* Input method toggle */
.input-method-toggle {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}

.toggle-btn {
    flex: 1;
    padding: 0.55rem;
    background: transparent;
    color: var(--text-soft);
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.toggle-btn.active {
    background: var(--bg-surface);
    color: var(--white);
}

/* Form elements */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
    font-size: 0.83rem;
    letter-spacing: 0.01em;
}

.label-hint {
    font-weight: 400;
    color: var(--text-soft);
    font-size: 0.78rem;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 0.7rem 0.95rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea {
    resize: vertical;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.82rem;
    line-height: 1.65;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Drop zone */
.drop-zone {
    padding: 2.5rem 1.5rem;
    border: 1.5px dashed rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--bg-card);
    transition: all 0.2s;
    position: relative;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(124,58,237,0.05);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-label {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.drop-zone-hint {
    font-size: 0.78rem;
    color: var(--text-soft);
}

.file-list { margin-top: 1rem; }

.file-item {
    padding: 0.3rem 0;
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 500;
}

.file-error {
    color: var(--red);
    font-weight: 600;
    font-size: 0.85rem;
}

/* Site badges (URL tab) */
.site-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.site-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    background: var(--bg-surface);
    color: var(--text-soft);
    border: 1px solid var(--border);
    letter-spacing: 0.01em;
}

.site-note {
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Format hint */
.format-hint { margin-bottom: 1.5rem; }

.format-hint details {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.format-hint summary {
    padding: 0.7rem 1rem;
    cursor: pointer;
    color: var(--text-soft);
    font-size: 0.83rem;
    font-weight: 500;
}

.format-hint summary:hover { color: var(--text); }

.format-hint pre {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.78rem;
    color: var(--primary-light);
    padding: 0 1rem;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.format-hint p {
    font-size: 0.78rem;
    color: var(--text-soft);
    padding: 0 1rem;
    margin-bottom: 0.4rem;
}

.format-hint p:last-child { padding-bottom: 0.75rem; }

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease; }

/* ================================================
   PREFERENCES (step 2)
   ================================================ */
.pref-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}

.pref-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.3rem;
    display: block;
    letter-spacing: -0.01em;
}

.pref-hint {
    font-size: 0.78rem;
    color: var(--text-soft);
    margin-bottom: 1rem;
}

/* Budget slider */
.slider-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.slider-group input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: var(--bg-surface);
    border-radius: 2px;
    outline: none;
    border: none;
    padding: 0;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.slider-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    min-width: 65px;
    text-align: right;
}

.slider-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* Power level grid */
.power-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.power-option input { display: none; }

.power-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.5rem;
    border-radius: var(--radius);
    background: var(--bg-surface);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.power-option input:checked + .power-card {
    border-color: var(--primary);
    background: rgba(124,58,237,0.1);
    box-shadow: 0 0 16px var(--primary-glow);
}

.power-card:hover {
    border-color: rgba(124,58,237,0.3);
}

.power-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 0.15rem;
}

.power-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.1rem;
}

.power-desc {
    font-size: 0.68rem;
    color: var(--text-soft);
}

/* ================================================
   RECOMMEND PAGE
   ================================================ */
.rec-page { max-width: 860px; margin: 0 auto; }

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.rec-header h1 {
    font-size: 1.9rem;
    color: var(--white);
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.rec-sub {
    font-size: 0.875rem;
    color: var(--text-soft);
}

/* Profile row */
.rec-profile-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.rec-profile-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.rec-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
}

.strategy-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    background: rgba(124,58,237,0.12);
    color: var(--primary-light);
    border: 1px solid rgba(124,58,237,0.2);
}

/* Empty state */
.rec-empty {
    text-align: center;
    padding: 3rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

/* Recommendation list */
.rec-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Individual recommendation card */
.rec-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rec-card:hover {
    border-color: rgba(124,58,237,0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Commander image column */
.rec-card-img {
    position: relative;
    background: var(--bg-surface);
}

.rec-card-img img {
    width: 100%;
    display: block;
    object-fit: cover;
    height: 100%;
    min-height: 220px;
}

.rec-img-placeholder {
    width: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-size: 0.8rem;
    padding: 1rem;
    text-align: center;
}

.rec-match-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* Angle badge — shown above commander name to explain why it was picked */
.rec-angle-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.18rem 0.55rem;
    border-radius: 99px;
    margin-bottom: 0.35rem;
    color: #fff;
}
.rec-angle-strategy_champion  { background: #7c3aed; }
.rec-angle-community_pick      { background: #b45309; }
.rec-angle-secondary_strategy  { background: #0e7490; }
.rec-angle-color_synergy       { background: #1d4ed8; }
.rec-angle-wildcard            { background: #be185d; }

/* Info column */
.rec-card-body {
    padding: 1.25rem 1.25rem 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rec-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.rec-cmd-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 0.15rem;
}

.rec-cmd-type {
    font-size: 0.78rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.rec-cmd-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rec-cmd-price {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--green);
}

/* Cost box */
.rec-cost-box {
    text-align: right;
    flex-shrink: 0;
}

.rec-cost-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.rec-cost-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
}

.rec-cost-ok   { color: var(--green); }
.rec-cost-over { color: var(--gold); }

.rec-cost-note {
    font-size: 0.68rem;
    color: var(--gold);
    margin-top: 0.1rem;
}

/* Reasons list */
.rec-reasons {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.rec-reasons li {
    font-size: 0.82rem;
    color: var(--text-soft);
    padding-left: 1rem;
    position: relative;
}

.rec-reasons li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-light);
    font-weight: 700;
}

/* Synergy cards */
.rec-synergy-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.rec-synergy-grid {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rec-synergy-card {
    width: 56px;
    border-radius: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: transform 0.15s;
    cursor: default;
    /* overflow must stay visible so the ::after tooltip can escape the bounds */
    overflow: visible;
}

.rec-synergy-card:hover { transform: translateY(-2px) scale(1.05); }

.rec-synergy-card img {
    width: 100%;
    display: block;
    aspect-ratio: 488 / 680;
    object-fit: cover;
    border-radius: 4px;   /* clip the image itself instead */
    overflow: hidden;
}

.rec-synergy-placeholder {
    width: 56px;
    aspect-ratio: 488 / 680;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    color: var(--text-muted);
    padding: 0.25rem;
    text-align: center;
}

/* Clickable commander image */
.rec-img-link { display: block; }
.rec-img-link:hover img { opacity: 0.88; transition: opacity 0.15s; }

/* Synergy cards as links */
a.rec-synergy-card {
    display: block;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}
a.rec-synergy-card:hover { transform: translateY(-2px) scale(1.05); }

/* Hover tooltip: name · price */
a.rec-synergy-card::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.95);
    color: #e0e0f0;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 5px 9px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 20;
}
a.rec-synergy-card:hover::after { opacity: 1; }

/* Full deck list section */
.rec-decklist-section {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.rec-decklist-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    width: 100%;
    justify-content: space-between;
}
.rec-decklist-toggle:hover {
    border-color: var(--primary-light);
    color: var(--text);
}
.rec-decklist-arrow { font-size: 0.7rem; }

.rec-decklist-body {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Structured deck list (replaces textarea) */
.rec-dl-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.rec-dl-section-header {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.45rem 0.85rem;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
}
.rec-dl-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.85rem;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.rec-dl-row:last-child { border-bottom: none; }
.rec-dl-qty {
    color: var(--text-muted);
    font-size: 0.72rem;
    min-width: 20px;
}
.rec-dl-name {
    flex: 1;
    color: var(--text-soft);
}
.rec-dl-price {
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rec-decklist-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.rec-decklist-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
}

@media (max-width: 768px) {
    .rec-header { flex-direction: column; }
    .rec-card   { grid-template-columns: 1fr; }
    .rec-card-img img { min-height: 280px; max-height: 360px; }
    .rec-card-body { padding: 1rem; }
}

/* ================================================
   SEARCH
   ================================================ */
.search-form { max-width: 600px; margin: 0 auto; }
.search-bar  { display: flex; gap: 0.5rem; }

.search-bar input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.search-bar button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.search-header { margin-bottom: 1.5rem; }
.result-count  { color: var(--text-soft); margin-bottom: 1rem; font-size: 0.875rem; }

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.card-tile {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.card-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,58,237,0.2);
}

.card-image { width: 100%; display: block; aspect-ratio: 488 / 680; object-fit: cover; }

.card-image-placeholder {
    width: 100%; aspect-ratio: 488 / 680;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface); color: var(--text-soft);
    padding: 1rem; text-align: center; font-size: 0.82rem;
}

.card-info    { padding: 0.75rem; }
.card-name    { font-family: 'Space Grotesk', sans-serif; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.15rem; color: var(--white); letter-spacing: -0.01em; }
.card-type    { font-size: 0.72rem; color: var(--text-soft); margin-bottom: 0.15rem; }
.card-price   { font-size: 0.82rem; font-weight: 600; color: var(--green); }
.card-price--na { color: var(--text-muted); }

.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 1rem; margin-top: 2rem; padding: 1rem 0;
}
.page-num { color: var(--text-soft); }

.no-results { text-align: center; padding: 3rem 1rem; }
.no-results h2 { margin-bottom: 0.5rem; color: var(--text); letter-spacing: -0.02em; }
.no-results p  { color: var(--text-soft); }

/* ================================================
   FOOTER
   ================================================ */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 4rem; padding: 2rem 1.5rem;
    background: var(--surface);
}
.footer-inner {
    max-width: 900px; margin: 0 auto;
    display: flex; flex-direction: column; align-items: center;
    gap: 0.75rem; text-align: center;
}
.footer-legal {
    font-size: 0.78rem; color: var(--text-muted); line-height: 1.6;
    max-width: 680px;
}
.footer-legal a { color: var(--text-soft); text-decoration: underline; }
.footer-legal a:hover { color: var(--text); }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { font-size: 0.82rem; color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ================================================
   LEGAL PAGES (Privacy / Terms)
   ================================================ */
.legal-page {
    max-width: 720px; margin: 0 auto; padding: 2rem 0 4rem;
}
.legal-page h1 {
    font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.25rem;
}
.legal-date { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 2.5rem; }
.legal-section { margin-bottom: 2rem; }
.legal-section h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.6rem; }
.legal-section p, .legal-section li {
    font-size: 0.92rem; color: var(--text-soft); line-height: 1.7; margin-bottom: 0.5rem;
}
.legal-section ul { padding-left: 1.4rem; margin-bottom: 0.5rem; }
.legal-section a { color: var(--accent); text-decoration: none; }
.legal-section a:hover { text-decoration: underline; }

/* ================================================
   LANDING PAGE — two-path CTA
   ================================================ */
.lp-cta-row {
    display: flex; align-items: center; gap: 1.25rem;
    flex-wrap: wrap; justify-content: center; margin-top: 2rem;
}
.lp-cta-or {
    color: var(--text-muted); font-size: 0.9rem; flex-shrink: 0;
}
.lp-cta-sub {
    display: block; font-size: 0.75rem; font-weight: 400;
    opacity: 0.75; margin-top: 2px;
}

/* ================================================
   QUIZ / CHATBOT
   ================================================ */
.quiz-wrap {
    max-width: 640px; margin: 0 auto; padding: 1.5rem 1rem 3rem;
}
.quiz-header {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1.5rem;
}
.quiz-avatar {
    font-size: 2.2rem; line-height: 1;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 50%; width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.quiz-title   { font-size: 1.15rem; font-weight: 700; margin: 0; }
.quiz-subtitle { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.chat-window {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 1.25rem;
    min-height: 320px; max-height: 65vh;
    overflow-y: auto; display: flex; flex-direction: column; gap: 1rem;
}

/* Bot message */
.chat-msg { display: flex; gap: 0.6rem; align-items: flex-start; }
.chat-bot  { justify-content: flex-start; }
.chat-user { justify-content: flex-end; }

.chat-msg .chat-avatar {
    font-size: 1.1rem; flex-shrink: 0;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 50%; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
}
.chat-bubble {
    max-width: 78%; padding: 0.65rem 0.9rem;
    border-radius: 14px; font-size: 0.92rem; line-height: 1.5;
}
.chat-bot  .chat-bubble { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.chat-user .chat-bubble { background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.chat-hint { font-size: 0.8rem; color: var(--text-muted); }

/* Choice buttons */
.chat-choices {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    padding-left: 2.4rem; /* align with bubble */
}
.choice-btn {
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text); border-radius: 20px;
    padding: 0.45rem 0.9rem; cursor: pointer;
    font-size: 0.88rem; text-align: left;
    display: flex; flex-direction: column;
    transition: border-color 0.15s, background 0.15s;
}
.choice-btn:hover { border-color: var(--accent); background: rgba(99,102,241,0.08); }
.choice-btn.selected { border-color: var(--accent); background: rgba(99,102,241,0.15); }
.choice-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.choice-confirm {
    background: var(--accent); color: #fff; border-color: var(--accent);
    font-weight: 600; margin-top: 0.25rem;
}
.choice-confirm:hover { background: #4f46e5; border-color: #4f46e5; }

/* Free-text chat input row */
.chat-input-row {
    display: flex; gap: 0.5rem; margin-top: 0.75rem;
}
.chat-input {
    flex: 1; background: var(--surface); border: 1px solid var(--border);
    color: var(--text); border-radius: 10px; padding: 0.65rem 0.9rem;
    font-size: 0.95rem; outline: none; font-family: inherit;
    transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input:disabled { opacity: 0.5; }
.chat-send-btn { flex-shrink: 0; padding: 0.65rem 1.25rem; border-radius: 10px; }

/* Typing indicator dots */
.typing-dots { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.typing-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-muted); display: inline-block;
    animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-5px); opacity: 1; }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .onboarding-hero h1 { font-size: 2.1rem; }
    .onboarding-steps { flex-direction: column; gap: 0.5rem; }
    .step-connector { width: 1px; height: 20px; margin: 0; }
    .collection-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .collection-actions { width: 100%; }
    .collection-actions .btn { flex: 1; text-align: center; }
    .deck-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
    .power-grid { grid-template-columns: repeat(2, 1fr); }
    .navbar { padding: 0.75rem 1rem; }
    .container { padding: 1.25rem; }
    .wizard-panel h1 { font-size: 1.5rem; }
}
