
/* =========================================
   CARD CACHE - COLOR THEMES
   ========================================= */

/* Dark Mode */

:root {
    --background: #171b2a;
    --surface: #252a3c;
    --surface-alt: #30364b;

    --text: #f5f4f0;
    --text-muted: #b5bbcb;

    --accent: #75d6aa;
    --accent-hover: #a3ebca;

    --border: #3b4055;
    --chart-grid: #3b4055;

    --common: #bfc4d4;
    --uncommon: #d4d8e1;
    --rare: #eab76c;
    --mythic: #e68b68;
}

/* Light Mode */

:root[data-theme="light"] {
    --background: #f7f1e7;
    --surface: #ffffff;
    --surface-alt: #f8f4ee;

    --text: #262934;
    --text-muted: #71695f;

    --accent: #14785e;
    --accent-hover: #095540;

    --border: #e7dac9;
    --chart-grid: #eae0d4;

    --common: #655f59;
    --uncommon: #888a91;
    --rare: #a36b22;
    --mythic: #b95733;
}

/* =========================================
   GENERAL STYLING
   ========================================= */

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;

    background-color: var(--background);
    color: var(--text);

    margin: 0;

    transition:
        background-color 0.25s,
        color 0.25s;
}

h1, h2, h3, h4 {
    margin-top: 0;
}

/* =========================================
   HEADER
   ========================================= */

header {
    background-color: var(--surface);

    padding: 12px 5%;

    border-bottom: 1px solid var(--border);
}

.header-top {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 20px;
}

.brand h1 {
    color: var(--accent);

    font-family: Georgia, serif;

    font-size: 28px;

    margin: 0;
}

.brand p {
    color: var(--text-muted);

    font-size: 13px;

    margin: 3px 0 0;
}

nav {
    display: flex;

    gap: 25px;

    margin-top: 12px;
}

nav a {
    color: var(--text-muted);

    text-decoration: none;

    font-size: 14px;
}

nav a:hover {
    color: var(--accent);
}

/* =========================================
   MAIN CONTENT
   ========================================= */

main {
    width: 90%;

    max-width: 1600px;

    margin: 25px auto;

    padding: 10px 0;
}

#collection > p {
    color: var(--text-muted);
}

/* =========================================
   BUTTONS
   ========================================= */

button {
    background-color: var(--accent);
    color: var(--background);

    border: none;
    border-radius: 8px;

    padding: 12px 24px;

    font-size: 16px;
    font-weight: bold;

    cursor: pointer;

    transition:
        background-color 0.2s,
        transform 0.2s;
}

button:hover {
    background-color: var(--accent-hover);

    transform: translateY(-2px);
}


/* =========================================
   LIGHT / DARK MODE SWITCH
   ========================================= */

.theme-switch {
    width: 64px;
    height: 34px;

    padding: 4px;

    border: 1px solid var(--border);
    border-radius: 50px;

    background-color: var(--surface-alt);

    display: flex;
    align-items: center;

    cursor: pointer;

    flex-shrink: 0;

    transition:
        background-color 0.25s,
        border-color 0.25s;
}

/* Don't let the normal button hover move it */

.theme-switch:hover {
    background-color: var(--surface-alt);
    transform: none;
}

/* The sliding circle */

.switch-thumb {
    width: 24px;
    height: 24px;

    border-radius: 50%;

    background-color: var(--accent);
    color: var(--background);

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateX(30px);

    transition:
        transform 0.25s,
        background-color 0.25s;
}

/* Sun and moon icons */

.switch-thumb svg {
    width: 15px;
    height: 15px;
}

/* Dark mode shows the moon */

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

/* Light mode moves the circle left */

:root[data-theme="light"] .switch-thumb {
    transform: translateX(0);
}

/* Light mode shows the sun */

:root[data-theme="light"] .sun-icon {
    display: block;
}

:root[data-theme="light"] .moon-icon {
    display: none;
}

/* Keyboard accessibility */

.theme-switch:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* =========================================
   COLLECTION DASHBOARD
   ========================================= */

.collection-dashboard {
    display: grid;

    grid-template-columns: 1fr 2fr;

    gap: 20px;

    margin: 30px 0;

    align-items: stretch;
}

/* Collection Summary */

