/* TNT Decklist Premium Styles */

:root {
    --tnt-gold:     #c5a059;
    --tnt-gold-dim: rgba(197, 160, 89, 0.3);
    --tnt-accent:   #4fb7b4;
    --tnt-accent-dim: rgba(79, 183, 180, 0.22);
    --tnt-dark:     #050505;
    --tnt-card:     #0c0c0c;
}

.tnt-deck-container {
    font-family: 'Merriweather', serif;
    background: var(--tnt-dark);
    border: 1px solid var(--tnt-gold-dim);
    color: #e5e7eb;
    margin: 2rem 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}

/* Header */
.tnt-deck-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 1rem 1.5rem 1.1rem;
    background: #0a0a0a;
    border-bottom: 1px solid var(--tnt-gold-dim);
    gap: 0.85rem;
}

.tnt-header-left,
.tnt-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tnt-header-left {
    gap: 0.65rem;
}

.tnt-header-right {
    gap: 0.8rem;
}

.tnt-pill {
    font-family: 'Beleren', sans-serif;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    border: 1px solid var(--tnt-gold-dim);
    color: var(--tnt-gold);
    background: rgba(197, 160, 89, 0.05);
}

.tnt-btn-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--tnt-gold);
    color: var(--tnt-gold);
    min-height: 32px;
    padding: 7px 13px;
    font-family: 'Beleren', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation; /* eliminate 300ms iOS tap delay */
    -webkit-tap-highlight-color: transparent;
}
.tnt-btn-action:hover { background: var(--tnt-gold); color: #000; }
.tnt-btn-action.btn-secondary { border-color: #666; color: #aaa; }
.tnt-btn-action.btn-secondary:hover { background: #333; color: #fff; }
.tnt-deck-container a:focus-visible,
.tnt-deck-container button:focus-visible,
.tnt-modal button:focus-visible,
.tnt-modal select:focus-visible,
.tnt-modal textarea:focus-visible,
.tnt-deck-search:focus-visible {
    outline: 2px solid var(--tnt-accent);
    outline-offset: 3px;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hero */
.tnt-deck-hero {
    position: relative;
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--tnt-gold-dim);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tnt-hero-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center 20%;
    opacity: 0.4;
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
}

.tnt-hero-content { position: relative; z-index: 2; }
.tnt-hero-title {
    margin: 0;
    line-height: 1.1;
    /* Multi-layer shadow creates a readable halo against any art background */
    text-shadow: 0 1px 3px rgba(0,0,0,1), 0 4px 12px rgba(0,0,0,0.9), 0 8px 28px rgba(0,0,0,0.75);
}

.tnt-commander-link,
.tnt-commander-link:hover,
.tnt-commander-link:focus,
.tnt-commander-link:active,
.tnt-commander-link:visited {
    font-family: 'Beleren', serif;
    font-size: clamp(1.2rem, 5.5vw, 2.5rem);
    color: #fff;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    background-image: none !important;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
.tnt-commander-link:hover {
    color: var(--tnt-gold);
    text-shadow: 0 0 20px var(--tnt-gold-dim);
}

/* Partner commander layout */
.tnt-hero-title--partner .tnt-commander-link { font-size: clamp(0.85rem, 3vw, 1.8rem); }

/*
 * Both partner-col commander links MUST be block + overflow:hidden + nowrap.
 *
 * Why:
 *  - display:block → the element's offsetWidth is constrained to the
 *    column's CONTENT width (not the padded total), giving JS a reliable
 *    measurement target.
 *  - white-space:nowrap → keeps text on one line so scrollWidth reflects
 *    the full text run, not a multi-line wrapped height.
 *  - overflow:hidden → ensures scrollWidth > offsetWidth is a valid
 *    overflow signal even when the element is block-level.
 *
 * Without these, the inline / unconstrained element inflates to fit its own
 * text, so scrollWidth ≤ offsetWidth is always true and JS never fires.
 * CSS text-overflow:ellipsis acts as a visual fallback for no-JS visitors.
 */
.tnt-partner-col .tnt-commander-link {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.tnt-partner-sep {
    font-family: 'Beleren', serif;
    font-size: 1.4rem;
    color: var(--tnt-gold);
    opacity: 0.7;
    vertical-align: middle;
}

.tnt-hero-label {
    font-family: 'Beleren', sans-serif;
    color: var(--tnt-gold);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.tnt-hero-label::before,
.tnt-hero-label::after {
    content: '';
    display: block;
    height: 1px;
    width: 1.5rem;
    background: var(--tnt-gold);
    opacity: 0.6;
    flex-shrink: 0;
}
.tnt-hero-sub   { font-style: italic; color: #ccc; font-size: 0.9rem; margin-top: 0.5rem; }

/* Nameplate — structural wrapper only; visual contrast comes from text-shadow */
.tnt-hero-nameplate {
    display: inline-block;
    max-width: 90%;
}

/*
 * Single-commander link must be block + nowrap so JS can measure scrollWidth.
 * (Partner cols already have an identical block for the same reason.)
 */
.tnt-hero-nameplate .tnt-commander-link {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── PARTNER COMMANDER DUAL-PANEL HERO ─────────────────────────────────────── */

/* Contain clipped panels; slightly taller than single-commander hero */
.tnt-deck-hero--partner {
    overflow: hidden;
    min-height: 290px;
}

/*
 * Art panels — use art_crop images (artwork only, no card frame).
 *
 * FRAMING NOTE: commander art_crops have the character in the upper-centre of
 * the frame.  A vertical position of 20–25 % (rather than 50 %) shows the
 * face and shoulders instead of the torso/background, which looks far more
 * striking behind the name text at the bottom.
 *
 * Horizontal positions diverge slightly for each side so that the commander
 * on the left panel leans toward the left-of-centre of their art, and the one
 * on the right leans toward the right — both commanders end up "facing in"
 * toward the divider, a classic editorial split-portrait composition.
 *
 * A subtle scale + fade-in animation on load adds a premium cinematic feel.
 * opacity: 0 is the starting state; the animation fills in to 0.62 final.
 */
@keyframes tnt-panel-reveal {
    from { opacity: 0; transform: scale(1.07); }
    to   { opacity: 0.62; transform: scale(1); }
}

.tnt-hero-panel {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.62;                          /* fallback / prefers-reduced-motion */
    /* Cinematic entrance: fade in while gently zooming to 1×.
       fill-mode: both → holds the "from" state during any animation-delay so there
       is no flash at the base opacity before the animation clock starts.          */
    animation: tnt-panel-reveal 1s ease-out both;
    will-change: transform, opacity;
}

/* Honour OS-level reduced-motion preference: skip the animation entirely */
@media (prefers-reduced-motion: reduce) {
    .tnt-hero-panel {
        animation: none;
        opacity: 0.62;
    }
}

/*
 * WHY THE OLD APPROACH CUT FACES
 * ───────────────────────────────
 * The previous version set both panels to inset:0 (full container width).
 * With background-size:cover on a wide hero (~900–1100 px), the art_crop
 * (626×457) scales to almost exactly the container width.  That means the
 * face — centred at 50 % of the image — lands at ~50 % of the container,
 * right on the diagonal seam.  The 35 %/65 % background-position had no
 * useful effect: when image ≈ container width there is < 1 px of horizontal
 * room to shift.
 *
 * THE FIX: narrow-panel + edge-anchor (mirrors the GD wider-canvas trick)
 * ────────────────────────────────────────────────────────────────────────
 * Each panel is set to width:62 % and anchored to its own edge of the hero.
 * background-size:cover now scales the art_crop to fill a 62 %-wide element,
 * so the face (at 50 % of the image) sits at 50 % of 62 % = 31 % of the
 * container (left panel) or 69 % (right panel) — both well clear of the
 * diagonal zone (42 %–58 %).
 *
 * CLIP-PATH RECALCULATION
 * ───────────────────────
 * The diagonal still runs from x = 42 % (y = 0) to x = 58 % (y = 100 %)
 * of the CONTAINER, same slope/position as before.  The polygon coordinates
 * are just re-expressed in each panel's own coordinate space:
 *
 *   Left panel (width = 62 %, left-anchored):
 *     seam at top    = 42 % container / 62 % panel = 68 %
 *     seam at bottom = 58 % container / 62 % panel = 94 %
 *
 *   Right panel (width = 62 %, right-anchored, starts at container x = 38 %):
 *     seam at top    = (42 % − 38 %) / 62 % =  6 %
 *     seam at bottom = (58 % − 38 %) / 62 % = 32 %
 *
 * The gold .tnt-hero-divider line (left:50 %, rotate 9°) is mathematically
 * unchanged — it still bisects the diagonal at the container centre.
 */
.tnt-hero-panel--left {
    -webkit-clip-path: polygon(0 0, 68% 0, 94% 100%, 0 100%);
    clip-path: polygon(0 0, 68% 0, 94% 100%, 0 100%);
    width: 62%;
    left: 0;
    right: auto;                            /* override inset:0 from base rule */
    background-position: 50% 20%;          /* face centred within its 62%-wide panel */
    animation-delay: 0s;
}

.tnt-hero-panel--right {
    -webkit-clip-path: polygon(6% 0, 100% 0, 100% 100%, 32% 100%);
    clip-path: polygon(6% 0, 100% 0, 100% 100%, 32% 100%);
    width: 62%;
    right: 0;
    left: auto;                             /* override inset:0 from base rule */
    background-position: 50% 20%;          /* face centred within its 62%-wide panel */
    animation-delay: 0.08s;                /* tiny stagger for visual polish */
}

/* Dark gradient overlay — fades to near-black at the bottom for text legibility */
.tnt-deck-hero--partner .tnt-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.08)  0%,
        rgba(0, 0, 0, 0.52) 55%,
        rgba(5, 5, 5, 0.94) 100%
    );
    z-index: 1;
}

/*
 * Gold \ separator line.
 * Centred at left: 50 %, rotated +9 ° to match the clip-path \ slope.
 * Extended ±20 % past the hero edges so it never looks cropped.
 */
.tnt-hero-divider {
    position: absolute;
    left: 50%;
    top: -20%;
    width: 1px;
    height: 140%;
    background: linear-gradient(
        to bottom,
        transparent                  0%,
        rgba(197, 160, 89, 0.35)    20%,
        var(--tnt-gold)             50%,
        rgba(197, 160, 89, 0.35)    80%,
        transparent                 100%
    );
    transform: translateX(-50%) rotate(9deg);   /* \ direction */
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 0 12px 2px rgba(197, 160, 89, 0.22);
}

/* Hero content sits above overlay (z-index 1) and divider (z-index 2) */
.tnt-deck-hero--partner .tnt-hero-content { z-index: 4; }

/* ── PARTNER HERO CONTENT LAYOUT ────────────────────────────────────────────
 * "PARTNER COMMANDERS" label spans full width.
 * Below it, a flex row splits commander names + type lines to each side.
 * Left col: text left-aligned, padded away from divider.
 * Right col: text right-aligned, padded away from divider.
 * The 12 % padding on each side creates ~24 % of breathing room centred
 * on the divider (which sits at 50 %) — names never touch the line.     */
.tnt-hero-content--partner {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.tnt-partner-cols {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.75rem;
}

.tnt-partner-col { flex: 1; }

.tnt-partner-col--left {
    padding-right: 4%;   /* reduced from 12% — no divider, so no large buffer needed */
    text-align: left;
}

.tnt-partner-col--right {
    padding-left: 4%;    /* reduced from 12% — gives long names ~46% of hero width */
    text-align: right;
}

/* Right-side type line aligns right (the commander link itself is handled
   by the shared .tnt-partner-col rule above which sets display:block for both). */
.tnt-partner-col--right .tnt-hero-sub { text-align: right; }

/* Command Zone Showcase */
.tnt-deck-hero {
    display: none !important;
}

.tnt-command-zone {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--tnt-gold-dim);
    background: #050505;
}

.tnt-command-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(135deg, rgba(197, 160, 89, 0.18), rgba(79, 183, 180, 0.12)),
        #080808;
    background-size: cover;
    background-position: center 20%;
    opacity: 0.58;
    filter: saturate(1.08) contrast(1.08);
    transform: scale(1.03);
}

.tnt-command-zone--partner .tnt-command-bg--primary {
    right: 38%;
    clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);
    background-position: center 18%;
}

.tnt-command-zone--partner .tnt-command-bg--secondary {
    left: 38%;
    clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
    background-position: center 18%;
}

.tnt-command-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(5, 5, 5, 0.92) 0%, rgba(5, 5, 5, 0.62) 42%, rgba(5, 5, 5, 0.22) 100%),
        linear-gradient(0deg, rgba(5, 5, 5, 0.96) 0%, rgba(5, 5, 5, 0.18) 62%, rgba(5, 5, 5, 0.42) 100%);
}

.tnt-command-stage {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    min-height: 320px;
    padding: 2.25rem;
}

.tnt-command-copy {
    max-width: 920px;
}

.tnt-command-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    color: var(--tnt-gold);
    font-family: 'Beleren', sans-serif;
    font-size: 0.76rem;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.tnt-command-kicker::before {
    content: '';
    width: 1.6rem;
    height: 1px;
    background: linear-gradient(90deg, var(--tnt-gold), rgba(79, 183, 180, 0.55));
}

.tnt-command-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.28em 0.36em;
    margin: 0;
    line-height: 1.02;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 14px 34px rgba(0, 0, 0, 0.82);
}

