/* ===== MTG-Themed Dark Design ===== */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Mythic Night (Arcane) — card-back navy + pale arcane blue */
    --color-dark-bg: #0f1a2e;        /* deep card-back navy */
    --color-darker-bg: #0a1220;
    --color-card-bg: #16233a;        /* dark panel */
    --color-bg-secondary: #1d2c47;
    --color-accent-primary: #3a6ea8;  /* deep arcane blue (fills) */
    --color-accent-secondary: #24344f;
    --color-arcane: #8ec9f0;         /* pale arcane blue (wording/glow) */
    --color-arcane-bright: #b8e2ff;

    --color-text-primary: #dde5f0;
    --color-text-secondary: #93a1b8;
    --color-text-muted: #67788f;

    /* MTG Mana Colors */
    --color-white-mana: #f0e68c;
    --color-blue-mana: #0e68ab;
    --color-black-mana: #150b00;
    --color-red-mana: #d32029;
    --color-green-mana: #00733e;
    /* gold is reserved for foil accents & the camera guide frame */
    --color-gold: #ffd700;

    /* UI Colors */
    --color-success: #2ecc71;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-info: #3498db;

    /* Card Rarity Colors */
    --color-common: #1e1e1e;
    --color-uncommon: #c0c0c0;
    --color-rare: #ffd700;
    --color-mythic: #ff8c00;
}

body {
    font-family: 'Source Sans 3', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-dark-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Display type for page titles & brand */
h1, h2, .nav-brand {
    font-family: 'Cinzel', serif;
}

/* Twilight ambience + card-back filigree lattice */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(ellipse 70% 45% at 18% -8%, rgba(109, 90, 168, 0.22), transparent 65%),
        radial-gradient(ellipse 60% 40% at 85% 108%, rgba(212, 175, 55, 0.10), transparent 60%),
        repeating-linear-gradient(45deg, rgba(201, 162, 39, 0.04) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(-45deg, rgba(201, 162, 39, 0.04) 0 1px, transparent 1px 26px);
    pointer-events: none;
    z-index: 0;
}

/* Starfield (slow twinkle) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 12% 22%, rgba(221, 229, 240, 0.7), transparent),
        radial-gradient(1px 1px at 34% 8%,  rgba(221, 229, 240, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 58% 30%, rgba(142, 201, 240, 0.6), transparent),
        radial-gradient(1px 1px at 76% 14%, rgba(221, 229, 240, 0.5), transparent),
        radial-gradient(1px 1px at 90% 42%, rgba(158, 143, 214, 0.6), transparent),
        radial-gradient(1.5px 1.5px at 44% 55%, rgba(221, 229, 240, 0.4), transparent),
        radial-gradient(1px 1px at 8% 70%,  rgba(221, 229, 240, 0.4), transparent),
        radial-gradient(1px 1px at 68% 78%, rgba(142, 201, 240, 0.45), transparent);
    background-size: 900px 700px;
    pointer-events: none;
    z-index: 0;
    animation: twinkle 9s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from { opacity: 0.35; }
    to { opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
    body::after { animation: none; }
}

/* Navigation - Bootstrap 5 Enhanced */
.navbar {
    background: rgba(15, 26, 46, 0.95) !important;
    box-shadow: 0 1px 0 rgba(142, 201, 240, 0.18),
                0 6px 24px rgba(0, 0, 0, 0.45);
    border-bottom: 1px solid rgba(142, 201, 240, 0.25);
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand,
.navbar-brand.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-arcane-bright) !important;
    text-decoration: none;
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.5),
                 0 0 20px rgba(58, 110, 168, 0.3);
    letter-spacing: 1px;
    transition: all 0.3s;
}

.nav-brand:hover,
.navbar-brand.nav-brand:hover {
    color: var(--color-arcane-bright) !important;
    text-shadow: 0 2px 12px rgba(142, 201, 240, 0.8),
                 0 0 30px rgba(58, 110, 168, 0.5);
}

.currency-select {
    width: auto;
    min-width: 5.5rem;
}