.collection-summary {
    background-color: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 25px;
}

.collection-summary h3 {
    color: var(--text-muted);

    font-size: 14px;
}

#totalCards {
    color: var(--text);

    font-size: 40px;
    font-weight: bold;

    margin: 15px 0 25px;
}

/* Rarity Boxes */

.rarity-grid {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 12px;
}

.rarity-box {
    background-color: var(--surface-alt);

    padding: 15px;

    border-radius: 8px;
}

.rarity-box h4 {
    color: var(--text-muted);

    font-size: 13px;

    margin: 0 0 10px;
}

.rarity-box p {
    font-size: 25px;
    font-weight: bold;

    margin: 0;
}

.common p {
    color: var(--common);
}

.uncommon p {
    color: var(--uncommon);
}

.rare p {
    color: var(--rare);
}

.mythic p {
    color: var(--mythic);
}

/* =========================================
   COLLECTION PRICE CHART
   ========================================= */

.price-chart {
    background-color: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 25px;

    min-width: 0;
}

.price-chart h3 {
    color: var(--text-muted);

    font-size: 14px;

    margin: 0;
}

#collectionValue {
    color: var(--accent);

    font-size: 36px;
    font-weight: bold;

    margin: 15px 0;
}

.chart-container {
    position: relative;

    width: 100%;
    height: 260px;
}

#refreshPricesButton {
    margin-bottom: 16px;
}

#chartMessage {
    color: var(--text-muted);

    font-size: 13px;

    text-align: center;
}

/* =========================================
   COLLECTION IMPORT
   ========================================= */

#import {
    background-color: var(--surface);

    border: 1px solid var(--border);

    padding: 30px;

    border-radius: 12px;

    margin: 30px 0;
}

#import p {
    color: var(--text-muted);
}

#collectionFile {
    display: block;

    margin: 20px 0;

    max-width: 100%;
}

/* =========================================
   COLLECTION RESULTS
   ========================================= */

#cardList {
    margin-top: 40px;
}

#collectionResults {
    background-color: var(--surface);

    border: 1px solid var(--border);

    padding: 25px;

    border-radius: 12px;
}

#collectionResults p {
    color: var(--text-muted);
}

/* =========================================
   RESPONSIVE LAYOUT
   ========================================= */

@media (max-width: 800px) {

    .collection-dashboard {
        grid-template-columns: 1fr;
    }

    main {
        width: 95%;

        padding: 10px;
    }

    .brand h1 {
        font-size: 28px;
    }

    nav {
        flex-wrap: wrap;

        gap: 15px;
    }

}

@media (max-width: 480px) {

    .header-top {
        flex-wrap: wrap;
    }

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

    .collection-summary,
    .price-chart {
        padding: 15px;
    }

}


/* =========================================
   COLLECTION QUANTITY CONTROLS
   ========================================= */

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    white-space: nowrap;
}

.quantity-button {
    width: 30px;
    height: 30px;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 6px;

    background-color: var(--surface-alt);
    color: var(--text);

    font-size: 19px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.quantity-button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.quantity-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}


/* =========================================
   EDITABLE QUANTITY NUMBER
   ========================================= */

.quantity-number {
    width: 42px;

    padding: 5px 2px;

    box-sizing: border-box;

    border: 1px solid transparent;
    border-radius: 6px;

    background-color: transparent;
    color: var(--text);

    text-align: center;

    font-family: inherit;
    font-size: 15px;
    font-weight: bold;

    outline: none;

    transition:
        border-color 0.15s,
        background-color 0.15s;
}

/* Show that the number can be edited */

.quantity-number:hover:not(:disabled) {
    border-color: var(--border);
    cursor: text;
}

/* Highlight the input when editing */

.quantity-number:focus {
    border-color: var(--accent);
    background-color: var(--surface-alt);
}

/* Hide the browser's number arrows */

.quantity-number::-webkit-inner-spin-button,
.quantity-number::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-number {
    appearance: textfield;
    -moz-appearance: textfield;
}


/* =========================================
   DELETE CARD BUTTON
   ========================================= */

