/* =========================================================================
   MTG Section Styles — Magery.com
   ========================================================================= */

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */

.mtg-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 40px;
    color: var(--theme-text);
}

.mtg-page a {
    color: var(--theme-accent);
    text-decoration: none;
}

.mtg-page a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Breadcrumbs
   --------------------------------------------------------------------------- */

.mtg-breadcrumbs {
    margin-bottom: 16px;
    font-size: 13px;
}

.mtg-breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
    margin: 0;
}

.mtg-breadcrumbs li::after {
    content: '\203A';
    margin-left: 6px;
    color: var(--theme-text-muted);
}

.mtg-breadcrumbs li:last-child::after {
    content: '';
}

.mtg-breadcrumbs a {
    color: var(--theme-accent);
}

.mtg-crumb-active {
    color: var(--theme-text-secondary);
    font-weight: 500;
}

.mtg-page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--theme-text);
    margin-bottom: 12px;
}

.mtg-page-subtitle {
    font-size: 14px;
    color: var(--theme-text-muted);
    margin-bottom: 16px;
}

/* ---------------------------------------------------------------------------
   Card Detail — Hero Layout
   --------------------------------------------------------------------------- */

.mtg-card-hero {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 32px;
    margin-bottom: 28px;
}

.mtg-card-image-wrap {
    position: relative;
}

.mtg-card-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--theme-header-shadow);
    display: block;
}

.mtg-card-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mtg-card-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--theme-text);
    margin: 0;
    line-height: 1.2;
}

.mtg-card-mana {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.mtg-card-type {
    font-size: 16px;
    color: var(--theme-text-secondary);
    font-weight: 500;
}

.mtg-card-oracle {
    font-size: 15px;
    line-height: 1.6;
    color: var(--theme-text);
}

.mtg-oracle-line {
    margin: 0 0 8px;
}

.mtg-oracle-line:last-child {
    margin-bottom: 0;
}

.mtg-card-pt {
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-text);
    background: var(--theme-soft-bg, #f0f0f0);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--theme-border);
}

.mtg-card-color-identity {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mtg-card-price-summary {
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-accent);
}

.mtg-card-price-label {
    font-size: 13px;
    color: var(--theme-text-muted);
    font-weight: 400;
}

/* ---------------------------------------------------------------------------
   Mana Symbols
   --------------------------------------------------------------------------- */

.mtg-mana {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}

.mtg-mana-generic {
    background: #ccc;
    border-color: #999;
    color: #333;
}

.mtg-mana-hybrid {
    background: linear-gradient(135deg, #d4a854, #9333ea);
    border-color: #7c5c2c;
    color: #fff;
    font-size: 9px;
}

/* Larger mana in card header */
.mtg-card-mana .mtg-mana {
    width: 26px;
    height: 26px;
    font-size: 14px;
}

/* ---------------------------------------------------------------------------
   Tabs (mobile: visible; desktop: hidden)
   --------------------------------------------------------------------------- */

.mtg-tabs {
    display: none;
    margin-bottom: 0;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    overflow: hidden;
}

.mtg-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.mtg-tab.active {
    background: var(--theme-accent);
    color: #fff;
}

.mtg-tab:not(.active):hover {
    background: var(--theme-soft-bg, #f0f0f0);
}

/* Tab panels */
.mtg-tab-panel {
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.mtg-tab-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-text);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--theme-border-light);
}

/* Desktop: all panels visible */
.mtg-panels {
    display: grid;
    gap: 20px;
}

/* Set page: use tabs on desktop too (mobile already handled below) */
.mtg-set-page .mtg-tabs {
    display: flex;
}

.mtg-set-page .mtg-panels {
    display: block;
}

.mtg-set-page .mtg-tab-panel {
    display: none;
}

.mtg-set-page .mtg-tab-panel.tab-active {
    display: block;
}

/* ---------------------------------------------------------------------------
   Prints Table
   --------------------------------------------------------------------------- */

.mtg-prints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.mtg-print-card {
    background: var(--theme-soft-bg, #f8f9fa);
    border: 1px solid var(--theme-border-light);
    border-radius: 10px;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.mtg-print-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px var(--theme-header-shadow);
    text-decoration: none;
}

.mtg-print-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 8px;
    display: block;
}

.mtg-print-set {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--theme-text-secondary);
    margin-bottom: 4px;
}

