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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #f1f1f1;
    min-height: 100vh;
    padding-bottom: 40px;
}

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

header {
    text-align: center;
    padding: 30px 10px 25px;
    background: linear-gradient(135deg, #1a1a4e 0%, #2d1b69 30%, #1a3a5c 70%, #162447 100%);
    border-radius: 18px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.15);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header-pokemon-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Pokeball SVG background decorations (subtle/ghosted) */
.header-pokemon-bg .pokeball-bg {
    position: absolute;
    opacity: 0.08;
}
.header-pokemon-bg .pokeball-bg.pb1 {
    left: -15px; top: 50%; transform: translateY(-50%) rotate(-15deg); width: 130px; height: 130px;
}
.header-pokemon-bg .pokeball-bg.pb2 {
    right: -20px; bottom: -15px; transform: rotate(20deg); width: 110px; height: 110px;
}
.header-pokemon-bg .pokeball-bg.pb3 {
    right: 30%; top: -25px; transform: rotate(10deg); width: 80px; height: 80px;
}
.header-pokemon-bg .pokeball-bg.pb4 {
    left: 25%; bottom: -20px; transform: rotate(-25deg); width: 70px; height: 70px; opacity: 0.05;
}

/* Real cartoon Pokemon character images */
.header-pokemon-bg .pokemon-char {
    position: absolute;
    bottom: 5px;
    height: auto;
    z-index: 1;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}
.header-pokemon-bg .pokemon-char:hover {
    transform: scale(1.08) translateY(-2px);
}
.header-pokemon-bg .pokemon-pikachu {
    right: 8px;
    width: 88px;
}
.header-pokemon-bg .pokemon-psyduck {
    left: 8px;
    width: 78px;
}
.header-pokemon-bg .pokemon-togepi {
    left: 50%;
    transform: translateX(-50%);
    bottom: -2px;
    width: 62px;
    opacity: 0.9;
}
.header-pokemon-bg .pokemon-togepi:hover {
    transform: translateX(-50%) scale(1.08) translateY(-2px);
}

/* Pokeball PNG accents (floating) */
.header-pokemon-bg .pokeball-accent {
    position: absolute;
    z-index: 1;
    opacity: 0.5;
    width: 28px;
}
.header-pokemon-bg .pokeball-accent.pba1 {
    top: 8px; left: 18%;
    animation: float-pokeball 4s ease-in-out infinite;
}
.header-pokemon-bg .pokeball-accent.pba2 {
    width: 22px; top: 12px; right: 22%;
    animation: float-pokeball 4s ease-in-out infinite 1.5s;
}

@keyframes float-pokeball {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(15deg); }
}

/* Floating sparkles */
.header-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    opacity: 0;
    animation: sparkle 3s ease-in-out infinite;
    z-index: 2;
}
.header-sparkle:nth-child(1) { left: 20%; top: 20%; animation-delay: 0s; }
.header-sparkle:nth-child(2) { left: 45%; top: 60%; animation-delay: 0.8s; }
.header-sparkle:nth-child(3) { left: 70%; top: 25%; animation-delay: 1.6s; }
.header-sparkle:nth-child(4) { left: 85%; top: 50%; animation-delay: 2.2s; }
.header-sparkle:nth-child(5) { left: 35%; top: 35%; animation-delay: 1.2s; width: 3px; height: 3px; }

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 3;
    text-shadow: none;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo-link {
    display: inline-block;
    position: relative;
    z-index: 3;
    text-decoration: none;
    margin-bottom: 4px;
}

.header-logo {
    width: min(420px, 85vw);
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.3));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.header-logo:hover {
    filter: drop-shadow(0 4px 16px rgba(255, 215, 0, 0.5));
    transform: scale(1.03);
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    position: relative;
    z-index: 3;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.sync-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
}

.sync-indicator.synced { background: #00ff88; }
.sync-indicator.syncing { background: #ffaa00; animation: pulse 1s infinite; }
.sync-indicator.error { background: #ff4444; }

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

/* Block selection buttons */
.block-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

@media (max-width: 767px) {
    .block-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        overflow-x: visible;
    }
    .block-btn {
        min-width: unset;
        padding: 10px;
    }
    .block-btn-logo-wrapper { height: 35px; margin-bottom: 4px; }
    .block-btn-logo { max-height: 35px; }
    .block-btn-name { font-size: 0.8rem; margin-bottom: 4px; }
    .block-btn-stats { font-size: 0.65rem; }
    .block-btn-progress { margin-top: 6px; }
    .block-buttons.has-selection .block-btn:not(.active),
    .set-buttons.has-selection .set-btn:not(.active) {
        display: none;
    }
    .block-buttons.has-selection,
    .set-buttons.has-selection {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .block-buttons {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
        overflow-x: visible;
    }
}

.block-btn {
    --block-color: #888;
    padding: 20px;
    border: 3px solid;
    border-radius: 16px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--block-color) 35%, transparent) 0%,
        color-mix(in srgb, var(--block-color) 25%, transparent) 50%,
        color-mix(in srgb, var(--block-color) 35%, transparent) 100%);
    border-color: color-mix(in srgb, var(--block-color) 50%, transparent);
}