.delete-card-button {
    width: 30px;
    height: 30px;

    padding: 0;

    background-color: transparent;
    color: #dc4545;

    border: 1px solid #dc4545;
    border-radius: 6px;

    font-size: 21px;
    line-height: 1;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.delete-card-button:hover:not(:disabled) {
    background-color: #dc4545;
    color: white;
}

.delete-card-button:disabled {
    opacity: 0.35;
    cursor: wait;
}

/* Give the collection table enough space */

.collection-table {
    width: 100%;
    table-layout: auto;
}

/* Card names use the remaining space */

.collection-table th:first-child,
.collection-table td:first-child {
    text-align: left;
    padding-right: 24px;
}

/* Quantity column */

.collection-table th:nth-child(2),
.collection-table td:nth-child(2) {
    width: 160px;
    min-width: 160px;
    text-align: center;
}

/* Actions column */

.collection-table th:nth-child(3),
.collection-table td:nth-child(3) {
    width: 90px;
    min-width: 90px;
    text-align: center;
}

/* =========================================
   COLLECTION TABLE ROW SEPARATORS
   ========================================= */

.collection-table {
    width: 100%;
    border-collapse: collapse;
}

/* Give every row a little breathing room */

.collection-table th,
.collection-table td {
    padding: 12px 14px;
}

/* Line underneath the headings */

.collection-table th {
    border-bottom: 2px solid var(--border);
}

/* Line underneath each card */

.collection-table td {
    border-bottom: 1px solid var(--border);
}

/* Make the lines visible in both themes */

.collection-table th,
.collection-table td {
    border-bottom-color:
        color-mix(in srgb, var(--text) 20%, transparent);
}

/* Don't draw a line after the final card */

.collection-table tr:last-child td {
    border-bottom: none;
}

/* Highlight the entire card row on hover */

.collection-table tr:hover td {
    background-color: var(--surface-alt);
}

/* Smooth the hover transition */

.collection-table td {
    transition: background-color 0.15s ease;
}

/* =========================================
   COLLECTION SEARCH BAR
   ========================================= */

.collection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}

#collectionSearch {
    width: 100%;
    max-width: 420px;

    padding: 12px 15px;

    box-sizing: border-box;

    border: 1px solid var(--border);
    border-radius: 8px;

    background-color: var(--surface);
    color: var(--text);

    font-family: inherit;
    font-size: 15px;

    outline: none;

    transition: border-color 0.15s;
}

#collectionSearch::placeholder {
    color: var(--text-muted);
}

#collectionSearch:focus {
    border-color: var(--accent);
}

#searchStatus {
    color: var(--text-muted);

    font-size: 13px;

    white-space: nowrap;
}

/* Smaller screens */

@media (max-width: 600px) {
    .collection-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    #collectionSearch {
        max-width: none;
    }

    #searchStatus {
        text-align: left;
    }
}


/* =========================================
   ADD CARD PANEL
   ========================================= */

.add-card-toolbar {
    display: flex;
    justify-content: flex-end;

    margin-bottom: 15px;
}

#addCardButton,
#confirmAddCard {
    background-color: var(--accent);
    color: var(--background);

    border: none;
    border-radius: 8px;

    padding: 10px 18px;

    cursor: pointer;
}

#addCardPanel {
    background-color: var(--surface);

    border: 1px solid var(--border);
    border-radius: 10px;

    padding: 20px;
    margin-bottom: 20px;
}

#addCardPanel[hidden],
#printingSection[hidden],
#selectedCardSection[hidden],
#loadMorePrintings[hidden] {
    display: none;
}

.scryfall-search-row {
    display: flex;
    gap: 10px;
}

#scryfallSearch {
    flex: 1;
    min-width: 0;

    padding: 10px;

    background-color: var(--surface-alt);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 8px;
}


/* =========================================
   CARD NAME RESULTS
   ========================================= */

#scryfallResults {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.scryfall-name-result {
    padding: 10px 12px;

    background-color: var(--surface-alt);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;

    text-align: left;
    cursor: pointer;
}

.scryfall-name-result:hover {
    border-color: var(--accent);
}


/* =========================================
   PRINTING RESULTS
   ========================================= */

#printingResults {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(180px, 1fr));

    gap: 12px;

    max-height: 450px;
    overflow-y: auto;

    margin: 15px 0;
}

