/* Dashboard shell + card-game components. Loaded alongside base.css. */

:root {
    --sidebar-width: 248px;
    --topbar-height: 64px;
    --bottomnav-height: 64px;
    --content-max-width: 1080px;
    /* --rarity-* tokens live in base.css (loaded before this file everywhere
       dashboard.css is used) so non-dashboard pages can share them too. */
}

/* ---------- Shell ---------- */

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: var(--space-4) var(--space-3);
    z-index: 20;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-2);
    margin-bottom: var(--space-4);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
    text-decoration: none;
}

.app-brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--rarity-cosmic));
    flex-shrink: 0;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.65rem var(--space-2);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.app-nav-link svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.app-nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text);
}

.app-nav-link.is-active {
    background: rgba(79, 140, 255, 0.12);
    color: var(--color-accent);
}

.app-sidebar-footer {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-3);
    margin-top: var(--space-3);
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    position: sticky;
    top: 0;
    background: rgba(15, 17, 21, 0.9);
    backdrop-filter: blur(6px);
    z-index: 10;
}

.balance-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.balance-pill-dust {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
}

.app-content {
    flex: 1;
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--space-4);
    padding-bottom: calc(var(--bottomnav-height) + var(--space-4));
}

.app-content--wide {
    max-width: 1600px;
}

.page-header {
    margin-bottom: var(--space-4);
}

.page-header h1 {
    margin: 0 0 4px;
    font-size: 1.4rem;
}

.page-header p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Bottom nav — mobile only */

.app-bottomnav {
    display: none;
}

@media (max-width: 860px) {
    .app-sidebar {
        display: none;
    }

    .app-main {
        margin-left: 0;
    }

    .app-content {
        padding: var(--space-3);
    }

    .app-bottomnav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: var(--bottomnav-height);
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        z-index: 20;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .app-bottomnav-link {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--color-text-muted);
        text-decoration: none;
        font-size: 0.65rem;
    }

    .app-bottomnav-link svg {
        width: 20px;
        height: 20px;
    }

    .app-bottomnav-link.is-active {
        color: var(--color-accent);
    }
}

/* ---------- Cards / stat tiles ---------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.stat-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.stat-tile-label {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.stat-tile-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-tile-value small {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.stat-tile-sub {
    margin-top: 2px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ---------- Dashboard "ready for you" callouts ---------- */

.callout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
}

.callout-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.callout-card--ready {
    border-color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 8%, var(--color-surface));
}

.callout-card--ready strong {
    display: block;
    color: var(--color-success);
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.section {
    margin-bottom: var(--space-4);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--space-3);
}

/* ---------- Rarity badge ---------- */

.rarity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
}

.rarity-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.rarity-common { color: var(--rarity-common); background: color-mix(in srgb, var(--rarity-common) 15%, transparent); }
.rarity-uncommon { color: var(--rarity-uncommon); background: color-mix(in srgb, var(--rarity-uncommon) 15%, transparent); }
.rarity-rare { color: var(--rarity-rare); background: color-mix(in srgb, var(--rarity-rare) 15%, transparent); }
.rarity-super-rare { color: var(--rarity-super-rare); background: color-mix(in srgb, var(--rarity-super-rare) 15%, transparent); }
.rarity-epic { color: var(--rarity-epic); background: color-mix(in srgb, var(--rarity-epic) 15%, transparent); }
.rarity-mythic { color: var(--rarity-mythic); background: color-mix(in srgb, var(--rarity-mythic) 15%, transparent); }
.rarity-legendary { color: var(--rarity-legendary); background: color-mix(in srgb, var(--rarity-legendary) 15%, transparent); }
.rarity-divine { color: var(--rarity-divine); background: color-mix(in srgb, var(--rarity-divine) 15%, transparent); }
.rarity-ancestral { color: var(--rarity-ancestral); background: color-mix(in srgb, var(--rarity-ancestral) 15%, transparent); }
.rarity-cosmic { color: var(--rarity-cosmic); background: color-mix(in srgb, var(--rarity-cosmic) 15%, transparent); }