.tnt-command-link,
.tnt-command-link:visited {
    min-width: 0;
    color: #fff;
    font-family: 'Beleren', serif;
    font-size: 3.25rem;
    line-height: 1.02;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    background-image: none !important;
    transition: color 0.18s ease, text-shadow 0.18s ease;
}

.tnt-command-link:hover,
.tnt-command-link:focus {
    color: var(--tnt-gold);
    text-shadow: 0 0 22px rgba(197, 160, 89, 0.28);
}

.tnt-command-sep {
    color: var(--tnt-gold);
    font-family: 'Beleren', serif;
    font-size: 2rem;
    opacity: 0.8;
}

.tnt-command-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    margin-top: 0.85rem;
    color: rgba(229, 231, 235, 0.86);
    font-size: 0.88rem;
    font-style: italic;
    line-height: 1.45;
}

.tnt-command-types span:not(:last-child)::after {
    content: '/';
    margin-left: 0.75rem;
    color: rgba(197, 160, 89, 0.62);
    font-style: normal;
}

.tnt-command-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.15rem;
}

.tnt-command-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 30px;
    padding: 0.34rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(5, 5, 5, 0.56);
    color: rgba(245, 245, 244, 0.9);
    font: 700 0.72rem/1.1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tnt-command-meta svg {
    color: var(--tnt-accent);
}

@media (max-width: 1100px) {
    .tnt-command-link,
    .tnt-command-link:visited {
        font-size: 2.7rem;
    }

    .tnt-command-sep {
        font-size: 1.7rem;
    }

}

@media (max-width: 900px) {
    .tnt-command-zone {
        min-height: 270px;
    }

    .tnt-command-zone--partner .tnt-command-bg--primary,
    .tnt-command-zone--partner .tnt-command-bg--secondary {
        inset: 0;
        left: 0;
        right: 0;
        clip-path: none;
    }

    .tnt-command-zone--partner .tnt-command-bg--secondary {
        opacity: 0.32;
        mix-blend-mode: screen;
    }

    .tnt-command-scrim {
        background:
            linear-gradient(0deg, rgba(5, 5, 5, 0.96) 0%, rgba(5, 5, 5, 0.58) 48%, rgba(5, 5, 5, 0.22) 100%),
            linear-gradient(90deg, rgba(5, 5, 5, 0.86) 0%, rgba(5, 5, 5, 0.28) 100%);
    }

    .tnt-command-stage {
        grid-template-columns: 1fr;
        align-content: end;
        min-height: 270px;
        padding: 1.15rem;
    }

    .tnt-command-link,
    .tnt-command-link:visited {
        font-size: 2.15rem;
    }

    .tnt-command-sep {
        font-size: 1.35rem;
    }

    .tnt-command-meta {
        gap: 0.4rem;
        margin-top: 0.85rem;
    }
}

@media (max-width: 640px) {
    .tnt-command-zone {
        min-height: 250px;
    }

    .tnt-command-stage {
        min-height: 250px;
        padding: 1rem;
    }

    .tnt-command-title {
        gap: 0.22em 0.3em;
    }

    .tnt-command-link,
    .tnt-command-link:visited {
        overflow-wrap: anywhere;
        font-size: 1.82rem;
    }

    .tnt-command-sep {
        font-size: 1.15rem;
    }

    .tnt-command-types {
        font-size: 0.78rem;
        line-height: 1.35;
        margin-top: 0.55rem;
    }
}

@media (max-width: 480px) {
    .tnt-command-zone {
        min-height: 238px;
    }

    .tnt-command-stage {
        min-height: 238px;
        padding: 0.9rem;
    }

    .tnt-command-kicker {
        font-size: 0.68rem;
        margin-bottom: 0.5rem;
    }

    .tnt-command-link,
    .tnt-command-link:visited {
        font-size: 1.55rem;
    }

    .tnt-command-sep {
        font-size: 1rem;
    }

    .tnt-command-types {
        display: none;
    }

    .tnt-command-meta {
        gap: 0.32rem;
        margin-top: 0.65rem;
    }

    .tnt-command-meta span {
        min-height: 28px;
        padding: 0.3rem 0.5rem;
        font-size: 0.66rem;
    }
}

/* Body Layout */
.tnt-deck-body {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
}

.tnt-deck-list-col {
    flex: 1;
    padding: 2rem;
    border-right: 1px solid var(--tnt-gold-dim);
    background: #0c0c0c;
    min-width: 0;
}