.printing-option {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 8px;

    padding: 12px;

    background-color: var(--surface-alt);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 8px;

    cursor: pointer;
}

.printing-option:hover {
    border-color: var(--accent);
}

.printing-option img {
    width: 100%;
    max-width: 145px;

    border-radius: 8px;
}

.printing-option span {
    font-size: 12px;
    text-align: center;
}


/* =========================================
   SELECTED CARD
   ========================================= */

#selectedCardSection {
    margin-top: 20px;

    padding-top: 20px;

    border-top: 1px solid var(--border);
}

#selectedCardPreview img {
    width: 200px;
    max-width: 100%;

    border-radius: 10px;
}

#selectedCardSection label {
    display: block;

    margin: 12px 0 5px;
}

#cardFinish,
#cardQuantity {
    padding: 9px;

    background-color: var(--surface-alt);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;
}

#cardQuantity {
    width: 80px;
}

#confirmAddCard {
    display: block;

    margin-top: 18px;
}

#confirmAddCard:disabled {
    opacity: 0.5;
    cursor: wait;
}

#addCardStatus {
    color: var(--accent);
}

/* =========================================
   CARD NAME AND PRINTING
   ========================================= */

.collection-card-name {
    color: var(--text);

    font-size: 15px;
    font-weight: 600;
}

.collection-printing-info {
    color: var(--text-muted);

    font-size: 12px;

    margin-top: 4px;
}

/* =========================================
   DECK BUILDER
   ========================================= */

#deckBuilder {
    width: 100%;
}

#deckInput {
    display: block;

    width: 100%;
    min-height: 260px;

    box-sizing: border-box;

    padding: 16px;

    margin: 20px 0;

    background-color: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 10px;

    font-family: inherit;
    font-size: 15px;

    resize: vertical;
}

#deckInput:focus {
    outline: 1px solid var(--accent);
}

#analyzeDeckButton {
    background-color: var(--accent);
    color: var(--background);

    border: none;
    border-radius: 8px;

    padding: 12px 20px;

    cursor: pointer;
}

#analyzeDeckButton:disabled {
    opacity: 0.5;
    cursor: wait;
}

#deckStatus {
    margin: 20px 0;

    font-size: 16px;
    font-weight: 600;
}


/* =========================================
   DECK ANALYSIS TABLE
   ========================================= */

#deckResults {
    width: 100%;
    overflow-x: auto;
}

.deck-results-table {
    width: 100%;

    border-collapse: collapse;

    background-color: var(--surface);

    border-radius: 10px;
}

.deck-results-table th,
.deck-results-table td {
    padding: 14px 16px;

    text-align: left;

    border-bottom: 1px solid var(--border);
}

.deck-results-table th {
    color: var(--text-muted);
}

.deck-results-table th:not(:first-child),
.deck-results-table td:not(:first-child) {
    text-align: center;
}

.deck-card-owned td:first-child {
    color: var(--accent);
}

.deck-card-missing td:last-child {
    color: #e57373;
    font-weight: bold;
}

/* =========================================
   COLLECTION VALUE CONTROLS
   ========================================= */

.price-chart-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;
    gap: 12px;

    margin: 16px 0;
}

.chart-range-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chart-range-button {
    width: auto;

    padding: 6px 10px;

    background: transparent;
    color: inherit;

    border: 1px solid currentColor;
    border-radius: 6px;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    opacity: 0.65;
}

.chart-range-button:hover {
    opacity: 1;
}

.chart-range-button.active {
    background: #7dd8b0;
    color: #19202c;

    border-color: #7dd8b0;

    opacity: 1;
}

.chart-range-button:focus-visible {
    outline: 2px solid #7dd8b0;
    outline-offset: 3px;
}


/* Smaller Refresh Prices button */

.price-chart #refreshPricesButton {
    width: auto;

    display: inline-flex;
    align-items: center;

    padding: 6px 10px;

    font-size: 12px;
    line-height: 1.3;

    border-radius: 6px;

    margin: 0;
}

@media (max-width: 520px) {

    .price-chart-controls {
        align-items: flex-start;
        flex-direction: column;
    }

}

/* =========================================
   DECK SAVINGS
   ========================================= */

