:root {
    --bg-color: #0a0a0c; /* Landing-page match: near-black */
    --card-bg: #111017; /* Solid dark panel — no glassmorphism */
    --card-bg-grad-top: #14131b;
    --card-bg-grad-bottom: #101015;
    --card-border: #232030;
    --accent-primary: oklch(0.72 0.16 55);   /* Warm gold (logo) */
    --accent-secondary: oklch(0.66 0.16 38); /* Burnt amber/rust (logo) */
    --accent-tertiary: oklch(0.78 0.13 75);  /* Light gold highlight (logo) */
    --accent-success: #10b981; /* Emerald Green (Success state) */
    --accent-danger: oklch(0.62 0.19 18);     /* Warm red (Error / danger state) */
    --text-primary: #f2f0f5;
    --text-secondary: #a8a5b4;
    --text-tertiary: #77748a;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --transition-speed: 0.25s;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Abstract glowing background decorations (matches landing page glowdrift) */
body::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(46% 42% at 28% 32%, oklch(0.62 0.16 55 / 0.16) 0%, transparent 70%),
                radial-gradient(40% 38% at 74% 22%, oklch(0.62 0.13 75 / 0.12) 0%, transparent 72%);
    z-index: -1;
    filter: blur(80px);
    animation: glowdrift 26s ease-in-out infinite;
}

body::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(50% 40% at 52% 62%, oklch(0.66 0.16 38 / 0.10) 0%, transparent 75%);
    z-index: -1;
    filter: blur(80px);
    animation: glowdrift 32s ease-in-out infinite reverse;
}

@keyframes glowdrift {
    0% { transform: translate3d(-4%, 0, 0) scale(1); }
    50% { transform: translate3d(4%, -2%, 0) scale(1.08); }
    100% { transform: translate3d(-4%, 0, 0) scale(1); }
}

header {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 2.5rem;
    padding: 4.5rem 1.5rem 3rem;
    text-align: center;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, oklch(0.62 0.16 55 / 0.4), var(--accent-primary), oklch(0.62 0.13 75 / 0.4), transparent);
    box-shadow: 0 1px 8px oklch(0.62 0.16 55 / 0.5);
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.logo-image {
    width: auto;
    height: 4.25rem;
    object-fit: contain;
    filter: drop-shadow(0 0 12px oklch(0.62 0.16 55 / 0.4));
    transition: transform var(--transition-speed);
    animation: logoPulse 4s ease-in-out infinite;
}

.logo-image:hover {
    transform: scale(1.08) rotate(-1deg);
}

@keyframes logoPulse {
    0%, 100% {
        filter: drop-shadow(0 0 12px oklch(0.62 0.16 55 / 0.4));
    }
    50% {
        filter: drop-shadow(0 0 24px oklch(0.62 0.16 55 / 0.65));
    }
}

h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    background: linear-gradient(135deg, #ffffff 30%, #ffe0b8 70%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 13px 6px 10px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: #14131a;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
}

.header-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-tertiary);
    box-shadow: 0 0 10px var(--accent-tertiary);
}

main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Solid dark panel — no glass/blur, per the new design direction */
.glass-card {
    background: linear-gradient(180deg, var(--card-bg-grad-top), var(--card-bg-grad-bottom));
    border: 1px solid var(--card-border);
    border-radius: 1.125rem;
    padding: 2rem;
    box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.6);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.glass-card:hover {
    border-color: oklch(0.62 0.16 55 / 0.35);
    box-shadow: 0 20px 70px -30px oklch(0.62 0.16 55 / 0.12);
}

/* Forms styling */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 2fr 1fr;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-help {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

textarea, input[type="text"] {
    background-color: #0d0c12;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 1rem;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    width: 100%;
}

textarea:focus, input[type="text"]:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px oklch(0.62 0.16 55 / 0.12);
}

textarea {
    height: 280px;
    resize: vertical;
    line-height: 1.6;
}

textarea::placeholder, input[type="text"]::placeholder {
    color: #504c5c;
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed #2a2733;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.015);
    cursor: pointer;
    transition: background var(--transition-speed), border-color var(--transition-speed);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.drop-zone.dragover {
    background: oklch(0.62 0.16 55 / 0.08);
    border-color: var(--accent-primary);
}

.drop-zone svg {
    width: 2rem;
    height: 2rem;
    color: var(--text-tertiary);
    transition: color var(--transition-speed);
}

.drop-zone.dragover svg {
    color: var(--accent-primary);
}

.drop-zone-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.drop-zone-text span {
    color: var(--accent-tertiary);
    font-weight: 500;
}

/* Buttons styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.875rem 1.75rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.btn-primary {
    background: linear-gradient(140deg, oklch(0.72 0.16 55), oklch(0.66 0.16 38));
    color: #0c0a12;
    width: 100%;
    box-shadow: 0 0 28px -8px oklch(0.66 0.16 46 / 0.75);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 0 34px -6px oklch(0.66 0.16 46 / 0.85);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Button Shine animation */
.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg);
    transition: 0.75s;
}