.block-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--block-color) 20%, transparent),
        color-mix(in srgb, var(--block-color) 15%, transparent));
    opacity: 0;
    transition: opacity 0.3s;
}

.block-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.block-btn:hover::before {
    opacity: 1;
}

.block-btn.active {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.block-btn.active::before {
    opacity: 1;
}

.block-btn:active {
    transform: scale(0.98);
}

@media (max-width: 767px) {
    .block-btn.active {
        transform: none;
        box-shadow: 0 0 0 2px var(--block-color), 0 4px 16px rgba(0,0,0,0.5);
    }
}

.block-btn-content {
    position: relative;
    z-index: 1;
}

.block-btn-logo-wrapper {
    width: 100%;
    height: 50px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-btn-logo {
    max-width: 100%;
    max-height: 50px;
    object-fit: contain;
}

.block-btn-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.block-btn-stats {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 4px;
}

.block-btn.active .block-btn-stats {
    opacity: 0.9;
}

/* Set selection buttons */
.set-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 260px));
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
}

/* Custom Sets centering fix — auto-fit ensures columns collapse to center with few items */
#custom-sets-content .set-buttons {
    grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
}

/* Hierarchical set buttons for Pokemon TCG (hidden until block selected) */
#pokemon-tcg-content .set-buttons {
    display: none;
}

#pokemon-tcg-content .set-buttons.active {
    display: grid;
    animation: slideDown 0.3s ease-out;
}

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

.set-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, var(--set-accent, rgba(255,255,255,0.08)) 100%);
    border-left: 3px solid var(--set-border, transparent);
    color: #f1f1f1;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.set-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

.set-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    border-left-color: transparent;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    filter: none;
    transform: none;
}

/* Keep logo fully visible on active button — active state indicated by border/glow */
.set-btn.active .set-btn-logo {
    opacity: 1;
}

.set-btn-logo-wrapper {
    position: relative;
    width: 100%;
    height: 100px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.set-btn-logo {
    width: 100%;
    height: 100px;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    transition: opacity 0.3s ease;
}

/* When a real image replaces the SVG, blend it with the dark background
   so rectangular product images don't look like hard-edged boxes */
.set-btn-logo.logo-loaded {
    mix-blend-mode: lighten;
}

.set-btn-logo-fallback {
    font-size: 2.5rem;
    opacity: 0.9;
    filter: grayscale(30%);
    z-index: 1;
    display: block;
}

.set-btn-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.set-btn .set-release-date {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 2px;
}

/* Top-level tab bar */
.top-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 4px;
}