/* Mobile menu toggle */
.navbar-toggler {
    color: var(--color-arcane-bright) !important;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(142, 201, 240, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(142, 201, 240, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Nav menu items */
.nav-menu {
    list-style: none;
    gap: 1rem;
}

.nav-menu .nav-link {
    color: var(--color-text-primary) !important;
    text-decoration: none;
    transition: all 0.3s;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.nav-menu .nav-link:hover,
.nav-menu .nav-link:focus {
    color: var(--color-arcane-bright) !important;
    background: rgba(142, 201, 240, 0.12);
}

/* Mobile nav dropdown styling */
@media (max-width: 390px) {
    .navbar-collapse {
        background: var(--color-card-bg);
        margin-top: 0.5rem;
        border-radius: 8px;
        padding: 0.5rem;
        border: 1px solid rgba(58, 110, 168, 0.3);
    }

    .nav-menu .nav-item {
        border-bottom: 1px solid rgba(58, 110, 168, 0.1);
    }

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

    .nav-menu .nav-link {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
    }

    .nav-menu .nav-link i {
        font-size: 1.2rem;
        width: 28px;
    }
}

/* Main Container */
.container,
.container-main {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
    min-height: calc(100vh - 200px);
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    .container,
    .container-main {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Match result cards (scan results) */
.match-result {
    background: var(--color-card-bg);
}

.match-result h5,
.match-result .text-light {
    color: var(--color-text-primary) !important;
}

.match-result .text-secondary {
    color: var(--color-text-secondary) !important;
}

/* Bootstrap overrides for dark theme */
.card {
    background: var(--color-card-bg);
    border-color: rgba(58, 110, 168, 0.2);
    color: var(--color-text-primary);
}

.card-body {
    color: var(--color-text-primary);
}

.form-control,
.form-select {
    background-color: var(--color-bg-secondary);
    border-color: rgba(58, 110, 168, 0.3);
    color: var(--color-text-primary);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--color-bg-secondary);
    border-color: var(--color-accent-primary);
    color: var(--color-text-primary);
    box-shadow: 0 0 0 0.2rem rgba(58, 110, 168, 0.25);
}

.form-control::placeholder {
    color: var(--color-text-secondary);
}

.form-label {
    color: var(--color-text-primary);
}

.form-check-label {
    color: var(--color-text-primary);
}

.alert {
    border: none;
}

.alert-info {
    background-color: rgba(52, 152, 219, 0.2);
    color: #5dade2;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.2);
    color: #58d68d;
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.2);
    color: #f5b041;
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.2);
    color: #ec7063;
}

.alert-secondary {
    background-color: rgba(149, 165, 166, 0.2);
    color: #aab7b8;
}

.border-top {
    border-color: rgba(58, 110, 168, 0.2) !important;
}

/* Input group styling */
.input-group-text {
    background-color: var(--color-bg-secondary);
    border-color: rgba(58, 110, 168, 0.3);
    color: var(--color-text-secondary);
}

/* Alternative card in modals */
.alternative-card {
    background: var(--color-card-bg);
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.alternative-card:hover {
    border-color: var(--color-accent-primary);
}

/* Text colors for Bootstrap classes */
.text-light {
    color: var(--color-text-primary) !important;
}

.text-secondary {
    color: var(--color-text-secondary) !important;
}

/* Spinner */
.spinner-border {
    color: var(--color-accent-primary);
}

/* Badge styling */
.badge.bg-secondary {
    background-color: rgba(149, 165, 166, 0.3) !important;
    color: var(--color-text-primary);
}

.badge.bg-primary {
    background-color: var(--color-accent-primary) !important;
}

/* Card-style containers */
.stat-card,
.container-item,
.container-card,
.deck-card,
.card-item,
.printing-card {
    background: linear-gradient(135deg, var(--color-card-bg) 0%, rgba(29, 44, 71, 0.8) 100%);
    border: 1px solid rgba(58, 110, 168, 0.2);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
                0 2px 6px rgba(58, 110, 168, 0.1);
    transition: all 0.3s;
}

/* Buttons - themed, but Bootstrap's size & variant system stays in charge */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

/* Bare .btn (no variant class) -> neutral dark button */
.btn:not([class*="btn-"]) {
    background: var(--color-accent-secondary);
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(29, 44, 71, 0.3);
}

/* Solid variants get the MTG gradients */
.btn-primary {
    background: linear-gradient(180deg, #6db3e8 0%, var(--color-accent-primary) 75%);
    border-color: transparent;
    color: #0c1a26 !important;
    box-shadow: 0 4px 8px rgba(142, 201, 240, 0.3);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(180deg, var(--color-arcane) 0%, var(--color-accent-primary) 75%);
    border-color: transparent;
    color: #0c1a26 !important;
    box-shadow: 0 4px 12px rgba(142, 201, 240, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-accent-secondary) 0%, #2c3e50 100%);
    border-color: transparent;
    box-shadow: 0 4px 8px rgba(29, 44, 71, 0.3);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background: linear-gradient(135deg, #1a4a80 0%, #34495e 100%);
    border-color: transparent;
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #27ae60 100%);
    border-color: transparent;
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background: linear-gradient(135deg, #4cd787 0%, #2ecc71 100%);
    border-color: transparent;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, #c0392b 100%);
    border-color: transparent;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    background: linear-gradient(135deg, #f0655a 0%, #d64535 100%);
    border-color: transparent;
    color: white;
}

/* Outline variants - real outlines for the dark theme */
.btn-outline-primary {
    color: var(--color-arcane);
    border-color: var(--color-arcane);
    background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    color: white;
}

.btn-check:checked + .btn-outline-primary {
    background-color: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    color: white;
}

.btn-outline-secondary {
    color: var(--color-text-secondary);
    border-color: var(--color-text-secondary);
    background-color: transparent;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: rgba(149, 165, 166, 0.25);
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

.btn-outline-success {
    color: var(--color-success);
    border-color: var(--color-success);
    background-color: transparent;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background-color: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.btn-outline-danger {
    color: var(--color-danger);
    border-color: var(--color-danger);
    background-color: transparent;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background-color: var(--color-danger);
    border-color: var(--color-danger);
    color: white;
}

.btn-outline-warning {
    color: var(--color-warning);
    border-color: var(--color-warning);
    background-color: transparent;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
    background-color: var(--color-warning);
    border-color: var(--color-warning);
    color: #1a1a2e;
}

/* Active view-mode toggle */
.btn-outline-secondary.active,
.btn-outline-primary.active {
    background-color: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    color: white;
}

/* Links styled as buttons */
.btn-link {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--color-info);
}

.btn-link:hover,
.btn-link:focus {
    color: var(--color-arcane-bright);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Dashboard */
.dashboard h1 {
    margin-bottom: 2rem;
    color: var(--color-arcane-bright);
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.4);
    font-size: 2.5rem;
}

/* Random mana symbol in the dashboard title */
.mana-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 0.6rem;
    vertical-align: middle;
    color: #fff;
    box-shadow: 0 0 12px rgba(142, 201, 240, 0.3), inset 0 0 4px rgba(0, 0, 0, 0.35);
}
.mana-w { background: #f5f0e1; color: #2b2118; }
.mana-u { background: #2b4ebd; }
.mana-b { background: #262019; border: 1px solid rgba(221, 229, 240, 0.5); }
.mana-r { background: #c02a1a; }
.mana-g { background: #1f7a33; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(58, 110, 168, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(58, 110, 168, 0.5);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5),
                0 4px 12px rgba(58, 110, 168, 0.3);
}

.stat-card h3 {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-arcane-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-actions {
    margin-bottom: 3rem;
}

.quick-actions h2 {
    color: var(--color-arcane-bright);
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.3);
}

.quick-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quick-actions-buttons .btn {
    flex: 1 1 auto;
}

@media (max-width: 576px) {
    .quick-actions-buttons {
        flex-direction: column;
    }

    .quick-actions-buttons .btn {
        width: 100%;
    }
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.container-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.container-card {
    padding: 1.5rem;
}

.container-card:hover {
    transform: translateY(-4px);
    border-color: rgba(58, 110, 168, 0.5);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5),
                0 4px 12px rgba(58, 110, 168, 0.3);
}

.container-card h3 {
    margin-bottom: 0.5rem;
    color: var(--color-arcane-bright);
}

.container-type {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Scan Page */
.scan-container h1 {
    margin-bottom: 2rem;
    color: var(--color-arcane-bright);
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.4);
}

.scan-mode-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.beta-badge {
    background: var(--color-warning);
    color: white;
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    font-weight: bold;
    vertical-align: middle;
}

.search-section {
    margin-bottom: 2rem;
}

/* Camera Section */
.camera-section {
    margin-bottom: 2rem;
}

.camera-help {
    background: linear-gradient(135deg, rgba(29, 44, 71, 0.6) 0%, rgba(22, 33, 62, 0.6) 100%);
    border-left: 4px solid var(--color-info);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.camera-help p {
    margin: 0 0 0.5rem 0;
    color: var(--color-info);
    font-weight: 600;
}

.camera-help ul {
    margin: 0.5rem 0 0 1.5rem;
    color: var(--color-text-secondary);
}

.camera-help li {
    margin-bottom: 0.25rem;
}

.camera-container {
    background: var(--color-card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.camera-video-wrap {
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

#cameraVideo {
    width: 100%;
    max-width: 640px;
    height: clamp(220px, 45vh, 420px);
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

#detectionOverlay {
    width: 100%;
    height: 100%;
    max-width: 100%;
}

/* Static guide so users know where to line the card up, even before
   auto-detection locks on */
.card-guide-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 82%;
    aspect-ratio: 2.5 / 3.5;
    border: 3px dashed var(--color-gold);
    border-radius: 14px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.camera-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.camera-preview {
    margin-top: 2rem;
    text-align: center;
}

.camera-preview h3 {
    margin-bottom: 1rem;
    color: var(--color-arcane-bright);
}

.camera-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.preview-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

#ocrStatus {
    margin-top: 1rem;
    text-align: center;
}

#ocrResults {
    background: var(--color-card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-top: 1rem;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

#ocrResults h3 {
    color: var(--color-arcane-bright);
    margin-bottom: 1rem;
}

.detected-names-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detected-names-list li {
    display: flex;
}

.detected-names-list button {
    width: 100%;
    text-align: left;
}

#ocrResults details {
    margin-top: 1rem;
    background: rgba(29, 44, 71, 0.4);
    padding: 1rem;
    border-radius: 4px;
}

#ocrResults summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--color-text-secondary);
}

#ocrResults pre {
    margin-top: 0.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.autocomplete-container {
    flex: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid rgba(58, 110, 168, 0.3);
    border-radius: 8px;
    background: var(--color-card-bg);
    color: var(--color-text-primary);
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 12px rgba(58, 110, 168, 0.3);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-card-bg);
    border: 2px solid rgba(58, 110, 168, 0.3);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(58, 110, 168, 0.1);
    transition: background-color 0.2s;
    color: var(--color-text-primary);
}

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

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: rgba(58, 110, 168, 0.2);
}

.autocomplete-item:active {
    background: rgba(58, 110, 168, 0.3);
}

#searchStatus {
    margin-top: 1rem;
}

.loading {
    color: var(--color-info);
    font-style: italic;
}

.success {
    color: var(--color-success);
    font-weight: bold;
}

.error {
    color: var(--color-danger);
    font-weight: bold;
}

/* Printings Grid */
#printingsSection {
    margin-bottom: 3rem;
}

#printingsSection h2 {
    margin-bottom: 1.5rem;
    color: var(--color-arcane-bright);
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.3);
}

.printings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.printing-card {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.printing-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6),
                0 6px 16px rgba(58, 110, 168, 0.4);
    border-color: rgba(58, 110, 168, 0.6);
}

.printing-card img {
    width: 100%;
    height: auto;
    display: block;
}

.printing-info {
    padding: 1rem;
}

.printing-info .set-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: var(--color-arcane-bright);
}

.printing-info .set-code {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.printing-info .rarity {
    text-transform: capitalize;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.printing-info .rarity.common { color: var(--color-text-secondary); }
.printing-info .rarity.uncommon { color: var(--color-uncommon); }
.printing-info .rarity.rare { color: var(--color-rare); }
.printing-info .rarity.mythic { color: var(--color-mythic); }

.printing-info .price {
    font-size: 0.9rem;
    color: var(--color-success);
    font-weight: bold;
}

/* Card Details Section */
#cardDetailsSection {
    background: var(--color-card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

#cardDetailsSection h2,
#cardDetailsSection h3 {
    color: var(--color-arcane-bright);
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.3);
}

.card-details {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.card-image-container {
    flex-shrink: 0;
}

.card-image-container img {
    max-width: 300px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6),
                0 4px 12px rgba(58, 110, 168, 0.3);
    transition: transform 0.3s;
}

.card-image-container img:hover {
    transform: scale(1.05);
}

.card-info {
    flex: 1;
    min-width: 300px;
}

.card-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card-info p {
    margin-bottom: 0.75rem;
    color: var(--color-text-primary);
}

.card-oracle-text {
    background: rgba(29, 44, 71, 0.4);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    white-space: pre-line;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.pricing-info {
    background: rgba(46, 204, 113, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.pricing-info h4 {
    color: var(--color-success);
    margin-bottom: 0.5rem;
}

/* Form Styles */
.add-to-collection-form {
    border-top: 2px solid rgba(58, 110, 168, 0.2);
    padding-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(58, 110, 168, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--color-card-bg);
    color: var(--color-text-primary);
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 12px rgba(58, 110, 168, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Containers Page */
.containers-page h1 {
    margin-bottom: 2rem;
    color: var(--color-arcane-bright);
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.4);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.containers-list {
    display: grid;
    gap: 1.5rem;
}

.container-item {
    padding: 1.5rem;
}

.container-item:hover {
    transform: translateY(-2px);
    border-color: rgba(58, 110, 168, 0.5);
}

.container-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.container-item h3 {
    color: var(--color-arcane-bright);
}

.container-type-badge {
    background: var(--color-accent-secondary);
    color: var(--color-text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.container-description {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.container-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}

.container-actions {
    display: flex;
    gap: 0.5rem;
}

/* View Container Page */
.view-container-page h1 {
    color: var(--color-arcane-bright);
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.4);
}

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

.container-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.qr-preview {
    background: var(--color-card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.qr-preview h3 {
    margin-bottom: 1rem;
    color: var(--color-arcane-bright);
}

.qr-image {
    max-width: 250px;
    margin: 1rem auto;
    display: block;
    border-radius: 8px;
    background: white;
    padding: 1rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card-item {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6),
                0 4px 12px rgba(58, 110, 168, 0.4);
    border-color: rgba(58, 110, 168, 0.6);
}

.card-thumbnail {
    width: 100%;
    height: auto;
    display: block;
}

.card-item-info {
    padding: 1rem;
}

.card-item-info h4 {
    color: var(--color-arcane-bright);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.card-set,
.card-details,
.card-container {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.card-container a {
    color: var(--color-arcane);
    text-decoration: none;
    transition: color 0.3s;
}

.card-container a:hover {
    color: var(--color-arcane-bright);
    text-decoration: underline;
}

.card-condition,
.card-quantity,
.card-price,
.card-value {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.foil-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.card-price {
    color: var(--color-success);
    font-weight: bold;
}

.card-value {
    color: var(--color-success);
    font-weight: bold;
}

/* Collection Page */
.collection-page h1 {
    margin-bottom: 1rem;
    color: var(--color-arcane-bright);
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.4);
}

.collection-stats {
    margin-bottom: 2rem;
    color: var(--color-text-secondary);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--color-card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.empty-state p {
    margin-bottom: 1.5rem;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--color-card-bg) 0%, var(--color-accent-secondary) 100%);
    color: var(--color-text-primary);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
    border-top: 2px solid rgba(58, 110, 168, 0.3);
}

.back-link {
    margin-top: 2rem;
}

.back-link a {
    color: var(--color-accent-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.back-link a:hover {
    color: var(--color-arcane-bright);
    text-decoration: underline;
}

/* Decks Page */
.decks-page h1 {
    margin-bottom: 1rem;
    color: var(--color-arcane-bright);
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.4);
}

.decks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.deck-card {
    padding: 1.5rem;
    transition: all 0.3s;
}

.deck-card:hover {
    transform: translateY(-4px);
    border-color: rgba(58, 110, 168, 0.6);
}

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

.deck-card h3 {
    color: var(--color-arcane-bright);
    margin: 0;
    font-size: 1.3rem;
}

.deck-format-badge {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(156, 39, 176, 0.3);
}

.deck-commander {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.deck-description {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.deck-stats {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid rgba(58, 110, 168, 0.2);
    border-bottom: 1px solid rgba(58, 110, 168, 0.2);
}

.deck-stats .stat {
    text-align: center;
}

.deck-stats .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-arcane-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.deck-stats .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.deck-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.deck-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(58, 110, 168, 0.2);
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* View Deck Page */
.view-deck-page h1 {
    color: var(--color-arcane-bright);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.4);
    font-size: 2.5rem;
}

.deck-meta-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.deck-commander-info {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* Commander Showcase Section */
.commander-showcase {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5),
                0 4px 12px rgba(102, 126, 234, 0.4);
}

.commander-showcase h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.commander-card-display {
    display: flex;
    gap: 2rem;
    align-items: center;
    background: var(--color-card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.commander-card-image {
    width: 250px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease;
}

.commander-card-image:hover {
    transform: scale(1.05);
}

.commander-card-details {
    flex: 1;
}

.commander-card-details h4 {
    font-size: 1.8rem;
    color: var(--color-arcane-bright);
    margin-bottom: 0.75rem;
}

.commander-set {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.commander-type {
    color: var(--color-text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.commander-mana {
    color: var(--color-text-primary);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    background: rgba(29, 44, 71, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: inline-block;
    margin-top: 0.5rem;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

/* Responsive commander showcase */
@media (max-width: 390px) {
    .commander-card-display {
        flex-direction: column;
        text-align: center;
    }

    .commander-card-image {
        width: 200px;
    }
}

.deck-stats-summary {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat-box {
    background: var(--color-card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    text-align: center;
    min-width: 150px;
    border: 1px solid rgba(58, 110, 168, 0.2);
    transition: all 0.3s;
}

.stat-box:hover {
    transform: translateY(-4px);
    border-color: rgba(58, 110, 168, 0.5);
}

.stat-box .stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-arcane-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-box .stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
}

/* Mana Curve */
.mana-curve-section {
    background: var(--color-card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.mana-curve-section h3 {
    color: var(--color-arcane-bright);
    margin-bottom: 1rem;
}

.mana-curve {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    height: 150px;
    padding: 1rem 0;
}

.mana-curve-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar-container {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: flex-end;
}

.bar {
    width: 100%;
    background: linear-gradient(to top, var(--color-accent-primary), var(--color-arcane-bright));
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: all 0.3s;
    box-shadow: 0 -2px 8px rgba(58, 110, 168, 0.3);
}

.bar-label {
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 0.25rem;
    color: var(--color-text-primary);
}

.bar-cmc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

.deck-actions-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Deck Lists */
.deck-lists {
    display: grid;
    gap: 2rem;
}

.mainboard-section h2,
.sideboard-section h2 {
    color: var(--color-arcane-bright);
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.3);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(58, 110, 168, 0.3);
}

.sideboard-section h2 {
    border-bottom-color: rgba(231, 76, 60, 0.3);
}

.deck-card-list {
    background: var(--color-card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.deck-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(58, 110, 168, 0.1);
    gap: 1rem;
}

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

.card-quantity {
    font-weight: bold;
    color: var(--color-arcane);
    min-width: 40px;
}

.card-details-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.card-list-thumbnail {
    width: 60px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.card-list-info {
    flex: 1;
}

.card-name {
    font-weight: bold;
    color: var(--color-arcane-bright);
    margin-bottom: 0.25rem;
}

.card-set-info {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.card-type {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

.card-mana-cost {
    font-family: monospace;
    color: var(--color-text-primary);
    min-width: 80px;
    text-align: right;
}

.empty-list {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-secondary);
}

/* Responsive Design */
@media (max-width: 390px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .nav-brand {
        font-size: 1.4rem;
    }

    .card-details {
        flex-direction: column;
    }

    .card-image-container img {
        max-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .container-header {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .printings-grid {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    color: var(--color-text-primary);
}

.radio-label input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.radio-label:hover {
    color: var(--color-accent-primary);
}

/* Progress Bar Styles */
.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(29, 44, 71, 0.4);
    border-radius: 15px;
    overflow: hidden;
    margin: 1rem 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-arcane-bright));
    border-radius: 15px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(58, 110, 168, 0.4);
}

/* ===== Card Controls (Search, Sort, View Modes) ===== */
.collection-controls {
    background: var(--color-card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.controls-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(58, 110, 168, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--color-darker-bg);
    color: var(--color-text-primary);
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 12px rgba(58, 110, 168, 0.3);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-weight: 500;
    color: var(--color-text-primary);
}

.sort-controls select {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(58, 110, 168, 0.3);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--color-darker-bg);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 12px rgba(58, 110, 168, 0.3);
}

.view-mode-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-mode-controls label {
    font-weight: 500;
    color: var(--color-text-primary);
    margin-right: 0.25rem;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    border: 2px solid rgba(58, 110, 168, 0.3);
    background: var(--color-darker-bg);
    color: var(--color-text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.view-btn:hover {
    border-color: var(--color-accent-primary);
    background: rgba(58, 110, 168, 0.1);
}

.view-btn.active {
    border-color: var(--color-accent-primary);
    background: var(--color-accent-primary);
    color: white;
    box-shadow: 0 4px 8px rgba(58, 110, 168, 0.3);
}

.collection-stats {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    padding-top: 0.5rem;
    border-top: 1px solid rgba(58, 110, 168, 0.2);
}

#filteredCount {
    color: var(--color-arcane);
    font-weight: 500;
}

/* ===== View Modes ===== */

/* Grid View (default - large cards with images) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cards-grid .card-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
}

.cards-grid .card-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6),
                0 4px 16px rgba(58, 110, 168, 0.4);
}

.cards-grid .card-thumbnail {
    width: 100%;
    height: auto;
    display: block;
}

.cards-grid .card-item-info {
    padding: 1rem;
}

/* Deck page grid cards: image on top, info below (deck-list-item's flex row squashed them) */
.cards-grid .deck-list-item {
    display: block;
    padding: 0;
    border-bottom: none;
}

/* List View (compact rows with small images) */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cards-list .card-item {
    background: var(--color-card-bg);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(58, 110, 168, 0.2);
    transition: all 0.2s;
}

.cards-list .card-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-color: rgba(58, 110, 168, 0.5);
}

.cards-list .card-thumbnail {
    width: 80px;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.cards-list .card-item-info {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    align-items: baseline;
    min-width: 0;
}

.cards-list .card-item-info h4 {
    margin: 0;
    font-size: 1.05rem;
    flex: 1 1 auto; /* name takes the remaining line and wraps naturally */
    min-width: 0;
}

.cards-list .card-item-info p {
    margin: 0;
    font-size: 0.9rem;
}

.cards-list .card-set {
    flex: 0 1 auto; /* natural width, no fixed column */
}

/* Deck rows: type line gets its own full-width line under name + set */
.deck-card-list.cards-list .card-type {
    flex: 1 1 100%;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.cards-list .card-quantity,
.cards-list .card-condition,
.cards-list .card-price {
    flex: 0 0 auto;
}

.cards-list .card-container,
.cards-list .card-details,
.cards-list .card-value {
    display: none;
}

.cards-list .card-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

/* Thumbnail View (tiny grid with images only) */
.cards-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.cards-thumbs .card-item {
    position: relative;
    aspect-ratio: 0.7;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.cards-thumbs .card-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    border-color: rgba(58, 110, 168, 0.6);
}

.cards-thumbs .card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cards-thumbs .card-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    padding: 0.5rem 0.25rem;
    color: white;
}

.cards-thumbs .card-item-info h4 {
    font-size: 0.75rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cards-thumbs .card-item-info p:not(.card-quantity) {
    display: none;
}

.cards-thumbs .card-quantity {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(58, 110, 168, 0.95);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.cards-thumbs .foil-badge {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    background: rgba(255, 215, 0, 0.95);
    color: #1a1a2e;
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: bold;
}

.cards-thumbs .card-actions,
.cards-thumbs .card-pricing {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 390px) {
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }

    .sort-controls,
    .view-mode-controls {
        justify-content: space-between;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .cards-list .card-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .cards-list .card-thumbnail {
        width: 100%;
    }

    .cards-thumbs {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ===== Deck View Specific Styles ===== */
.card-quantity-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(58, 110, 168, 0.95);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 10;
}

.deck-card-list.cards-grid .card-item {
    position: relative;
}

.deck-card-list.cards-thumbs .card-quantity-badge {
    top: 0.25rem;
    right: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.deck-card-list.cards-list .card-quantity-badge {
    position: static;
    display: inline-block;
    margin-right: 0.5rem;
}

.deck-lists {
    margin-top: 2rem;
}

.mainboard-section,
.sideboard-section {
    margin-bottom: 2rem;
}

.mainboard-section h2,
.sideboard-section h2 {
    color: var(--color-arcane-bright);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(58, 110, 168, 0.3);
}

.sideboard-section h2 {
    border-bottom-color: rgba(231, 76, 60, 0.3);
}

/* ===== Card Badge Indicators ===== */

.card-deck-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    font-size: 1.2rem;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 10;
    cursor: help;
    transition: all 0.2s;
}

.card-deck-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.card-deck-badge a {
    color: white;
    text-decoration: none;
    display: block;
}

.card-foil-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a2e;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 10;
    cursor: help;
    animation: shimmer 2s infinite;
}

.cards-list .card-deck-badge,
.cards-list .card-foil-badge {
    position: static;
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
}

.cards-thumbs .card-deck-badge {
    top: 0.25rem;
    left: 0.25rem;
    padding: 0.25rem 0.4rem;
    font-size: 1rem;
}

.cards-thumbs .card-foil-badge {
    top: 0.25rem;
    right: 0.25rem;
    padding: 0.25rem 0.4rem;
    font-size: 0.9rem;
}

.card-item:has(.card-deck-badge):has(.card-foil-badge) .card-foil-badge {
    top: 2.5rem;
}

.cards-thumbs .card-item:has(.card-deck-badge):has(.card-foil-badge) .card-foil-badge {
    top: 2rem;
}

.card-item {
    position: relative;
}

/* ===== Error Resolution Interface ===== */

#errorResolution {
    background: var(--color-card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-top: 2rem;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

#errorResolution h3 {
    color: var(--color-arcane-bright);
    margin-bottom: 1rem;
}

.error-resolution-item {
    background: rgba(29, 44, 71, 0.4);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--color-danger);
}

.error-card-header {
    font-size: 1.05rem;
    margin-bottom: 1rem;
    color: var(--color-danger);
}

.error-card-search {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.error-search-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid rgba(58, 110, 168, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--color-darker-bg);
    color: var(--color-text-primary);
    transition: all 0.3s;
}

.error-search-input:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 12px rgba(58, 110, 168, 0.3);
}

.search-results {
    margin-top: 1rem;
}

.search-result-card {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--color-darker-bg);
    border: 2px solid rgba(58, 110, 168, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-card:hover {
    border-color: var(--color-accent-primary);
    box-shadow: 0 4px 12px rgba(58, 110, 168, 0.3);
    transform: translateX(4px);
}

.search-result-card.selected {
    border-color: var(--color-success);
    background: rgba(46, 204, 113, 0.1);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.search-result-card.selected::before {
    content: "✓ ";
    position: absolute;
    left: 0.5rem;
    font-size: 1.5rem;
    color: var(--color-success);
    font-weight: bold;
}

.result-thumbnail {
    width: 80px;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    color: var(--color-arcane-bright);
}

.result-set {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.result-type {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.error-message {
    color: var(--color-danger);
    font-style: italic;
    padding: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 390px) {
    .error-card-search {
        flex-direction: column;
    }

    .search-result-card {
        flex-direction: column;
    }

    .result-thumbnail {
        width: 100%;
    }
}

/* Edit Deck Page */
.edit-deck-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.edit-deck-page h1 {
    color: var(--color-arcane-bright);
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 8px rgba(142, 201, 240, 0.4);
}

.edit-deck-page h2 {
    color: var(--color-arcane-bright);
    margin-bottom: 1rem;
}

.edit-deck-page h3 {
    color: var(--color-text-primary);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.3rem;
}

.edit-card-item {
    position: relative;
}

.card-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.cards-list .edit-card-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
}

.cards-list .card-item-actions {
    padding-left: 1rem;
}

.cards-grid .edit-card-item {
    display: flex;
    flex-direction: column;
}

.cards-grid .card-item-actions {
    margin-top: 0.5rem;
    margin-left: 0;
    justify-content: center;
}

.cards-thumbs .edit-card-item {
    display: flex;
    flex-direction: column;
}

.cards-thumbs .card-item-actions {
    margin-top: 0.5rem;
    margin-left: 0;
    justify-content: center;
}

.cards-thumbs .card-item-actions .btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
}

.mainboard-section,
.sideboard-section {
    margin-bottom: 2rem;
}

@media (max-width: 390px) {
    .cards-list .edit-card-item {
        flex-wrap: wrap;
    }

    .card-item-actions {
        width: 100%;
        margin-top: 0.5rem;
        justify-content: flex-start;
    }
}

/* Edit Card Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: var(--color-card-bg);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(58, 110, 168, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid rgba(58, 110, 168, 0.2);
}

.modal-header h3 {
    margin: 0;
    color: var(--color-arcane-bright);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--color-danger);
}

.modal-body {
    padding: 1.5rem;
}

.edit-options h4 {
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
}

.edit-options p {
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.alternative-printings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.alternative-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: rgba(29, 44, 71, 0.4);
    border-radius: 8px;
    border: 2px solid rgba(58, 110, 168, 0.2);
    transition: border-color 0.3s;
}

.alternative-card:hover {
    border-color: var(--color-accent-primary);
}

.alternative-card img {
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.alternative-card-info {
    flex: 1;
}

.alternative-card-info strong {
    display: block;
    color: var(--color-arcane-bright);
    margin-bottom: 0.25rem;
}

.alternative-card-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.alternative-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.collection-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.collection-card-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(46, 204, 113, 0.3);
}

.collection-card-item img {
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.collection-card-item strong {
    display: block;
    color: var(--color-success);
}

.collection-card-item p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.loading {
    color: var(--color-text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.error {
    color: var(--color-danger);
    padding: 1rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
}

@media (max-width: 390px) {
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .alternative-card,
    .collection-card-item {
        flex-direction: column;
        text-align: center;
    }

    .alternative-card img,
    .collection-card-item img {
        margin: 0 auto;
    }

    .alternative-card-actions {
        width: 100%;
    }

    .alternative-card-actions .btn {
        width: 100%;
    }
}

/* Import Pages */
.import-page h1,
.import-help {
    color: var(--color-arcane-bright);
}

.import-help {
    background: rgba(29, 44, 71, 0.4);
    border-left: 4px solid var(--color-info);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.import-help h3,
.import-help h4 {
    color: var(--color-arcane-bright);
    margin-bottom: 0.75rem;
}

.import-help ul {
    margin-left: 1.5rem;
    color: var(--color-text-secondary);
}

.import-help pre {
    background: var(--color-darker-bg);
    padding: 1rem;
    border-radius: 6px;
    color: var(--color-text-primary);
    border: 1px solid rgba(58, 110, 168, 0.2);
}

.import-summary {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    justify-content: center;
}

.import-summary .stat {
    text-align: center;
}

.import-summary .stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-arcane-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.import-summary .stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.info-box {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    padding: 1rem;
    border-radius: 8px;
}

.info-box p {
    color: var(--color-success);
    margin: 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent-secondary);
    border-radius: 6px;
    border: 2px solid var(--color-darker-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-primary);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Test Hand Feature */
.test-hand-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-darker-bg);
    border-radius: 8px;
    min-height: 200px;
}

.test-hand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 180px;
    padding: 0.75rem;
    background: var(--color-card-bg);
    border: 2px solid var(--color-accent-secondary);
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.test-hand-card:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--color-arcane-bright);
    box-shadow: 0 8px 16px rgba(142, 201, 240, 0.4);
}

.test-hand-card img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.test-hand-card-info {
    text-align: center;
    width: 100%;
}

.test-hand-card-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--color-arcane-bright);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.test-hand-card-info small {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

/* ===== Mobile polish (phones) ===== */
@media (max-width: 390px) {
    /* Headings: smaller, tighter */
    .dashboard h1,
    .scan-container h1,
    .containers-page h1,
    .collection-page h1,
    .decks-page h1,
    .view-deck-page h1,
    .import-page h1 {
        font-size: 1.6rem;
        margin-bottom: 1.25rem;
        text-shadow: none;
    }

    /* Trim heavy padding on small screens */
    .camera-container,
    #cardDetailsSection,
    #ocrResults,
    #errorResolution,
    .qr-preview,
    .collection-controls {
        padding: 1rem;
    }

    .edit-deck-page {
        padding: 0.5rem 0;
    }

    .stat-card {
        padding: 1rem;
    }

    .container-card,
    .deck-card,
    .container-item {
        padding: 1rem;
    }

    /* Collection grid: two compact columns instead of one giant card */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .cards-grid .card-item-info {
        padding: 0.75rem;
    }

    /* List view: keep horizontal rows with a small thumbnail */
    .cards-list .card-item {
        flex-direction: row;
        align-items: center;
    }

    .cards-list .card-thumbnail {
        width: 56px;
    }

    .cards-list .card-item-info h4 {
        flex: 1 1 100%;
        font-size: 1rem;
    }

    .cards-list .card-set {
        flex: 0 0 auto;
    }

    .cards-list .card-condition {
        display: none;
    }

    /* Inputs >= 16px so iOS doesn't zoom on focus */
    input,
    select,
    textarea {
        font-size: 1rem;
    }

    /* Deck stats & boxes */
    .deck-stats {
        gap: 1rem;
    }

    .stat-box {
        min-width: 120px;
        padding: 1rem;
    }

    .stat-box .stat-value {
        font-size: 1.8rem;
    }

    /* Test hand cards */
    .test-hand-card {
        width: 140px;
    }

    /* Footer */
    .footer {
        margin-top: 2rem;
        padding: 1.25rem 0;
    }

    /* Scan page spacing */
    .scan-mode-toggle {
        margin-bottom: 1.25rem;
    }

    .camera-help {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 390px) {
    .container-main {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Keep two compact card columns even on small phones */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .printings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* No hover effects on touch devices */
@media (hover: none) {
    .printing-card:hover,
    .card-item:hover,
    .stat-card:hover,
    .container-item:hover,
    .deck-card:hover,
    .test-hand-card:hover,
    .btn:hover {
        transform: none;
    }
}

/* ===== Collection Stats Panel ===== */
.collection-stats-panel {
    background: var(--color-card-bg);
    border: 1px solid rgba(58, 110, 168, 0.25);
    border-radius: 12px;
}

.stat-chip {
    font-size: 0.85rem;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    padding: 0.4rem 0.75rem;
}

.top-sets-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.15rem 0;
    border-bottom: 1px dashed rgba(58, 110, 168, 0.15);
}

.top-sets-list li:last-child {
    border-bottom: none;
}

.rarity-common { background: rgba(30, 30, 30, 0.6); color: var(--color-text-secondary); }
.rarity-uncommon { background: rgba(192, 192, 192, 0.18); color: var(--color-uncommon); }
.rarity-rare { background: rgba(255, 215, 0, 0.16); color: var(--color-rare); }
.rarity-mythic { background: rgba(255, 140, 0, 0.18); color: var(--color-mythic); }