/* ---------- Card grid / tile (collection) ---------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}

.card-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    border-top: 3px solid var(--tile-color, var(--color-border));
}

.card-tile-art {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 6px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--tile-color, var(--color-border)) 25%, var(--color-bg)), var(--color-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tile-color, var(--color-text-muted));
    font-size: 1.8rem;
    font-weight: 700;
}

.card-tile-name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.card-tile-qty {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.recycle-dialog-qty-label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.recycle-dialog-qty-label input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1rem;
    text-align: center;
}

/* Not-obtained cards: keep the frame at full visibility (rarity/progress
   still readable) but never reveal the art — a lootbox/PTC economy runs
   on not knowing exactly what you're chasing, so a faded-but-clear image
   would work against the collection's own carrot. */
.card-tile.is-empty .card-tile-name {
    color: var(--color-text-muted);
}

.card-tile-locked {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-tile-lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34%;
    color: var(--color-text-muted);
    opacity: 0.7;
}

.card-tile-lock-icon svg {
    width: 100%;
    height: 100%;
}

/* ---------- Rarity set section ---------- */

.set-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
}

.set-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.set-progress {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.set-progress.is-complete {
    color: var(--color-success);
    font-weight: 600;
}

/* ---------- Lootbox shop ---------- */

.lootbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
}

.lootbox-card {
    position: relative;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.lootbox-card:hover {
    transform: translateY(-4px);
    border-color: var(--tile-color, var(--color-border));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--tile-color, transparent) 25%, transparent);
}

.lootbox-card-glow {
    position: absolute;
    top: -50%;
    right: -25%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, var(--tile-color, transparent) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.lootbox-card-head {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
}

.lootbox-card-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.lootbox-card-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--tile-color, var(--color-accent));
}

.lootbox-free-badge {
    position: relative;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-success);
}