.btn:hover::after {
    left: 120%;
}

/* Results dashboard layout */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.results-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.top-results-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .top-results-row {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.results-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.deck-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.btn-copy {
    background-color: #17161e;
    border: 1px solid #302c3c;
    color: #cfcbdb;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.btn-copy:hover {
    border-color: #4a4459;
    color: #ffffff;
}

.btn-copy.success {
    background-color: var(--accent-success);
    border-color: var(--accent-success);
    color: white;
}

.decklist-output {
    height: 350px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background-color: #0d0c12;
    color: #e9e6f0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}

@media (min-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: #131219;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.stat-val {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.stat-val.success {
    color: var(--accent-success);
}

.stat-val.danger {
    color: var(--accent-danger);
}

.stat-lbl {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
}

/* Removed cards styling */
.removed-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.removed-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.removed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: oklch(0.62 0.19 18 / 0.05);
    border: 1px solid oklch(0.62 0.19 18 / 0.2);
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.removed-card-name {
    font-weight: 500;
    color: #f3a9a0;
}

.removed-reason {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    background: rgba(0, 0, 0, 0.25);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

/* Suggestions Board styling */
.suggestions-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.commander-badge {
    background: linear-gradient(135deg, oklch(0.62 0.16 55 / 0.14), oklch(0.62 0.16 38 / 0.14));
    border: 1px solid oklch(0.62 0.16 55 / 0.35);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 500;
    color: #ffe6c4;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Suggestions Section Layout */
.suggestions-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.recommendation-grid-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .recommendation-grid-top {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .recommendation-grid-top {
        grid-template-columns: repeat(3, 1fr);
    }
}

.categorized-suggestions-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .categorized-suggestions-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .categorized-suggestions-layout {
        grid-template-columns: repeat(4, 1fr);
    }
}

.suggestion-column {
    background: #0e0d13;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.column-title {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent-tertiary);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.column-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Removed cards with replacements layout */
.removed-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.removed-row-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    background: oklch(0.62 0.19 18 / 0.03);
    border: 1px solid oklch(0.62 0.19 18 / 0.15);
    border-radius: 0.75rem;
    padding: 1rem;
    align-items: center;
}

@media (min-width: 768px) {
    .removed-row-item {
        grid-template-columns: 1.2fr 2fr;
    }
}

.removed-card-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
    cursor: help;
}

@media (min-width: 768px) {
    .removed-card-info {
        border-right: 1px solid rgba(255, 255, 255, 0.05);
        border-bottom: none;
        padding-bottom: 0;
    }
}

.removed-name-and-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.removed-name {
    font-weight: 600;
    color: #f3a9a0;
    font-size: 0.95rem;
}

.removed-type-cost {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.replacement-options-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.replacement-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    font-family: var(--font-mono);
}

.replacement-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .replacement-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .replacement-options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card Pill styling */
.card-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #131219;
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
    cursor: pointer;
    position: relative;
}

.card-pill:hover {
    border-color: var(--accent-tertiary);
    background-color: oklch(0.78 0.13 75 / 0.06);
    transform: translateX(2px);
}

.card-pill-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-width: 75%;
}