.deck-savings-summary {
    margin: 24px 0;
    padding: 24px;

    border: 1px solid #7dd8b0;
    border-radius: 12px;
}

.deck-savings-summary h3 {
    margin-top: 0;
}

.deck-alternative {
    padding: 16px;
    margin: 12px 0;

    border: 1px solid #7dd8b0;
    border-radius: 8px;
}

.deck-alternative p {
    margin: 8px 0 0;
}

.deck-pricing-note {
    display: block;

    margin: -6px 0 16px;

    font-size: 12px;
    opacity: 0.7;
}

.deck-field-note {
    font-size: 12px;
    opacity: 0.7;
}

/* =========================================
   OWNED PRINTINGS IN DECKLIST
   ========================================= */

.deck-owned-printings {
    margin-top: 8px;

    font-size: 12px;
}

.deck-owned-printings summary {
    cursor: pointer;

    opacity: 0.8;
}

.deck-owned-printings summary:hover {
    opacity: 1;
}

.deck-owned-printings ul {
    margin: 8px 0 0;

    padding-left: 18px;
}

.deck-owned-printings li {
    margin-bottom: 5px;
}

/* =========================================
   ALTERNATIVES INSIDE DECKLIST
   ========================================= */

.deck-owned-alternatives {
    margin-top: 10px;

    font-size: 12px;
}

.deck-owned-alternatives > summary {
    cursor: pointer;

    color: #7dd8b0;

    font-weight: 600;
}

.deck-owned-alternatives > summary:hover {
    text-decoration: underline;
}

.deck-alternative-option {
    margin-top: 12px;

    padding: 12px;

    border: 1px solid #7dd8b0;
    border-radius: 8px;

    font-size: 12px;
}

.deck-alternative-option p {
    margin: 6px 0;
}

.deck-alternative-printings {
    margin: 8px 0 0;

    padding-left: 18px;
}

.deck-alternative-printings li {
    margin-bottom: 5px;
}

/* =========================================
   REQUESTED DECK PRINTING
   ========================================= */

.deck-requested-printing {
    margin-top: 5px;

    font-size: 12px;

    opacity: 0.75;
}

/* =========================================
   DECK SAVINGS DASHBOARD
   ========================================= */

.deck-savings-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-top: 20px;
    margin-bottom: 20px;
}


/* Individual financial cards */

.deck-saving-card {
    display: flex;
    flex-direction: column;

    gap: 10px;

    min-width: 0;

    padding: 20px;

    border: 1px solid
        color-mix(
            in srgb,
            currentColor 18%,
            transparent
        );

    border-radius: 12px;

    background: var(--surface, transparent);
}


/* Small descriptive label */

.deck-saving-label {
    font-size: 12px;

    font-weight: 700;

    line-height: 1.4;

    letter-spacing: 0.4px;

    text-transform: uppercase;

    opacity: 0.75;
}


/* Main dollar amount */

.deck-saving-amount {
    font-size: clamp(
        24px,
        3vw,
        36px
    );

    font-weight: 800;

    line-height: 1.1;

    font-variant-numeric:
        tabular-nums;

    overflow-wrap: anywhere;
}


/* Highlight money saved */

.deck-saving-card--saved {
    border-color: #7dd8b0;

    background: color-mix(
        in srgb,
        #7dd8b0 10%,
        transparent
    );
}

.deck-saving-card--saved
.deck-saving-amount {
    color: #7dd8b0;
}


/* Scryfall attribution */

.deck-saving-card
.deck-pricing-note {
    display: block;

    margin: 0;

    font-size: 11px;

    font-weight: 400;

    line-height: 1.5;

    opacity: 0.7;
}


/* =========================================
   UNPRICED CARDS WARNING
   ========================================= */

.deck-pricing-warning {
    padding: 14px 18px;

    margin: 16px 0;

    border: 1px solid #e5a84b;

    border-radius: 10px;

    background: color-mix(
        in srgb,
        #e5a84b 10%,
        transparent
    );
}

.deck-pricing-warning strong {
    display: block;

    margin-bottom: 6px;
}

.deck-pricing-warning p {
    margin: 0;

    font-size: 13px;

    line-height: 1.5;
}


/* =========================================
   SMALL SCREEN LAYOUT
   ========================================= */