.top-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(241, 241, 241, 0.5);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.top-tab:hover {
    color: rgba(241, 241, 241, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.top-tab.active {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f1f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.top-tab-divider {
    width: 100%;
    height: 1px;
    margin: 2px 0;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.top-tab-utility {
    flex: 1;
    font-size: 0.85rem;
    color: rgba(241, 241, 241, 0.4);
}

.top-tab-utility.active {
    background: rgba(37, 99, 235, 0.25);
    color: #93bbfc;
}

.top-tab-content {
    display: none;
    overflow: hidden;
}

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

@media (max-width: 768px) {
    .top-tabs {
        gap: 3px;
        padding: 3px;
    }

    .top-tab {
        padding: 8px 8px;
        font-size: 0.78rem;
    }

    .top-tab-utility {
        font-size: 0.75rem;
    }
}

.placeholder-content {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.placeholder-content h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    opacity: 0.9;
}

.placeholder-content p {
    font-size: 0.95rem;
    opacity: 0.5;
    line-height: 1.6;
}

.placeholder-content .coming-soon-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 16px;
}

.coming-soon-badge.custom-sets {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.coming-soon-badge.lorcana {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
}

/* Inline progress bar in set buttons */
.set-btn-progress {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.set-btn-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00d4ff);
    transition: width 0.3s;
    border-radius: 4px;
}

.set-btn.active .set-btn-progress {
    background: rgba(255, 255, 255, 0.25);
}

.set-btn.active .set-btn-progress-fill {
    background: linear-gradient(90deg, #fff, #e0e0e0);
}

.set-btn-stats {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}

.set-btn.active .set-btn-stats {
    opacity: 0.95;
}

.block-btn-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.block-btn-progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.3s;
    border-radius: 4px;
}

.block-btn.active .block-btn-progress-fill {
    background: rgba(255, 255, 255, 0.9);
}

/* Helper text for navigation guidance */
.helper-text {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
    font-style: italic;
}


/* Set selection section header */
.set-selection-header {
    display: none;
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.set-selection-header.active {
    display: block;
}

.set-selection-title {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.set-section {
    display: none;
}

.set-section.active {
    display: block;
}

/* Set view tabs (Cards / Sealed Products) */
.set-view-tabs {
    display: flex;
    gap: 2px;
    margin: 0 auto 16px auto;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
}

.set-view-tab {
    padding: 7px 20px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: rgba(241, 241, 241, 0.55);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}

.set-view-tab:hover {
    color: rgba(241, 241, 241, 0.8);
    background: rgba(255, 255, 255, 0.06);
}

.set-view-tab.active {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f1f1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.set-view-content {
    display: none;
}

.set-view-content.active {
    display: block;
}

/* Sealed Products grid */
.sealed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.sealed-item {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s;
}

.sealed-item:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.sealed-item.owned {
    background: rgba(0, 255, 136, 0.07);
    border-color: rgba(0, 255, 136, 0.25);
}

.sealed-img-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.sealed-img-wrapper > img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Real product image overlaid on styled thumb */
.sealed-product-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0d1b2a;
}

/* Styled thumbnail for fallback sealed products */
.sealed-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(145deg, #0d1b2a, #0d1b2a);
    box-shadow: inset 0 0 60px 10px var(--thumb-color);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.sealed-thumb-symbol {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.6));
    opacity: 0.9;
}

.sealed-thumb-icon {
    font-size: 1.3rem;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.sealed-img-placeholder {
    font-size: 2.5rem;
    opacity: 0.5;
}

.sealed-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sealed-name {
    font-size: 0.83rem;
    font-weight: 500;
    line-height: 1.3;
    color: #f1f1f1;
}

.sealed-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sealed-qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.sealed-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    color: #f1f1f1;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
    padding: 0;
}

.sealed-qty-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
}

.sealed-qty-value {
    font-size: 1rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    color: #f1f1f1;
}

.sealed-item.owned .sealed-qty-value {
    color: #00ff88;
}

.sealed-empty,
.sealed-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: rgba(241, 241, 241, 0.45);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Card controls: filters and search */
.card-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    justify-content: center;
}

.filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f1f1f1;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.search-container {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f1f1f1;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-clear:hover {
    color: rgba(255, 255, 255, 0.8);
}

.search-clear.visible {
    display: flex;
}

/* Rarity filter toggle buttons */
.rarity-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    justify-content: center;
}

.rarity-btn {
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(241, 241, 241, 0.6);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.rarity-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(241, 241, 241, 0.85);
}

.rarity-btn.active {
    background: rgba(102, 126, 234, 0.35);
    border-color: rgba(102, 126, 234, 0.6);
    color: #f1f1f1;
    box-shadow: 0 1px 6px rgba(102, 126, 234, 0.25);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.card-item,
.card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px;
    transition: all 0.2s;
    font-size: 0.85rem;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
}

.card-item:hover,
.card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.card-item.all-collected,
.card.completed {
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    opacity: 0.55;
    transition: opacity 0.2s;
}

.card-item.all-collected:hover,
.card.completed:hover {
    opacity: 0.85;
}

.card-item.all-collected .card-img-wrapper img,
.card.completed .card-img-wrapper img {
    filter: saturate(0.4) brightness(0.85);
    transition: filter 0.2s;
}

.card-item.all-collected:hover .card-img-wrapper img,
.card.completed:hover .card-img-wrapper img {
    filter: saturate(0.7) brightness(0.95);
}

/* Lock badge on completed cards */
.completed-lock {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    color: #00ff88;
    opacity: 0.7;
    margin-top: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completed-lock svg {
    width: 10px;
    height: 10px;
    fill: #00ff88;
}

/* Unlock confirmation toast */
.unlock-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #16213e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease;
    max-width: 340px;
    width: calc(100% - 40px);
}

.unlock-toast.visible {
    transform: translateX(-50%) translateY(0);
}

.unlock-toast-text {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.3;
}

.unlock-toast-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.unlock-toast-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.unlock-toast-btn.confirm {
    background: rgba(255, 68, 68, 0.8);
    color: #fff;
}

.unlock-toast-btn.confirm:hover {
    background: rgba(255, 68, 68, 1);
}

.unlock-toast-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f1f1;
}

.unlock-toast-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Card Detail Modal */
.card-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-modal.visible {
    display: flex;
    opacity: 1;
}

.card-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    touch-action: pan-y pinch-zoom;
}