.rec-card-name {
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-card-meta {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
}

.rec-card-cost {
    font-family: var(--font-mono);
    color: #f5cf9e;
}

.rec-card-synergy {
    color: var(--accent-tertiary);
}

.btn-add-card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.card-pill:hover .btn-add-card {
    background-color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: white;
    transform: scale(1.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: #2a2733;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3a3547;
}

/* Floating Card Tooltip */
.card-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    display: none;
    width: 240px;
    height: 335px;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    border: 1px solid #2a2733;
    overflow: hidden;
    background-color: #14131a;
}

.card-tooltip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card-tooltip img.loaded {
    opacity: 1;
}

/* Loading Screen styling */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-screen.visible {
    opacity: 1;
    pointer-events: all;
}

.loader-ring {
    width: 4rem;
    height: 4rem;
    border: 4px solid oklch(0.62 0.16 55 / 0.1);
    border-top: 4px solid var(--accent-primary);
    border-right: 4px solid var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.loader-subtext {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

footer {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    border-top: 1px solid var(--card-border);
    margin-top: 3rem;
}

footer a {
    color: var(--accent-tertiary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

footer a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.error-banner {
    background-color: oklch(0.62 0.19 18 / 0.1);
    border: 1px solid oklch(0.62 0.19 18 / 0.3);
    color: #f3a9a0;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.error-banner svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Autocomplete dropdown styling */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #14131a;
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    margin-top: 0.25rem;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background-color var(--transition-speed);
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: var(--accent-primary);
    color: #0c0a12;
}

/* Top Links Styling */
.top-links {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.top-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.top-links a:hover {
    color: var(--accent-tertiary);
}

@media (max-width: 768px) {
    header {
        padding-top: 4rem;
    }
    .top-links {
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
        justify-content: center;
        width: 100%;
        right: auto;
    }
}

/* Replaced Row Condensed and Locked State */
.removed-row-item.replaced {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-color: rgba(16, 185, 129, 0.3) !important;
    border-left: 4px solid var(--accent-success) !important;
    background: rgba(16, 185, 129, 0.04) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.03);
    padding: 0.75rem 1.25rem !important;
    gap: 0.75rem !important;
    transition: all var(--transition-speed);
}

.btn-undo {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-family: var(--font-display);
    font-weight: 500;
    transition: all var(--transition-speed);
}

.btn-undo:hover {
    border-color: var(--accent-tertiary) !important;
    background-color: oklch(0.78 0.13 75 / 0.1) !important;
    color: white !important;
}

/* Tabs Interface */
.tabs-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: white;
    background-color: oklch(0.62 0.16 55 / 0.14);
    border: 1px solid oklch(0.62 0.16 55 / 0.4);
    box-shadow: 0 0 15px oklch(0.62 0.16 55 / 0.1);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

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

/* Analytics Tab Styling */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.analytics-card {
    background: #0e0d13;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mana Curve Histogram */
.histogram-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 180px;
    padding-top: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.75rem;
    position: relative;
}

.histogram-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 10%;
    height: 100%;
    justify-content: flex-end;
    gap: 0.25rem;
    cursor: pointer;
}

.histogram-bar {
    width: 100%;
    background: linear-gradient(0deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    border-radius: 0.25rem 0.25rem 0 0;
    min-height: 2px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 0 10px oklch(0.62 0.16 55 / 0.2);
}

.histogram-bar-wrapper:hover .histogram-bar {
    filter: brightness(1.2);
    box-shadow: 0 0 15px oklch(0.62 0.16 55 / 0.45);
}

.bar-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-weight: 500;
}

.bar-value {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: white;
    font-weight: 600;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
}

.histogram-bar-wrapper:hover .bar-value {
    opacity: 1;
    transform: translateY(0);
}

/* Type breakdown horizontal bars */
.type-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.type-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.type-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.type-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.type-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-secondary) 0%, var(--accent-tertiary) 100%);
    width: 0;
    transition: width 0.5s ease-out;
}

/* Mana Symbol Badges */
.symbols-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-around;
    padding: 0.5rem 0;
}

.symbol-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 55px;
}

.mana-icon-bubble {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* True-to-card mana colors — kept distinct from the brand accent palette on purpose */
.mana-icon-bubble.white { background-color: #f9fafb; color: #1f2937; border: 1px solid #d1d5db; }
.mana-icon-bubble.blue  { background-color: #0284c7; border: 1px solid #0369a1; }
.mana-icon-bubble.black { background-color: #374151; border: 1px solid #1f2937; }
.mana-icon-bubble.red   { background-color: #dc2626; border: 1px solid #b91c1c; }
.mana-icon-bubble.green { background-color: #16a34a; border: 1px solid #15803d; }
.mana-icon-bubble.colorless { background-color: #78716c; border: 1px solid #57534e; }

.symbol-pct {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
}

.symbol-lbl {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-family: var(--font-mono);
}

/* Playtester Simulator card rendering */
.simulator-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.playtest-hand {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 1rem 0.5rem;
    min-height: 250px;
    align-items: center;
    border: 1px dashed var(--card-border);
    border-radius: 0.75rem;
    background: rgba(0,0,0,0.15);
    margin-bottom: 1rem;
}

.playtest-card {
    width: 140px;
    height: 195px;
    border-radius: 0.5rem;
    border: 1px solid #2a2733;
    background-color: #14131a;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0,0,0,0.45);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.playtest-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-tertiary);
    box-shadow: 0 12px 24px oklch(0.78 0.13 75 / 0.25);
    z-index: 5;
}

.playtest-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playtest-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    padding: 0.5rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playtest-card-empty {
    flex-grow: 1;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    padding: 2rem 0;
}

.playtest-stat-bar {
    display: flex;
    justify-content: space-between;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

/* Collapsible About Section styling */
.about-card {
    padding: 0 !important;
    overflow: hidden;
    margin-top: 2rem;
    border-color: var(--card-border);
    transition: border-color var(--transition-speed);
}

.about-card:hover {
    border-color: oklch(0.78 0.13 75 / 0.25);
}

.about-toggle-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    outline: none;
    text-align: left;
}

.about-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.about-toggle-btn .chevron-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-tertiary);
}

.about-toggle-btn[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
    color: var(--accent-tertiary);
}

.about-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(0, 0, 0, 0.2);
}

.about-text-wrapper {
    padding: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