@media (max-width: 850px) {

    .deck-savings-grid {
        grid-template-columns: 1fr;
    }

}

/* =========================================
   PROPOSED OPTIMIZED REPLACEMENTS
   ========================================= */

.deck-optimized-preview {
    margin-top: 12px;
    padding: 12px;

    border: 1px solid #47ad80;
    border-radius: 10px;

    background: color-mix(
        in srgb,
        #47ad80 10%,
        transparent
    );
}

.deck-optimized-heading {
    display: block;
    margin-bottom: 10px;

    font-size: 12px;
    color: #47ad80;

    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.deck-optimized-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin-top: 10px;
}

.deck-optimized-image {
    width: 76px;
    height: auto;

    flex-shrink: 0;

    border-radius: 5px;
}

.deck-optimized-information {
    min-width: 0;
}

.deck-optimized-information p {
    margin: 5px 0;

    font-size: 12px;
    line-height: 1.4;
}

.deck-optimized-difference {
    color: #47ad80;
    font-weight: 700;
}

/* Full card image in owned alternatives */

.deck-alternative-card-image {
    display: block;

    width: 160px;
    max-width: 100%;

    height: auto;
    max-height: none;

    object-fit: contain;

    margin: 12px 0;

    border-radius: 8px;
}

/* Full card image in proposed replacement */

.deck-optimized-image {
    width: 120px;
    max-width: 100%;

    height: auto;
    max-height: none;

    object-fit: contain;
}

/* =========================================
   IMAGES FOR YOUR OWNED PRINTINGS
   ========================================= */

.deck-owned-printings li {
    display: flex;

    align-items: flex-start;

    gap: 14px;

    margin: 12px 0;

    line-height: 1.5;
}

.deck-owned-printing-image {
    display: block;

    width: 120px;

    max-width: 100%;

    height: auto;

    max-height: none;

    object-fit: contain;

    flex-shrink: 0;

    border-radius: 8px;
}

/* Each alternative printing and its own image */

.deck-alternative-printings {
    padding-left: 0;
    margin-top: 14px;
    list-style: none;
}

.deck-alternative-printings li {
    display: flex;
    align-items: flex-start;
    gap: 14px;

    margin: 14px 0;
    padding: 12px;

    border: 1px solid
        color-mix(in srgb, currentColor 15%, transparent);

    border-radius: 8px;
}

.deck-alternative-printing-image {
    display: block;

    width: 120px;
    max-width: 100%;
    height: auto;
    max-height: none;

    object-fit: contain;
    flex-shrink: 0;

    border-radius: 8px;
}

/* =========================================
   ONE CARD IMAGE PER ALTERNATIVE PRINTING
   ========================================= */

.deck-alternative-printings {
    list-style: none;
    padding-left: 0;
    margin: 14px 0 0;
}

.deck-alternative-printings li {
    display: flex;
    align-items: flex-start;
    gap: 16px;

    margin: 14px 0;
    padding: 14px;

    border: 1px solid
        color-mix(
            in srgb,
            currentColor 18%,
            transparent
        );

    border-radius: 10px;
}

.deck-alternative-printing-image {
    display: block;

    width: 140px;
    height: auto;
    max-height: none;

    object-fit: contain;
    flex-shrink: 0;

    border-radius: 8px;
}

.deck-alternative-printing-info {
    min-width: 0;
}

.deck-alternative-printing-info p {
    margin: 8px 0;
    line-height: 1.5;
}

@media (max-width: 550px) {
    .deck-alternative-printings li {
        flex-direction: column;
    }
}

/* =========================================
   PRINTING SELECTION
   ========================================= */

.deck-choose-printing-button {
    display: inline-block;

    width: auto;
    margin-top: 10px;
    padding: 8px 12px;

    font-size: 12px;

    background: transparent;
    color: var(--accent);

    border: 1px solid var(--accent);
    border-radius: 6px;
}

.deck-choose-printing-button:hover {
    background: var(--accent);
    color: var(--background);
}

.deck-choose-printing-button.selected {
    background: var(--accent);
    color: var(--background);
}

.deck-printing-choice-message {
    margin: 10px 0;

    color: var(--accent);

    font-size: 12px;
    font-weight: 700;
}

/* Let the button wrap below an
   owned printing's image and text */