.tnt-deck-sidebar {
    width: 320px;
    max-width: 100%;
    flex-shrink: 0;
    padding: 2rem;
    background: #080808;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 0;
}

.tnt-deck-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
}

.tnt-deck-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
    color: var(--tnt-accent);
}

.tnt-deck-search {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: #f4f4f5;
    font: 600 0.82rem/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tnt-deck-search::placeholder { color: rgba(255,255,255,0.38); }

.tnt-filter-empty {
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    border: 1px dashed rgba(255,255,255,0.14);
    border-radius: 6px;
    color: #9ca3af;
    text-align: center;
    font-size: 0.85rem;
}

.tnt-deck-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
}

.tnt-card-group {
    width: 100%;
    min-width: 0;
}

.tnt-card-group h4 {
    color: var(--tnt-gold);
    font-size: 0.8rem;
    border-bottom: 1px solid var(--tnt-gold-dim);
    padding-bottom: 0.5rem;
    margin-bottom: 0.55rem;
    display: flex;
    justify-content: space-between;
    text-transform: uppercase;
}

.tnt-card-item {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) max-content;
    column-gap: 0.55rem;
    row-gap: 0.1rem;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
    align-items: center;
    position: relative;
    min-width: 0;
}
.tnt-card-qty  { grid-column: 1; color: #666; width: 2rem; text-align: right; font-feature-settings: "tnum"; }
.tnt-card-name {
    grid-column: 2;
    color: #e5e7eb; text-decoration: none;
    white-space: normal; overflow: visible; text-overflow: clip;
    min-width: 0; display: block;
    line-height: 1.35;
    transition: color 0.2s ease;
}
.tnt-card-name:hover { color: var(--tnt-gold); }

.tnt-card-name-wrap {
    grid-column: 2;
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
}
.tnt-card-name-wrap .tnt-card-name {
    grid-column: auto;
    display: inline;
    min-width: 0;
}

.tnt-card-meta {
    --tnt-card-meta-gap: 0.46rem;
    grid-column: 3;
    display: inline-flex;
    align-items: center;
    gap: var(--tnt-card-meta-gap);
    justify-content: flex-end;
    justify-self: end;
    min-width: 13.4rem;
}

.tnt-card-meta > * {
    margin-inline: 0;
}

.tnt-card-price {
    width: 4.35rem;
    min-width: 4.35rem;
    text-align: right;
    font-size: 0.75rem;
    color: #d7dee9;
    font-weight: 700;
    font-feature-settings: "tnum";
    text-shadow: 0 0 12px rgba(215, 222, 233, 0.12);
}

.tnt-card-mana {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    justify-content: flex-end;
    width: 3.05rem;
    min-width: 3.05rem;
    opacity: 0.94;
}

.tnt-card-mana .ms {
    font-size: 0.78rem;
    margin: 0;
}

.tnt-set-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.2rem;
    min-width: 4.2rem;
    padding: 2px 5px;
    border: 1px solid rgba(126,230,226,0.42);
    border-radius: 4px;
    color: #d5ffff;
    background: linear-gradient(180deg, rgba(79,183,180,0.2), rgba(79,183,180,0.08));
    font: 800 0.58rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    white-space: nowrap;
    box-shadow: inset 0 0 10px rgba(79,183,180,0.12), 0 0 10px rgba(79,183,180,0.08);
}

.tnt-card-mana--empty,
.tnt-set-chip--empty,
.tnt-card-price--empty {
    visibility: hidden;
}

.tnt-tokens-panel .tnt-card-item {
    grid-template-columns: minmax(0, 1fr);
}

.tnt-tokens-panel .tnt-card-name {
    grid-column: 1;
}

.tnt-tokens-panel .tnt-card-meta {
    display: none;
}

.tnt-card-item[hidden],
.tnt-card-group[hidden] {
    display: none !important;
}

.tnt-dfc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: 1rem;
    min-width: 1rem;
    color: var(--tnt-gold);
    opacity: 0.72;
    font-size: 0.7em;
}
.tnt-dfc-icon svg { width: 12px; height: 12px; }

/* Sidebar Elements */
.tnt-price-box   { text-align: center; margin-bottom: 0.5rem; }
.tnt-price-label { display: block; font-family: 'Beleren', sans-serif; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; color: #9ca3af; margin-bottom: 0.25rem; }
.tnt-price-val   { font-family: 'Beleren', serif; font-size: 2.5rem; color: #c5a059; text-shadow: 0 0 20px var(--tnt-gold-dim); }

.tnt-price-leaders {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tnt-price-leader {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.75rem;
    color: #9ca3af;
    font-size: 0.78rem;
}

.tnt-price-leader__name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tnt-price-leader strong {
    color: #e5e7eb;
    font-feature-settings: "tnum";
}

.tnt-actions { display: flex; flex-direction: column; gap: 1rem; }

/* Button Styles */
.tnt-buy-btn {
    display: flex; flex-direction: column; align-items: center; width: 100%;
    padding: 1.15rem 1rem; text-decoration: none; text-transform: uppercase; font-family: 'Beleren', sans-serif;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    position: relative; overflow: hidden;
    backface-visibility: hidden;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.4), 0 4px 15px rgba(0,0,0,0.4);
}
.tnt-buy-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }


/* Button Variants */
.btn-gold {
    background: linear-gradient(135deg, #11A651 0%, #0c7b3c 100%);
    color: #fff !important; font-weight: bold;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.4), 0 4px 15px rgba(17, 166, 81, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.5);
}
.btn-gold::after {
    content: '';
    position: absolute;
    right: 4px; top: 50%; transform: translateY(-50%);
    width: 60px; height: 60px;
    background-image: url('../images/tcgplayer-logo.svg');
    background-size: contain; background-repeat: no-repeat; background-position: center;
    opacity: 0.28; pointer-events: none;
}
.btn-gold .btn-main { color: #fff !important; }
.btn-gold .btn-sub  { color: rgba(255,255,255,0.8) !important; font-weight: normal; }

.btn-manapool {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%) !important;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.4), 0 4px 15px rgba(59,130,246,0.15) !important;
    border: 1px solid #60a5fa !important;
}
.btn-manapool::after {
    content: '';
    position: absolute;
    right: 4px; top: 50%; transform: translateY(-50%);
    width: 60px; height: 60px;
    background-image: url('../images/manapool-logo.svg');
    background-size: contain; background-repeat: no-repeat; background-position: center;
    opacity: 0.28; pointer-events: none;
}
.btn-manapool .btn-main { color: #ffffff !important; }
.btn-manapool .btn-sub  { color: rgba(255,255,255,0.8) !important; }
.btn-manapool:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%) !important;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.4), 0 0 15px rgba(59,130,246,0.28) !important;
}

.btn-moxfield {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: #fff !important;
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.4), 0 4px 15px rgba(124, 58, 237, 0.18);
}
.btn-moxfield::after {
    content: '';
    position: absolute;
    right: -5px; top: 50%; transform: translateY(-50%);
    width: 70px; height: 70px;
    background-image: url('../images/moxfield-logo.svg');
    background-size: contain; background-repeat: no-repeat; background-position: center;
    opacity: 0.28; pointer-events: none;
}
.btn-moxfield .btn-sub { color: rgba(255,255,255,0.8); }