a.mtg-print-set {
    text-decoration: none;
    color: var(--theme-text-secondary);
}

a.mtg-print-set:hover {
    color: var(--theme-accent);
}

.mtg-print-set-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mtg-print-details {
    font-size: 12px;
    color: var(--theme-text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mtg-print-price {
    font-weight: 700;
    color: var(--theme-accent);
    font-size: 14px;
}

.mtg-print-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* ---------------------------------------------------------------------------
   Prices Table
   --------------------------------------------------------------------------- */

.mtg-prices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mtg-prices-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--theme-soft-bg, #f8f9fa);
    border-bottom: 2px solid var(--theme-border);
    font-weight: 600;
    color: var(--theme-text);
    font-size: 13px;
    white-space: nowrap;
}

.mtg-prices-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--theme-border-light);
    vertical-align: middle;
}

.mtg-prices-table tr:hover td {
    background: var(--theme-soft-bg, #fafafa);
}

.mtg-prices-table .mtg-price-value {
    font-weight: 700;
    color: var(--theme-accent);
}

.mtg-checklist-color {
    white-space: nowrap;
}

.mtg-checklist-color .mtg-mana {
    width: 18px;
    height: 18px;
    font-size: 10px;
    margin-right: 2px;
}

/* Price chart container */
.mtg-chart-wrap {
    position: relative;
    margin-top: 20px;
}

/* Chart section — separated from prices table */
.mtg-chart-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid var(--theme-border-light);
}

.mtg-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.mtg-chart-header .mtg-chart-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-text);
}

.mtg-chart-header .mtg-chart-toggles {
    margin-bottom: 0;
}

