/* ============================================================
   ARCANE TOME CARD TEMPLATE — Global Card Styles
   Classes: .atc (default 360px), .atc-md (265px),
            .atc-sm (200px), .atc-xs (160px)
   Card Back: .atc-back
   ============================================================ */

/* ===== WRAPPER ===== */
.atc {
    width: 360px;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.23,1,0.32,1);
}
.atc-md { width: 265px; }
.atc-sm { width: 200px; }
.atc-xs { width: 160px; }

.atc:hover { transform: translateY(-8px) scale(1.02); }

/* ===== AURA ===== */
.atc-aura {
    position: absolute;
    inset: -12px;
    border-radius: 28px;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.atc-aura-mythical {
    background: radial-gradient(ellipse, color-mix(in srgb, var(--rc) 30%, transparent), transparent 65%);
    animation: atcAuraPulse 3s ease-in-out infinite;
    opacity: 0.6;
}
.atc-aura-legendary {
    background: radial-gradient(ellipse, color-mix(in srgb, var(--rc) 22%, transparent), transparent 65%);
    animation: atcAuraPulse 4s ease-in-out infinite;
    opacity: 0.45;
}
.atc-aura-epic {
    background: radial-gradient(ellipse, color-mix(in srgb, var(--rc) 15%, transparent), transparent 65%);
    opacity: 0;
}
.atc:hover .atc-aura-epic { opacity: 0.5; }
.atc:hover .atc-aura-mythical { opacity: 0.85; }
.atc:hover .atc-aura-legendary { opacity: 0.7; }
@keyframes atcAuraPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* ===== PARTICLES ===== */
.atc-particles {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
    border-radius: 16px;
}
.atc-particle {
    position: absolute;
    border-radius: 50%;
    animation: atcParticleDrift linear infinite;
}
@keyframes atcParticleDrift {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    12% { opacity: 1; }
    80% { opacity: 0.4; }
    100% { transform: translateY(-200px) translateX(var(--dx, 15px)) scale(0.15); opacity: 0; }
}

/* ===== MAIN FRAME ===== */
.atc-frame {
    position: relative;
    z-index: 1;
    border-radius: 16px;
    overflow: hidden;
    border: 2.5px solid color-mix(in srgb, var(--rc, #a78bfa) 35%, #1a0f2e);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.6),
        0 0 20px color-mix(in srgb, var(--rc, #a78bfa) 10%, transparent),
        inset 0 1px 0 color-mix(in srgb, var(--rc, #a78bfa) 15%, transparent);
    background: linear-gradient(170deg, #1a0f2e 0%, #0d0820 40%, #0a0615 100%);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.atc:hover .atc-frame {
    border-color: color-mix(in srgb, var(--rc, #a78bfa) 60%, #1a0f2e);
    box-shadow:
        0 24px 64px rgba(0,0,0,0.7),
        0 0 50px color-mix(in srgb, var(--rc, #a78bfa) 25%, transparent),
        inset 0 1px 0 color-mix(in srgb, var(--rc, #a78bfa) 25%, transparent);
}

/* Rarity frame backgrounds */
.atc[data-rarity="Mythical"] .atc-frame {
    background:
        radial-gradient(ellipse at 25% 8%, color-mix(in srgb, var(--rc) 14%, transparent), transparent 45%),
        radial-gradient(ellipse at 75% 92%, color-mix(in srgb, var(--rc) 10%, transparent), transparent 45%),
        linear-gradient(170deg, #1c1032 0%, #0f0924 40%, #0a0615 100%);
    border-color: color-mix(in srgb, var(--rc) 55%, #1a0f2e);
    animation: atcMythBorder 4s ease-in-out infinite;
}
@keyframes atcMythBorder {
    0%, 100% { border-color: color-mix(in srgb, var(--rc) 45%, #1a0f2e); }
    50% { border-color: color-mix(in srgb, var(--rc) 75%, #2a1040); }
}
.atc[data-rarity="Legendary"] .atc-frame {
    background:
        radial-gradient(ellipse at 35% 12%, color-mix(in srgb, var(--rc) 12%, transparent), transparent 45%),
        radial-gradient(ellipse at 65% 88%, rgba(255,215,0,0.025), transparent 45%),
        linear-gradient(170deg, #1a1028 0%, #0e0822 40%, #0a0615 100%);
    border-color: color-mix(in srgb, var(--rc) 45%, #1a0f2e);
}
.atc[data-rarity="Epic"] .atc-frame {
    background:
        radial-gradient(ellipse at 50% 15%, color-mix(in srgb, var(--rc) 10%, transparent), transparent 50%),
        linear-gradient(170deg, #180e2a 0%, #0d0820 40%, #0a0615 100%);
}
.atc[data-rarity="Rare"] .atc-frame {
    background:
        radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--rc) 6%, transparent), transparent 50%),
        linear-gradient(170deg, #14102a 0%, #0d0820 40%, #0a0615 100%);
}

/* ===== HOLO ===== */
.atc-holo {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(115deg,
        transparent 15%,
        color-mix(in srgb, var(--rc) 7%, transparent) 30%,
        color-mix(in srgb, var(--rc) 16%, transparent) 50%,
        color-mix(in srgb, var(--rc) 7%, transparent) 70%,
        transparent 85%);
    background-size: 300% 300%;
    animation: atcHoloSweep 4.5s ease-in-out infinite;
    mix-blend-mode: screen;
}
.atc-holo-subtle {
    background: linear-gradient(115deg,
        transparent 25%,
        color-mix(in srgb, var(--rc) 4%, transparent) 40%,
        color-mix(in srgb, var(--rc) 8%, transparent) 50%,
        color-mix(in srgb, var(--rc) 4%, transparent) 60%,
        transparent 75%);
    animation-duration: 7s;
}
@keyframes atcHoloSweep {
    0% { background-position: 100% 100%; }
    50% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* ===== EPIC SHIMMER ===== */
.atc[data-rarity="Epic"] .atc-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(135deg,
        transparent 35%,
        color-mix(in srgb, var(--rc) 5%, transparent) 45%,
        color-mix(in srgb, var(--rc) 9%, transparent) 50%,
        color-mix(in srgb, var(--rc) 5%, transparent) 55%,
        transparent 65%);
    background-size: 300% 300%;
    animation: atcEpicShimmer 6s ease-in-out infinite;
    mix-blend-mode: screen;
}
@keyframes atcEpicShimmer {
    0% { background-position: 100% 100%; }
    50% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* ===== CORNERS ===== */
.atc-corner {
    position: absolute;
    width: 32px;
    height: 32px;
    z-index: 11;
    pointer-events: none;
    transition: opacity 0.4s ease, filter 0.4s ease;
    opacity: 0.3;
}
.atc-md .atc-corner { width: 24px; height: 24px; }
.atc-sm .atc-corner { width: 20px; height: 20px; }
.atc-xs .atc-corner { width: 16px; height: 16px; }

.atc-tl { top: 4px; left: 4px; border-top: 2.5px solid var(--rc, #a78bfa); border-left: 2.5px solid var(--rc, #a78bfa); border-top-left-radius: 12px; }
.atc-tr { top: 4px; right: 4px; border-top: 2.5px solid var(--rc, #a78bfa); border-right: 2.5px solid var(--rc, #a78bfa); border-top-right-radius: 12px; }
.atc-bl { bottom: 4px; left: 4px; border-bottom: 2.5px solid var(--rc, #a78bfa); border-left: 2.5px solid var(--rc, #a78bfa); border-bottom-left-radius: 12px; }
.atc-br { bottom: 4px; right: 4px; border-bottom: 2.5px solid var(--rc, #a78bfa); border-right: 2.5px solid var(--rc, #a78bfa); border-bottom-right-radius: 12px; }

.atc:hover .atc-corner { opacity: 0.85; filter: drop-shadow(0 0 6px var(--rc, #a78bfa)); }
.atc[data-rarity="Mythical"] .atc-corner { opacity: 0.7; animation: atcCornerPulse 3s ease-in-out infinite; }
.atc[data-rarity="Legendary"] .atc-corner { opacity: 0.5; animation: atcCornerPulse 4s ease-in-out infinite; }
.atc[data-rarity="Epic"] .atc-corner { opacity: 0.4; }
@keyframes atcCornerPulse {
    0%, 100% { opacity: 0.4; filter: none; }
    50% { opacity: 1; filter: drop-shadow(0 0 10px var(--rc, #a78bfa)); }
}

/* ===== TOP BAR ===== */
.atc-top-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--rc, #a78bfa) 14%, rgba(15,8,30,0.95)) 0%, rgba(15,8,30,0.5) 100%);
    border-bottom: 1px solid color-mix(in srgb, var(--rc, #a78bfa) 22%, transparent);
}
.atc-md .atc-top-bar { padding: 8px 12px; gap: 8px; }
.atc-sm .atc-top-bar { padding: 6px 10px; gap: 6px; }
.atc-xs .atc-top-bar { padding: 5px 8px; gap: 4px; }

.atc-gem-wrap { flex-shrink: 0; }
.atc-gem {
    color: var(--rc, #a78bfa);
    font-size: 0.6rem;
    text-shadow: 0 0 10px var(--rc, #a78bfa);
    opacity: 0.6;
}
.atc-md .atc-gem { font-size: 0.5rem; }
.atc-sm .atc-gem, .atc-xs .atc-gem { font-size: 0.45rem; }

.atc[data-rarity="Mythical"] .atc-gem,
.atc[data-rarity="Legendary"] .atc-gem { animation: atcGemGlow 3s ease-in-out infinite; }
@keyframes atcGemGlow {
    0%, 100% { opacity: 0.4; text-shadow: 0 0 6px var(--rc, #a78bfa); }
    50% { opacity: 1; text-shadow: 0 0 16px var(--rc, #a78bfa), 0 0 6px #fff; }
}

.atc-name {
    font-family: 'Cinzel', serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.7);
    text-align: center;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.atc-md .atc-name { font-size: 0.75rem; }
.atc-sm .atc-name { font-size: 0.65rem; }
.atc-xs .atc-name { font-size: 0.6rem; }

/* ===== MEDIA ===== */
.atc-media-frame {
    position: relative;
    margin: 0 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid color-mix(in srgb, var(--rc, #a78bfa) 22%, rgba(255,255,255,0.06));
    box-shadow: inset 0 0 25px rgba(0,0,0,0.5);
    transition: border-color 0.4s ease;
}
.atc-sm .atc-media-frame, .atc-xs .atc-media-frame { margin: 0 6px; }
.atc:hover .atc-media-frame { border-color: color-mix(in srgb, var(--rc, #a78bfa) 40%, rgba(255,255,255,0.1)); }

.atc-media {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    position: relative;
    background: #0a0612;
}
.atc-media video,
.atc-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.atc-media .atc-poster {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 0.3s ease;
}
.atc-media video {
    position: absolute;
    top: 0; left: 0;
    z-index: 2;
    will-change: transform;
    transform: translateZ(0);
}
.atc-media .atc-poster.poster-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Level badge */
.atc-lvl-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    display: flex;
    align-items: baseline;
    gap: 2px;
    background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(0,0,0,0.5));
    backdrop-filter: blur(8px);
    border: 1.5px solid color-mix(in srgb, var(--rc, #a78bfa) 40%, transparent);
    border-radius: 6px;
    padding: 3px 8px 3px 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5), 0 0 10px color-mix(in srgb, var(--rc, #a78bfa) 15%, transparent);
}
.atc-sm .atc-lvl-badge, .atc-xs .atc-lvl-badge { top: 5px; left: 5px; padding: 2px 6px 2px 4px; }

.atc-lvl-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.atc-sm .atc-lvl-text, .atc-xs .atc-lvl-text { font-size: 0.5rem; }

.atc-lvl-num {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--rc, #a78bfa);
    line-height: 1;
    text-shadow: 0 0 10px color-mix(in srgb, var(--rc, #a78bfa) 40%, transparent);
}
.atc-md .atc-lvl-num { font-size: 1.1rem; }
.atc-sm .atc-lvl-num { font-size: 0.95rem; }
.atc-xs .atc-lvl-num { font-size: 0.8rem; }

.atc[data-rarity="Mythical"] .atc-lvl-badge {
    border-color: color-mix(in srgb, var(--rc) 60%, transparent);
    box-shadow: 0 2px 12px rgba(0,0,0,0.5), 0 0 16px color-mix(in srgb, var(--rc) 25%, transparent);
}
.atc[data-rarity="Mythical"] .atc-lvl-num { animation: atcLvlGlow 3s ease-in-out infinite; }
@keyframes atcLvlGlow {
    0%, 100% { text-shadow: 0 0 8px color-mix(in srgb, var(--rc, #a78bfa) 35%, transparent); }
    50% { text-shadow: 0 0 18px var(--rc, #a78bfa), 0 0 6px #fff; }
}

/* Quantity badge */
.atc-qty-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.65);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 2px 7px;
    backdrop-filter: blur(4px);
}
.atc-sm .atc-qty-badge, .atc-xs .atc-qty-badge { font-size: 0.55rem; padding: 2px 5px; top: 5px; right: 5px; }

/* New badge */
.atc-new-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    border-radius: 4px;
    padding: 3px 8px;
    box-shadow: 0 0 10px rgba(124,58,237,0.5);
}

/* Exclusive ribbon badge */
.atc-exclusive-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    font-family: 'Cinzel', serif;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    background: linear-gradient(135deg, #b8860b, #ffd700, #daa520);
    padding: 3px 14px 3px 8px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 2px 8px rgba(218,165,32,0.5);
    animation: exclusiveShimmer 3s ease-in-out infinite;
}
@keyframes exclusiveShimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}
.atc-sm .atc-exclusive-ribbon { font-size: 0.4rem; letter-spacing: 1.5px; padding: 2px 10px 2px 5px; }
.atc-xs .atc-exclusive-ribbon { font-size: 0.35rem; letter-spacing: 1px; padding: 2px 8px 2px 4px; }
.atc-lg .atc-exclusive-ribbon { font-size: 0.6rem; padding: 4px 18px 4px 10px; }

/* Exclusive card frame glow */
.atc-exclusive .atc-frame {
    border-color: color-mix(in srgb, #ffd700 45%, #1a0f2e);
    box-shadow:
        0 0 12px rgba(255,215,0,0.15),
        0 0 30px rgba(218,165,32,0.08),
        inset 0 0 20px rgba(255,215,0,0.05);
}
.atc-exclusive:hover .atc-frame {
    box-shadow:
        0 0 18px rgba(255,215,0,0.25),
        0 0 40px rgba(218,165,32,0.12),
        inset 0 0 25px rgba(255,215,0,0.08);
}

/* Media edge glow */
.atc-media-edge {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--rc, #a78bfa), transparent);
    box-shadow: 0 0 12px var(--rc, #a78bfa), 0 -2px 20px color-mix(in srgb, var(--rc, #a78bfa) 20%, transparent);
    opacity: 0.6;
}
.atc[data-rarity="Mythical"] .atc-media-edge {
    height: 4px; opacity: 0.85; animation: atcEdgePulse 3s ease-in-out infinite;
}
@keyframes atcEdgePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; box-shadow: 0 0 20px var(--rc, #a78bfa), 0 -4px 30px color-mix(in srgb, var(--rc, #a78bfa) 35%, transparent); }
}

/* ===== BODY ===== */
.atc-body { padding: 8px 14px 12px; }
.atc-md .atc-body { padding: 6px 10px 10px; }
.atc-sm .atc-body { padding: 5px 8px 8px; }
.atc-xs .atc-body { padding: 4px 6px 6px; }

.atc-divider {
    position: relative;
    height: 1px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rc, #a78bfa) 35%, transparent), transparent);
}
.atc-sm .atc-divider, .atc-xs .atc-divider { margin-bottom: 6px; }

.atc-div-ornament {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.45rem;
    color: var(--rc, #a78bfa);
    background: #0d0820;
    padding: 0 8px;
    text-shadow: 0 0 8px var(--rc, #a78bfa);
    opacity: 0.6;
}

/* ===== STATS — RING DESIGN ===== */
.atc-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}
.atc-xs .atc-stats { gap: 4px; margin-bottom: 4px; }

.atc-stat { text-align: center; width: 80px; }
.atc-md .atc-stat { width: 60px; }
.atc-sm .atc-stat { width: 50px; }
.atc-xs .atc-stat { width: 42px; }

.atc-stat-ring {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 4px;
}
.atc-md .atc-stat-ring { width: 46px; height: 46px; }
.atc-sm .atc-stat-ring { width: 38px; height: 38px; }
.atc-xs .atc-stat-ring { width: 30px; height: 30px; }

.atc-stat-ring svg {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}
.atc-ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 3; }
.atc-ring-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 163.36;
    stroke-dashoffset: calc(163.36 - (163.36 * min(var(--pct), 100) / 100));
    filter: drop-shadow(0 0 3px currentColor);
    transition: stroke-dashoffset 1.5s cubic-bezier(0.23,1,0.32,1);
}
.atc-ring-atk { stroke: #ef4444; color: #ef4444; }
.atc-ring-def { stroke: #3b82f6; color: #3b82f6; }
.atc-ring-hp  { stroke: #22c55e; color: #22c55e; }

.atc-stat-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.atc-stat-num {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #e2d9f3;
    line-height: 1;
}
.atc-md .atc-stat-num { font-size: 0.8rem; }
.atc-sm .atc-stat-num { font-size: 0.65rem; }
.atc-xs .atc-stat-num { font-size: 0.55rem; }

.atc-stat-atk .atc-stat-num { color: #fca5a5; }
.atc-stat-def .atc-stat-num { color: #93c5fd; }
.atc-stat-hp  .atc-stat-num { color: #86efac; }

.atc-stat-lbl {
    font-family: 'Cinzel', serif;
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(255,255,255,0.35);
}
.atc-sm .atc-stat-lbl { font-size: 0.4rem; letter-spacing: 1.5px; }
.atc-xs .atc-stat-lbl { font-size: 0.35rem; letter-spacing: 1px; }

/* ===== COMPACT STATS (pill style) ===== */
.atc-stats-compact {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.15) 100%);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.atc-stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    position: relative;
    min-width: 42px;
}
.atc-pill-atk { background: linear-gradient(180deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05)); border: 1px solid rgba(239,68,68,0.25); }
.atc-pill-def { background: linear-gradient(180deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05)); border: 1px solid rgba(59,130,246,0.25); }
.atc-pill-hp { background: linear-gradient(180deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05)); border: 1px solid rgba(34,197,94,0.25); }
.atc-pill-tp { background: linear-gradient(180deg, rgba(250,204,21,0.15), rgba(250,204,21,0.05)); border: 1px solid rgba(250,204,21,0.25); }
.atc-pill-label {
    font-size: 0.45rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.85;
}
.atc-stat-pill {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.atc-stat-pill:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px currentColor;
}
.atc-pill-val {
    font-size: 0.8rem;
    font-weight: 800;
    text-shadow: 0 0 8px currentColor;
}
.atc-pill-atk .atc-pill-label { color: #ef4444; }
.atc-pill-atk .atc-pill-val { color: #fca5a5; }
.atc-pill-def .atc-pill-label { color: #3b82f6; }
.atc-pill-def .atc-pill-val { color: #93c5fd; }
.atc-pill-hp .atc-pill-label { color: #22c55e; }
.atc-pill-hp .atc-pill-val { color: #86efac; }
.atc-pill-tp .atc-pill-label { color: #facc15; }
.atc-pill-tp .atc-pill-val { color: #fde68a; }

.equip-stat-boost {
    font-size: 0.7em;
    color: #4ade80;
    font-weight: 700;
    margin-left: 2px;
    text-shadow: 0 0 6px rgba(34,197,94,0.5);
}
.equip-stat-boost-def { color: #60a5fa; text-shadow: 0 0 6px rgba(59,130,246,0.5); }
.equip-stat-boost-hp { color: #86efac; text-shadow: 0 0 6px rgba(34,197,94,0.5); }
.atc-md .equip-stat-boost { font-size: 0.6em; }
.atc-sm .equip-stat-boost { font-size: 0.55em; }

.atc-lg .atc-stats-compact { gap: 8px; margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; }
.atc-lg .atc-stat-pill { padding: 8px 16px; min-width: 56px; border-radius: 8px; }
.atc-lg .atc-pill-label { font-size: 0.55rem; letter-spacing: 2px; }
.atc-lg .atc-pill-val { font-size: 1rem; }

.atc-md .atc-stats-compact { gap: 4px; margin-bottom: 6px; padding: 4px 6px; border-radius: 6px; }
.atc-md .atc-stat-pill { padding: 3px 7px; min-width: 34px; border-radius: 5px; }
.atc-md .atc-pill-label { font-size: 0.38rem; }
.atc-md .atc-pill-val { font-size: 0.6rem; }
.atc-sm .atc-stats-compact { gap: 3px; margin-bottom: 4px; padding: 3px 4px; border-radius: 5px; }
.atc-sm .atc-stat-pill { padding: 2px 5px; min-width: 28px; border-radius: 4px; }
.atc-sm .atc-pill-label { font-size: 0.32rem; letter-spacing: 1px; }
.atc-sm .atc-pill-val { font-size: 0.5rem; }
.atc-xs .atc-stats-compact { gap: 2px; margin-bottom: 3px; padding: 2px 3px; border-radius: 4px; }
.atc-xs .atc-stat-pill { padding: 1px 4px; min-width: 22px; border-radius: 3px; }
.atc-xs .atc-pill-label { font-size: 0.28rem; letter-spacing: 0.5px; }
.atc-xs .atc-pill-val { font-size: 0.42rem; }

/* ===== ABILITY INDICATOR (compact, on card front) ===== */
.atc-ability-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 6px;
    padding: 3px 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.5px;
}
.atc-ability-indicator .atc-abi-icons {
    display: flex;
    gap: 3px;
    align-items: center;
}
.atc-ability-indicator .atc-abi-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid;
    opacity: 0.7;
}
.atc-ability-indicator .atc-abi-count {
    font-size: 0.5rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.atc-md .atc-ability-indicator { font-size: 0.48rem; gap: 3px; padding: 2px 6px; margin-bottom: 4px; }
.atc-md .atc-ability-indicator .atc-abi-dot { width: 5px; height: 5px; }
.atc-sm .atc-ability-indicator { font-size: 0.4rem; gap: 2px; padding: 2px 4px; margin-bottom: 3px; }
.atc-sm .atc-ability-indicator .atc-abi-dot { width: 4px; height: 4px; }
.atc-xs .atc-ability-indicator { font-size: 0.35rem; gap: 2px; padding: 1px 3px; margin-bottom: 2px; }
.atc-xs .atc-ability-indicator .atc-abi-dot { width: 3px; height: 3px; }

/* ===== ABILITIES LIST (for modal/popup detail view) ===== */
.atc-abilities-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
    max-height: 110px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.atc-abilities-list::-webkit-scrollbar { width: 3px; }
.atc-abilities-list::-webkit-scrollbar-track { background: transparent; }
.atc-abilities-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.atc-md .atc-abilities-list { max-height: 80px; gap: 1px; margin-bottom: 4px; }
.atc-sm .atc-abilities-list { max-height: 55px; gap: 1px; margin-bottom: 3px; }
.atc-xs .atc-abilities-list { max-height: 40px; gap: 1px; margin-bottom: 2px; }

/* ===== MODAL ABILITY DETAILS ===== */
.atc-modal-abilities {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
}
.atc-modal-ability-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    transition: border-color 0.3s ease;
}
.atc-modal-ability-card:hover {
    border-color: rgba(255,255,255,0.2);
}
.atc-modal-ab-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.atc-modal-ab-icon-img {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    object-fit: cover;
}
.atc-ability-icon-img {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 2px;
}
.atc-modal-ab-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.atc-modal-ab-name {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.atc-modal-ab-desc {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}
.atc-modal-ab-meta {
    display: flex;
    gap: 6px;
    font-size: 0.6rem;
    font-family: 'Cinzel', serif;
    color: rgba(255,255,255,0.35);
    flex-shrink: 0;
}
.atc-modal-ab-cd { color: rgba(255,215,0,0.6); }
.atc-modal-ab-passive { color: rgba(156,163,175,0.7); font-style: italic; }

/* ===== POWER BAR ===== */
.atc-power-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,215,0,0.12);
    overflow: hidden;
}
.atc-power-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    border-radius: 5px;
    background: linear-gradient(90deg, rgba(255,170,0,0.4) 0%, rgba(255,215,0,0.55) 60%, rgba(255,240,120,0.65) 100%);
    transition: width 0.6s cubic-bezier(0.23,1,0.32,1);
    pointer-events: none;
}
.atc-power-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 70%, rgba(255,255,255,0.08));
    border-radius: inherit;
}
.atc-power-bar-split .atc-power-bar-base {
    border-radius: 5px 0 0 5px;
}
.atc-power-bar-split .atc-power-bar-equip {
    border-radius: 0 5px 5px 0;
    background: linear-gradient(90deg, rgba(0,200,255,0.35) 0%, rgba(56,189,248,0.5) 50%, rgba(125,211,252,0.6) 100%);
    border-left: 1px solid rgba(255,255,255,0.15);
}
.atc-power-bar-split .atc-power-bar-equip::after {
    background: linear-gradient(90deg, transparent 50%, rgba(255,255,255,0.1));
}
.atc-power-eq-val {
    font-size: 0.65em;
    color: #7dd3fc;
    margin-left: 2px;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(56,189,248,0.5);
}
.atc-power-bar-split .atc-power-bar-base,
.atc-power-bar-split .atc-power-bar-equip {
    pointer-events: auto;
    cursor: default;
    z-index: 2;
}
.atc-power-bar-split .atc-power-bar-base:hover,
.atc-power-bar-split .atc-power-bar-equip:hover {
    filter: brightness(1.3);
}
.atc-power-bar-split .atc-power-bar-base[data-tooltip],
.atc-power-bar-split .atc-power-bar-equip[data-tooltip] {
    position: absolute;
}

.atc-power-tooltip {
    position: fixed;
    background: rgba(10, 5, 20, 0.97);
    border: 1px solid rgba(192, 132, 252, 0.3);
    color: #e8e0f0;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: pre-line;
    line-height: 1.5;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 99999;
    min-width: 150px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}
.atc-power-tooltip.active { opacity: 1; }
.atc-power-tooltip.tooltip-base { border-color: rgba(255, 200, 0, 0.3); }
.atc-power-tooltip.tooltip-equip { border-color: rgba(56, 189, 248, 0.35); }
.atc-power-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(10, 5, 20, 0.97);
}
.atc-power-tooltip.tooltip-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: rgba(10, 5, 20, 0.97);
}
.atc-power-bar-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.08) 40%, rgba(255,255,255,0.12) 50%, rgba(255,215,0,0.08) 60%, transparent);
    animation: atcPwrShimmer 4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes atcPwrShimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}
.atc-power-star {
    font-size: 0.7rem;
    color: #ffd700;
    text-shadow: 0 0 6px rgba(255,215,0,0.5);
    z-index: 1;
    flex-shrink: 0;
    line-height: 1;
}
.atc-power-label {
    font-family: 'Cinzel', serif;
    font-size: 0.45rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,215,0,0.5);
    text-transform: uppercase;
    z-index: 1;
    flex-shrink: 0;
    line-height: 1;
}
.atc-power-val {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 800;
    color: #fde68a;
    text-shadow: 0 0 10px rgba(255,215,0,0.4);
    z-index: 1;
    margin-left: auto;
    line-height: 1;
}
.atc-sm .atc-power-bar { padding: 3px 6px; margin-bottom: 5px; gap: 4px; border-radius: 4px; }
.atc-xs .atc-power-bar { padding: 2px 5px; margin-bottom: 4px; gap: 3px; border-radius: 4px; }
.atc-sm .atc-power-star { font-size: 0.55rem; }
.atc-xs .atc-power-star { font-size: 0.45rem; }
.atc-sm .atc-power-label { font-size: 0.35rem; letter-spacing: 1.5px; }
.atc-xs .atc-power-label { font-size: 0.3rem; letter-spacing: 1px; }
.atc-sm .atc-power-val { font-size: 0.65rem; }
.atc-xs .atc-power-val { font-size: 0.55rem; }
.atc-md .atc-power-bar { padding: 4px 7px; gap: 5px; }
.atc-md .atc-power-star { font-size: 0.6rem; }
.atc-md .atc-power-label { font-size: 0.4rem; }
.atc-md .atc-power-val { font-size: 0.75rem; }
.atc[data-rarity="Mythical"] .atc-power-bar { border-color: rgba(255,69,0,0.25); }
.atc[data-rarity="Mythical"] .atc-power-bar-fill:not(.atc-power-bar-equip) { background: linear-gradient(90deg, rgba(255,69,0,0.5) 0%, rgba(255,140,0,0.6) 50%, rgba(255,215,0,0.7) 100%); }
.atc[data-rarity="Mythical"] .atc-power-bar { animation: atcPowerPulse 3s ease-in-out infinite; }
.atc[data-rarity="Legendary"] .atc-power-bar { border-color: rgba(255,215,0,0.2); }
.atc[data-rarity="Legendary"] .atc-power-bar-fill:not(.atc-power-bar-equip) { background: linear-gradient(90deg, rgba(255,180,0,0.45) 0%, rgba(255,215,0,0.6) 100%); }
.atc[data-rarity="Epic"] .atc-power-bar { border-color: rgba(168,85,247,0.2); }
.atc[data-rarity="Epic"] .atc-power-bar-fill:not(.atc-power-bar-equip) { background: linear-gradient(90deg, rgba(124,58,237,0.4) 0%, rgba(168,85,247,0.55) 60%, rgba(196,140,255,0.65) 100%); }
.atc[data-rarity="Epic"] .atc-power-star { color: #c084fc; text-shadow: 0 0 6px rgba(168,85,247,0.5); }
.atc[data-rarity="Epic"] .atc-power-val { color: #d8b4fe; text-shadow: 0 0 10px rgba(168,85,247,0.4); }
.atc[data-rarity="Epic"] .atc-power-label { color: rgba(168,85,247,0.5); }
@keyframes atcPowerPulse {
    0%, 100% { border-color: rgba(255,215,0,0.12); box-shadow: 0 0 4px rgba(255,215,0,0.05); }
    50% { border-color: rgba(255,215,0,0.3); box-shadow: 0 0 12px rgba(255,215,0,0.15); }
}

/* ===== FLAVOR ===== */
.atc-flavor {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.4;
    margin-bottom: 8px;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.atc-sm .atc-flavor, .atc-xs .atc-flavor { font-size: 0.65rem; margin-bottom: 5px; }

/* ===== ABILITY BADGE ===== */
.atc-ability-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid;
    transition: all 0.3s ease;
}
.atc-ability-badge .atc-ability-icon {
    font-size: 0.75rem;
    flex-shrink: 0;
}
.atc-ability-badge .atc-ability-name {
    overflow: hidden;
    text-overflow: ellipsis;
}
.atc-ability-badge .atc-ability-cd {
    display: none;
}
.atc-ability-badge.atc-ability-passive {
    opacity: 0.55;
    border-style: dashed;
}
.atc:hover .atc-ability-badge {
    filter: brightness(1.2);
}
.atc-md .atc-ability-badge { font-size: 0.55rem; padding: 3px 8px; margin-bottom: 5px; }
.atc-sm .atc-ability-badge { font-size: 0.45rem; padding: 2px 6px; margin-bottom: 4px; gap: 3px; }
.atc-sm .atc-ability-badge .atc-ability-icon { font-size: 0.6rem; }
.atc-xs .atc-ability-badge { font-size: 0.4rem; padding: 2px 4px; margin-bottom: 3px; gap: 2px; }
.atc-xs .atc-ability-badge .atc-ability-icon { font-size: 0.5rem; }

/* ===== FOOTER ===== */
.atc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.atc-rarity {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--rc, #a78bfa);
    text-shadow: 0 0 8px color-mix(in srgb, var(--rc, #a78bfa) 35%, transparent);
}
.atc-sm .atc-rarity, .atc-xs .atc-rarity { font-size: 0.45rem; letter-spacing: 1.5px; }

.atc[data-rarity="Mythical"] .atc-rarity { animation: atcRarityGlow 3s ease-in-out infinite; }
.atc[data-rarity="Legendary"] .atc-rarity { animation: atcRarityGlow 4s ease-in-out infinite; }
@keyframes atcRarityGlow {
    0%, 100% { text-shadow: 0 0 6px color-mix(in srgb, var(--rc, #a78bfa) 30%, transparent); }
    50% { text-shadow: 0 0 20px var(--rc, #a78bfa), 0 0 6px #fff; }
}

.atc-pack {
    font-size: 0.5rem;
    color: rgba(255,255,255,0.2);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: right;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.atc-xs .atc-pack { display: none; }

/* ===== RARE HOVER ===== */
.atc[data-rarity="Rare"]:hover .atc-frame {
    box-shadow:
        0 20px 56px rgba(0,0,0,0.7),
        0 0 30px color-mix(in srgb, var(--rc) 20%, transparent),
        inset 0 1px 0 color-mix(in srgb, var(--rc) 20%, transparent);
}

/* ===== LOCKED CARD OVERLAY ===== */
.atc-locked-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(4, 1, 14, 0.72);
    gap: 6px;
}
.atc-lock-icon {
    font-size: 2rem;
    color: rgba(255,255,255,0.85);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.9));
}
.atc-lock-text {
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}
.atc-sm .atc-lock-icon { font-size: 1.4rem; }
.atc-xs .atc-lock-icon { font-size: 1.2rem; }

/* Locked card image: completely obscured */
.atc-media-locked {
    filter: grayscale(1) brightness(0.06) saturate(0) blur(20px);
    transform: scale(1.12);
}

/* Locked card: no hover lift */
.atc-locked-card { pointer-events: none; }
.atc-locked-card:hover { transform: none !important; }
.atc-locked-card:hover .atc-frame {
    border-color: color-mix(in srgb, var(--rc, #a78bfa) 35%, #1a0f2e) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px color-mix(in srgb, var(--rc, #a78bfa) 10%, transparent), inset 0 1px 0 color-mix(in srgb, var(--rc, #a78bfa) 15%, transparent) !important;
}

/* Blurred content on locked cards (stats, power, flavor) */
.atc-locked-blur {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
    opacity: 0.6;
}
/* The lock overlay sits only over the media, so border-radius should match media */
.atc-media-frame .atc-locked-overlay {
    border-radius: 0;
}

/* ===== DEAD OVERLAY (Arena) ===== */
.atc-dead-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 14px;
}
.atc-dead-text {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #ef4444;
    text-shadow: 0 0 12px rgba(239,68,68,0.6);
}
.atc-xs .atc-dead-text { font-size: 0.6rem; letter-spacing: 2px; }

/* ===== HP BAR (Arena overlay on media) ===== */
.atc-hp-bar-wrap {
    padding: 0 0 6px;
}
.atc-hp-bar {
    height: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.atc-hp-fill {
    height: 100%;
    border-radius: 3px;
    background: #22c55e;
    transition: width 0.4s ease;
}
.atc-hp-fill.hp-mid { background: #f59e0b; }
.atc-hp-fill.hp-low { background: #ef4444; }
.atc-hp-text {
    font-size: 0.45rem;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-family: 'Cinzel', serif;
}


/* ================================================================
   CARD BACK (.atc-back)  — Upgraded Arcane Vault Design
   ================================================================ */

.atc-back {
    width: 360px;
    position: relative;
    flex-shrink: 0;
}
.atc-md.atc-back { width: 265px; }
.atc-sm.atc-back { width: 200px; }
.atc-xs.atc-back { width: 160px; }

.atc-back-frame {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--cb-border, rgba(167,139,250,0.4));
    box-shadow:
        0 0 0 1px var(--cb-inner-border, rgba(167,139,250,0.08)) inset,
        0 12px 48px rgba(0,0,0,0.85),
        0 0 40px var(--cb-glow, rgba(124,58,237,0.15)),
        inset 0 1px 0 var(--cb-top-shine, rgba(167,139,250,0.2));
    background:
        radial-gradient(ellipse at 50% 15%, var(--cb-top-glow, rgba(124,58,237,0.18)) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 85%, var(--cb-bot-glow, rgba(192,38,211,0.12)) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 50%, var(--cb-side-glow, rgba(89,28,210,0.06)) 0%, transparent 50%),
        linear-gradient(170deg, var(--cb-bg-top, #1c1040) 0%, var(--cb-bg-mid, #0f0825) 40%, var(--cb-bg-bot, #070313) 100%);
    display: flex;
    flex-direction: column;
}

/* --- Corner ornaments --- */
.atc-back-corner {
    position: absolute;
    width: 36px;
    height: 36px;
    z-index: 11;
    pointer-events: none;
}
.atc-sm.atc-back .atc-back-corner,
.atc-xs.atc-back .atc-back-corner { width: 20px; height: 20px; }
.atc-md.atc-back .atc-back-corner { width: 28px; height: 28px; }

.atc-back-tl { top: 5px; left: 5px; border-top: 2px solid var(--cb-corner, #a78bfa); border-left: 2px solid var(--cb-corner, #a78bfa); border-top-left-radius: 12px; opacity: 0.65; }
.atc-back-tr { top: 5px; right: 5px; border-top: 2px solid var(--cb-corner, #a78bfa); border-right: 2px solid var(--cb-corner, #a78bfa); border-top-right-radius: 12px; opacity: 0.65; }
.atc-back-bl { bottom: 5px; left: 5px; border-bottom: 2px solid var(--cb-corner, #a78bfa); border-left: 2px solid var(--cb-corner, #a78bfa); border-bottom-left-radius: 12px; opacity: 0.65; }
.atc-back-br { bottom: 5px; right: 5px; border-bottom: 2px solid var(--cb-corner, #a78bfa); border-right: 2px solid var(--cb-corner, #a78bfa); border-bottom-right-radius: 12px; opacity: 0.65; }

/* --- Diamond weave pattern --- */
.atc-back-pattern {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.05;
    background-image:
        repeating-linear-gradient(45deg, var(--cb-corner, #a78bfa) 0px, var(--cb-corner, #a78bfa) 1px, transparent 1px, transparent 18px),
        repeating-linear-gradient(-45deg, var(--cb-corner, #a78bfa) 0px, var(--cb-corner, #a78bfa) 1px, transparent 1px, transparent 18px);
}
.atc-back-dots {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.025;
    background-image: radial-gradient(circle, var(--cb-corner, #a78bfa) 1.2px, transparent 1.2px);
    background-size: 22px 22px;
}

/* --- Holo sweep --- */
.atc-back-holo {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(115deg,
        transparent 18%,
        var(--cb-holo1, rgba(167,139,250,0.05)) 33%,
        var(--cb-holo2, rgba(167,139,250,0.10)) 50%,
        var(--cb-holo1, rgba(167,139,250,0.05)) 67%,
        transparent 82%);
    background-size: 300% 300%;
    animation: atcHoloSweep 7s ease-in-out infinite;
    mix-blend-mode: screen;
}

/* --- Content wrapper --- */
.atc-back-content {
    position: relative;
    z-index: 3;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 18px;
    gap: 14px;
    min-height: 440px;
}
.atc-md.atc-back .atc-back-content { min-height: 360px; padding: 18px 14px; gap: 11px; }
.atc-sm.atc-back .atc-back-content { min-height: 270px; padding: 14px 12px; gap: 9px; }
.atc-xs.atc-back .atc-back-content { min-height: 210px; padding: 10px 8px; gap: 7px; }

/* --- Separator lines --- */
.atc-back-line {
    width: 65%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cb-line, rgba(167,139,250,0.5)), transparent);
}
.atc-back-line-short {
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cb-line, rgba(167,139,250,0.3)), transparent);
}

/* --- Central crest assembly --- */
.atc-back-crest {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
}
.atc-md.atc-back .atc-back-crest { width: 64px; height: 64px; }
.atc-sm.atc-back .atc-back-crest { width: 52px; height: 52px; }
.atc-xs.atc-back .atc-back-crest { width: 42px; height: 42px; }

.atc-back-crest-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--cb-ring, rgba(167,139,250,0.35));
    animation: atcCrestSpin 14s linear infinite;
    pointer-events: none;
}
.atc-back-crest-ring2 {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1px dashed var(--cb-ring2, rgba(167,139,250,0.2));
    animation: atcCrestSpin 9s linear infinite reverse;
    pointer-events: none;
}
.atc-md.atc-back .atc-back-crest-ring2 { inset: 6px; }
.atc-sm.atc-back .atc-back-crest-ring2 { inset: 5px; }
.atc-xs.atc-back .atc-back-crest-ring2 { inset: 4px; }
@keyframes atcCrestSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.atc-back-icon {
    position: relative;
    z-index: 2;
    font-size: 2.6rem;
    color: var(--cb-icon, #a78bfa);
    text-shadow:
        0 0 24px var(--cb-icon-glow1, rgba(167,139,250,0.7)),
        0 0 48px var(--cb-icon-glow2, rgba(167,139,250,0.3));
    animation: atcBackIconPulse 4s ease-in-out infinite;
    line-height: 1;
}
.atc-md.atc-back .atc-back-icon { font-size: 2rem; }
.atc-sm.atc-back .atc-back-icon { font-size: 1.55rem; }
.atc-xs.atc-back .atc-back-icon { font-size: 1.2rem; }
@keyframes atcBackIconPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4) drop-shadow(0 0 8px var(--cb-icon, #a78bfa)); }
}

/* --- Brand name with shimmer --- */
.atc-back-brand {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    text-align: center;
    background: var(--cb-brand-gradient, linear-gradient(90deg, #c4b5fd 0%, #ffd700 50%, #c4b5fd 100%));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: atcBrandShimmer 4s linear infinite;
    filter: drop-shadow(0 0 8px var(--cb-icon-glow1, rgba(167,139,250,0.5)));
}
.atc-md.atc-back .atc-back-brand { font-size: 1.05rem; letter-spacing: 5px; }
.atc-sm.atc-back .atc-back-brand { font-size: 0.8rem; letter-spacing: 3px; }
.atc-xs.atc-back .atc-back-brand { font-size: 0.62rem; letter-spacing: 2px; }
@keyframes atcBrandShimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* --- Subtitle --- */
.atc-back-sub {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.72rem;
    color: var(--cb-sub, rgba(167,139,250,0.45));
    letter-spacing: 2.5px;
    text-align: center;
    text-transform: uppercase;
}
.atc-sm.atc-back .atc-back-sub,
.atc-xs.atc-back .atc-back-sub { font-size: 0.5rem; letter-spacing: 1.5px; }

/* --- Gem ornament row --- */
.atc-back-gem-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.atc-back-gem {
    color: var(--cb-icon, #a78bfa);
    font-size: 0.6rem;
    opacity: 0.55;
    text-shadow: 0 0 8px var(--cb-icon-glow1, rgba(167,139,250,0.5));
}
.atc-back-gem-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cb-dot, #a78bfa);
    box-shadow: 0 0 10px var(--cb-dot-glow, rgba(167,139,250,0.6));
    animation: atcBackDotPulse 3s ease-in-out infinite;
}
.atc-back-gem-dot:nth-child(2) { animation-delay: 0.6s; opacity: 0.7; }
.atc-back-gem-dot:nth-child(4) { animation-delay: 1.2s; opacity: 0.5; }
.atc-xs.atc-back .atc-back-gem-dot { width: 5px; height: 5px; }
@keyframes atcBackDotPulse {
    0%, 100% { opacity: 0.45; box-shadow: 0 0 6px var(--cb-dot-glow, rgba(167,139,250,0.4)); }
    50% { opacity: 1; box-shadow: 0 0 16px var(--cb-dot-glow, rgba(167,139,250,0.9)); }
}


/* ================================================================
   CARD THEME SYSTEM — body[data-card-theme="X"] overrides
   Applied to card backs and general card chrome.
   ================================================================ */

/* ── Ember Theme (fire / crimson) ── */
body[data-card-theme="ember"] {
    --cb-border: rgba(251,146,60,0.45);
    --cb-inner-border: rgba(251,146,60,0.08);
    --cb-glow: rgba(220,80,20,0.2);
    --cb-top-shine: rgba(251,146,60,0.22);
    --cb-top-glow: rgba(234,88,12,0.22);
    --cb-bot-glow: rgba(153,27,27,0.15);
    --cb-side-glow: rgba(180,40,10,0.07);
    --cb-bg-top: #261008;
    --cb-bg-mid: #180a04;
    --cb-bg-bot: #0e0402;
    --cb-corner: #fb923c;
    --cb-ring: rgba(251,146,60,0.4);
    --cb-ring2: rgba(251,146,60,0.2);
    --cb-icon: #fb923c;
    --cb-icon-glow1: rgba(251,146,60,0.7);
    --cb-icon-glow2: rgba(251,146,60,0.3);
    --cb-brand-gradient: linear-gradient(90deg, #fb923c 0%, #ffd700 50%, #fb923c 100%);
    --cb-line: rgba(251,146,60,0.5);
    --cb-sub: rgba(251,146,60,0.5);
    --cb-dot: #fb923c;
    --cb-dot-glow: rgba(251,146,60,0.65);
    --cb-holo1: rgba(251,146,60,0.05);
    --cb-holo2: rgba(251,146,60,0.10);
}
body[data-card-theme="ember"] .atc-back-frame {
    background:
        radial-gradient(ellipse at 50% 15%, rgba(234,88,12,0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 85%, rgba(153,27,27,0.15) 0%, transparent 55%),
        linear-gradient(170deg, #261008 0%, #180a04 40%, #0e0402 100%);
}
body[data-card-theme="ember"] .atc-corner {
    border-color: #fb923c !important;
}
body[data-card-theme="ember"] .atc-gem { color: #fb923c; }
body[data-card-theme="ember"] .atc-top-bar { background: linear-gradient(90deg, transparent, rgba(251,146,60,0.06), transparent); }

/* ── Celestial Theme (blue / silver / cosmic) ── */
body[data-card-theme="celestial"] {
    --cb-border: rgba(34,211,238,0.4);
    --cb-inner-border: rgba(34,211,238,0.08);
    --cb-glow: rgba(6,182,212,0.2);
    --cb-top-shine: rgba(34,211,238,0.2);
    --cb-top-glow: rgba(14,165,233,0.2);
    --cb-bot-glow: rgba(30,64,175,0.12);
    --cb-side-glow: rgba(8,80,150,0.06);
    --cb-bg-top: #080f26;
    --cb-bg-mid: #050c1e;
    --cb-bg-bot: #030812;
    --cb-corner: #22d3ee;
    --cb-ring: rgba(34,211,238,0.4);
    --cb-ring2: rgba(34,211,238,0.2);
    --cb-icon: #22d3ee;
    --cb-icon-glow1: rgba(34,211,238,0.7);
    --cb-icon-glow2: rgba(34,211,238,0.3);
    --cb-brand-gradient: linear-gradient(90deg, #7dd3fc 0%, #ffffff 50%, #7dd3fc 100%);
    --cb-line: rgba(34,211,238,0.5);
    --cb-sub: rgba(34,211,238,0.5);
    --cb-dot: #22d3ee;
    --cb-dot-glow: rgba(34,211,238,0.6);
    --cb-holo1: rgba(34,211,238,0.05);
    --cb-holo2: rgba(34,211,238,0.10);
}
body[data-card-theme="celestial"] .atc-back-frame {
    background:
        radial-gradient(ellipse at 50% 15%, rgba(14,165,233,0.2) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 85%, rgba(30,64,175,0.12) 0%, transparent 55%),
        linear-gradient(170deg, #080f26 0%, #050c1e 40%, #030812 100%);
}
body[data-card-theme="celestial"] .atc-corner {
    border-color: #22d3ee !important;
}
body[data-card-theme="celestial"] .atc-gem { color: #22d3ee; }
body[data-card-theme="celestial"] .atc-top-bar { background: linear-gradient(90deg, transparent, rgba(34,211,238,0.06), transparent); }

/* ── Shadow Theme (deep green / emerald) ── */
body[data-card-theme="shadow"] {
    --cb-border: rgba(74,222,128,0.4);
    --cb-inner-border: rgba(74,222,128,0.08);
    --cb-glow: rgba(34,197,94,0.15);
    --cb-top-shine: rgba(74,222,128,0.18);
    --cb-top-glow: rgba(21,128,61,0.2);
    --cb-bot-glow: rgba(6,78,59,0.12);
    --cb-side-glow: rgba(5,60,40,0.06);
    --cb-bg-top: #050f0a;
    --cb-bg-mid: #030b06;
    --cb-bg-bot: #020703;
    --cb-corner: #4ade80;
    --cb-ring: rgba(74,222,128,0.4);
    --cb-ring2: rgba(74,222,128,0.2);
    --cb-icon: #4ade80;
    --cb-icon-glow1: rgba(74,222,128,0.7);
    --cb-icon-glow2: rgba(74,222,128,0.3);
    --cb-brand-gradient: linear-gradient(90deg, #86efac 0%, #d1fae5 50%, #86efac 100%);
    --cb-line: rgba(74,222,128,0.5);
    --cb-sub: rgba(74,222,128,0.5);
    --cb-dot: #4ade80;
    --cb-dot-glow: rgba(74,222,128,0.6);
    --cb-holo1: rgba(74,222,128,0.04);
    --cb-holo2: rgba(74,222,128,0.09);
}
body[data-card-theme="shadow"] .atc-back-frame {
    background:
        radial-gradient(ellipse at 50% 15%, rgba(21,128,61,0.2) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 85%, rgba(6,78,59,0.12) 0%, transparent 55%),
        linear-gradient(170deg, #050f0a 0%, #030b06 40%, #020703 100%);
}
body[data-card-theme="shadow"] .atc-corner {
    border-color: #4ade80 !important;
}
body[data-card-theme="shadow"] .atc-gem { color: #4ade80; }
body[data-card-theme="shadow"] .atc-top-bar { background: linear-gradient(90deg, transparent, rgba(74,222,128,0.06), transparent); }

/* ── Rarity Section Headers (shared: pack_detail + collection) ──────────── */
.rarity-section {
    margin-bottom: 3.5rem;
}
.rarity-section-mythical {
    margin-bottom: 5rem;
}
.rarity-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.4rem;
    padding: 0 0.25rem;
}
.rarity-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--rs-color, #9ca3af), transparent);
    opacity: 0.35;
}
.rarity-section-badge {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 1.1rem;
    background: rgba(5, 0, 20, 0.7);
    border: 1px solid color-mix(in srgb, var(--rs-color, #9ca3af) 28%, transparent);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px color-mix(in srgb, var(--rs-color, #9ca3af) 10%, transparent),
                inset 0 1px 0 rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.rarity-section-icon {
    color: var(--rs-color, #9ca3af);
    font-size: 0.7rem;
    text-shadow: 0 0 10px var(--rs-color, #9ca3af);
    opacity: 0.85;
}
.rarity-section-name {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--rs-color, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 3.5px;
    text-shadow: 0 0 14px color-mix(in srgb, var(--rs-color, #9ca3af) 45%, transparent);
}
.rarity-section-count {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 1px 8px;
}
.rarity-section-mythical .rarity-section-badge {
    box-shadow: 0 0 30px color-mix(in srgb, var(--rs-color) 20%, transparent),
                inset 0 1px 0 rgba(255,255,255,0.08);
}
.rarity-section-mythical .rarity-section-name {
    animation: rsNameGlow 3s ease-in-out infinite;
}
@keyframes rsNameGlow {
    0%, 100% { text-shadow: 0 0 10px color-mix(in srgb, var(--rs-color) 40%, transparent); }
    50% { text-shadow: 0 0 24px var(--rs-color), 0 0 8px #fff; }
}
.asset-grid-mythical {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    padding: 0.5rem 0 1rem;
}
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 2rem;
    justify-items: center;
}

/* ============================================================
   ARCANE TICKET CARD
   ============================================================ */
.atc-ticket-wrap {
    width: 200px;
    position: relative;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.atc-ticket-wrap.atc-md { width: 265px; }
.atc-ticket-wrap.atc-lg { width: 360px; }
.atc-ticket-wrap.atc-fill { width: 100%; height: 100%; }

.atc-ticket-aura {
    position: absolute;
    inset: -14px;
    border-radius: 22px;
    background: radial-gradient(ellipse at center, rgba(255,215,0,0.38) 0%, transparent 70%);
    animation: ticketAuraPulse 2.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes ticketAuraPulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.atc-ticket-frame {
    background: linear-gradient(155deg, #2b1c00 0%, #1a1000 40%, #0d0800 80%, #1e1400 100%);
    border: 2px solid #ffd700;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
    box-shadow:
        0 0 22px rgba(255,215,0,0.45),
        0 0 60px rgba(255,165,0,0.18),
        inset 0 0 28px rgba(255,215,0,0.05);
}

.atc-ticket-holo {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(
        118deg,
        transparent 0%,
        rgba(255,215,0,0.07) 30%,
        rgba(255,165,0,0.13) 50%,
        rgba(255,215,0,0.07) 70%,
        transparent 100%
    );
    animation: ticketHoloShift 4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ticketHoloShift {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

.atc-ticket-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: #ffd700;
    border-style: solid;
    opacity: 0.85;
}
.atc-ticket-tl { top: 5px; left: 5px; border-width: 2px 0 0 2px; border-radius: 3px 0 0 0; }
.atc-ticket-tr { top: 5px; right: 5px; border-width: 2px 2px 0 0; border-radius: 0 3px 0 0; }
.atc-ticket-bl { bottom: 5px; left: 5px; border-width: 0 0 2px 2px; border-radius: 0 0 0 3px; }
.atc-ticket-br { bottom: 5px; right: 5px; border-width: 0 2px 2px 0; border-radius: 0 0 3px 0; }

.atc-ticket-top-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.38rem 0.6rem 0.3rem;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.08), transparent);
    border-bottom: 1px solid rgba(255,215,0,0.22);
    flex-shrink: 0;
}
.atc-ticket-gem {
    font-size: 0.5rem;
    color: #ffd700;
    text-shadow: 0 0 6px #ffd700;
    flex-shrink: 0;
}
.atc-ticket-title {
    font-family: 'Cinzel', serif;
    font-size: 0.58rem;
    font-weight: 700;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px rgba(255,215,0,0.6);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.atc-ticket-media-frame {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #0a0600;
}
.atc-ticket-media {
    width: 100%;
    height: 100%;
}
.atc-ticket-media video,
.atc-ticket-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.atc-ticket-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(180deg, rgba(255,215,0,0.06) 0%, transparent 60%);
}
.atc-ticket-star {
    font-size: 2.6rem;
    color: #ffd700;
    text-shadow: 0 0 22px rgba(255,215,0,0.85), 0 0 44px rgba(255,165,0,0.4);
    animation: ticketStarPulse 2.2s ease-in-out infinite;
}
@keyframes ticketStarPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.1); opacity: 1; }
}
.atc-ticket-placeholder-text {
    font-family: 'Cinzel', serif;
    font-size: 0.42rem;
    color: rgba(255,215,0,0.45);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    text-align: center;
}
.atc-ticket-media-edge {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 22px;
    background: linear-gradient(to top, rgba(26,16,0,0.92), transparent);
    pointer-events: none;
}

.atc-ticket-body {
    padding: 0.38rem 0.5rem 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
}
.atc-ticket-divider {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.atc-ticket-divider::before,
.atc-ticket-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.38), transparent);
}
.atc-ticket-div-orn {
    color: #ffd700;
    font-size: 0.45rem;
    opacity: 0.65;
}
.atc-ticket-label {
    font-family: 'Cinzel', serif;
    font-size: 0.52rem;
    font-weight: 700;
    color: #ffd700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(255,215,0,0.4);
}
.atc-ticket-desc {
    font-size: 0.46rem;
    color: rgba(255,215,0,0.55);
    text-align: center;
    line-height: 1.35;
    font-style: italic;
}
.atc-ticket-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(255,215,0,0.14);
    margin-top: auto;
}
.atc-ticket-footer-text {
    font-size: 0.4rem;
    color: rgba(255,215,0,0.42);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* New badge on ticket */
.atc-ticket-new-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a0a00;
    font-family: 'Cinzel', serif;
    font-size: 0.42rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 5;
    box-shadow: 0 0 8px rgba(255,215,0,0.7);
}

/* Size-specific overrides */
.atc-ticket-wrap.atc-md .atc-ticket-title { font-size: 0.7rem; letter-spacing: 2px; }
.atc-ticket-wrap.atc-md .atc-ticket-label { font-size: 0.62rem; }
.atc-ticket-wrap.atc-md .atc-ticket-desc  { font-size: 0.56rem; }
.atc-ticket-wrap.atc-md .atc-ticket-corner { width: 18px; height: 18px; }
.atc-ticket-wrap.atc-md .atc-ticket-star { font-size: 3.2rem; }
.atc-ticket-wrap.atc-md .atc-ticket-gem { font-size: 0.58rem; }

.atc-ticket-wrap.atc-lg .atc-ticket-title { font-size: 0.88rem; letter-spacing: 3px; }
.atc-ticket-wrap.atc-lg .atc-ticket-label { font-size: 0.82rem; }
.atc-ticket-wrap.atc-lg .atc-ticket-desc  { font-size: 0.72rem; }
.atc-ticket-wrap.atc-lg .atc-ticket-corner { width: 22px; height: 22px; }
.atc-ticket-wrap.atc-lg .atc-ticket-star { font-size: 4.2rem; }
.atc-ticket-wrap.atc-lg .atc-ticket-gem { font-size: 0.7rem; }
.atc-ticket-wrap.atc-lg .atc-ticket-top-bar { padding: 0.6rem 0.8rem; }
.atc-ticket-wrap.atc-lg .atc-ticket-body { padding: 0.6rem 0.8rem 0.7rem; gap: 0.4rem; }

/* ============================================================
   LARGE SIZE — Modal Variant (.atc-lg)
   ============================================================ */
.atc-lg { width: 440px; }
.atc-lg:hover { transform: none; }
.atc-lg .atc-corner { width: 32px; height: 32px; }
.atc-lg .atc-top-bar { padding: 12px 18px; gap: 10px; }
.atc-lg .atc-gem { font-size: 0.65rem; }
.atc-lg .atc-name { font-size: 1.15rem; letter-spacing: 1px; }
.atc-lg .atc-media-frame { margin: 0 12px; }
.atc-lg .atc-lvl-badge { padding: 5px 12px 5px 8px; }
.atc-lg .atc-lvl-text { font-size: 0.65rem; }
.atc-lg .atc-lvl-num { font-size: 1.35rem; }
.atc-lg .atc-body { padding: 10px 16px 14px; }
.atc-lg .atc-divider { margin-bottom: 12px; }
.atc-lg .atc-stat { width: 90px; }
.atc-lg .atc-stat-ring { width: 68px; height: 68px; margin-bottom: 6px; }
.atc-lg .atc-stat-num { font-size: 1.15rem; }
.atc-lg .atc-stat-lbl { font-size: 0.55rem; letter-spacing: 3px; }
.atc-lg .atc-power-bar { padding: 8px 12px; margin-bottom: 10px; }
.atc-lg .atc-power-val { font-size: 1.4rem; }
.atc-lg .atc-power-star { font-size: 1rem; }
.atc-lg .atc-power-label { font-size: 0.55rem; letter-spacing: 4px; }
.atc-lg .atc-flavor {
    font-size: 0.92rem;
    -webkit-line-clamp: unset;
    overflow: visible;
    margin-bottom: 10px;
}
.atc-lg .atc-rarity { font-size: 0.7rem; letter-spacing: 3px; }
.atc-lg .atc-pack { font-size: 0.55rem; }
.atc-lg .atc-qty-badge { font-size: 0.7rem; padding: 3px 8px; }
.atc-lg .atc-new-badge { font-size: 0.55rem; padding: 3px 8px; }
@media (max-width: 480px) {
    .atc-lg { width: min(92vw, 440px); }
}

@media (max-width: 768px) {
    .rarity-section { margin-bottom: 2.5rem; }
    .rarity-section-mythical { margin-bottom: 3.5rem; }
    .asset-grid { gap: 1.5rem; }
    .asset-grid-mythical { gap: 2rem; }
}

/* ============================================================
   ATC MODAL OVERLAY SYSTEM
   ============================================================ */
.atc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 2rem 1rem 3rem;
}
.atc-modal-overlay.active { display: flex; }

.atc-modal-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    max-width: 480px;
    width: 100%;
    animation: atcModalIn 0.35s cubic-bezier(0.23,1,0.32,1);
}
@keyframes atcModalIn {
    from { transform: scale(0.92) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.atc-modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1010;
    background: rgba(20, 10, 40, 0.85);
    color: #e5e5e5;
    border: 1px solid rgba(167,139,250,0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}
.atc-modal-close:hover {
    background: rgba(239, 68, 68, 0.7);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

.atc-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    background: rgba(10, 5, 20, 0.75);
    border: 1px solid rgba(167,139,250,0.25);
    border-radius: 50%;
    color: #c4b5fd;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.atc-modal-nav:hover {
    background: rgba(167,139,250,0.3);
    border-color: rgba(167,139,250,0.5);
    color: #fff;
}
.atc-modal-nav-left { left: 6px; }
.atc-modal-nav-right { right: 6px; }

.atc-modal-counter {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    background: rgba(10, 5, 20, 0.7);
    padding: 2px 10px;
    border-radius: 10px;
    letter-spacing: 2px;
    backdrop-filter: blur(4px);
}

.atc-media-overlay-btns {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    display: flex;
    gap: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}
.atc-lg:hover .atc-media-overlay-btns,
.atc-media-frame:hover .atc-media-overlay-btns,
.atc-media-overlay-btns:hover,
.atc-media-overlay-btns.show {
    opacity: 1;
    pointer-events: auto;
}
.atc-media-overlay-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 1px solid;
    text-decoration: none;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
@keyframes atcChampionPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,0.3), 0 0 20px rgba(255,215,0,0.1), inset 0 1px 0 rgba(255,255,255,0.15); }
    50% { box-shadow: 0 0 14px rgba(255,215,0,0.5), 0 0 30px rgba(255,215,0,0.2), inset 0 1px 0 rgba(255,255,255,0.2); }
}
.atc-media-overlay-mc {
    background: linear-gradient(135deg, rgba(180,130,0,0.7) 0%, rgba(120,80,0,0.75) 50%, rgba(180,130,0,0.7) 100%);
    border: 1.5px solid rgba(255,215,0,0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 8px 18px;
    border-radius: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: atcChampionPulse 2s ease-in-out infinite;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6), 0 0 10px rgba(255,215,0,0.3);
}
.atc-media-overlay-mc:hover {
    background: linear-gradient(135deg, rgba(220,170,0,0.85) 0%, rgba(160,110,0,0.85) 50%, rgba(220,170,0,0.85) 100%);
    border-color: rgba(255,215,0,0.9);
    color: #fff;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 20px rgba(255,215,0,0.5), 0 0 40px rgba(255,215,0,0.2), 0 4px 15px rgba(0,0,0,0.3);
}
.atc-media-overlay-mc.mc-success {
    background: linear-gradient(135deg, rgba(34,197,94,0.7), rgba(22,163,74,0.75));
    border-color: rgba(34,197,94,0.7);
    color: #fff;
    animation: none;
    box-shadow: 0 0 15px rgba(34,197,94,0.4);
}
.atc-media-overlay-cover {
    background: rgba(160, 130, 0, 0.45);
    border-color: rgba(255,215,0,0.5);
    color: #fef3c7;
}
.atc-media-overlay-cover:hover {
    background: rgba(180, 150, 0, 0.65);
    border-color: rgba(255,215,0,0.8);
    color: #fff;
}
.atc-media-overlay-cover.is-current {
    opacity: 0.5;
    cursor: default;
    background: rgba(80, 70, 20, 0.4);
}

.atc-modal-desc {
    width: 100%;
    max-width: 440px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.6;
    text-align: center;
    padding: 0 0.5rem;
}

.atc-modal-actions {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0 0.5rem;
}

.atc-modal-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.atc-modal-thumbstrip {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 440px;
}
.atc-modal-thumb {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(167,139,250,0.2);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    background: rgba(10, 5, 20, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}
.atc-modal-thumb:hover {
    border-color: rgba(167,139,250,0.5);
    transform: scale(1.08);
}
.atc-modal-thumb.active {
    border-color: #a78bfa;
    box-shadow: 0 0 12px rgba(167,139,250,0.4);
}
.atc-modal-thumb.locked {
    opacity: 0.5;
    border-color: rgba(255,255,255,0.1);
}
.atc-modal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.atc-modal-thumb-icon {
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
}
.atc-modal-thumb-lock {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.atc-modal-thumb-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd700;
    box-shadow: 0 0 4px rgba(255,215,0,0.6);
}

.atc-modal-leveling {
    background: rgba(10, 5, 20, 0.5);
    border: 1px solid rgba(167,139,250,0.15);
    border-radius: 10px;
    padding: 0.8rem 1rem;
}
.atc-modal-leveling .leveling-panel { margin: 0; }

.atc-modal-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
    text-decoration: none;
}
.atc-modal-sell-btn {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.08));
    border-color: rgba(239,68,68,0.3);
    color: #fca5a5;
}
.atc-modal-sell-btn:hover {
    background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(239,68,68,0.15));
    border-color: rgba(239,68,68,0.5);
}
.atc-modal-dl-btn {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
    color: #94a3b8;
}
.atc-modal-dl-btn:hover {
    color: #c084fc;
    border-color: rgba(167,139,250,0.3);
    background: rgba(167,139,250,0.08);
}
.atc-modal-mc-btn {
    background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(167,139,250,0.08));
    border-color: rgba(167,139,250,0.3);
    color: #c4b5fd;
}
.atc-modal-mc-btn:hover {
    background: linear-gradient(135deg, rgba(167,139,250,0.25), rgba(167,139,250,0.15));
    border-color: rgba(167,139,250,0.5);
}
.atc-modal-mc-btn.mc-success {
    background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.1));
    border-color: rgba(34,197,94,0.4);
    color: #86efac;
}
.atc-modal-cover-btn {
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,215,0,0.08));
    border-color: rgba(255,215,0,0.3);
    color: #fde68a;
}
.atc-modal-cover-btn:hover {
    background: linear-gradient(135deg, rgba(255,215,0,0.25), rgba(255,215,0,0.15));
    border-color: rgba(255,215,0,0.5);
}
.atc-modal-cover-btn.is-current {
    opacity: 0.5;
    cursor: default;
}
.atc-modal-listed-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(167,139,250,0.08);
    border: 1px solid rgba(167,139,250,0.2);
    color: #a78bfa;
}

.atc-modal-gallery-locked {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(10,5,20,0.9);
    border-radius: 4px;
    overflow: hidden;
}
.atc-modal-gallery-locked-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.25) saturate(0);
    transform: scale(1.3);
}
.atc-modal-gallery-locked-bg-vid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(40px) brightness(0.25) saturate(0);
    transform: scale(1.3);
}
.atc-modal-locked-fg {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.atc-modal-locked-icon {
    font-size: 2.5rem;
    color: rgba(255,255,255,0.7);
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.8));
}
.atc-modal-locked-text {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}
.atc-modal-locked-nsfw-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #ef4444;
    letter-spacing: 2px;
    padding: 2px 8px;
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 4px;
}
.atc-modal-buy-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid rgba(255,215,0,0.3);
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,215,0,0.08));
    color: #fde68a;
    cursor: pointer;
    transition: all 0.2s;
}
.atc-modal-buy-btn:hover {
    background: linear-gradient(135deg, rgba(255,215,0,0.25), rgba(255,215,0,0.15));
    border-color: rgba(255,215,0,0.5);
}
.atc-modal-ticket-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,215,0,0.4);
    background: linear-gradient(135deg, rgba(43,28,0,0.9), rgba(26,16,0,0.9));
    color: #ffd700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.03em;
}
.atc-modal-ticket-btn:hover {
    background: linear-gradient(135deg, rgba(61,40,0,0.95), rgba(43,28,0,0.95));
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255,215,0,0.3);
}

@media (max-width: 480px) {
    .atc-modal-overlay { padding: 1rem 0.5rem 2rem; }
    .atc-modal-close { top: 8px; right: 8px; width: 36px; height: 36px; font-size: 1.2rem; }
    .atc-modal-action-row { flex-direction: column; align-items: stretch; }
    .atc-modal-action-btn { justify-content: center; }
}
