/* ════════════════════════════════════════════════════════════════════
   Token Clash — Universal Card Overlay (v6 — Pure Text)
   ───────────────────────────────────────────────────────────────────
   Variant 2 (text-only) from card-overlay-preview-v6. Apply to ANY
   card class: collection-card, deck-card-mini, battle-card, library-card.

   Markup contract (rendered by card.js + cardlibrary.js):
     <div class="collection-card legendary">
       <img class="...-bg-art" src="...">
       <div class="card-frame-overlay rarity-legendary"></div>
       <span class="sparkle s1...s14"></span>      <!-- Epic -->
       <div class="card-foil"></div>               <!-- Legendary -->
       <div class="tc-cost">
         <span class="tc-cost-num">8</span>
         <span class="tc-cost-label">GAS</span>
       </div>
       <div class="tc-name"><span class="tc-name-text">Binance Emperor</span></div>
       <div class="tc-stats">
         <div class="tc-stat hp"><span class="num">60</span><span class="label">HP</span></div>
         <div class="tc-stat atk"><span class="num">40</span><span class="label">ATK</span></div>
         <div class="tc-stat def"><span class="num">16</span><span class="label">DEF</span></div>
       </div>
       <div class="tc-badges"> ... </div>
     </div>

   z-index stack: bg-art(1) < frame-overlay(2) < sparkle/foil(4) < text(6)
   "tc-" prefix = TokenClash overlay, avoids conflict with legacy classes.
   ═══════════════════════════════════════════════════════════════════ */

/* ── COST: top-left, big number + GAS label ──────────────────────── */
.tc-cost {
    position: absolute;
    top: 4%; left: 5%;
    z-index: 6;
    container-type: inline-size;
    pointer-events: none;
    text-align: left;
    line-height: 1;
}
.tc-cost-num {
    color: #d0eeff;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 800;
    font-size: clamp(15px, 8cqw, 26px);
    text-shadow: 0 1px 4px rgba(0,0,0,1), 0 0 8px rgba(76,201,255,0.6);
    display: block;
}
.tc-cost-label {
    color: #4cc9ff;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 600;
    font-size: clamp(7px, 3cqw, 10px);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0,0,0,1);
    display: block;
    margin-top: 2px;
    opacity: 0.9;
}

/* ── NAME: bottom-middle, pure text with shadow (no background) ── */
.tc-name {
    position: absolute;
    bottom: 13%; left: 0; right: 0;
    z-index: 6;
    text-align: center;
    container-type: inline-size;
    pointer-events: none;
    padding: 0 8%;
}
.tc-name-text {
    color: rgba(255,255,255,0.9);
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    font-weight: 600;
    font-size: clamp(9px, 4.2cqw, 12px);
    text-shadow: 0 1px 4px rgba(0,0,0,1), 0 0 8px rgba(0,0,0,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* ── STATS: bottom row, pure text (HP/ATK/DEF) ─────────────────── */
.tc-stats {
    position: absolute;
    bottom: 4%; left: 0; right: 0;
    z-index: 6;
    display: flex;
    justify-content: center;
    gap: 4%;
    container-type: inline-size;
    pointer-events: none;
}
.tc-stat {
    display: flex;
    align-items: baseline;
    gap: 3px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    text-shadow: 0 1px 4px rgba(0,0,0,1), 0 0 6px rgba(0,0,0,0.8);
}
.tc-stat .num {
    font-weight: 800;
    font-size: clamp(13px, 7cqw, 19px);
}
.tc-stat .label {
    font-weight: 600;
    font-size: clamp(7px, 3cqw, 10px);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.85;
}
.tc-stat.hp .num    { color: #ffe0e0; }
.tc-stat.atk .num   { color: #fff0c8; }
.tc-stat.def .num   { color: #d0eeff; }
.tc-stat.hp .label  { color: #ff8a8a; }
.tc-stat.atk .label { color: #ffb340; }
.tc-stat.def .label { color: #4cc9ff; }

/* Damaged HP pulse */
.tc-stat.hp.damaged .num {
    color: #ff5050;
    animation: tcHpPulse 1.2s ease-in-out infinite;
}
@keyframes tcHpPulse {
    0%, 100% { text-shadow: 0 1px 2px rgba(0,0,0,1); }
    50%      { text-shadow: 0 0 12px rgba(255,60,40,1), 0 1px 2px rgba(0,0,0,1); }
}

/* ── TOP-RIGHT: count + tx/trap badges ─────────────────────────── */
.tc-badges {
    position: absolute;
    top: 4%; right: 5%;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    pointer-events: none;
}

/* ── ROLE WATERMARK: top-right corner, transparent SVG icon ─────
   Sword (ATK), Shield (DEF), Sword+Shield X (HYB) — generated via
   Claude Design as transparent watermark icons. Files in /img/icons/.
   Pure background-image, no container — minimum coverage of card art. */
.tc-role-watermark {
    position: absolute;
    top: 5%; right: 5%;
    z-index: 6;
    width: 22%;
    aspect-ratio: 1;
    max-width: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    opacity: 0.7;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.95));
    container-type: inline-size;
}
.tc-role-watermark.atk { background-image: url('/img/icons/crossed-swords-watermark.svg'); }
.tc-role-watermark.def { background-image: url('/img/icons/shield-watermark.svg'); }
.tc-role-watermark.hyb { background-image: url('/img/icons/sword-shield-crossed-watermark.svg'); }

/* ── Trap/TX text-area for transaction & trap card types ───────── */
/* Transaction/Trap cards have ability text instead of stats */
.tc-tx-text {
    position: absolute;
    bottom: 4%; left: 8%; right: 8%;
    z-index: 6;
    color: rgba(255,255,255,0.95);
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    font-weight: 500;
    font-size: clamp(8px, 3.5cqw, 11px);
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,1);
    container-type: inline-size;
    pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════════
   LEGACY MARKUP DISABLE — hide pre-v6 inner elements that conflict
   ═══════════════════════════════════════════════════════════════════ */

.collection-card-id,
.collection-card-name,
.collection-card-stats,
.collection-card-footer,
.collection-card-top,
.deck-card-mini-id,
.deck-card-mini-name,
.deck-card-mini-stats,
.deck-card-mini-footer,
.deck-card-mini-top,
.battle-card-name,
.battle-card-stats,
.battle-card-footer,
.battle-card-cost,
.battle-card-tx-text,
.library-card-top,
.library-card-name,
.library-card-stats,
.library-card-footer,
.library-card .card-id {
    display: none !important;
}