.mtg-chart-toggles {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.mtg-chart-toggle {
    padding: 6px 14px;
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    background: var(--theme-surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.mtg-chart-toggle.active {
    background: var(--theme-accent);
    color: #fff;
    border-color: var(--theme-accent);
}

.mtg-chart-toggle:hover:not(.active) {
    background: var(--theme-soft-bg, #f0f0f0);
}

.mtg-variant-series-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    max-height: 220px;
    overflow: auto;
    padding-right: 2px;
}

.mtg-variant-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--theme-border-light);
    border-radius: 999px;
    background: var(--theme-surface);
    color: var(--theme-text-secondary);
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.mtg-variant-pill:hover {
    border-color: var(--theme-border);
    background: var(--theme-soft-bg, #f8f9fa);
}

.mtg-variant-pill.active {
    border-color: var(--theme-accent);
    background: var(--theme-soft-bg, #f8f9fa);
    color: var(--theme-text);
}

.mtg-variant-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mtg-variant-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

.mtg-variant-price {
    margin-left: 4px;
    font-weight: 700;
    color: var(--theme-accent);
    flex-shrink: 0;
}

.mtg-variant-change {
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.mtg-variant-up {
    color: #27ae60;
}

.mtg-variant-down {
    color: #e74c3c;
}

@media (max-width: 720px) {
    .mtg-variant-text {
        max-width: 170px;
    }
}

/* eBay sold listings CTA */
.mtg-ebay-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding: 14px 18px;
    background: var(--theme-soft-bg, #f8f9fa);
    border: 1px solid var(--theme-border-light);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}

.mtg-ebay-cta:hover {
    border-color: var(--theme-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--theme-header-shadow);
    text-decoration: none;
}

.mtg-ebay-cta > i:first-child {
    font-size: 22px;
    color: var(--theme-accent);
    flex-shrink: 0;
}

.mtg-ebay-cta > span {
    flex: 1;
    min-width: 0;
}

.mtg-ebay-cta > span strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--theme-text);
}

.mtg-ebay-cta > span small {
    display: block;
    font-size: 13px;
    color: var(--theme-text-muted);
    margin-top: 2px;
}

.mtg-ebay-cta > i:last-child {
    font-size: 14px;
    color: var(--theme-text-muted);
    flex-shrink: 0;
}

/* Prices table: "This Set" / "All Sets" filter */
.mtg-prices-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.mtg-prices-filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: var(--theme-surface);
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.mtg-prices-filter-btn.active {
    background: var(--theme-accent);
    color: #fff;
    border-color: var(--theme-accent);
}

.mtg-prices-filter-btn:hover:not(.active) {
    background: var(--theme-soft-bg, #f0f0f0);
}

.mtg-chart-empty {
    text-align: center;
    color: var(--theme-text-muted);
    padding: 20px;
}

/* ---------------------------------------------------------------------------
   Rulings
   --------------------------------------------------------------------------- */

.mtg-rulings-list {
    display: grid;
    gap: 12px;
}

.mtg-ruling {
    padding: 12px 14px;
    background: var(--theme-soft-bg, #f8f9fa);
    border: 1px solid var(--theme-border-light);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--theme-text);
}

.mtg-ruling-meta {
    font-size: 12px;
    color: var(--theme-text-muted);
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.mtg-ruling-source {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--theme-surface);
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border-light);
}

.mtg-ruling-source.wotc { background: var(--theme-accent); color: #fff; border-color: var(--theme-accent); }
.mtg-ruling-source.scryfall { background: var(--theme-text-secondary); color: #fff; border-color: var(--theme-text-secondary); }

/* ---------------------------------------------------------------------------
   Legality Grid
   --------------------------------------------------------------------------- */

.mtg-legality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.mtg-legality-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--theme-soft-bg, #f8f9fa);
    border: 1px solid var(--theme-border-light);
    border-radius: 6px;
}

.mtg-legality-format {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 500;
    color: var(--theme-text);
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.mtg-legality-badge {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mtg-legal { background: #27ae60; color: #fff; }
.mtg-not-legal { background: var(--theme-border); color: var(--theme-text); }
.mtg-banned { background: #e74c3c; color: #fff; }
.mtg-restricted { background: #f39c12; color: #fff; }

/* ---------------------------------------------------------------------------
   Rarity Badges
   --------------------------------------------------------------------------- */

.mtg-rarity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.mtg-rarity-common { background: #e0e0e0; color: #555; }
.mtg-rarity-uncommon { background: #b0c4de; color: #2c3e50; }
.mtg-rarity-rare { background: #f0c878; color: #5c3d00; }
.mtg-rarity-mythic { background: #e74c3c; color: #fff; }
.mtg-rarity-special { background: #9b59b6; color: #fff; }
.mtg-rarity-bonus { background: #3498db; color: #fff; }

.mtg-treatment-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: var(--theme-text);
    background: var(--theme-soft-bg, #f8f9fa);
    border: 1px solid var(--theme-border);
    white-space: nowrap;
}

.mtg-finish-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--theme-text-secondary);
    background: var(--theme-surface);
    border: 1px solid var(--theme-border-light);
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Sets Browser
   --------------------------------------------------------------------------- */

.mtg-sets-list {
    display: grid;
    gap: 8px;
}

.mtg-set-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border-light);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.mtg-set-row:hover {
    background: var(--theme-soft-bg, #f8f9fa);
    border-color: var(--theme-border);
    transform: translateX(4px);
    text-decoration: none;
}

.mtg-set-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.mtg-set-name {
    flex: 1;
    font-weight: 600;
    color: var(--theme-text);
    font-size: 15px;
}

.mtg-set-code {
    font-size: 13px;
    color: var(--theme-text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.mtg-set-date {
    font-size: 13px;
    color: var(--theme-text-muted);
}

.mtg-set-count {
    font-size: 13px;
    color: var(--theme-text-muted);
    white-space: nowrap;
}

/* Artist avatar in listing */
.mtg-artist-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--theme-soft-bg, #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--theme-border-light);
}

.mtg-artist-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mtg-artist-avatar i {
    font-size: 18px;
    color: var(--theme-text-muted);
}

/* Artist index explicit theme blending */
.mtg-page.mtg-artists-page .mtg-set-row {
    background: var(--theme-surface) !important;
    border-color: var(--theme-border-light) !important;
}

.mtg-page.mtg-artists-page .mtg-set-row:hover {
    background: var(--theme-soft-bg, #f8f9fa) !important;
    border-color: var(--theme-border) !important;
}

.mtg-page.mtg-artists-page .mtg-set-name {
    color: var(--theme-text) !important;
}

.mtg-page.mtg-artists-page .mtg-set-code,
.mtg-page.mtg-artists-page .mtg-set-count,
.mtg-page.mtg-artists-page .mtg-set-date {
    color: var(--theme-text-muted) !important;
}

.mtg-page.mtg-artists-page .mtg-artist-avatar {
    background: var(--theme-soft-bg, #f0f0f0) !important;
    border-color: var(--theme-border-light) !important;
}

.mtg-page.mtg-artists-page .mtg-artist-avatar i {
    color: var(--theme-text-muted) !important;
}

.mtg-year-heading {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 24px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e74c3c;
}

.mtg-year-heading:first-child {
    margin-top: 0;
}

/* ---------------------------------------------------------------------------
   Set Detail — Card Grid
   --------------------------------------------------------------------------- */

.mtg-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.mtg-grid-card {
    display: block;
    text-decoration: none;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mtg-grid-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.mtg-grid-card img {
    width: 100%;
    height: auto;
    display: block;
}

.mtg-grid-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Search Results
   --------------------------------------------------------------------------- */

.mtg-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.mtg-result-card {
    background: var(--theme-surface);
    border: 1px solid var(--theme-border-light);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
    display: block;
}

.mtg-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px var(--theme-header-shadow);
    border-color: var(--theme-border);
    background: var(--theme-soft-bg, var(--theme-surface));
    text-decoration: none;
}

.mtg-result-image {
    width: 100%;
    aspect-ratio: 488/680;
    object-fit: cover;
    display: block;
}

.mtg-result-body {
    padding: 12px;
}

.mtg-result-name {
    font-weight: 600;
    color: var(--theme-text);
    font-size: 15px;
    margin-bottom: 4px;
}

.mtg-result-type {
    font-size: 13px;
    color: var(--theme-text-muted);
    margin-bottom: 6px;
}

.mtg-result-mana {
    margin-bottom: 4px;
}

.mtg-result-price {
    font-weight: 700;
    color: var(--theme-accent);
    font-size: 15px;
}

.mtg-search-title {
    margin-bottom: 16px;
}

.mtg-search-count {
    font-size: 14px;
    font-weight: 400;
    color: var(--theme-text-muted);
}

.mtg-search-help {
    margin-top: -4px;
    margin-bottom: 16px;
    max-width: 860px;
}

/* ---------------------------------------------------------------------------
   Filters / Search
   --------------------------------------------------------------------------- */

.mtg-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
}

.mtg-artist-search-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.mtg-search-input {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border: 2px solid var(--theme-input-border);
    background: var(--theme-input-bg);
    color: var(--theme-input-text);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.mtg-search-input:focus {
    outline: none;
    border-color: var(--theme-accent);
}

.mtg-search-btn {
    padding: 10px 24px;
    background: var(--theme-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.mtg-search-btn:hover {
    background: var(--theme-accent-hover);
}

.mtg-artist-autocomplete {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    top: calc(100% + 8px);
    background: var(--theme-surface);
    border: 2px solid var(--theme-accent);
    border-radius: 10px;
    box-shadow: 0 10px 28px var(--theme-header-shadow);
    z-index: 40;
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
}

.mtg-artist-autocomplete.active {
    display: block;
}

.mtg-artist-ac-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--theme-border-light);
    background: var(--theme-surface);
    text-align: left;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font: inherit;
    min-height: 58px;
}

.mtg-artist-ac-item:last-child {
    border-bottom: 0;
}

.mtg-artist-ac-item:hover,
.mtg-artist-ac-item.selected {
    background: var(--theme-soft-bg, #f8fafc);
}

.mtg-artist-ac-avatar,
.mtg-artist-ac-fallback {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    border-radius: 50%;
    flex: 0 0 42px;
}

.mtg-artist-ac-avatar {
    display: block;
    object-fit: cover;
    border: 1px solid var(--theme-border-light);
}

.mtg-artist-ac-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-soft-bg, #eef2f7);
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border-light);
}

.mtg-artist-ac-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mtg-artist-ac-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--theme-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mtg-artist-ac-meta {
    margin-top: 3px;
    font-size: 12px;
    color: var(--theme-text-muted);
}

.mtg-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.mtg-chip {
    padding: 6px 16px;
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    background: var(--theme-surface);
    font-size: 13px;
    font-weight: 500;
    color: var(--theme-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.mtg-chip:hover,
.mtg-chip.active {
    background: var(--theme-accent);
    color: #fff;
    border-color: var(--theme-accent);
    text-decoration: none;
}

.mtg-export-menu {
    position: relative;
    margin: 0;
    display: inline-block;
}

.mtg-export-menu summary {
    list-style: none;
}

.mtg-export-menu summary::-webkit-details-marker {
    display: none;
}

.mtg-export-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 230px;
    user-select: none;
}

.mtg-export-trigger:focus {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
}

.mtg-export-caret {
    transition: transform 0.15s ease;
}

.mtg-export-menu[open] .mtg-export-caret {
    transform: rotate(180deg);
}

.mtg-export-list {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 260px;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    box-shadow: 0 10px 24px var(--theme-header-shadow);
    padding: 6px;
    z-index: 20;
}

.mtg-export-list .mtg-export-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 8px;
    color: var(--theme-text);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.3;
}

.mtg-export-list .mtg-export-item:hover {
    background: var(--theme-soft-bg, #f2f4f7);
    color: var(--theme-text);
    text-decoration: none;
}

@media (max-width: 820px) {
    .mtg-export-trigger {
        min-width: 0;
    }

    .mtg-export-list {
        right: auto;
        left: 0;
        min-width: 230px;
        max-width: min(92vw, 320px);
    }
}

/* ---------------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------------- */

.mtg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    padding: 16px 0;
}

.mtg-pagination a,
.mtg-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

.mtg-pagination a:hover {
    background: var(--theme-accent);
    color: #fff;
    border-color: var(--theme-accent);
}

.mtg-pagination .active {
    background: var(--theme-accent);
    color: #fff;
    border-color: var(--theme-accent);
}

.mtg-pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

.mtg-card-autoload {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--theme-border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mtg-card-autoload-status {
    font-size: 12px;
    color: var(--theme-text-muted);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 18px;
}

.mtg-card-loadmore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.mtg-card-loadmore:disabled {
    opacity: 0.7;
    cursor: default;
    pointer-events: none;
}

.mtg-card-autoload-sentinel {
    width: 100%;
    height: 1px;
}

.mtg-card-autoload-done {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.mtg-card-autoload-done img {
    width: 184px;
    height: 250px;
    max-width: min(80vw, 184px);
    object-fit: contain;
}

.mtg-card-autoload-done-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-text);
    text-align: center;
}

.mtg-card-autoload.is-complete .mtg-card-loadmore {
    display: none;
}

.mtg-card-autoload.is-complete .mtg-card-autoload-status {
    display: none;
}

.mtg-card-autoload.is-complete .mtg-card-autoload-done {
    display: flex;
}

.mtg-card-autoload.is-loading .mtg-card-autoload-status::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--theme-border);
    border-top-color: var(--theme-accent);
    border-radius: 50%;
    animation: mtg-card-load-spin 0.85s linear infinite;
    flex-shrink: 0;
}

@keyframes mtg-card-load-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
   Landing Page — Hero
   --------------------------------------------------------------------------- */

.mtg-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    border-radius: 16px;
    padding: 32px 40px;
    margin-bottom: 28px;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mtg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 40%, rgba(147, 51, 234, 0.3), transparent 60%);
    pointer-events: none;
}

.mtg-hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px;
    position: relative;
    z-index: 1;
}

.mtg-hero p {
    font-size: 16px;
    opacity: 0.85;
    margin: 0 0 24px;
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------------------------------------
   Landing Page — Sections
   --------------------------------------------------------------------------- */

.mtg-section {
    margin-bottom: 32px;
}

.mtg-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mtg-section-title i {
    color: #e74c3c;
}

.mtg-format-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mtg-format-link {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.mtg-format-link:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
    text-decoration: none;
}

.mtg-recent-sets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.mtg-recent-set {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.mtg-recent-set:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}

.mtg-recent-set-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.mtg-recent-set-date {
    font-size: 12px;
    color: #7f8c8d;
}

/* ---------------------------------------------------------------------------
   Empty / Error States
   --------------------------------------------------------------------------- */

.mtg-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--theme-text-muted);
    font-size: 16px;
}

.mtg-empty i {
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ---------------------------------------------------------------------------
   Checklist Table (Set Detail)
   --------------------------------------------------------------------------- */

.mtg-checklist {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mtg-checklist th {
    text-align: left;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 5;
    cursor: pointer;
}

.mtg-checklist th:hover {
    background: #eee;
}

.mtg-checklist td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.mtg-checklist tr:hover td {
    background: #fafafa;
}

/* Sort bar: hidden on desktop, shown on mobile via media query */
.mtg-checklist-sort {
    display: none;
}

/* ---------------------------------------------------------------------------
   Mobile: <=820px — Tab Behavior
   --------------------------------------------------------------------------- */

@media (max-width: 820px) {
    .mtg-search-input {
        font-size: 16px;
    }

    #mtg-artist-search-input {
        font-size: 16px !important;
        line-height: 1.35;
        -webkit-text-size-adjust: 100%;
    }

    .mtg-search-bar {
        gap: 6px;
    }

    .mtg-search-btn {
        padding: 10px 14px;
        flex: 0 0 auto;
    }

    .mtg-artist-autocomplete {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        top: calc(100% + 4px);
        max-height: min(55vh, 320px);
        scrollbar-width: thin;
        scrollbar-color: var(--theme-accent) var(--theme-soft-bg, #e9edf2);
    }

    .mtg-artist-autocomplete::-webkit-scrollbar {
        width: 8px;
    }

    .mtg-artist-autocomplete::-webkit-scrollbar-track {
        background: var(--theme-soft-bg, #e9edf2);
        border-radius: 8px;
    }

    .mtg-artist-autocomplete::-webkit-scrollbar-thumb {
        background: linear-gradient(
            180deg,
            color-mix(in srgb, var(--theme-accent) 70%, #fff 30%) 0%,
            var(--theme-accent) 100%
        );
        border-radius: 8px;
        border: 1px solid var(--theme-surface);
    }

    .mtg-tabs {
        display: flex;
    }

    .mtg-tab-panel {
        display: none;
    }

    .mtg-tab-panel.tab-active {
        display: block;
    }

    .mtg-card-hero {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mtg-card-image-wrap {
        max-width: 300px;
        margin: 0 auto;
    }

    .mtg-card-name {
        font-size: 22px;
    }

    .mtg-chart-header {
        flex-wrap: wrap;
    }

    .mtg-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .mtg-prints-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mtg-legality-grid {
        grid-template-columns: 1fr;
    }

    .mtg-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .mtg-hero {
        padding: 24px 20px;
    }

    .mtg-hero h1 {
        font-size: 24px;
    }

    /* ----- Prices table card-row layout on mobile ----- */

    .mtg-prices-table thead {
        display: none;
    }

    .mtg-prices-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        border-collapse: separate;
    }

    .mtg-prices-table tbody {
        display: block;
        width: 100%;
    }

    .mtg-prices-table tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 2px 8px;
        padding: 10px 12px;
        margin-bottom: 6px;
        border: 1px solid var(--theme-border-light);
        border-radius: 10px;
        background: var(--theme-surface);
        max-width: 100%;
        box-sizing: border-box;
    }

    .mtg-prices-table tr:hover td {
        background: transparent;
    }

    .mtg-prices-table td {
        display: block;
        padding: 0;
        border: none;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Row 1: Set name (spans left+center) ... Price (right) */
    .mtg-prices-table td:nth-child(1) {
        grid-column: 1 / 3;
        grid-row: 1;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mtg-prices-table td:nth-child(5) {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        font-size: 15px;
    }

    /* Row 2: #number · Treatment · Finish */
    .mtg-prices-table td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        font-size: 12px;
        color: var(--theme-text-muted);
        align-self: center;
    }

    .mtg-prices-table td:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
    }

    .mtg-prices-table td:nth-child(4) {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
        align-self: center;
        font-size: 12px;
        color: var(--theme-text-muted);
    }

    .mtg-set-row {
        padding: 10px 12px;
    }

    .mtg-artist-avatar {
        width: 36px;
        height: 36px;
    }

    .mtg-artist-avatar i {
        font-size: 15px;
    }

    /* Hide columns on mobile for set rows */
    .mtg-set-date {
        display: none;
    }

    /* ----- Checklist card-row layout on mobile ----- */

    .mtg-set-page .mtg-tab-panel {
        padding: 12px;
    }

    .mtg-checklist thead {
        display: none;
    }

    .mtg-checklist {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        border-collapse: separate;
    }

    .mtg-checklist tbody {
        display: block;
        width: 100%;
    }

    .mtg-checklist tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 0 8px;
        padding: 10px 12px;
        margin-bottom: 6px;
        border: 1px solid var(--theme-border-light);
        border-radius: 10px;
        background: var(--theme-surface);
        max-width: 100%;
        box-sizing: border-box;
    }

    .mtg-checklist tr:hover {
        border-color: var(--theme-border);
    }

    .mtg-checklist tr:hover td {
        background: transparent;
    }

    /* Reset all td defaults */
    .mtg-checklist td {
        display: block;
        padding: 0;
        border: none;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Row 1: # (left) ... price (right) */
    .mtg-checklist td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        font-size: 12px;
        font-weight: 600;
        color: var(--theme-text-muted);
    }

    .mtg-checklist td:nth-child(6) {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        font-size: 15px;
    }

    /* Row 2: Card name — full width */
    .mtg-checklist td:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
        font-size: 15px;
        font-weight: 600;
        padding: 2px 0 4px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Row 3: color · type · rarity */
    .mtg-checklist td:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
        align-self: center;
    }

    .mtg-checklist td:nth-child(5) {
        grid-column: 2;
        grid-row: 3;
        font-size: 12px;
        color: var(--theme-text-muted);
        align-self: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mtg-checklist td:nth-child(4) {
        grid-column: 3;
        grid-row: 3;
        justify-self: end;
        align-self: center;
    }

    .mtg-checklist .mtg-rarity-badge {
        font-size: 10px;
        padding: 1px 6px;
    }

    /* ----- Mobile sort bar for checklist ----- */

    .mtg-checklist-sort {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 12px;
    }

    .mtg-checklist-sort-btn {
        padding: 4px 12px;
        border: 1px solid var(--theme-border);
        border-radius: 16px;
        background: var(--theme-surface);
        font-size: 12px;
        font-weight: 600;
        color: var(--theme-text-secondary);
        cursor: pointer;
        transition: all 0.15s;
        font-family: inherit;
    }

    .mtg-checklist-sort-btn.active {
        background: var(--theme-accent);
        color: #fff;
        border-color: var(--theme-accent);
    }
}

@media (max-width: 480px) {
    .mtg-page {
        padding: 12px 12px 32px;
    }

    .mtg-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .mtg-results-grid {
        grid-template-columns: 1fr;
    }

    .mtg-prints-grid {
        grid-template-columns: 1fr;
    }

    .mtg-recent-sets {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   Netflix-Style MTG Landing Page
   All classes prefixed with nfx- to avoid collisions with existing mtg- styles
   ========================================================================= */

/* --- Landing page wrapper override --- */
.mtg-page.mtg-landing {
    max-width: 100%;
    padding: 0;
    background: var(--theme-bg);
}

.mtg-page.mtg-landing a {
    color: #fff;
}

.mtg-page.mtg-landing a:hover {
    text-decoration: none;
}

/* --- Hero Billboard --- */
.nfx-hero {
    position: relative;
    width: 100%;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    margin-bottom: 20px;
}

.nfx-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.nfx-hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.4) saturate(1.2);
}

.nfx-hero-gradient {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(20, 20, 20, 0.3) 40%,
        var(--theme-bg) 100%
    );
}

.nfx-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 40px 48px;
    width: 100%;
}

.nfx-hero-title {
    font-size: 52px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.1;
}

.nfx-hero-subtitle {
    font-size: 18px;
    color: #b3b3b3;
    margin: 0 0 28px;
    max-width: 600px;
    line-height: 1.5;
}

.nfx-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Buttons (Netflix-style) --- */
.nfx-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: none;
    line-height: 1;
}

.nfx-btn-primary {
    background: var(--theme-accent);
    color: #fff;
}

.nfx-btn-primary:hover {
    background: var(--theme-accent-hover);
    transform: scale(1.02);
    color: #fff;
}

.nfx-btn-secondary {
    background: rgba(109, 109, 110, 0.7);
    color: #fff;
}

.nfx-btn-secondary:hover {
    background: rgba(109, 109, 110, 0.4);
    color: #fff;
}

.nfx-btn-ghost {
    background: transparent;
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border);
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 4px;
}

.nfx-btn-ghost:hover {
    color: var(--theme-text);
    border-color: var(--theme-text);
}

/* --- Netflix Row Layout --- */
.nfx-row {
    padding: 0 40px;
    margin-bottom: 40px;
    max-width: 100%;
}

.nfx-row-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-text);
    margin: 0 0 12px;
    padding: 0;
}

.nfx-row-more {
    margin-top: 16px;
    text-align: center;
}

/* --- Horizontal Carousel --- */
.nfx-carousel {
    position: relative;
    overflow: visible;
}

.nfx-carousel-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nfx-carousel-track::-webkit-scrollbar {
    display: none;
}

/* --- Tiles (cards inside carousels) --- */
.nfx-tile {
    position: relative;
    flex: 0 0 auto;
    width: 200px;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    scroll-snap-align: start;
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0.3s;
    z-index: 1;
    cursor: pointer;
}

.nfx-tile:hover {
    transform: scale(1.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    z-index: 10;
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0s;
    text-decoration: none;
    color: #fff;
}

.nfx-tile-wide {
    width: 220px;
    height: 130px;
}

.nfx-tile-color {
    width: 180px;
    height: 110px;
}

.nfx-tile-format {
    width: 200px;
    height: 120px;
}

.nfx-tile-set {
    width: 240px;
    height: 140px;
}

.nfx-tile-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 6px;
}

.nfx-tile-bg--set {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.nfx-tile-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px 16px;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.1) 60%,
        transparent 100%
    );
}

.nfx-tile-body--color {
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.15) 100%
    );
}

.nfx-tile-body--color .mtg-mana {
    width: 36px;
    height: 36px;
    font-size: 18px;
    margin-bottom: 6px;
    border-width: 2px;
}

.nfx-tile-body--set {
    align-items: center;
    text-align: center;
    justify-content: center;
    gap: 6px;
}

.nfx-tile-icon {
    font-size: 22px;
    opacity: 0.6;
    margin-bottom: 4px;
}

.nfx-tile-label {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.nfx-tile-desc {
    font-size: 12px;
    color: #b3b3b3;
    margin-top: 2px;
}

.nfx-set-icon {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* --- Carousel edge fades --- */
.nfx-carousel::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 20px;
    right: 0;
    width: 40px;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(to left, var(--theme-bg), transparent);
}

/* --- Carousel arrow buttons --- */
.nfx-carousel-arrow {
    position: absolute;
    top: 0;
    bottom: 20px;
    width: 44px;
    background: rgba(20, 20, 20, 0.7);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nfx-carousel:hover .nfx-carousel-arrow {
    opacity: 1;
}

.nfx-arrow-left {
    left: 0;
    border-radius: 0 4px 4px 0;
}

.nfx-arrow-right {
    right: 0;
    border-radius: 4px 0 0 4px;
}

.nfx-carousel-arrow:hover {
    background: rgba(20, 20, 20, 0.9);
}

/* --- Mobile: Landing Page --- */
@media (max-width: 820px) {
    .nfx-hero {
        min-height: 360px;
    }

    .nfx-hero-content {
        padding: 60px 20px 32px;
    }

    .nfx-hero-title {
        font-size: 32px;
    }

    .nfx-hero-subtitle {
        font-size: 15px;
    }

    .nfx-row {
        padding: 0 16px;
        margin-bottom: 28px;
    }

    .nfx-row-title {
        font-size: 18px;
    }

    .nfx-tile {
        width: 160px;
        height: 100px;
    }

    .nfx-tile-wide {
        width: 180px;
        height: 110px;
    }

    .nfx-tile-set {
        width: 200px;
        height: 120px;
    }

    .nfx-tile-color {
        width: 140px;
        height: 90px;
    }

    .nfx-tile:hover {
        transform: scale(1.08);
    }

    .nfx-carousel-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .nfx-hero {
        min-height: 300px;
    }

    .nfx-hero-content {
        padding: 40px 16px 24px;
    }

    .nfx-hero-title {
        font-size: 26px;
    }

    .nfx-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .nfx-row {
        padding: 0 12px;
        margin-bottom: 24px;
    }

    .nfx-tile {
        width: 140px;
        height: 90px;
    }

    .nfx-tile-wide {
        width: 160px;
        height: 100px;
    }

    .nfx-tile-set {
        width: 180px;
        height: 110px;
    }

    .nfx-tile-color {
        width: 120px;
        height: 80px;
    }
}