.card-modal.visible .card-modal-content {
    transform: scale(1);
}

.card-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #f1f1f1;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.card-modal-close:hover {
    background: rgba(255, 68, 68, 0.8);
    transform: rotate(90deg);
}

.card-modal-body {
    display: flex;
    gap: 24px;
    padding: 24px;
}

.card-modal-image {
    flex-shrink: 0;
    width: 300px;
}

.card-modal-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.card-modal-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f1f1;
    margin-bottom: 4px;
}

.card-modal-number {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.card-modal-set {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.card-modal-rarity {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.card-modal-variants {
    margin-top: 8px;
}

.card-modal-variants-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.card-modal-variant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-modal-variant-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

.card-modal-variant-item.collected {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
}

.card-modal-variant-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Mobile responsive modal */
@media (max-width: 768px) {
    .card-modal-body {
        flex-direction: column;
        padding: 16px;
    }

    .card-modal-image {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .card-modal-title {
        font-size: 1.2rem;
    }

    .card-modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
}

/* Responsive design for block and set buttons */
@media (max-width: 768px) {
    .set-buttons {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    .set-btn { padding: 10px 8px; }
    .set-btn-logo-wrapper { height: 60px; }
    .set-btn-logo { height: 60px; }
    .set-btn-name { font-size: 0.8rem; }
}

/* Card image support */
.card-img-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.04);
    position: relative;
}
.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.card-item:hover .card-img-wrapper img,
.card:hover .card-img-wrapper img {
    transform: scale(1.03);
}
.card-img-wrapper .card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    opacity: 0.3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

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

.tcgplayer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: #2563eb;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.tcgplayer-link:hover {
    background: #1d4ed8;
}

.tcgplayer-link svg {
    width: 16px;
    height: 16px;
}

.card-number {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-bottom: 2px;
}

.card-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rarity-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Main set rarities */
.rarity-common { background: #666; }
.rarity-uncommon { background: #4a9eff; }
.rarity-rare { background: #9d4aff; }

/* EX and basic special */
.rarity-ex { background: #ff6b6b; }
.rarity-trainer { background: #ff9500; }
.rarity-energy { background: #48c774; }

/* Secret rare types (all get special styling) */
.rarity-secret { background: linear-gradient(45deg, #ffd700, #ffed4e); color: #000; }
.rarity-illustration-rare { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
}
.rarity-special-illustration-rare { 
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); 
}
.rarity-ultra-rare {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.rarity-rare-holo-gx {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
}
.rarity-hyper-rare { 
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); 
    color: #000;
}
.rarity-double-rare { 
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); 
}
.rarity-trainer-ultra-rare { 
    background: linear-gradient(135deg, #ff9a56 0%, #ffecd2 100%); 
    color: #000;
}
.rarity-gold-secret { 
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%); 
}

/* Special mechanic rarities */
.rarity-ace-spec { 
    background: linear-gradient(135deg, #000000 0%, #434343 100%); 
    border: 2px solid #ffd700;
}
.rarity-radiant { 
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%); 
    color: #000;
}
.rarity-amazing-rare { 
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%); 
}
.rarity-shiny-rare { 
    background: linear-gradient(135deg, #c0c0c0 0%, #ffffff 100%); 
    color: #000;
}
.rarity-promo {
    background: linear-gradient(135deg, #ff512f 0%, #dd2476 100%);
}
.rarity-rare-holo {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
}

/* Lorcana-specific rarities */
.rarity-super-rare {
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
}
.rarity-legendary {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
}
.rarity-enchanted {
    background: linear-gradient(135deg, #c084fc 0%, #ec4899 50%, #f59e0b 100%);
}
.rarity-epic {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}
.rarity-iconic {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 30%, #ffffff 50%, #fbbf24 70%, #f59e0b 100%);
    color: #000;
}
.rarity-special {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
}

.region-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
}

/* Language sub-tab toggle for custom sets with mixed EN/JP cards */
.lang-toggle {
    display: flex;
    gap: 2px;
    margin: 0 auto 12px auto;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 3px;
    width: fit-content;
}

.lang-toggle-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(241, 241, 241, 0.45);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-toggle-btn:hover {
    color: rgba(241, 241, 241, 0.7);
    background: rgba(255, 255, 255, 0.05);
}

.lang-toggle-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f1f1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.lang-toggle-btn .lang-count {
    font-size: 0.65rem;
    opacity: 0.6;
    font-weight: 400;
}

.lang-toggle-btn.active .lang-count {
    opacity: 0.8;
}

.card-origin {
    font-size: 0.6rem;
    opacity: 0.45;
    padding: 2px 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.variants-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 6px;
}

.variants-title {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-bottom: 4px;
    text-transform: uppercase;
    display: none; /* Hide "VARIANTS:" label to save space */
}

.variant-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.variant-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.variant-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
}

.variant-checkbox.checked {
    background: rgba(0, 255, 136, 0.2);
}

.variant-checkbox input {
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.variant-checkbox label {
    font-size: 0.7rem;
    flex: 1;
}

.variant-tcgplayer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    color: #888;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 3px;
    margin-left: auto;
}

.variant-tcgplayer-link:hover {
    color: #4a9eff;
    background: rgba(74, 158, 255, 0.1);
}

.variant-tcgplayer-link svg {
    display: block;
}

.single-variant {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
}

.single-variant.checked {
    background: rgba(0, 255, 136, 0.2);
}

.single-variant input {
    width: 14px;
    height: 14px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: #16213e;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 100%;
}

.modal-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #00ff88;
}

.modal-text {
    margin-bottom: 20px;
    opacity: 0.9;
    line-height: 1.5;
}

.modal-input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #f1f1f1;
    font-size: 1rem;
    margin-bottom: 15px;
}

.modal-input:focus {
    outline: none;
    border-color: #00ff88;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #00ff88, #00d4ff);
    color: #000;
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.error-text {
    color: #ff4444;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* ── Auth modal ─────────────────────────────────────────────── */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.auth-modal-content {
    background: #16213e;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 100%;
}

.auth-modal-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #00ff88;
}

.auth-modal-text {
    margin-bottom: 20px;
    opacity: 0.9;
    line-height: 1.5;
}

.auth-input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #f1f1f1;
    font-size: 1rem;
    margin-bottom: 12px;
}

.auth-input:focus {
    outline: none;
    border-color: #00ff88;
}

.auth-error {
    color: #ff4444;
    font-size: 0.85rem;
    min-height: 1.2em;
    margin-bottom: 8px;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.auth-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: #f1f1f1;
}

.auth-btn.primary {
    background: linear-gradient(135deg, #00ff88, #00d4ff);
    color: #000;
    border: none;
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.auth-btn.google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: #333;
    border: none;
    margin-bottom: 12px;
}

.auth-btn.google:hover {
    background: #f0f0f0;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.auth-links a {
    color: #00d4ff;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ── User header bar ────────────────────────────────────────── */
.user-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(0, 255, 136, 0.08);
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 8px;
}

.user-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-display-name {
    font-weight: 600;
    color: #00ff88;
}

.user-collection-name {
    opacity: 0.7;
    font-size: 0.85rem;
}

.user-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-bar-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: #f1f1f1;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-bar-btn:hover {
    background: rgba(255,255,255,0.1);
}

.user-bar-btn.gear {
    padding: 5px 8px;
    font-size: 1rem;
}

@media (max-width: 767px) {
    .user-bar-right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .sync-status {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

/* ── Invite banner ──────────────────────────────────────────── */
.invite-banner {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: #16213e;
    border: 1px solid #00ff88;
    border-radius: 10px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    transition: top 0.3s ease;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.invite-banner.visible {
    top: 16px;
}

.invite-banner-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.3;
}

.invite-banner-actions {
    display: flex;
    gap: 6px;
}

.invite-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.invite-btn.accept {
    background: #00ff88;
    color: #000;
}

.invite-btn.decline {
    background: rgba(255,255,255,0.1);
    color: #f1f1f1;
}

/* ── Collection switcher panel ──────────────────────────────── */
.collection-panel {
    position: fixed;
    top: 0;
    right: -350px;
    width: 340px;
    height: 100%;
    background: #16213e;
    z-index: 10002;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.collection-panel.open {
    right: 0;
}

.collection-panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collection-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00ff88;
}

.collection-panel-close {
    background: none;
    border: none;
    color: #f1f1f1;
    font-size: 1.5rem;
    cursor: pointer;
}

.collection-panel-body {
    padding: 16px 20px;
    flex: 1;
}

.collection-list-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: background 0.15s;
}

.collection-list-item:hover {
    background: rgba(255,255,255,0.05);
}

.collection-list-item.active {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.08);
}

.collection-list-item-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.collection-list-item-role {
    font-size: 0.75rem;
    opacity: 0.6;
}

.collection-panel-actions {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.collection-action-btn {
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: transparent;
    color: #f1f1f1;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.collection-action-btn:hover {
    background: rgba(255,255,255,0.08);
}

.collection-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10001;
}

.collection-panel-overlay.open {
    display: block;
}

@media (max-width: 768px) {
    h1 { font-size: 1.3rem; }
    .header-logo { width: min(300px, 80vw); }
    .header-pokemon-bg .pokemon-pikachu { width: 58px; right: 3px; }
    .header-pokemon-bg .pokemon-psyduck { width: 52px; left: 3px; }
    .header-pokemon-bg .pokemon-togepi { width: 42px; }
    .header-pokemon-bg .pokeball-accent { display: none; }
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    .sealed-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .set-buttons { grid-template-columns: 1fr; }
    .card-item,
    .card {
        padding: 5px;
        font-size: 0.75rem;
    }
    .card-name {
        font-size: 0.75rem;
    }
    .card-number {
        font-size: 0.65rem;
    }
    .rarity-badge {
        font-size: 0.55rem;
        padding: 1px 4px;
    }
    .variant-checkbox {
        padding: 2px 4px;
        font-size: 0.65rem;
    }
    .variant-checkbox label {
        font-size: 0.6rem;
    }
    .variant-checkbox input {
        width: 12px;
        height: 12px;
    }
    .card-controls {
        flex-direction: column;
        gap: 8px;
    }
    .filter-buttons {
        width: 100%;
        justify-content: center;
    }
    .rarity-filters {
        gap: 4px;
        justify-content: center;
    }
    .rarity-btn {
        padding: 3px 8px;
        font-size: 0.6rem;
    }
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    .search-container {
        max-width: 100%;
    }
    .search-input {
        font-size: 0.8rem;
        padding: 6px 32px 6px 10px;
    }
}

/* Price tags on card grid */
.price-tag {
    display: none;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(0, 200, 83, 0.25);
    color: #69f0ae;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.price-tag.loaded {
    display: inline-block;
    opacity: 1;
}

/* Market price in card modal */
.card-modal-price {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-price-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.modal-price-value {
    font-size: 1rem;
    font-weight: 700;
    color: #69f0ae;
}

/* Collection value in set buttons */
.set-btn-value {
    font-size: 0.65rem;
    color: #69f0ae;
    margin-top: 4px;
    font-weight: 600;
    opacity: 0.8;
}

/* Footer Styles */
.app-footer {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.6);
    padding: 12px 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-text {
    color: rgba(255, 255, 255, 0.5);
}

.footer-separator {
    color: rgba(255, 255, 255, 0.3);
}

.footer-link {
    color: rgba(100, 181, 246, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #64b5f6;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .app-footer {
        padding: 10px 15px;
        font-size: 0.7rem;
    }
}

/* ===== Store Hunter ===== */

.sf-search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 12px;
}

.sf-locate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sf-locate-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.sf-address-wrap {
    display: flex;
    flex: 1;
    min-width: 200px;
    gap: 0;
}

.sf-address-input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: #f1f1f1;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.sf-address-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.sf-address-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(37, 99, 235, 0.5);
}

.sf-address-search-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0 8px 8px 0;
    color: #f1f1f1;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sf-address-search-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.sf-radius-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.sf-radius-select {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f1f1f1;
    font-size: 0.85rem;
    cursor: pointer;
}

.sf-status-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.sf-status-error {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff8888;
}

.sf-status-info {
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #93bbfc;
}

.sf-map-wrap {
    position: relative;
    margin-bottom: 12px;
}

.sf-map {
    height: 420px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.sf-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #f1f1f1;
    font-size: 0.9rem;
    z-index: 2;
}

.sf-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: sf-spin 0.8s linear infinite;
}

@keyframes sf-spin {
    to { transform: rotate(360deg); }
}

.sf-list-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.sf-list-header {
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sf-store-list {
    max-height: 420px;
    overflow-y: auto;
}

.sf-store-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s;
}

.sf-store-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.sf-store-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sf-store-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f1f1;
}

.sf-store-dist {
    font-size: 0.75rem;
    font-weight: 700;
    color: #3b82f6;
    white-space: nowrap;
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.15);
    border-radius: 10px;
}