.btn-wny {
    background: linear-gradient(135deg, #0a0a0a 0%, #111827 100%);
    color: #ffffff !important;
    border: 1px solid rgba(59, 159, 232, 0.5);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.08), inset 0 -2px 4px rgba(0,0,0,0.5), 0 4px 15px rgba(59,159,232,0.1);
}
.btn-wny::after {
    content: '';
    position: absolute;
    right: 2px; top: 50%; transform: translateY(-50%);
    width: 72px; height: 72px;
    background-image: url('../images/wnygaming-logo.webp');
    background-size: contain; background-repeat: no-repeat; background-position: center;
    opacity: 0.22; pointer-events: none;
}
.btn-wny:hover {
    background: linear-gradient(135deg, #0d1117 0%, #1a2744 100%);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.08), inset 0 -2px 4px rgba(0,0,0,0.5), 0 0 18px rgba(59,159,232,0.18);
}
.btn-wny .btn-main { color: #ffffff !important; }
.btn-wny .btn-sub  { color: rgba(255,255,255,0.7) !important; }

.btn-main { font-weight: 800; font-size: 1.4rem; letter-spacing: 0.05em; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.btn-sub  { font-size: 0.85rem; opacity: 1; margin-top: 2px; letter-spacing: 0.1em; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

.tnt-mobile-actionbar {
    display: none;
}

.tnt-mana-curve { margin-top: auto; padding-top: 1rem; }
.curve-title    { text-align: center; font-family: 'Beleren', sans-serif; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: #666; margin-bottom: 1rem; }
.curve-bars     { display: flex; align-items: flex-end; gap: 4px; height: 80px; padding-bottom: 20px; }
.curve-bar-col  { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.curve-bar      { background: var(--tnt-gold); width: 100%; border-top: 1px solid #fff; transition: height 0.5s; opacity: 0.8; }
.curve-label    { position: absolute; bottom: -20px; width: 100%; text-align: center; font-size: 0.6rem; color: #666; }

/* ── Interactive Mana Curve ─────────────────────────────────────────────────── */

/* Curve title row: title stays centred; Clear button is absolute right */
.tnt-mana-curve .curve-title {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Clickable cursor on bars */
.curve-bar-col { cursor: pointer; }

/* Hover: brighten the bar (mouse-capable devices only) */
@media (hover: hover) and (pointer: fine) {
    .curve-bar-col:hover .curve-bar {
        opacity: 1;
        filter: brightness(1.25);
        box-shadow: 0 0 10px rgba(197,160,89,0.45);
    }
    .curve-bar-col:hover .curve-label { color: var(--tnt-gold); }
}

/* Active / selected bar — gold glow + outline */
.curve-bar-col.tnt-curve-active .curve-bar {
    opacity: 1;
    filter: brightness(1.3);
    box-shadow: 0 0 16px rgba(197,160,89,0.7);
    outline: 1px solid var(--tnt-gold);
}
.curve-bar-col.tnt-curve-active .curve-label {
    color: var(--tnt-gold);
    font-weight: bold;
}

/* Dim sibling bars when one is selected (no :has() — class-based instead) */
.tnt-mana-curve.tnt-curve-filtering .curve-bar-col:not(.tnt-curve-active) .curve-bar {
    opacity: 0.25;
    filter: brightness(0.7);
}
.tnt-mana-curve.tnt-curve-filtering .curve-bar-col:not(.tnt-curve-active) .curve-label {
    opacity: 0.45;
}

/* ✕ Clear filter button — absolute so it doesn't shift the centred title */
.tnt-curve-clear {
    position: absolute;
    right: 0;
    background: none;
    border: 1px solid rgba(197,160,89,0.4);
    color: var(--tnt-gold);
    font-family: 'Beleren', sans-serif;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 2px 7px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.tnt-curve-clear:hover {
    background: rgba(197,160,89,0.12);
    border-color: var(--tnt-gold);
}

/* ── Mana Pip Distribution ─────────────────────────────────────────────────── */
.tnt-pip-chart {
    border-top: 1px solid var(--tnt-gold-dim);
    padding-top: 1.25rem;
}

.tnt-pip-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}

/* Mana font icon — fixed size, no flex shrink so it never gets squeezed */
.tnt-pip-row .ms {
    flex-shrink: 0;
    font-size: 0.95rem;
    line-height: 1;
}

/* Full-width track that the colored fill sits inside */
.tnt-pip-bar-track {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 3px;
    overflow: hidden;
    min-width: 0;
}

/* Colored fill — width set inline proportional to the leading color */
.tnt-pip-bar {
    height: 100%;
    border-radius: 3px;
    opacity: 0.85;
}

/* Right-aligned pip count — tabular figures keep decimals from shifting */
.tnt-pip-count {
    flex-shrink: 0;
    min-width: 2.2rem;
    text-align: right;
    font-size: 0.68rem;
    color: #6b7280;
    font-feature-settings: "tnum";
}

/* ── Curve hover tooltip ─────────────────────────────────────────────────── */
.tnt-curve-tooltip {
    position: fixed;
    z-index: 99998;
    background: #111;
    border: 1px solid var(--tnt-gold);
    padding: 10px 14px;
    pointer-events: none;
    display: none;
    min-width: 170px;
    max-width: 230px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.85);
}

.tnt-curve-tip-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--tnt-gold-dim);
    padding-bottom: 6px;
    margin-bottom: 7px;
    gap: 8px;
}
.tnt-curve-tip-cmc {
    font-family: 'Beleren', serif;
    color: var(--tnt-gold);
    font-size: 0.88rem;
    white-space: nowrap;
}
.tnt-curve-tip-count {
    font-family: 'Beleren', sans-serif;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
    white-space: nowrap;
}

.tnt-curve-tip-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tnt-curve-tip-list li {
    font-size: 0.71rem;
    color: #d1d5db;
    padding: 1px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Merriweather', serif;
}
.tnt-curve-tip-more {
    color: #555 !important;
    font-style: italic;
    margin-top: 3px;
}

/* ── IMPROVED MODAL SYSTEM ─────────────────────────────────────────────────── */

.tnt-modal {
    position: fixed; inset: 0; z-index: 10000;
    display: none;
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
    /* backdrop-filter removed from here — it created a GPU compositor layer
       that rendered above position:fixed elements (tooltip) regardless of z-index.
       The blur is now on .tnt-modal-backdrop instead, same visual result. */
}
.tnt-modal.active {
    display: flex;
    opacity: 1;
}

.tnt-modal-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px); /* blur lives here — inside the stacking context, not on it */
}

.tnt-modal-container {
    position: relative; z-index: 10;
    background: #0c0c0c; border: 1px solid var(--tnt-gold);
    max-width: 95vw; width: 1400px;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    display: flex; flex-direction: column;
    height: 800px;
    border-radius: 8px;
    overflow: hidden;
}

.tnt-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); background: #111;
}
.tnt-modal-header h3  { margin: 0; color: var(--tnt-gold); font-family: 'Beleren', serif; text-transform: uppercase; font-size: 1.2rem; }
.tnt-modal-close      { background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; }
.tnt-modal-close:hover { color: var(--tnt-gold); }

/* Sample Hand Area */
.tnt-sample-area {
    flex: 1; padding: 2rem;
    overflow: hidden;
    background: radial-gradient(circle at center, #1a1a1a 0%, #0c0c0c 100%);
    display: flex; justify-content: center; align-items: center;
    position: relative;
    z-index: 1;
}

.tnt-sample-hand {
    display: flex; justify-content: center;
    perspective: 1000px;
    height: 500px;
    align-items: flex-end;
    width: 100%;
    transform-style: preserve-3d;
}

.tnt-sample-card-wrapper {
    position: relative;
    width: 80px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: auto;
    transition: width 0.3s ease;
}

/* ── TASK 4 FIX: Hover states for the sample hand cards ───────────────────────
   Wrapped in @media (hover: hover) and (pointer: fine) so they ONLY apply on
   devices that have a true hovering pointer (mouse/trackpad).
   Touch screens report (hover: none) and/or (pointer: coarse) so they never
   enter this block — no sticky hover state can occur on mobile.               */
@media (hover: hover) and (pointer: fine) {
    .tnt-sample-card-wrapper:hover {
        width: 260px;
        z-index: 100 !important;
    }

    /* Room cards need a wider hover zone — the landscape card is ~335px wide when rotated */
    .tnt-sample-card-wrapper.has-room-card:hover {
        width: 360px;
    }

    /* Standard portrait cards: lift and straighten */
    .tnt-sample-card-wrapper:hover .sample-card-img:not(.room-card) {
        transform: translateY(-120px) scale(1.1) rotate(0deg) !important;
        box-shadow: 0 40px 80px rgba(0,0,0,0.9);
        z-index: 200;
    }

    /*
     * Room cards: lift to landscape orientation on hover.
     *
     * CRITICAL FIX: The base .sample-card-img style has transform-origin: center 120%
     * (places the origin ~200px below the card bottom, creating the fan spread effect).
     * For room cards we MUST override this to center center — otherwise rotate(90deg)
     * orbits around that far-below point and the card flies completely off-screen.
     */
    .tnt-sample-card-wrapper:hover .sample-card-img.room-card {
        transform-origin: center center !important;
        transform: translateY(-80px) scale(1.05) rotate(90deg) !important;
        box-shadow: 0 40px 80px rgba(0,0,0,0.9);
        z-index: 200;
    }
}

.sample-card-img {
    width: 240px;
    max-width: none !important;
    height: auto;
    border-radius: 10px;
    box-shadow: -10px 10px 25px rgba(0,0,0,0.7);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
    transform-origin: center 120%;
    cursor: pointer; opacity: 0;
    will-change: transform;
    backface-visibility: hidden;
    position: absolute;
    bottom: 20px;
}
.sample-card-img.dealt { opacity: 1; }

.tnt-modal-footer {
    padding: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1);
    background: #111; display: flex; justify-content: center; gap: 1rem;
    z-index: 20; position: relative;
}

.tnt-export-container {
    max-width: 760px;
    height: auto;
    max-height: 88vh;
}

.tnt-export-body {
    display: grid;
    gap: 0.9rem;
    padding: 1.25rem;
}

.tnt-export-format-label {
    color: var(--tnt-gold);
    font: 800 0.7rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tnt-export-format {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(79,183,180,0.3);
    border-radius: 5px;
    background: #080808;
    color: #f4f4f5;
    padding: 0 0.8rem;
}

.tnt-export-output {
    width: 100%;
    min-height: 320px;
    resize: vertical;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    background: #050505;
    color: #e5e7eb;
    padding: 1rem;
    font: 0.82rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    white-space: pre;
}

.tnt-export-footer {
    flex-wrap: wrap;
}

/* ── Sample-hand loader label ──────────────────────────────────────────────── */
.tnt-hand-loader {
    color: #fff;
    font-family: 'Beleren', serif;
    font-size: 1.5rem;
    opacity: 0.8;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ── Placeholder tile for cards Scryfall could not resolve ─────────────────── */
.sample-card-placeholder {
    background: #141414;
    border: 1px solid rgba(197, 160, 89, 0.25);
    width: 240px;
    height: 336px;                /* standard card aspect ratio ≈ 63 × 88 mm */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-family: 'Beleren', serif;
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
    box-sizing: border-box;
    border-radius: 10px;
    box-shadow: -10px 10px 25px rgba(0,0,0,0.7);
    cursor: default;
}

/* ── NEW MOBILE CARD MODAL STYLES ─────────────────────────────────────────── */

.tnt-card-view-modal .tnt-modal-content {
    width: 100%; max-width: 400px;
    background: transparent;
    border: none;
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    padding: 20px;
    pointer-events: none;
}

.tnt-mobile-close {
    position: absolute; top: -40px; right: 0;
    color: #fff; font-size: 2rem;
    background: none; border: none; cursor: pointer;
    pointer-events: auto;
    text-shadow: 0 2px 10px #000;
    z-index: 50;
}

.tnt-mobile-card-display {
    width: 100%;
    perspective: 1000px;
    margin-bottom: 1.5rem;
    pointer-events: auto;
    display: flex; justify-content: center;
}

.tnt-mobile-card-img {
    width: 100%; border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    display: block;
    height: auto; /* T6 – always respect natural aspect ratio */
}

/* T6 – Landscape cards (Battle cards are wider than tall).
   Constrain the width so the card doesn't appear tiny on narrow phone screens. */
.tnt-mobile-card-img.landscape-card {
    width: 88%;
    max-width: 300px;
    margin: 0 auto;
}

/* Dual Faced Card Flip Logic */
.tnt-flip-container {
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    cursor: pointer;
}
.tnt-flip-container::after {
    content: ""; display: block; padding-bottom: 139%;
}
.tnt-flip-face {
    position: absolute; inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.tnt-flip-front { z-index: 2; transform: rotateY(0deg); }
.tnt-flip-back  { transform: rotateY(180deg); }
.tnt-flip-container.flipped { transform: rotateY(180deg); }

.tnt-tap-hint {
    margin-top: 10px;
    color: var(--tnt-gold);
    font-family: 'Beleren', sans-serif;
    font-size: 0.8rem; letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
    animation: pulse 2s infinite;
    pointer-events: auto;
}

.tnt-mobile-actions {
    width: 100%;
    pointer-events: auto;
    animation: slideUp 0.4s ease-out;
    /* T5 – Stack buttons vertically with breathing room between each */
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* ── Base buy button (TCGPlayer gold) ── */
.tnt-mobile-buy-btn {
    position: relative;
    background: linear-gradient(135deg, #c5a059 0%, #d4af37 100%);
    color: #000;
    text-decoration: none;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-family: 'Beleren', sans-serif; font-weight: bold; text-transform: uppercase;
    box-shadow: 0 5px 20px rgba(197, 160, 89, 0.2);
    transition: transform 0.2s, filter 0.2s;
    border: 1px solid transparent;
    box-sizing: border-box;
    overflow: hidden;
}
.tnt-mobile-buy-btn:active { transform: scale(0.96); }
.tnt-mobile-buy-btn:hover  { filter: brightness(1.08); }

/* T5 – ManaPool button variant (blue) */
.tnt-mobile-buy-btn.btn-manapool {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fff !important;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.15);
    border-color: rgba(96, 165, 250, 0.4);
}

/* T5 – WNYGaming button variant (dark blue, WNY brand) */
.tnt-mobile-buy-btn.btn-wny {
    background: linear-gradient(135deg, #0a0a0a 0%, #111827 100%);
    border-color: rgba(59, 159, 232, 0.5);
    color: #ffffff !important;
    box-shadow: 0 5px 20px rgba(59, 159, 232, 0.09);
}
.tnt-mobile-buy-btn.btn-wny::after {
    content: '';
    position: absolute;
    right: 8px; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px;
    background-image: url('../images/wnygaming-logo.webp');
    background-size: contain; background-repeat: no-repeat; background-position: center;
    opacity: 0.2; pointer-events: none;
}
.tnt-mobile-buy-btn.btn-wny:hover { background: linear-gradient(135deg, #0d1117 0%, #1a2744 100%); }

@keyframes pulse   { 0%    { opacity: 0.5; } 50% { opacity: 1; }   100% { opacity: 0.5; } }
@keyframes slideUp { from  { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════════════════════════════════
   ENHANCED GOLDFISH SIMULATOR — Probability HUD + London Mulligan UI
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Goldfish HUD strip (sits in the modal header, between title and close) ── */
.tnt-goldfish-hud {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
    padding-right: 1rem;
    flex-wrap: wrap;
}

/* Probability HUD pill — "Next land  42.3%" */
.tnt-prob-hud {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(197, 160, 89, 0.08);
    border: 1px solid rgba(197, 160, 89, 0.3);
    padding: 4px 12px;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.15);
    animation: slideUp 0.3s ease-out;
}
.tnt-prob-label {
    font-family: 'Beleren', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #9ca3af;
}
.tnt-prob-hud strong {
    font-family: 'Beleren', serif;
    font-size: 1rem;
    color: var(--tnt-gold);
    text-shadow: 0 0 8px rgba(197, 160, 89, 0.4);
    min-width: 3.5ch;
    text-align: right;
}

/* Mulligan badge — "Mulligan 2 · Keep 5" */
.tnt-mulligan-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: 'Beleren', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c5a059;
    background: rgba(197, 160, 89, 0.06);
    border: 1px solid rgba(197, 160, 89, 0.2);
    padding: 3px 10px;
    animation: slideUp 0.25s ease-out;
}
.tnt-mulligan-badge span {
    color: #fff;
    font-weight: 700;
}

/* ── London Mulligan — bottom-selection banner ──────────────────────────────── */
.tnt-bottom-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(197, 160, 89, 0.06);
    border-bottom: 1px solid rgba(197, 160, 89, 0.25);
    font-family: 'Beleren', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #e5e7eb;
    animation: slideUp 0.25s ease-out;
    position: relative;
    z-index: 15;
}
.tnt-bottom-banner strong {
    color: var(--tnt-gold);
    font-size: 1rem;
}
.tnt-bottom-banner svg {
    color: var(--tnt-gold);
}

/* ── Selectable cards during bottom-pick mode ──────────────────────────────── */
.tnt-sample-card-wrapper.tnt-selectable {
    cursor: crosshair;
}
.tnt-sample-card-wrapper.tnt-selectable .sample-card-img {
    filter: brightness(0.9);
    transition: filter 0.2s, box-shadow 0.2s, transform 0.2s;
}
.tnt-sample-card-wrapper.tnt-selectable:hover .sample-card-img {
    filter: brightness(1.05);
}

/* Selected card — ruby tint + downward drift to indicate "going to bottom" */
.tnt-sample-card-wrapper.tnt-card-selected .sample-card-img {
    filter: sepia(0.6) hue-rotate(310deg) brightness(0.85) !important;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5), 0 0 40px rgba(220, 38, 38, 0.2) !important;
    transform: translateY(20px) scale(0.95) !important;
}

/* Mobile-only New Hand button — hidden on desktop, shown via mobile media query */
.tnt-mobile-newhand { display: none; }

/* Disabled mulligan button */
.tnt-btn-action.tnt-btn-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DECK COMPARISON — [tnt_deck_compare] shortcode styles
   Regal Gold aesthetic: deep charcoal backgrounds, gold borders, emerald/ruby diff
   ═══════════════════════════════════════════════════════════════════════════════ */

.tnt-compare-container {
    font-family: 'Merriweather', serif;
    background: var(--tnt-dark);
    border: 1px solid var(--tnt-gold-dim);
    color: #e5e7eb;
    margin: 2rem 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    overflow: hidden;
}

/* ── Summary header ── */
.tnt-compare-summary {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    border-bottom: 1px solid var(--tnt-gold-dim);
    background: #0a0a0a;
    flex-wrap: wrap;
}

.tnt-compare-deck-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.5rem 2rem;
    min-width: 200px;
}
.tnt-compare-deck-meta-b { text-align: right; }

.tnt-compare-deck-name {
    font-family: 'Beleren', serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--tnt-gold);
}
.tnt-compare-deck-price {
    font-family: 'Beleren', serif;
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 0 15px rgba(197,160,89,0.2);
    line-height: 1.1;
}
.tnt-compare-deck-count {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}

/* Centre VS column */
.tnt-compare-vs-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border-left: 1px solid var(--tnt-gold-dim);
    border-right: 1px solid var(--tnt-gold-dim);
    min-width: 160px;
}
.tnt-compare-vs-label {
    font-family: 'Beleren', serif;
    font-size: 1.5rem;
    color: var(--tnt-gold);
    opacity: 0.4;
}

/* Price delta */
.tnt-compare-delta {
    font-family: 'Beleren', serif;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    text-align: center;
}
.tnt-delta-up   { color: #34d399; }  /* emerald — upgraded deck is more expensive */
.tnt-delta-down { color: #f87171; }  /* ruby    — upgraded deck is cheaper        */

/* Change pills */
.tnt-compare-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}
.tnt-cpill {
    font-family: 'Beleren', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border: 1px solid;
}
.tnt-cpill-added     { color: #34d399; border-color: rgba(52,211,153,0.4);  background: rgba(52,211,153,0.06); }
.tnt-cpill-removed   { color: #f87171; border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.06); }
.tnt-cpill-changed   { color: #fbbf24; border-color: rgba(251,191,36,0.4);  background: rgba(251,191,36,0.06); }
.tnt-cpill-unchanged { color: #6b7280; border-color: rgba(107,114,128,0.3); background: transparent; }

/* ── Mana Curve comparison — Chart.js canvases ── */
.tnt-compare-curves {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 1rem 1.5rem 0.75rem;
    background: #0a0a0a;
    border-bottom: 1px solid var(--tnt-gold-dim);
}
.tnt-compare-curve-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}
.tnt-compare-curve-canvas-wrap {
    position: relative;
    height: 90px;
    width: 100%;
}
.tnt-compare-curve-canvas {
    cursor: pointer;
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.tnt-compare-curve-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    flex-shrink: 0;
}
.tnt-curve-mid-label {
    font-family: 'Beleren', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #444;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.tnt-curve-key {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.55rem;
    font-family: 'Beleren', sans-serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tnt-curve-key-a { color: var(--tnt-gold); opacity: 0.6; }
.tnt-curve-key-b { color: #60a5fa; opacity: 0.6; }

/* ── Side-by-side body ── */
.tnt-compare-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.tnt-compare-col { padding: 2rem; background: #0c0c0c; min-width: 0; }
.tnt-compare-col-b { background: #0a0a0a; border-left: 1px solid var(--tnt-gold-dim); min-width: 0; }

.tnt-compare-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--tnt-gold-dim);
}
.tnt-compare-col-title {
    font-family: 'Beleren', serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--tnt-gold);
}
.tnt-compare-col-count {
    font-size: 0.7rem;
    color: #6b7280;
    font-style: italic;
}

/* ── Diff card items ── */

/* Unchanged — standard styling (inherits .tnt-card-item base) */
.tnt-diff-unchanged .tnt-card-name {
    color: #e5e7eb;
}
.tnt-diff-unchanged .tnt-card-name:hover {
    color: var(--tnt-gold);
}

/* Added — emerald green (only in Deck B) */
.tnt-diff-added {
    background: rgba(52, 211, 153, 0.06);
    border-radius: 2px;
    padding: 1px 4px;
    margin-bottom: 2px !important;
    transition: background 0.2s;
}
.tnt-diff-added:hover { background: rgba(52, 211, 153, 0.14); }
.tnt-diff-added .tnt-card-name { color: #34d399 !important; }

/* Removed — ruby red (only in Deck A) */
.tnt-diff-removed {
    background: rgba(248, 113, 113, 0.06);
    border-radius: 2px;
    padding: 1px 4px;
    margin-bottom: 2px !important;
    transition: background 0.2s;
}
.tnt-diff-removed:hover { background: rgba(248, 113, 113, 0.14); }
.tnt-diff-removed .tnt-card-name { color: #f87171 !important; }

/* Changed — amber (in both, different quantity) */
.tnt-diff-changed {
    background: rgba(251, 191, 36, 0.05);
    border-radius: 2px;
    padding: 1px 4px;
    margin-bottom: 2px !important;
    transition: background 0.2s;
}
.tnt-diff-changed:hover { background: rgba(251, 191, 36, 0.12); }
.tnt-diff-changed .tnt-card-name { color: #fbbf24 !important; }

/* Diff badges (the +/−/~ indicators at the right of each row) */
.tnt-diff-badge {
    flex-shrink: 0;
    font-family: 'Beleren', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    width: 1.6rem;
    text-align: center;
    border-radius: 2px;
    padding: 0 3px;
}
.tnt-diff-badge-added   { color: #34d399; background: rgba(52,211,153,0.1);  }
.tnt-diff-badge-removed { color: #f87171; background: rgba(248,113,113,0.1); }
.tnt-diff-badge-changed { color: #fbbf24; background: rgba(251,191,36,0.1);  }

/* Mana symbols next to card names */
.tnt-compare-mana {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    flex-shrink: 0;
    margin-left: 2px;
    font-size: 0.75em;
    opacity: 0.7;
    line-height: 1;
}
.tnt-compare-mana .tnt-set-chip {
    min-width: auto;
    font-size: 0.62rem;
}
.tnt-compare-mana .ms {
    font-size: 0.9em;
    vertical-align: middle;
}

/* Error paragraph */
.tnt-compare-error {
    color: var(--tnt-gold);
    font-style: italic;
    padding: 1rem;
    border: 1px solid var(--tnt-gold-dim);
    background: rgba(197,160,89,0.04);
    margin: 1rem 0;
}

/* ── MOBILE — max-width: 900px ─────────────────────────────────────────────
   Deck display, comparison view, sample-hand modal, and header adjustments.
   Single combined block to avoid duplicated breakpoints.                     */
@media (max-width: 900px) {

    /* ── Deck display ── */
    .tnt-deck-container { margin: 0; border: none; }

    .tnt-deck-header {
        padding: 0.65rem 0.85rem;
        gap: 0;
    }

    .tnt-header-left {
        min-width: 0;
        justify-content: flex-start;
        gap: 0.4rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tnt-header-left::-webkit-scrollbar {
        display: none;
    }

    .tnt-header-right {
        display: none;
    }

    .tnt-pill {
        flex: 0 0 auto;
        padding: 3px 6px;
        font-size: 0.56rem;
        letter-spacing: 0.08em;
    }

    .tnt-deck-body { flex-direction: column; }

    .tnt-deck-list-col {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--tnt-gold-dim);
        padding: 1.1rem 0.85rem;
    }

    .tnt-deck-sidebar {
        width: 100%;
        position: static;
        padding: 1rem 0.85rem 5.4rem;
        border-top: 1px solid var(--tnt-gold-dim);
        gap: 1rem;
    }

    .tnt-deck-tools {
        align-items: stretch;
        gap: 0.5rem;
        margin-bottom: 1rem;
        padding: 0.62rem 0.72rem;
        border-radius: 6px;
    }

    .tnt-deck-search-wrap {
        min-width: 0;
    }

    .tnt-deck-search {
        min-height: 34px;
        font-size: 0.78rem;
    }

    .tnt-card-group h4 {
        position: sticky;
        top: 0;
        z-index: 3;
        margin: 0.7rem 0 0.38rem;
        padding: 0.38rem 0;
        background: #0c0c0c;
        font-size: 0.72rem;
    }

    .tnt-card-item {
        grid-template-columns: 1.45rem minmax(0, 1fr) max-content;
        column-gap: 0.4rem;
        row-gap: 0;
        align-items: start;
        font-size: 0.83rem;
        margin-bottom: 0.02rem;
    }

    .tnt-card-qty {
        width: 1.45rem;
        font-size: 0.78rem;
    }

    .tnt-card-name {
        line-height: 1.28;
    }

    .tnt-card-meta {
        --tnt-card-meta-gap: 0.28rem;
        grid-column: 3;
        justify-self: end;
        justify-content: flex-end;
        align-self: start;
        min-width: 0;
        flex-wrap: nowrap;
        margin-top: 0.1rem;
    }

    .tnt-set-chip {
        width: 3.6rem;
        min-width: 3.6rem;
        padding: 1px 4px;
        font-size: 0.5rem;
    }

    .tnt-card-mana .ms {
        font-size: 0.66rem;
    }

    .tnt-card-price {
        width: 3.35rem;
        min-width: 3.35rem;
        font-size: 0.68rem;
    }

    .tnt-dfc-icon {
        width: 0.8rem;
        height: 0.8rem;
    }

    .tnt-dfc-icon svg {
        width: 0.65rem;
        height: 0.65rem;
    }

    .tnt-price-box {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid rgba(197, 160, 89, 0.18);
        text-align: left;
    }

    .tnt-price-label {
        margin-bottom: 0;
        font-size: 0.62rem;
        letter-spacing: 0.13em;
    }

    .tnt-price-val {
        font-size: 1.55rem;
    }

    .tnt-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .tnt-buy-btn {
        min-height: 58px;
        justify-content: center;
        padding: 0.62rem 0.5rem;
    }

    .btn-main {
        font-size: 0.78rem;
    }

    .btn-sub {
        font-size: 0.52rem;
        letter-spacing: 0.06em;
    }

    .btn-gold::after,
    .btn-manapool::after,
    .btn-moxfield::after,
    .btn-wny::after {
        width: 42px;
        height: 42px;
        opacity: 0.18;
    }

    .tnt-price-leaders {
        padding: 0.75rem 0 0;
        gap: 0.35rem;
    }

    .tnt-price-leader {
        font-size: 0.74rem;
    }

    .tnt-mobile-actionbar {
        position: sticky;
        bottom: 0;
        z-index: 30;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1px;
        padding: 0.45rem;
        background: rgba(5,5,5,0.94);
        border-top: 1px solid var(--tnt-gold-dim);
        backdrop-filter: blur(12px);
    }

    .tnt-mobile-actionbar button,
    .tnt-mobile-actionbar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.22rem;
        min-height: 52px;
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 6px;
        background: #0c0c0c;
        color: #e5e7eb;
        text-decoration: none;
        font: 800 0.64rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        text-transform: uppercase;
    }

    .tnt-mobile-actionbar svg {
        width: 17px;
        height: 17px;
        color: var(--tnt-accent);
    }

    /* ── Hero — partner layout tightens padding on narrow viewports ── */
    /* ── Comparison view ── */
    .tnt-compare-body { grid-template-columns: 1fr; }
    .tnt-compare-col-b { border-left: none; border-top: 1px solid var(--tnt-gold-dim); }
    .tnt-compare-summary { flex-direction: column; }
    .tnt-compare-vs-col { border-left: none; border-right: none; border-top: 1px solid var(--tnt-gold-dim); border-bottom: 1px solid var(--tnt-gold-dim); }
    .tnt-compare-deck-meta-b { text-align: left; }
    .tnt-compare-curves { flex-direction: column; align-items: stretch; gap: 1rem; }
    .tnt-compare-curve-divider { padding: 0; }
    .tnt-curve-mid-label { writing-mode: horizontal-tb; transform: none; }

    /* ── Goldfish HUD ── */
    .tnt-goldfish-hud { justify-content: flex-start; padding-right: 0; }
    .tnt-prob-hud, .tnt-mulligan-badge { font-size: 0.6rem; }

    /* ── Modal ── */
    .tnt-modal-container { width: 100%; height: 100%; border: none; border-radius: 0; }
    .tnt-export-body { padding: 1rem; }
    .tnt-export-output { min-height: 45vh; }

    /* ── Sample hand: grid layout on mobile instead of fan ── */
    .tnt-sample-hand {
        flex-wrap: wrap;
        height: auto;
        align-items: center;
        perspective: none;
        margin-top: 2rem;
    }
    .tnt-sample-card-wrapper {
        width: 45%;
        height: auto;
        margin-bottom: 1rem;
    }
    .sample-card-img {
        position: relative;
        width: 100%;
        max-width: 100% !important;
        transform: none !important;
        opacity: 1;
        bottom: auto;
    }
    .sample-card-img.room-card {
        transform: rotate(90deg) !important;
        width: 70% !important;
        margin: 15% auto;
    }
    .tnt-sample-area { min-height: 0; align-items: flex-start; overflow-y: auto; padding: 1rem; }

    /* ── Button visibility swaps ── */
    .tnt-compare-btn    { display: none !important; }
    .tnt-desktop-only   { display: none !important; }
    .tnt-mobile-newhand { display: flex !important; }
}

/* ── Partner stacking — max-width: 640px ─────────────────────────────────── */
/*
 * Below 640 px the diagonal partner layout gets too cramped: names collide
 * with the divider and both columns shrink below legible width.
 * Stack the partner cols vertically so each commander name gets full width.
 * The hero grows taller to accommodate two stacked rows.
 */
@media (max-width: 640px) {
    .tnt-deck-hero--partner { min-height: 340px; }

    .tnt-partner-cols {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .tnt-partner-col--left  { padding-right: 0; }
    .tnt-partner-col--right { padding-left: 0; text-align: left; }
    .tnt-partner-col--right .tnt-hero-sub { text-align: left; }

    /* When stacked, each col gets full width — allow larger font than two-col mode */
    .tnt-hero-title--partner .tnt-commander-link { font-size: clamp(1.1rem, 5vw, 1.8rem); }

    .tnt-card-item {
        grid-template-columns: 1.35rem minmax(0, 1fr) max-content;
        align-items: baseline;
        padding: 0.24rem 0;
        margin-bottom: 0;
        border-bottom: 1px solid rgba(197, 160, 89, 0.14);
    }

    .tnt-card-meta {
        --tnt-card-meta-gap: 0.24rem;
        grid-column: 3;
        justify-self: end;
        justify-content: flex-end;
        flex-wrap: nowrap;
        margin-top: 0;
    }

    .tnt-card-mana {
        display: inline-flex;
        width: 3.05rem;
        min-width: 3.05rem;
    }

    .tnt-set-chip {
        display: none;
    }

    .tnt-card-price {
        width: 3.2rem;
        min-width: 3.2rem;
        text-align: right;
    }
}

/* ── Small phones — max-width: 480px ─────────────────────────────────────── */
@media (max-width: 480px) {
    /* clamp() handles font scaling — only structural/spacing overrides here */
    .tnt-deck-header {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .tnt-header-left {
        justify-content: flex-start;
    }

    .tnt-deck-list-col {
        padding: 0.95rem 0.72rem;
    }

    .tnt-deck-grid {
        gap: 0.9rem;
    }

    .tnt-card-group h4 {
        margin-top: 0.55rem;
    }

    .tnt-card-item {
        grid-template-columns: 1.35rem minmax(0, 1fr) max-content;
        column-gap: 0.38rem;
        align-items: baseline;
        padding: 0.24rem 0;
        margin-bottom: 0;
        border-bottom: 1px solid rgba(197, 160, 89, 0.14);
    }

    .tnt-card-qty {
        width: 1.35rem;
        line-height: 1.25;
    }

    .tnt-card-meta {
        --tnt-card-meta-gap: 0.22rem;
        grid-column: 3;
        justify-self: end;
        justify-content: flex-end;
        flex-wrap: nowrap;
        margin-top: 0;
    }

    .tnt-card-mana {
        display: inline-flex;
        width: 2.85rem;
        min-width: 2.85rem;
    }

    .tnt-card-mana .ms {
        font-size: 0.62rem;
    }

    .tnt-set-chip {
        display: none;
    }

    .tnt-card-price {
        width: 3.1rem;
        min-width: 3.1rem;
        text-align: right;
        font-size: 0.68rem;
    }

    .tnt-price-val {
        font-size: 1.45rem;
    }

    .tnt-buy-btn {
        min-height: 54px;
        padding: 0.58rem 0.45rem;
    }

    .btn-main {
        font-size: 0.72rem;
    }

    .btn-sub  {
        font-size: 0.5rem;
    }

    .tnt-mobile-actionbar {
        padding: 0.35rem;
    }

    .tnt-mobile-actionbar button,
    .tnt-mobile-actionbar a {
        min-height: 48px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   COMPARE DECK MODAL
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Modal shell ─────────────────────────────────────────────────────────── */
.tnt-compare-modal-container {
    max-width: 900px !important;
    width: 95vw !important;
    /* Use dvh where available (respects iOS browser chrome), fall back to vh */
    max-height: 90dvh !important;
    max-height: 90vh !important;
    height: 90dvh;
    height: 90vh;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
}

/* ── Strip standalone card box styling when the wrap lives inside the modal ─
   The .tnt-user-compare-wrap shortcode styles (background, border, padding,
   margin) fight the modal layout and cause the double-box / crushed columns
   appearance.  Reset them all here.                                          */
.tnt-compare-modal-container .tnt-user-compare-wrap {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
}

/* ── STATE 1: input form ──────────────────────────────────────────────────── */
#tnt-cdm-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tnt-cdm-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 0;
}

/* Two-column input grid — equal halves, "vs" in the middle */
.tnt-cdm-cols {
    display: grid;
    grid-template-columns: 1fr 36px 1fr;
    gap: 12px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
}

.tnt-user-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* The bordered stats card — label lives above it (same structure as left column),
   so its top edge aligns exactly with the textarea's top edge.               */
.tnt-user-col-theirs {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid rgba(197,160,89,0.18);
    border-radius: 6px;
    background: rgba(255,255,255,0.025);
    box-sizing: border-box;
}

/* "vs" — offset by the label height so it sits between the two content boxes */
.tnt-user-vs {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    /* ~28px = label font-size (16px) × line-height (1.4) + margin-bottom (4px) */
    padding-top: 28px;
    font-family: 'Beleren', serif;
    color: var(--tnt-gold);
    font-size: 1rem;
    opacity: 0.8;
}

/* Commander input + textarea inside modal */
.tnt-compare-modal-container .tnt-user-commander {
    width: 100%;
    box-sizing: border-box;
}
.tnt-compare-modal-container .tnt-user-decklist {
    width: 100%;
    min-height: 220px;
    box-sizing: border-box;
    flex: 1;
}

/* Footer sits flush at the bottom of the form */
.tnt-compare-modal-container .tnt-user-compare-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
    background: var(--tnt-dark);
    padding: 14px 24px;
    border-top: 1px solid var(--tnt-gold-dim);
    margin: 0;
}

/* ── STATE 2: comparison result ───────────────────────────────────────────── */
#tnt-cdm-result {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tnt-cdm-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Strip outer chrome so the compare container fills the modal cleanly */
.tnt-cdm-result-body .tnt-compare-container {
    margin: 0 !important;
    border: none !important;
    border-top: 1px solid var(--tnt-gold-dim) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Both card columns show side-by-side inside the modal — users scroll within the result pane */
.tnt-cdm-result-body .tnt-compare-col {
    padding: 1.5rem;
}

/* Thin gold scrollbar on the result pane */
.tnt-cdm-result-body::-webkit-scrollbar       { width: 5px; }
.tnt-cdm-result-body::-webkit-scrollbar-track  { background: #0a0a0a; }
.tnt-cdm-result-body::-webkit-scrollbar-thumb  { background: var(--tnt-gold-dim); border-radius: 3px; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
    /* Full-screen on mobile; dvh avoids iOS browser-chrome clip */
    .tnt-compare-modal-container {
        height: 100dvh !important;
        height: 100vh !important;
        max-height: 100dvh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        width: 100vw !important;
    }

    /* Stack the two input columns vertically */
    .tnt-cdm-cols {
        grid-template-columns: 1fr !important;
    }

    .tnt-user-vs {
        padding-top: 0;
        text-align: center;
    }

    /* Shorter textarea on mobile so the footer button stays visible */
    .tnt-compare-modal-container .tnt-user-decklist {
        min-height: 160px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CARD HOVER TOOLTIP
   ═══════════════════════════════════════════════════════════════════════════════ */

.tnt-card-tooltip {
    position: fixed;
    z-index: 2147483647; /* max possible — beats backdrop-filter compositor layers */
    pointer-events: none;
    will-change: transform; /* own GPU layer so z-index is respected above modals */
    isolation: isolate;
    display: none;
    filter: drop-shadow(0 6px 28px rgba(0,0,0,0.85));
}

.tnt-tooltip-img {
    display: block;
    width: 200px;
    border-radius: 10px;
    border: 1px solid var(--tnt-gold-dim);
    background: #111;
}

/* Room cards are landscape — rotate them so they read correctly in the tooltip */
.tnt-tooltip-img--room {
    width: 260px;
    transform: rotate(90deg);
    margin: 32px -30px; /* compensate for the rotation shifting the bounding box */
}

/* ─── Suppress tooltip on touch/hover-none devices ─────────────────────────── */
@media (hover: none) {
    .tnt-card-tooltip { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   USER vs. SITE DECK COMPARISON FORM
   ═══════════════════════════════════════════════════════════════════════════════ */

.tnt-user-compare-wrap {
    font-family: 'Merriweather', serif;
    background: var(--tnt-card);
    border: 1px solid rgba(197,160,89,0.25);
    border-radius: 8px;
    padding: 28px 24px;
    margin: 2rem 0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
}

.tnt-user-compare-header {
    text-align: center;
    margin-bottom: 24px;
}

.tnt-user-compare-header h3 {
    font-family: 'Beleren', serif;
    color: var(--tnt-gold);
    font-size: 1.45rem;
    margin: 0 0 8px;
    letter-spacing: 0.03em;
}

.tnt-user-compare-header p {
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
    margin: 0;
}

.tnt-user-compare-cols {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 22px;
}

.tnt-user-col-title {
    font-family: 'Beleren', serif;
    color: var(--tnt-gold);
    font-size: 0.95rem;
    margin-bottom: 10px;
    letter-spacing: 0.04em;
}

/* Commander name input — sits above the decklist textarea */
.tnt-user-commander {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(197,160,89,0.25);
    color: #e5e7eb;
    font-family: 'Merriweather', serif;
    font-size: 0.85rem;
    padding: 8px 12px;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tnt-user-commander::placeholder { color: rgba(255,255,255,0.25); font-style: italic; }
.tnt-user-commander:focus {
    border-color: var(--tnt-gold);
    box-shadow: 0 0 12px rgba(197,160,89,0.18);
}

/* Small label above the commander box */
.tnt-user-commander-label {
    font-family: 'Beleren', serif;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tnt-gold);
    opacity: 0.7;
    margin-bottom: 4px;
    display: block;
}

.tnt-user-decklist {
    width: 100%;
    min-height: 220px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(197,160,89,0.2);
    border-radius: 6px;
    color: rgba(255,255,255,0.85);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    padding: 10px 12px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tnt-user-decklist:focus {
    outline: none;
    border-color: var(--tnt-gold);
    box-shadow: 0 0 12px rgba(197,160,89,0.18);
}

.tnt-user-vs {
    font-family: 'Beleren', serif;
    color: var(--tnt-gold);
    font-size: 1.15rem;
    align-self: center;
    padding: 0 6px;
    opacity: 0.8;
}

.tnt-user-col-theirs {
    padding: 14px 16px;
    border: 1px solid rgba(197,160,89,0.15);
    border-radius: 6px;
    background: rgba(255,255,255,0.02);
    min-height: 130px;
}

.tnt-user-deck-stat {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    margin-bottom: 10px;
    line-height: 1.4;
}

.tnt-user-deck-stat strong {
    display: block;
    color: rgba(255,255,255,0.88);
    font-size: 0.9rem;
    margin-top: 2px;
}

.tnt-user-compare-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.tnt-user-compare-error {
    color: #f87171;
    font-size: 0.82rem;
}

/* Spinner animation used on the Compare button while loading */
@keyframes tntSpin {
    to { transform: rotate(360deg); }
}
.tnt-spin {
    display: inline-block;
    animation: tntSpin 0.9s linear infinite;
}

@media (max-width: 700px) {
    .tnt-user-compare-cols {
        grid-template-columns: 1fr;
    }
    .tnt-user-vs {
        text-align: center;
        padding: 4px 0;
    }
    .tnt-user-col-theirs {
        min-height: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CHART.JS — MANA CURVE + PIP DISTRIBUTION + RADAR CANVASES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Mana Curve (vertical bar) ─────────────────────────────────────────────── */
.tnt-curve-canvas-wrap {
    position: relative;
    height: 100px;
}

.tnt-curve-canvas {
    display: block;
    width: 100%;
}

/* ── Mana Pip Distribution (horizontal bar) ────────────────────────────────── */
.tnt-pip-canvas-wrap {
    position: relative;
    /* height is set dynamically by JS based on bar count */
}

.tnt-pip-canvas {
    display: block;
    width: 100%;
}

/* ── Deck Composition Radar ─────────────────────────────────────────────────── */
.tnt-radar-chart {
    border-top: 1px solid var(--tnt-gold-dim);
    padding-top: 1.25rem;
}

.tnt-radar-canvas {
    display: block;
    width: 100% !important;
    max-width: 260px;
    margin: 0 auto;
}

/* ── Mana Value Stats text block ──────────────────────────────────────────── */
.tnt-mv-stats {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(197,160,89,.15);
    border-radius: 6px;
}
.tnt-mv-stats__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.tnt-mv-stats__line {
    flex: 1;
    height: 1px;
    background: rgba(197,160,89,.25);
}
.tnt-mv-stats__icon {
    display: block;
    width: 12px;
    height: 12px;
    color: rgba(197,160,89,.5);
    flex-shrink: 0;
}
.tnt-mv-stats__text {
    font-size: 0.67rem;
    line-height: 1.7;
    color: #6b7280;
    margin: 0;
}
.tnt-mv-stats__text strong {
    color: #9ca3af;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOKENS USED PANEL — deck-display.php
   ═══════════════════════════════════════════════════════════════════════════════ */

.tnt-tokens-panel {
    border-top: 1px solid var(--tnt-gold-dim);
    margin-top: 2rem;
    padding-top: 2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BUY MISSING CARDS — deck-compare.php upgrade buttons
   ═══════════════════════════════════════════════════════════════════════════════ */

.tnt-compare-upgrades {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(197, 160, 89, 0.04);
    border-bottom: 1px solid var(--tnt-gold-dim);
    flex-wrap: wrap;
}

.tnt-upgrades-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Beleren', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--tnt-gold);
    flex-shrink: 0;
}

.tnt-upgrades-label svg {
    flex-shrink: 0;
}

.tnt-upgrades-btns {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Scale buy buttons down slightly for the compact compare bar */
.tnt-compare-upgrades .tnt-buy-btn {
    padding: 0.6rem 1.1rem;
    min-width: 0;
    flex: 1;
    min-width: 120px;
}

.tnt-compare-upgrades .btn-main { font-size: 0.9rem; }
.tnt-compare-upgrades .btn-sub  { font-size: 0.58rem; }

@media (max-width: 680px) {
    .tnt-compare-upgrades {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }
    .tnt-upgrades-btns {
        width: 100%;
    }
    .tnt-compare-upgrades .tnt-buy-btn {
        flex: 1;
        min-width: 0;
    }
}