.lootbox-card-price small {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.lootbox-tier-list {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lootbox-tier-chances {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lootbox-tier-chances li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.lootbox-tier-chance-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* ---------- Confirmation dialog (replaces window.confirm) ---------- */

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    transition: background 0.2s ease;
}

.confirm-overlay.is-open {
    background: rgba(0, 0, 0, 0.75);
}

.confirm-overlay[hidden] {
    display: none;
}

.confirm-dialog {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    max-width: 360px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.confirm-overlay.is-open .confirm-dialog {
    transform: scale(1);
    opacity: 1;
}

.confirm-dialog h3 {
    margin: 0 0 var(--space-2);
    font-size: 1.1rem;
}

.confirm-dialog p {
    margin: 0 0 var(--space-4);
    color: var(--color-text-muted);
}

.confirm-dialog p strong {
    color: var(--color-accent);
}

.confirm-actions {
    display: flex;
    gap: var(--space-2);
}

.confirm-actions button {
    flex: 1;
}

.lootbox-card form button {
    margin-top: auto;
}

/* ---------- Mining ---------- */

.mining-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.mining-card-rate {
    font-size: 1.3rem;
    font-weight: 700;
}

.mining-card-rate small {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
    display: block;
}

.mining-card button,
.mining-card .btn-disabled {
    width: auto;
    padding: 0.6rem 1.2rem;
}

.btn-disabled {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    border-radius: var(--radius);
    font-size: 0.875rem;
    text-align: center;
}

/* ---------- Generic buttons ---------- */

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

.btn-sm {
    width: auto;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

/* ---------- Referrals ---------- */

.referral-link-box {
    display: flex;
    gap: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.referral-link-box input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    color: var(--color-text);
    font-size: 0.9rem;
}

.referral-link-box input:focus {
    outline: none;
}

.referral-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.referral-row {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.referral-row-user {
    font-weight: 600;
}

.referral-row-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-right: auto;
}

.referral-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
    white-space: nowrap;
}

.referral-status--qualified {
    color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
}

.referral-status--active,
.referral-status--completed {
    color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
}

/* ---------- PTC ---------- */

.btn-cta {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.ptc-ad-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.ptc-ad-card--priority {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent), 0 8px 24px color-mix(in srgb, var(--color-accent) 20%, transparent);
}

.ptc-featured-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--color-accent);
    padding: 3px 9px;
    border-radius: 999px;
}

.ptc-ad-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.ptc-ad-reward {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: var(--color-success);
    font-weight: 700;
    font-size: 1rem;
    margin: var(--space-2) 0;
}

.ptc-ad-reward small {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.ptc-watch-frame {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
    overflow: hidden;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ptc-watch-iframe {
    width: 100%;
    height: 80vh;
    max-height: 900px;
    border: none;
}

@media (max-width: 860px) {
    .ptc-watch-iframe {
        height: 70vh;
    }
}

.ptc-watch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.ptc-watch-header-text h1 {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.ptc-watch-header-text p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.ptc-watch-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.ptc-watch-header-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
}

.ptc-watch-header-actions svg {
    width: 16px;
    height: 16px;
}

.ptc-watch-header-actions form {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

@media (max-width: 860px) {
    .ptc-watch-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ptc-watch-header-actions {
        justify-content: space-between;
    }
}

/* ---------- Tabs (shared) ---------- */

.tab-bar {
    display: flex;
    gap: var(--space-2);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-4);
}

.tab-link {
    padding: 0.6rem 0.2rem;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.tab-link.is-active {
    color: var(--color-text);
    border-bottom-color: var(--color-accent);
}

/* ---------- PTC campaign form (block choices + summary) ---------- */

.ptc-create-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-4);
    align-items: start;
}

@media (max-width: 860px) {
    .ptc-create-layout {
        grid-template-columns: 1fr;
    }
}

.form-block-field {
    margin-bottom: var(--space-3);
}

.form-block-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.field-hint {
    margin: 6px 0 0;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.char-counter {
    float: right;
    color: var(--color-text-muted);
    font-weight: 400;
    font-size: 0.75rem;
}

.block-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.block-choice-group label {
    display: block;
    cursor: pointer;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    font-size: 0.85rem;
    transition: border-color 0.15s, background 0.15s;
}

.block-choice-group label:has(input:checked) {
    border-color: var(--color-accent);
    background: color-mix(in srgb, var(--color-accent) 15%, transparent);
    font-weight: 600;
}

.block-choice-group input {
    display: none;
}

.block-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    font-size: 0.85rem;
    width: fit-content;
}

.block-toggle input {
    width: auto;
}

.ptc-summary-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    position: sticky;
    top: var(--space-4);
}

.ptc-summary-list {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-2) var(--space-2);
    margin: 0;
    font-size: 0.85rem;
}

.ptc-summary-list dt {
    color: var(--color-text-muted);
}

.ptc-summary-list dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
}

/* ---------- Rules page ---------- */

.rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: var(--space-3);
}

.rules-table th,
.rules-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.rules-table th {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rules-table-wrap {
    overflow-x: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

.rules-table-wrap .rules-table {
    margin-bottom: 0;
}

.prose p {
    color: var(--color-text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}

.prose strong {
    color: var(--color-text);
}

/* ---------- Offerwall embed ---------- */

.provider-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3);
    margin-bottom: var(--space-3);
}

.provider-frame {
    width: 100%;
    min-height: 480px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-top: var(--space-3);
}

/* ---------- Card inspect viewer ---------- */

.card-tile-art-btn {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: block;
    transition: transform 0.15s ease;
}

.card-tile-art-btn:hover {
    transform: scale(1.03);
}

body.no-scroll {
    overflow: hidden;
}

.card-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1400px;
    transition: background 0.3s ease;
}

.card-viewer-overlay.is-open {
    background: rgba(0, 0, 0, 0.75);
}

.card-viewer-overlay[hidden] {
    display: none;
}

.card-viewer-img {
    position: fixed;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    background: var(--color-bg);
}

.card-viewer-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card-viewer-overlay.is-open .card-viewer-close {
    opacity: 1;
}