.sf-store-addr {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.sf-store-hours {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

/* Store links */
.sf-store-links {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.sf-store-link {
    font-size: 0.75rem;
    color: rgba(100, 181, 246, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.sf-store-link:hover {
    color: #64b5f6;
    text-decoration: underline;
}

/* Popup links */
.sf-popup-links {
    margin-top: 6px;
    font-size: 0.8rem;
}

.sf-popup-links a {
    color: #2563eb;
    text-decoration: none;
}

.sf-popup-links a:hover {
    text-decoration: underline;
}

/* Disclaimer */
.sf-disclaimer {
    text-align: center;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    padding: 10px 16px;
    font-style: italic;
}

/* Leaflet popup overrides */
.sf-popup-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.sf-popup-addr,
.sf-popup-hours {
    font-size: 0.8rem;
    color: #555;
}

.sf-popup-dist {
    font-size: 0.78rem;
    color: #2563eb;
    font-weight: 600;
    margin-top: 2px;
}

/* ===== Pokemon Symbol Identifier ===== */

.si-search-bar {
    margin-bottom: 10px;
}

.si-search-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #f1f1f1;
    font-size: 0.85rem;
    box-sizing: border-box;
    transition: all 0.2s;
}

.si-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.si-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(37, 99, 235, 0.5);
}

.si-description {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 16px;
    font-style: italic;
}

/* Loading / error / empty states */
.si-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.si-error,
.si-empty {
    text-align: center;
    padding: 48px 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.si-error {
    color: #ff8888;
}

/* Series group */
.si-series-group {
    margin-bottom: 18px;
}

.si-series-header {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    border-left: 3px solid #2563eb;
}

/* Symbol grid */
.si-symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.si-symbol-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    transition: all 0.15s;
    cursor: default;
}

.si-symbol-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.si-symbol-img-wrap {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.si-symbol-img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.si-symbol-code {
    font-size: 0.8rem;
    font-weight: 800;
    color: #93bbfc;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    line-height: 40px;
}

.si-symbol-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

.si-symbol-year {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 2px;
}

/* Mobile overrides */
@media (max-width: 767px) {
    .sf-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .sf-locate-btn {
        justify-content: center;
    }

    .sf-address-wrap {
        min-width: unset;
    }

    .sf-map {
        height: 300px;
    }

    .si-symbol-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 6px;
    }

    .si-symbol-img-wrap {
        width: 34px;
        height: 34px;
    }

    .si-symbol-img {
        max-width: 34px;
        max-height: 34px;
    }

    .si-symbol-name {
        font-size: 0.65rem;
    }
}

/* ── Custom Set Editor Modal ──────────────────────────────────── */
.cse-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 16px;
}
.cse-modal.open { opacity: 1; }

.cse-modal-content {
    background: #1a1a2e;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
}

.cse-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.cse-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}
.cse-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
}
.cse-close:hover { color: #fff; }

.cse-modal-body { padding: 20px; }

.cse-step { display: none; }
.cse-step.active { display: block; }

.cse-form-group {
    margin-bottom: 14px;
}
.cse-form-group label {
    display: block;
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 4px;
}
.cse-form-row {
    display: flex;
    gap: 12px;
}
.cse-form-row .cse-form-group { flex: 1; }

.cse-input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.cse-input:focus {
    outline: none;
    border-color: #2563eb;
}
.cse-textarea {
    min-height: 60px;
    resize: vertical;
}
.cse-color-input {
    width: 48px;
    height: 36px;
    padding: 2px;
    border-radius: 6px;
    cursor: pointer;
}
.cse-logo-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.cse-logo-input-row .cse-input { flex: 1; }
.cse-logo-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #888;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}
.cse-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cse-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.cse-btn.primary {
    background: #2563eb;
    color: #fff;
    width: 100%;
    margin-top: 10px;
}
.cse-btn.primary:hover { background: #1d4fd8; }
.cse-btn.secondary {
    background: rgba(255,255,255,0.1);
    color: #ccc;
}
.cse-btn.secondary:hover { background: rgba(255,255,255,0.15); }

.cse-card-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.cse-selected-count {
    color: #00ff88;
    font-size: 0.9rem;
    font-weight: 600;
}

.cse-set-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.cse-set-selector select { flex: 1.5; }
.cse-picker-search { flex: 1; }

.cse-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    max-height: 45vh;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 4px;
}

.cse-picker-card {
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
    text-align: center;
}
.cse-picker-card:hover {
    border-color: rgba(255,255,255,0.2);
    transform: scale(1.03);
}
.cse-picker-card.selected {
    border-color: #00ff88;
    background: rgba(0,255,136,0.08);
}

.cse-picker-card-img {
    aspect-ratio: 63/88;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 4px;
}
.cse-picker-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cse-picker-card-info {
    font-size: 0.7rem;
    color: #ccc;
    line-height: 1.2;
}
.cse-picker-card-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cse-picker-card-num {
    color: #888;
    font-size: 0.65rem;
}

/* ── Search/Browse Mode Tabs ─────────────────────────────────── */
.cse-mode-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 3px;
}
.cse-mode-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #999;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.cse-mode-tab:hover { color: #ccc; }
.cse-mode-tab.active {
    background: #2563eb;
    color: #fff;
}