.deck-owned-printings li {
    flex-wrap: wrap;
}

/* =========================================
   COLLECTION CARD PRICES
   ========================================= */

.collection-card-price {
    margin-top: 6px;

    color: var(--accent);

    font-size: 12px;
    font-weight: 600;

    line-height: 1.5;
}

.hidden-file-input {
    display: none !important;
}

.add-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

/* =========================================
   COMPACT HEADER ACCOUNT
   ========================================= */

.header-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-top .brand {
    margin-right: auto;
}

#account.header-account {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;

    margin: 0;
    padding: 0;

    background: transparent;
    border: none;
    box-shadow: none;
}

.header-account #accountStatus {
    margin: 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.header-account .account-fields {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.header-account input {
    width: 150px;
    padding: 9px 12px;
    font-size: 13px;
}

.header-account button {
    padding: 9px 14px;
    font-size: 13px;
    white-space: nowrap;
}

/* Signed-in users only need Sign Out */

.header-account.is-signed-in .account-fields {
    display: none;
}

/* Signed-out users don't need Sign Out */

.header-account:not(.is-signed-in) #signOutButton {
    display: none;
}

/* Smaller screens */

@media (max-width: 900px) {
    #account.header-account {
        width: 100%;
        justify-content: flex-start;
        order: 3;
    }
}

/* Divider in dark mode */

.header-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.12);
    margin: 14px 0 12px;
}

/* Divider in light mode */

[data-theme="light"] .header-divider {
    background-color: rgba(0, 0, 0, 0.15);
}

/* =========================================
   COLLECTION PAGINATION
   ========================================= */

.collection-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 12px;
    margin-top: 22px;
    padding: 12px;
}

.collection-pagination button,
.collection-pagination select {
    padding: 8px 12px;

    border: 1px solid currentColor;
    border-radius: 8px;

    background: transparent;
    color: inherit;

    font: inherit;
    cursor: pointer;
}

.collection-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.collection-pagination label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Destructive collection action */

.clear-collection-button {
    background: transparent;
    color: #e57373;

    border: 1px solid currentColor;
    border-radius: 8px;

    padding: 10px 15px;

    font: inherit;
    cursor: pointer;
}

[data-theme="light"] .clear-collection-button {
    color: #b42318;
}

.clear-collection-button:hover {
    background: rgba(229, 115, 115, 0.12);
}

.clear-collection-button:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* =========================================
   READABLE COLLECTION PAGE SELECTORS
   ========================================= */

/* Dark mode */

.collection-pagination select {
    background-color: #303747;
    color: #ffffff;

    border: 1px solid #788397;
    border-radius: 8px;

    padding: 8px 12px;
    cursor: pointer;
}

.collection-pagination select option {
    background-color: #303747;
    color: #ffffff;
}

/* Light mode */

[data-theme="light"] .collection-pagination select {
    background-color: #ffffff;
    color: #202838;

    border-color: #9299a8;
}

[data-theme="light"] .collection-pagination select option {
    background-color: #ffffff;
    color: #202838;
}

/* =========================================
   SOLID COLLECTION PAGINATION BUTTONS
   ========================================= */