/* ── Global Search Input ─────────────────────────────────────── */
.cse-global-search {
    font-size: 1rem !important;
    padding: 12px 14px !important;
    min-height: 44px;
    margin-bottom: 8px;
}

.cse-search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.cse-add-all-btn {
    background: #00c853;
    color: #000;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}
.cse-add-all-btn:hover { background: #00e676; }
.cse-add-all-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
.cse-search-result-count {
    color: #888;
    font-size: 0.8rem;
}
.cse-search-hint {
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    padding: 30px 10px;
}
.cse-no-results {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    padding: 30px 10px;
    grid-column: 1 / -1;
}

/* ── Card set origin label in search results ─────────────────── */
.cse-picker-card-set {
    display: block;
    color: #888;
    font-size: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Selected Cards Panel ────────────────────────────────────── */
.cse-selected-panel {
    margin: 12px 0 4px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
}
.cse-selected-panel-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: none;
    color: #ccc;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.cse-selected-panel-toggle:hover { background: rgba(255,255,255,0.08); }
.cse-panel-arrow { font-size: 0.7rem; color: #888; }

.cse-selected-cards-list {
    display: none;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}
.cse-selected-empty {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    padding: 16px;
}
.cse-selected-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 0.8rem;
}
.cse-selected-item:hover { background: rgba(255,255,255,0.03); }
.cse-selected-item-name {
    color: #ddd;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cse-selected-item-origin {
    color: #777;
    font-size: 0.7rem;
    white-space: nowrap;
}
.cse-selected-item-remove {
    background: none;
    border: none;
    color: #666;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.cse-selected-item-remove:hover { color: #ff4444; }

/* ── Artwork Picker ──────────────────────────────────────────── */
.cse-artwork-toggle {
    width: 100%;
    margin-top: 6px;
    background: rgba(255,255,255,0.06) !important;
    color: #aaa !important;
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
    font-weight: 500 !important;
}
.cse-artwork-toggle:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #ddd !important;
}
.cse-artwork-picker {
    margin-top: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
}
.cse-artwork-picker .cse-input {
    margin-bottom: 8px;
}
.cse-artwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.cse-artwork-item {
    text-align: center;
    cursor: pointer;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: border-color 0.15s, background 0.15s;
}
.cse-artwork-item:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.03);
}
.cse-artwork-item.selected {
    border-color: #2563eb;
    background: rgba(37,99,235,0.1);
}
.cse-artwork-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}
.cse-artwork-item span {
    display: block;
    font-size: 0.6rem;
    color: #aaa;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cse-artwork-hint, .cse-artwork-loading {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    padding: 16px;
    grid-column: 1 / -1;
}

/* ── "+ New Set" button ───────────────────────────────────────── */
.new-set-btn {
    border: 2px dashed rgba(255,255,255,0.2) !important;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.new-set-btn:hover {
    border-color: rgba(255,255,255,0.4) !important;
    background: rgba(255,255,255,0.03) !important;
}
.new-set-btn-icon {
    font-size: 2rem;
    color: rgba(255,255,255,0.4);
    line-height: 1;
}

/* ── Edit/Delete action buttons on set buttons ───────────────── */
.custom-set-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 6px;
}
.custom-set-action-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}
.custom-set-action-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.custom-set-action-btn.delete:hover {
    color: #ff4444;
    background: rgba(255,68,68,0.1);
}

/* ── Mobile overrides for editor ─────────────────────────────── */
@media (max-width: 767px) {
    .cse-modal { padding: 8px; }
    .cse-modal-content { max-height: 95vh; }
    .cse-set-selector { flex-direction: column; }
    .cse-picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        max-height: 40vh;
    }
    .cse-form-row { flex-direction: column; gap: 0; }
    .cse-artwork-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    .cse-mode-tab { font-size: 0.8rem; padding: 8px 8px; }
    .cse-selected-cards-list { max-height: 150px; }
}