.collection-pagination button {
    background-color: #8ce5c1;
    color: #17212c;

    border: 1px solid #8ce5c1;
    border-radius: 8px;

    padding: 9px 16px;
    font-weight: 600;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

/* Hover effect */

.collection-pagination button:not(:disabled):hover {
    background-color: #aaf0d5;
    transform: translateY(-2px);
}

/* Disabled Previous / Next */

.collection-pagination button:disabled {
    background-color: #414958;
    color: #9ca5b5;
    border-color: #414958;

    opacity: 1;
    cursor: not-allowed;
}

/* Disabled buttons in light mode */

[data-theme="light"] .collection-pagination button:disabled {
    background-color: #e2e5e9;
    color: #8a929e;
    border-color: #e2e5e9;
}

/* =========================================
   ORIGINAL REQUESTED DECK PRINTING
   ========================================= */

.deck-requested-printing {
    display: flex;
    align-items: center;
    gap: 14px;

    margin: 12px 0;
    padding: 12px;

    border: 1px solid var(--border, #454d5c);
    border-radius: 10px;
}

.deck-requested-image {
    width: 100px;
    height: auto;

    border-radius: 7px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .deck-requested-image {
        width: 75px;
    }
}

/* =========================================
   FLOATING DECK CARD PREVIEW
   ========================================= */

.deck-requested-image,
.deck-optimized-image,
.deck-owned-printing-image,
.deck-alternative-printing-image {
    cursor: zoom-in;
}

.deck-card-preview {
    position: fixed;
    display: none;

    z-index: 99999;
    pointer-events: none;

    padding: 8px;

    background: #ffffff;
    border: 1px solid #d6d6d6;
    border-radius: 13px;

    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

.deck-card-preview img {
    display: block;

    width: 300px;
    max-width: calc(100vw - 48px);
    max-height: 75vh;

    height: auto;
    object-fit: contain;

    background: #ffffff;
    border-radius: 8px;
}

/* =========================================
   COLLECTION CARD THUMBNAILS
   ========================================= */

.collection-card-thumbnail {
    width: 42px;
    height: auto;

    border-radius: 4px;
    flex-shrink: 0;

    cursor: zoom-in;
}

.collection-card-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =========================================
   COMPACT COLLECTION CARD IMAGES
   ========================================= */

.collection-card-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.collection-card-details {
    min-width: 0;
}

.collection-card-thumbnail {
    width: 42px;
    height: 59px;

    object-fit: contain;

    background-color: #ffffff;
    border-radius: 4px;

    flex-shrink: 0;
    cursor: zoom-in;
}

/* =========================================
   COLLECTION SEARCH FILTERS
   ========================================= */

.collection-card-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;

    gap: 14px;
    margin: 14px 0 20px;
}

.collection-card-filters label {
    display: flex;
    flex-direction: column;

    gap: 6px;
    font-size: 0.9rem;
}

.collection-card-filters select {
    min-width: 145px;
    padding: 9px 12px;

    border: 1px solid #788397;
    border-radius: 8px;

    background-color: #303747;
    color: #ffffff;

    color-scheme: dark;
    font: inherit;
    cursor: pointer;
}

.collection-card-filters select option {
    background-color: #303747;
    color: #ffffff;
}

[data-theme="light"]
.collection-card-filters select {
    background-color: #ffffff;
    color: #202838;

    border-color: #9299a8;
    color-scheme: light;
}

[data-theme="light"]
.collection-card-filters select option {
    background-color: #ffffff;
    color: #202838;
}

/* =========================================
   COLLAPSIBLE COLLECTION FILTER MENU
   ========================================= */

.collection-filter-menu {
    margin: 12px 0 18px;
}

.collection-filter-menu > summary {
    display: inline-block;

    padding: 10px 16px;

    background-color: #8ce5c1;
    color: #17212c;

    border-radius: 8px;

    font-weight: 600;
    cursor: pointer;

    list-style: none;
    user-select: none;
}

.collection-filter-menu > summary::-webkit-details-marker {
    display: none;
}

.collection-filter-menu > summary:hover {
    background-color: #aaf0d5;
}

.collection-filter-menu[open] > summary {
    background-color: #aaf0d5;
}

/* Filter options revealed below the button */

.collection-filter-menu .collection-card-filters {
    padding: 16px;
    margin-top: 10px;

    border: 1px solid #788397;
    border-radius: 10px;

    background-color: #252c3a;
}

[data-theme="light"]
.collection-filter-menu .collection-card-filters {
    background-color: #f1f3f6;
    border-color: #d1d5db;
}

/* =========================================
   LEFT-ALIGNED FLOATING FILTER MENU
   ========================================= */

.collection-filter-menu {
    position: relative;

    display: block;
    width: 100%;

    margin: 10px 0 18px;
    text-align: left;

    align-self: stretch;
}

/* Keep the button small and on the left */

.collection-filter-menu > summary {
    display: inline-flex;
    align-items: center;

    width: fit-content;
    margin: 0;
}

/* Float the options over the page */

.collection-filter-menu .collection-card-filters {
    position: absolute;

    top: calc(100% + 8px);
    left: 0;

    z-index: 1000;

    width: min(520px, calc(100vw - 32px));
    box-sizing: border-box;

    margin: 0;  

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.35);
}