/* ==========================================================================
   Module Cartes : pages Combat, Decks, Éditeur, Échanges, Classement, Profil (préfixe .tpg-)
   DA v7 « Blitz × Meeko ». Chargé avant tcg.css (ordre alphabétique) : classes propres, sélecteurs
   descendants quand il faut surcharger la carte .tc.
   ========================================================================== */
.tpg { --tpg-cat: var(--cat-cards, #6d3cf0); --tpg-deep: #1c0f45; gap: 28px; }
.tpg .is-1 { --medal: #f5b941; }
.tpg .is-2 { --medal: #cfd6e0; }
.tpg .is-3 { --medal: #d9915a; }
.tpg-muted { margin: 0; color: var(--text-2); font-size: 14px; }
.tpg-sec { display: grid; gap: 14px; }
.tpg-h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 800 24px/1.1 var(--f-display, sans-serif); letter-spacing: -.025em; }
.tpg-count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--accent, #ff5b3a); color: var(--accent-ink, #1d0700); font: 800 14px/1 var(--f-display, sans-serif); }
.tpg-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--panel-3); color: var(--text-2); font: 700 12px/1 var(--f-mono, monospace); white-space: nowrap; }
.tpg-pill.is-ok { background: color-mix(in srgb, var(--mint, #3ddc97) 16%, transparent); color: var(--mint, #3ddc97); }
.tpg-pill.is-warn { background: color-mix(in srgb, var(--gold, #f5b941) 16%, transparent); color: var(--gold, #f5b941); }
.tpg-pill.is-ko { background: color-mix(in srgb, var(--loss, #ff4d6a) 16%, transparent); color: var(--loss, #ff4d6a); }
.tpg-textbtn { padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: 600 12px/1 var(--f-body, sans-serif); cursor: pointer; transition: color .15s, background .15s; }
.tpg-textbtn:hover { color: var(--loss, #ff4d6a); background: color-mix(in srgb, var(--loss, #ff4d6a) 12%, transparent); }

/* ---------- Héros (bloc violet catégorie Cartes, splash fondu, halo orange) ---------- */
.tpg-hero {
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px;
    min-height: 320px; padding: 28px 32px; border-radius: 16px; color: #fff;
    border: 1px solid color-mix(in srgb, var(--tpg-cat) 70%, #fff 12%);
    background:
        radial-gradient(70% 110% at 100% 0%, color-mix(in srgb, var(--tpg-cat) 60%, #c9b5ff) 0%, transparent 60%),
        radial-gradient(55% 90% at 0% 100%, rgba(255, 91, 58, .34), transparent 62%),
        linear-gradient(140deg, var(--tpg-cat) 0%, #3b1c99 48%, var(--tpg-deep) 100%);
}
.tpg-hero-bg { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: 70% 20%; opacity: .42; mix-blend-mode: luminosity; -webkit-mask-image: linear-gradient(90deg, transparent 15%, #000 80%); mask-image: linear-gradient(90deg, transparent 15%, #000 80%); pointer-events: none; transition: opacity .3s; }
.tpg-hero-main { display: grid; gap: 4px; align-content: center; min-width: 0; }
.tpg-hero-top { display: flex; align-items: center; gap: 12px; }
.tpg-title { flex: 1; min-width: 0; margin: 0; font: 800 clamp(42px, 6.4vw, 68px)/.92 var(--f-display, sans-serif); letter-spacing: -.045em; color: #fff; overflow-wrap: anywhere; }
.tpg-round { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; font: 800 18px/1 var(--f-display, sans-serif); text-decoration: none; cursor: pointer; transition: background .15s, transform .15s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tpg-round:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.tpg-lead { margin: 10px 0 0; max-width: 44ch; color: rgba(255, 255, 255, .84); font-size: 15px; line-height: 1.45; }
.tpg-hero .tpg-muted { color: rgba(255, 255, 255, .78); }
.tpg-record { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 16px; }
.tpg-record > span { display: grid; gap: 2px; }
.tpg-record b { font: 800 44px/1 var(--f-display, sans-serif); letter-spacing: -.04em; }
.tpg-record b i { font-style: normal; font-size: .5em; opacity: .7; }
.tpg-record b.is-win { color: var(--mint, #3ddc97); }
.tpg-record b.is-loss { color: #ff8197; }
.tpg-record b.is-hot { color: var(--accent-2, #ff7a55); }
.tpg-record small { color: rgba(255, 255, 255, .72); font-size: 12px; }
.tpg-form { display: flex; gap: 4px; margin-top: 10px; }
.tpg-form i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font: 800 11px/1 var(--f-display, sans-serif); font-style: normal; }
.tpg-form i.is-win { background: var(--mint, #3ddc97); color: #04291f; }
.tpg-form i.is-loss { background: var(--loss, #ff4d6a); color: #fff; }

.tpg-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 20px; }
.tpg-go-hint { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .78); font-size: 13px; }
.tpg-hero .tcg-tip > summary { border-color: rgba(255, 255, 255, .35); color: #fff; }
.tpg-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 58px; padding: 0 42px; border: 0; border-radius: 14px; background: var(--accent, #ff5b3a); color: var(--accent-ink, #1d0700); font: 800 22px/1 var(--f-display, sans-serif); letter-spacing: -.02em; text-decoration: none; cursor: pointer; box-shadow: 0 14px 40px -10px rgba(255, 91, 58, .75); transition: transform .15s var(--ease, ease), background .15s, box-shadow .15s; }
.tpg-cta:hover { background: var(--accent-2, #ff7a55); transform: translateY(-2px); box-shadow: 0 18px 48px -10px rgba(255, 91, 58, .9); }
.tpg-cta:active { transform: scale(.97); }
.tpg-cta.is-block { width: 100%; min-height: 52px; font-size: 19px; padding: 0 20px; }
.tpg-hero .tcg-btn:not(.is-primary) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }

/* ---------- Éventail de cartes ---------- */
.tpg-fan { --fw: 120px; position: relative; display: grid; place-items: end center; width: calc(var(--fw) * (1 + (var(--n) - 1) * .42)); max-width: 100%; height: calc(var(--fw) * 1.62); }
.tpg-fan-i { position: relative; grid-area: 1 / 1; display: block; border-radius: 12px; transform-origin: 50% 150%; transform: translateX(calc(var(--i) * var(--fw) * .34)) rotate(calc(var(--i) * 7deg)) translateY(calc(var(--a) * var(--fw) * .04)); z-index: calc(10 - var(--a) * 2); transition: transform .28s var(--ease, ease); }
.tpg-fan-i .tc { --tc-w: var(--fw); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .7); }
.tpg-fan-i::after { content: ""; position: absolute; inset: 0; z-index: 4; border-radius: 12px; pointer-events: none; mix-blend-mode: overlay; background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .5) 48%, transparent 62%) no-repeat; background-size: 260% 100%; background-position: 130% 0; transition: background-position .7s var(--ease, ease); }
:is(a, label, .tpg-foe, .tpg-hero, .tpg-deckbox):hover .tpg-fan-i { transform: translateX(calc(var(--i) * var(--fw) * .48)) rotate(calc(var(--i) * 10deg)) translateY(calc(var(--a) * var(--fw) * .06 - (1 - min(var(--a), 1)) * 10px)); }
:is(a, label, .tpg-foe, .tpg-hero, .tpg-deckbox):hover .tpg-fan-i::after { background-position: -30% 0; }
.tpg-fan.is-hero { --fw: 158px; }
.tpg-fan.is-md { --fw: 92px; }
.tpg-fan.is-sm { --fw: 74px; }
.tpg-fan.is-swap { --fw: 104px; }
.tpg-fan .tc-back { box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .7); }

/* ---------- Combat ---------- */
.tpg-tuto { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent, #ff5b3a) 55%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--accent, #ff5b3a) 26%, var(--panel)), var(--panel) 70%); }
.tpg-tuto-txt { flex: 1 1 200px; display: grid; gap: 2px; }
.tpg-tuto-txt b { font: 800 18px/1.15 var(--f-display, sans-serif); }
.tpg-tuto-txt small { color: var(--text-2); font-size: 13px; }

.tpg-hero-play { min-height: 400px; }
.tpg-hero-play.is-empty .tpg-fan-i { opacity: .55; }
.tpg-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 470px; margin: 20px 0 0; padding: 0; border: 0; }
.tpg-mode { position: relative; display: block; cursor: pointer; }
.tpg-mode input { position: absolute; opacity: 0; pointer-events: none; }
.tpg-mode span { display: grid; gap: 3px; height: 100%; padding: 14px 16px; border: 1.5px solid rgba(255, 255, 255, .16); border-radius: 14px; background: rgba(12, 6, 30, .45); transition: border-color .15s, background .15s, transform .15s; }
.tpg-mode b { font: 800 21px/1 var(--f-display, sans-serif); letter-spacing: -.02em; }
.tpg-mode small { color: rgba(255, 255, 255, .72); font-size: 12px; }
.tpg-mode:hover span { transform: translateY(-2px); border-color: rgba(255, 255, 255, .4); }
.tpg-mode input:checked + span { border-color: #fff; background: rgba(255, 255, 255, .16); }
.tpg-mode.is-ranked input:checked + span { border-color: var(--accent, #ff5b3a); background: color-mix(in srgb, var(--accent, #ff5b3a) 26%, rgba(12, 6, 30, .5)); }
.tpg-mode input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.tpg-mode input:disabled + span { opacity: .45; cursor: not-allowed; transform: none; }

.tpg-hero-deck { display: grid; justify-items: center; gap: 18px; min-width: 0; }
.tpg-deckshow { display: block; text-decoration: none; border-radius: 16px; }
.tpg-deckshow[hidden] { display: none; }
.tpg-deckpick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tpg-deckchip { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 8px; border: 1.5px solid rgba(255, 255, 255, .16); border-radius: 12px; background: rgba(12, 6, 30, .5); color: #fff; font: 700 13px/1.1 var(--f-display, sans-serif); text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.tpg-deckchip:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .45); }
.tpg-deckchip input { position: absolute; opacity: 0; pointer-events: none; }
.tpg-deckchip:has(input:checked) { border-color: #fff; background: rgba(255, 255, 255, .18); }
.tpg-deckchip:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 2px; }
.tpg-deckchip-art { display: flex; }
.tpg-deckchip-art img { width: 22px; height: 30px; margin-left: -10px; border-radius: 4px; object-fit: cover; border: 1px solid rgba(255, 255, 255, .3); }
.tpg-deckchip-art img:first-child { margin-left: 0; }
.tpg-deckchip.is-manage { border-style: dashed; background: transparent; padding: 6px 14px; }

.tpg-foes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.tpg-foe { position: relative; display: grid; gap: 12px; align-content: start; padding: 14px; border: 1px solid var(--line-2); border-radius: 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--tpg-cat) 26%, var(--panel)) 0%, var(--panel) 58%); transition: transform .2s var(--ease, ease), border-color .2s; }
.tpg-foe:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tpg-cat) 70%, #fff 10%); }
.tpg-foe-art { display: grid; place-items: center; height: 124px; }
.tpg-foe-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tpg-foe-id > span { display: grid; gap: 2px; min-width: 0; }
.tpg-foe-id b { font: 800 17px/1.1 var(--f-display, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpg-foe-id small { display: flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 12px; }
.tpg-foe-go { display: flex; align-items: center; gap: 8px; }
.tpg-foe-go .tcg-btn { flex: 1; }
.tpg-foe.is-friend { background: linear-gradient(180deg, color-mix(in srgb, var(--accent, #ff5b3a) 20%, var(--panel)) 0%, var(--panel) 62%); }
.tpg-foe.is-friend .tpg-foe-go .tcg-btn { flex: 1 1 auto; }
.tpg-foe-title { margin: 0; font: 800 20px/1.1 var(--f-display, sans-serif); letter-spacing: -.02em; }
.tpg-friends { display: flex; flex-wrap: wrap; gap: 12px; min-height: 76px; align-content: center; }
.tpg-friend { position: relative; display: grid; justify-items: center; gap: 5px; max-width: 64px; color: var(--text-2); font-size: 11px; cursor: pointer; }
.tpg-friend input { position: absolute; opacity: 0; pointer-events: none; }
.tpg-friend .avatar { outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s, transform .15s; }
.tpg-friend:hover .avatar { transform: translateY(-2px); }
.tpg-friend:has(input:checked) { color: var(--text); }
.tpg-friend:has(input:checked) .avatar { outline-color: var(--accent, #ff5b3a); transform: scale(1.08); }
.tpg-friend:has(input:focus-visible) .avatar { outline-color: #fff; }
.tpg-friend small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpg-switch { display: inline-flex; align-items: center; gap: 8px; font: 700 13px/1 var(--f-display, sans-serif); cursor: pointer; }
.tpg-switch input { appearance: none; -webkit-appearance: none; position: relative; width: 38px; height: 22px; margin: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background .15s; }
.tpg-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease, ease); }
.tpg-switch input:checked { background: var(--accent, #ff5b3a); }
.tpg-switch input:checked::after { transform: translateX(16px); }
.tpg-switch input:disabled { opacity: .4; cursor: not-allowed; }

.tpg-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tpg-rule { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.tpg-rule b { display: flex; align-items: center; gap: 6px; font: 700 14px/1.2 var(--f-display, sans-serif); }
.tpg-rule-pic { display: flex; gap: 4px; height: 34px; }
.tpg-rule-pic i { flex: 1; display: grid; place-items: center; min-width: 0; border-radius: 7px; font: 700 10px/1 var(--f-mono, monospace); font-style: normal; color: #fff; }
.tpg-rule-pic.is-lanes i { background: color-mix(in srgb, var(--tpg-cat) 45%, var(--panel-2)); }
.tpg-rule-pic.is-mana { gap: 3px; }
.tpg-rule-pic.is-mana i { align-self: end; height: calc(30% + var(--k) * 11.6%); background: #1f6fff; opacity: calc(.35 + var(--k) * .11); }
.tpg-rule-pic.is-win i.is-w { background: color-mix(in srgb, var(--mint, #3ddc97) 75%, var(--panel)); }
.tpg-rule-pic.is-win i.is-l { background: color-mix(in srgb, var(--loss, #ff4d6a) 55%, var(--panel)); }

.tpg-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.tpg-game { display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
.tpg-game:hover { transform: translateY(-2px); border-color: var(--line-2); }
.tpg-game-res { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--panel-3); font: 800 22px/1 var(--f-display, sans-serif); }
.tpg-game.is-win { border-color: color-mix(in srgb, var(--mint, #3ddc97) 28%, var(--line)); }
.tpg-game.is-win .tpg-game-res { background: var(--mint, #3ddc97); color: #04291f; }
.tpg-game.is-loss .tpg-game-res { background: var(--loss, #ff4d6a); color: #fff; }
.tpg-game.is-live { border-color: color-mix(in srgb, var(--accent, #ff5b3a) 50%, var(--line)); }
.tpg-game.is-live .tpg-game-res { background: var(--accent, #ff5b3a); color: var(--accent-ink, #1d0700); font-size: 11px; }
.tpg-game-who { display: grid; gap: 2px; min-width: 0; }
.tpg-game-who b { font: 700 15px/1.15 var(--f-display, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpg-game-who small { color: var(--text-2); font-size: 12px; }
.tpg-game-lp { margin-left: auto; color: var(--text-2); font: 700 12px/1 var(--f-mono, monospace); white-space: nowrap; }
.tpg-game.is-win .tpg-game-lp { color: var(--mint, #3ddc97); }
.tpg-game.is-loss .tpg-game-lp { color: var(--loss, #ff4d6a); }

/* ---------- Decks ---------- */
.tpg-deckgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.tpg-deckbox { position: relative; overflow: hidden; border: 1px solid var(--line-2); border-radius: 16px; background: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--tpg-cat) 55%, transparent), transparent 72%), var(--panel); transition: transform .2s var(--ease, ease), border-color .2s; }
.tpg-deckbox:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tpg-cat) 75%, #fff 10%); }
.tpg-deckbox.is-short { background: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--gold, #f5b941) 22%, transparent), transparent 72%), var(--panel); }
.tpg-deckbox-link { display: grid; gap: 14px; padding: 18px 16px 16px; color: var(--text); text-decoration: none; }
.tpg-deckbox-stage { display: grid; place-items: center; height: 172px; }
.tpg-deckbox-info { display: grid; gap: 10px; }
.tpg-deckbox-name { font: 800 22px/1.05 var(--f-display, sans-serif); letter-spacing: -.025em; overflow-wrap: anywhere; }
.tpg-deckbox-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tpg-deckbox-del { position: absolute; top: 8px; right: 8px; margin: 0; }
.tpg-deckbox.is-new { border-style: dashed; background: transparent; }
.tpg-deckbox.is-new .tpg-fan-i { opacity: .5; }
.tpg-deckbox.is-new:hover { border-color: var(--accent, #ff5b3a); }
.tpg-deckbox.is-new:hover .tpg-fan-i { opacity: .9; }

.tpg-curve { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; height: 58px; }
.tpg-curve > span { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 3px; height: 100%; }
.tpg-curve i { align-self: end; display: grid; place-items: start center; height: max(4px, var(--v)); min-height: 4px; padding-top: 2px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #5a95ff, #1f6fff); color: #fff; font: 700 10px/1 var(--f-mono, monospace); font-style: normal; overflow: hidden; transition: height .25s var(--ease, ease); }
.tpg-curve small { color: var(--muted); font: 600 10px/1 var(--f-mono, monospace); text-align: center; }

/* ---------- Éditeur de deck ---------- */
.tpg-editor { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 22px; }
.tpg-dpanel {
    position: sticky; top: calc(var(--top-h, 64px) + 56px); grid-column: 2; grid-row: 1; isolation: isolate; overflow: hidden;
    display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "count" "slots" "mix" "warn" "save";
    padding: 16px; border-radius: 16px; color: #fff; border: 1px solid color-mix(in srgb, var(--tpg-cat) 70%, #fff 12%);
    background: radial-gradient(60% 80% at 0% 100%, rgba(255, 91, 58, .3), transparent 62%), linear-gradient(160deg, var(--tpg-cat) 0%, #3b1c99 50%, var(--tpg-deep) 100%);
}
.tpg-dpanel .tpg-hero-bg { opacity: .28; -webkit-mask-image: linear-gradient(180deg, #000, transparent 60%); mask-image: linear-gradient(180deg, #000, transparent 60%); }
.tpg-dpanel-top { grid-area: top; display: flex; align-items: center; gap: 8px; }
.tpg-dname { flex: 1; min-width: 0; padding: 4px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #fff; font: 800 24px/1.1 var(--f-display, sans-serif); letter-spacing: -.025em; }
.tpg-dname:hover { border-bottom-color: rgba(255, 255, 255, .3); }
.tpg-dname:focus { outline: none; border-bottom-color: #fff; }
.tpg-dcount { grid-area: count; display: flex; align-items: center; gap: 12px; }
.tpg-dcount .tcg-count { color: #fff; font: 800 30px/1 var(--f-display, sans-serif); letter-spacing: -.03em; }
.tpg-dcount .tcg-count.is-ok { color: var(--mint, #3ddc97); }
.tpg-dbar { display: block; flex: 1; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.tpg-dbar i { display: block; width: var(--v, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent, #ff5b3a), #ffb36b); transition: width .3s var(--ease, ease); }
.tpg-slots { grid-area: slots; display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.tpg-slots .tcg-slot-mini { position: relative; display: block; width: 100%; aspect-ratio: 63 / 88; padding: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px; background: rgba(12, 6, 30, .5); cursor: pointer; transition: transform .15s, border-color .15s; animation: tpg-pop .22s var(--ease, ease); }
.tpg-slots .tcg-slot-mini img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transition: filter .15s; }
.tpg-slots .tcg-slot-mini b { position: absolute; top: 3px; left: 3px; display: grid; place-items: center; min-width: 18px; height: 18px; border-radius: 6px; background: #1f6fff; color: #fff; font: 700 11px/1 var(--f-mono, monospace); }
.tpg-slots .tcg-slot-mini::after { content: "Retirer"; position: absolute; inset: auto 0 6px; color: #fff; font: 800 11px/1 var(--f-display, sans-serif); text-align: center; opacity: 0; transition: opacity .15s; }
.tpg-slots button.tcg-slot-mini:hover { transform: translateY(-2px); border-color: var(--loss, #ff4d6a); }
.tpg-slots button.tcg-slot-mini:hover img { filter: brightness(.45); }
.tpg-slots button.tcg-slot-mini:hover::after { opacity: 1; }
.tpg-slots .tcg-slot-mini.is-empty { border: 1.5px dashed rgba(255, 255, 255, .25); background: transparent; cursor: default; animation: none; }
.tpg-dmix { grid-area: mix; }
.tpg-dmix .tpg-types-leg small { color: rgba(255, 255, 255, .78); }
.tpg-dmix .tpg-types-leg b { color: #fff; }
.tpg-slots .tcg-slot-mini b { display: none; }

.tpg-dpanel [data-dk-save] { grid-area: save; }
.tpg-pool { grid-column: 1; grid-row: 1; display: grid; gap: 14px; min-width: 0; }
.tpg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tpg-search { flex: 1 1 220px; min-width: 0; min-height: 46px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--text); font: 500 15px/1 var(--f-body, sans-serif); }
.tpg-search:focus { outline: none; border-color: var(--accent, #ff5b3a); }
.tpg-costs { display: flex; gap: 6px; }
.tpg-cost { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, #1f6fff 18%, var(--panel)); color: #9fc0ff; font: 800 15px/1 var(--f-display, sans-serif); cursor: pointer; transition: transform .15s, background .15s, color .15s; }
.tpg-cost:first-child { padding: 0 14px; border-radius: 999px; }
.tpg-cost:hover { transform: translateY(-2px); }
.tpg-cost[aria-pressed="true"] { background: #1f6fff; color: #fff; }
.tpg-poolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 12px; }
.tpg-pick { display: grid; gap: 6px; align-content: start; min-width: 0; }
.tpg-pick[hidden] { display: none; }
.tpg-pick-btn { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; background: none; cursor: pointer; transition: transform .18s var(--ease, ease); }
.tpg-pick-btn .tc { --tc-w: 100%; transition: filter .2s, outline-color .15s; outline: 3px solid transparent; outline-offset: 2px; }
.tpg-pick-btn:hover { transform: translateY(-4px) rotate(-1.5deg); }
.tpg-pick-btn:active { transform: scale(.95); }
.tpg-pick-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.tpg-pick.is-on .tpg-pick-btn .tc { outline-color: var(--accent, #ff5b3a); }
.tpg-pick.is-on .tpg-pick-btn::after { content: "Dans le deck"; position: absolute; left: 50%; bottom: 26%; z-index: 5; padding: 4px 9px; border-radius: 999px; background: var(--accent, #ff5b3a); color: var(--accent-ink, #1d0700); font: 800 11px/1 var(--f-display, sans-serif); white-space: nowrap; transform: translateX(-50%); animation: tpg-pop .22s var(--ease, ease); }
.tpg-editor.is-full .tpg-pick:not(.is-on) .tc { filter: grayscale(.7) brightness(.55); }
.tpg-pick-text { margin: 0; color: var(--text-2); font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpg-variant { width: 100%; min-height: 30px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 12px; }

/* ---------- Échanges ---------- */
.tpg-swap { display: flex; align-items: center; justify-content: center; }
.tpg-swap-side { display: grid; justify-items: center; gap: 8px; transform: rotate(-5deg); transition: transform .3s var(--ease, ease); }
.tpg-swap-side.is-right { transform: rotate(5deg); }
.tpg-hero:hover .tpg-swap-side { transform: rotate(-8deg) translateX(-6px); }
.tpg-hero:hover .tpg-swap-side.is-right { transform: rotate(8deg) translateX(6px); }
.tpg-swap-side small { padding: 4px 10px; border-radius: 999px; background: rgba(12, 6, 30, .55); color: #fff; font: 700 12px/1 var(--f-display, sans-serif); }
.tpg-swap-vs { position: relative; z-index: 20; margin: 0 -14px; padding: 9px 12px; border-radius: 999px; background: var(--accent, #ff5b3a); color: var(--accent-ink, #1d0700); font: 800 14px/1 var(--f-display, sans-serif); box-shadow: 0 8px 24px -6px rgba(255, 91, 58, .8); }

.tpg-offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 12px; }
.tpg-offer { display: grid; gap: 14px; padding: 14px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); }
.tpg-offer.is-hot { border-color: var(--accent, #ff5b3a); background: radial-gradient(100% 80% at 50% 0%, rgba(255, 91, 58, .2), transparent 70%), var(--panel); box-shadow: 0 18px 50px -24px rgba(255, 91, 58, .7); }
.tpg-offer-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tpg-offer-head > b { flex: 1; min-width: 0; font: 700 16px/1.1 var(--f-display, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpg-offer-time { color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap; }
.tpg-offer-time:hover { color: var(--text); }
.tpg-offer-body { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.tpg-offer-side { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.tpg-offer-side small { color: var(--text-2); font: 700 12px/1 var(--f-display, sans-serif); }
.tpg-offer-side.is-in small { color: var(--mint, #3ddc97); }
.tpg-offer-vs { color: var(--muted); font: 800 12px/1 var(--f-display, sans-serif); }
.tpg-hand { display: flex; justify-content: center; padding-top: 6px; }
.tpg-hand > a { margin-left: -30px; border-radius: 10px; transform: rotate(calc((var(--k) - (var(--n) - 1) / 2) * 7deg)); transition: transform .2s var(--ease, ease); }
.tpg-hand > a:first-child { margin-left: 0; }
.tpg-hand > a:hover { transform: translateY(-8px) rotate(0deg); z-index: 2; }
.tpg-hand .tc { --tc-w: 80px; }
.tpg-hand.is-gone .tc { --tc-w: 56px; opacity: .35; }
.tpg-offer-act { display: flex; justify-content: flex-end; gap: 8px; }
.tpg-offer-act form { margin: 0; }
.tpg-offer.is-mini { gap: 8px; padding: 10px 12px; }
.tpg-offer.is-mini .tpg-hand .tc { --tc-w: 54px; }
.tpg-offer.is-mini .tpg-hand > a { margin-left: -22px; }
.tpg-offer.is-mini .tpg-hand > a:first-child { margin-left: 0; }

.tpg-partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.tpg-partner { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line-2); border-radius: 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--tpg-cat) 26%, var(--panel)) 0%, var(--panel) 60%); color: var(--text); text-decoration: none; transition: transform .2s var(--ease, ease), border-color .2s; }
.tpg-partner:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tpg-cat) 75%, #fff 10%); }
.tpg-partner-art { display: grid; place-items: center; height: 124px; }
.tpg-partner-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tpg-partner-id b { font: 800 19px/1.1 var(--f-display, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpg-partner-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpg-partner-kpi > span { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .28); }
.tpg-partner-kpi b { font: 800 26px/1 var(--f-display, sans-serif); letter-spacing: -.03em; }
.tpg-partner-kpi > span:first-child b { color: var(--mint, #3ddc97); }
.tpg-partner-kpi small { color: var(--text-2); font-size: 11px; }
.tpg-partner-go { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 10px; background: var(--accent, #ff5b3a); color: var(--accent-ink, #1d0700); font: 800 15px/1 var(--f-display, sans-serif); transition: background .15s; }
.tpg-partner:hover .tpg-partner-go { background: var(--accent-2, #ff7a55); }
.tpg-partner:active { transform: scale(.98); }

.tpg-empty { display: grid; justify-items: center; gap: 8px; padding: 24px 16px; border: 1.5px dashed var(--line-2); border-radius: 16px; text-align: center; }
.tpg-empty b { font: 800 19px/1.1 var(--f-display, sans-serif); }
.tpg-empty small { color: var(--text-2); font-size: 13px; }
.tpg-empty .tpg-fan-i { opacity: .6; }
.tpg-empty.is-stage { border: 0; padding: 12px 0 24px; }

/* ---------- Classement ---------- */
.tpg-hero-rank { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 18px; padding-bottom: 0; }
.tpg-mypos { display: grid; justify-items: end; gap: 2px; }
.tpg-mypos b { font: 800 44px/1 var(--f-display, sans-serif); letter-spacing: -.04em; }
.tpg-mypos sup, .tpg-kpi-r sup { font-size: .5em; }
.tpg-mypos small { color: rgba(255, 255, 255, .72); font-size: 12px; }
.tpg-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tpg-tabs a { padding: 9px 16px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(12, 6, 30, .4); color: rgba(255, 255, 255, .86); font: 700 14px/1 var(--f-display, sans-serif); text-decoration: none; transition: background .15s, transform .15s; }
.tpg-tabs a:hover { background: rgba(255, 255, 255, .14); transform: translateY(-1px); }
.tpg-tabs a[aria-current="page"] { border-color: #fff; background: #fff; color: #1d1140; }
.tpg-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 14px; width: 100%; max-width: 760px; margin: 6px auto 0; padding: 0; list-style: none; }
.tpg-podium > li > a { display: grid; justify-items: center; gap: 12px; color: #fff; text-decoration: none; }
.tpg-podium-card { --rot: -5deg; }
.tpg-podium .is-1 .tpg-podium-card { --rot: 0deg; }
.tpg-podium .is-3 .tpg-podium-card { --rot: 5deg; }
.tpg-podium-card .tc { --tc-w: 118px; box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .8); }
.tpg-podium .is-1 .tpg-podium-card .tc { --tc-w: 150px; box-shadow: 0 0 0 2px var(--medal), 0 24px 60px -16px rgba(245, 185, 65, .55); }
.tpg-podium-who { display: grid; justify-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.tpg-podium-who .avatar { box-shadow: 0 0 0 3px var(--medal); }
.tpg-podium-who b { max-width: 100%; font: 800 17px/1.1 var(--f-display, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpg-podium .is-me .tpg-podium-who b { color: #ffc1ad; }
.tpg-podium-step { display: grid; justify-items: center; align-content: start; gap: 4px; width: 100%; height: var(--hh, 90px); padding: 12px 6px 0; border: 1px solid color-mix(in srgb, var(--medal) 55%, transparent); border-bottom: 0; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 42%, transparent), rgba(12, 6, 30, .25)); }
.tpg-podium .is-1 .tpg-podium-step { --hh: 150px; }
.tpg-podium .is-2 .tpg-podium-step { --hh: 112px; }
.tpg-podium .is-3 .tpg-podium-step { --hh: 86px; }
.tpg-podium-v { font: 800 20px/1 var(--f-display, sans-serif); letter-spacing: -.02em; white-space: nowrap; }
.tpg-podium-v small { margin-left: 4px; font-size: 11px; opacity: .75; }
.tpg-podium-step i { color: var(--medal); font: 800 54px/1 var(--f-display, sans-serif); font-style: normal; letter-spacing: -.05em; }
.tpg-podium .is-1 .tpg-podium-step i { font-size: 76px; }

.tpg-ladder { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tpg-ladder a { display: grid; grid-template-columns: 40px auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
.tpg-ladder a:hover { transform: translateX(4px); border-color: var(--line-2); }
.tpg-ladder .is-me a { border-color: var(--accent, #ff5b3a); background: linear-gradient(90deg, rgba(255, 91, 58, .16), var(--panel) 55%); }
.tpg-ladder-n { color: var(--text-2); font: 800 26px/1 var(--f-display, sans-serif); text-align: center; }
.tpg-ladder-who { display: grid; gap: 7px; min-width: 0; }
.tpg-ladder-who b { font: 700 17px/1.1 var(--f-display, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpg-ladder-who .tpg-dbar { height: 6px; background: var(--line); }
.tpg-ladder-cards { display: flex; }
.tpg-ladder-cards img { width: 32px; height: 45px; margin-left: -12px; border: 1px solid var(--rc, var(--line-2)); border-radius: 5px; object-fit: cover; box-shadow: 0 6px 14px -6px #000; transition: transform .2s; }
.tpg-ladder-cards img:first-child { margin-left: 0; }
.tpg-ladder a:hover .tpg-ladder-cards img { transform: translateY(-3px); }
.tpg-ladder-v { display: grid; justify-items: end; }
.tpg-ladder-v b { font: 800 24px/1 var(--f-display, sans-serif); letter-spacing: -.03em; }
.tpg-ladder-v small { color: var(--text-2); font-size: 11px; }

/* ---------- Profil collectionneur ---------- */
.tpg-hero-prof { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 6px; padding-bottom: 0; }
.tpg-prof-id { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.tpg-prof-id .tpg-title { font-size: clamp(36px, 5.4vw, 58px); }
.tpg-prof-id .tpg-muted { margin-top: 6px; }
.tpg-prof-ava .avatar { display: block; box-shadow: 0 0 0 3px #fff, 0 0 0 8px rgba(255, 255, 255, .16); }
.tpg-ring { display: grid; place-items: center; align-content: center; gap: 2px; width: 118px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, #1d1140 80%, transparent 81% 100%), conic-gradient(var(--accent, #ff5b3a) calc(var(--v) * 1%), rgba(255, 255, 255, .16) 0); }
.tpg-ring b { font: 800 32px/1 var(--f-display, sans-serif); letter-spacing: -.04em; }
.tpg-ring b small { font-size: .5em; }
.tpg-ring > small { color: rgba(255, 255, 255, .72); font: 600 11px/1 var(--f-mono, monospace); }
.tpg-stage { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; align-items: end; gap: 22px; margin: 14px 0 0; padding: 0; list-style: none; }
.tpg-stage > li { display: grid; justify-items: center; }
.tpg-stage-card { position: relative; z-index: 2; --rot: -5deg; }
.tpg-stage .is-1 .tpg-stage-card { --rot: 0deg; }
.tpg-stage .is-3 .tpg-stage-card { --rot: 5deg; }
.tpg-stage-card .tc { --tc-w: 152px; box-shadow: 0 22px 46px -16px rgba(0, 0, 0, .85); }
.tpg-stage .is-1 .tpg-stage-card .tc { --tc-w: 196px; box-shadow: 0 0 0 2px var(--medal), 0 28px 70px -18px rgba(245, 185, 65, .6); }
.tpg-socle { position: relative; z-index: 1; display: grid; justify-items: center; align-content: start; gap: 6px; width: calc(100% + 28px); height: var(--hh, 56px); margin-top: -16px; padding-top: 24px; border-top: 2px solid var(--medal); border-radius: 50% 50% 0 0 / 22px 22px 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 50%, #2b1a5c), rgba(12, 6, 30, .5)); }
.tpg-stage .is-1 .tpg-socle { --hh: 104px; }
.tpg-stage .is-2 .tpg-socle { --hh: 82px; }
.tpg-stage .is-3 .tpg-socle { --hh: 70px; }
.tpg-socle > b { color: var(--medal); font: 800 26px/1 var(--f-display, sans-serif); }
.tpg-edit { position: absolute; right: 18px; bottom: 16px; z-index: 3; padding: 9px 14px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; background: rgba(12, 6, 30, .55); color: #fff; font: 700 13px/1 var(--f-display, sans-serif); text-decoration: none; transition: background .15s; }
.tpg-edit:hover { background: rgba(255, 255, 255, .16); }

.tpg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tpg-kpi { position: relative; display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.tpg-kpi-v { font: 800 42px/1 var(--f-display, sans-serif); letter-spacing: -.04em; }
.tpg-kpi-l { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.tpg-kpi-r { justify-self: start; margin-top: 6px; padding: 4px 10px; border-radius: 999px; background: var(--panel-3); color: var(--text-2); font-size: 12px; }
.tpg-kpi-r b { color: var(--text); font: 800 14px/1 var(--f-display, sans-serif); }
.tpg-kpi.is-top { border-color: color-mix(in srgb, var(--medal) 45%, var(--line)); background: radial-gradient(90% 90% at 100% 0%, color-mix(in srgb, var(--medal) 18%, transparent), transparent 70%), var(--panel); }
.tpg-kpi.is-top .tpg-kpi-r b { color: var(--medal); }

.tpg-coll { grid-template-columns: minmax(0, 1fr) 280px; grid-template-areas: "h h" "bars pull" "rec rec"; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.tpg-coll > .tpg-h2 { grid-area: h; }
.tpg-ladderbars { grid-area: bars; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); align-items: end; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tpg-ladderbars li { display: grid; justify-items: center; gap: 6px; }
.tpg-ladderbars-n { font: 800 18px/1 var(--f-display, sans-serif); }
.tpg-ladderbars-bar { position: relative; width: 100%; max-width: 46px; height: 120px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.tpg-ladderbars-bar i { position: absolute; inset: auto 0 0; height: var(--v); background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 75%, #fff), var(--rc)); transition: height .4s var(--ease, ease); }
.tpg-ladderbars li:hover .tpg-ladderbars-bar { border-color: var(--rc); }
.tpg-ladderbars small { color: var(--muted); font: 600 10px/1 var(--f-mono, monospace); }
.tpg-records { grid-area: rec; display: flex; flex-wrap: wrap; gap: 8px; }
.tpg-records > span { display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--panel-2); }
.tpg-records b { font: 800 20px/1 var(--f-display, sans-serif); }
.tpg-records small { color: var(--text-2); font-size: 12px; }
.tpg-pull { grid-area: pull; align-self: center; display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid color-mix(in srgb, var(--gold, #f5b941) 35%, var(--line)); border-radius: 14px; background: radial-gradient(100% 100% at 0% 0%, color-mix(in srgb, var(--gold, #f5b941) 20%, transparent), transparent 70%), var(--panel-2); color: var(--text); text-decoration: none; transition: transform .2s, border-color .2s; }
.tpg-pull:hover { transform: translateY(-3px); border-color: var(--gold, #f5b941); }
.tpg-pull > span:last-child { display: grid; gap: 4px; min-width: 0; }
.tpg-pull small { color: var(--gold, #f5b941); font: 700 12px/1 var(--f-display, sans-serif); }
.tpg-pull b { font: 800 20px/1.1 var(--f-display, sans-serif); }
.tpg-pull-card { --rot: -4deg; flex: none; }
.tpg-pull-card .tc { --tc-w: 96px; }

.tpg-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 18px 12px; margin: 0; padding: 0; list-style: none; }
.tpg-shelf > li { position: relative; display: grid; justify-items: center; padding-top: 34px; }
.tpg-shelf-n { position: absolute; top: -4px; left: 0; z-index: 0; color: transparent; font: 800 58px/1 var(--f-display, sans-serif); letter-spacing: -.05em; -webkit-text-stroke: 1.5px var(--line-2); }
.tpg-shelf a { position: relative; z-index: 1; border-radius: 10px; transition: transform .2s var(--ease, ease); }
.tpg-shelf a:hover { transform: translateY(-6px) rotate(-2deg); }
.tpg-shelf .tc { --tc-w: 106px; }

/* ---------- Inclinaison 3D + reflet (survol) ---------- */
[data-tpg-tilt] { position: relative; display: block; border-radius: 12px; transform: perspective(800px) rotate(var(--rot, 0deg)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s var(--ease, ease); }
[data-tpg-tilt].is-tilting { transition: transform .06s linear; }
[data-tpg-tilt]::after { content: ""; position: absolute; inset: 0; z-index: 6; border-radius: 12px; pointer-events: none; mix-blend-mode: overlay; opacity: 0; background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, .6), transparent 55%); transition: opacity .2s; }
[data-tpg-tilt]:hover::after { opacity: 1; }
:is(.tpg-stage, .tpg-podium) .is-1 [data-tpg-tilt] .tc::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; mix-blend-mode: overlay; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%) no-repeat; background-size: 300% 100%; animation: tpg-sheen 4.5s ease-in-out infinite; }

@keyframes tpg-sheen { 0%, 55% { background-position: 140% 0; } 100% { background-position: -40% 0; } }
@keyframes tpg-pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .tpg-editor { grid-template-columns: minmax(0, 1fr); }
    .tpg-dpanel { grid-column: 1; grid-row: 1; top: calc(var(--top-h, 56px) + 48px); z-index: 10; gap: 10px; padding: 12px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "top top" "count save" "slots slots" "warn warn"; }
    .tpg-dmix { display: none; }
    .tpg-dpanel [data-dk-save] { width: auto; min-height: 40px; font-size: 15px; padding: 0 16px; }
    .tpg-dname { font-size: 20px; }
    .tpg-dcount .tcg-count { font-size: 22px; }
    .tpg-slots { grid-template-columns: repeat(var(--cols, 12), minmax(0, 1fr)); gap: 3px; }
    .tpg-slots .tcg-slot-mini { border-radius: 4px; }
    .tpg-slots .tcg-slot-mini b { top: 1px; left: 1px; min-width: 12px; height: 12px; font-size: 8px; border-radius: 3px; }
    .tpg-slots .tcg-slot-mini::after { display: none; }
    .tpg-pool { grid-column: 1; grid-row: 2; }
    .tpg-coll { grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "bars" "pull" "rec"; }
}
@media (max-width: 720px) {
    .tpg { gap: 22px; }
    .tpg-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; min-height: 0; padding: 20px 16px; }
    .tpg-hero-bg { -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 75%); mask-image: linear-gradient(180deg, #000 10%, transparent 75%); opacity: .3; }
    .tpg-title { font-size: 44px; }
    .tpg-record { gap: 6px 20px; margin-top: 12px; }
    .tpg-record b { font-size: 34px; }
    .tpg-fan.is-hero { --fw: 104px; }
    .tpg-hero-play .tpg-hero-deck { order: -1; }
    .tpg-hero-play .tpg-hero-main { display: contents; }
    .tpg-hero-play .tpg-hero-top { order: -2; }
    .tpg-modes { margin-top: 0; max-width: none; }
    .tpg-go { margin-top: 0; }
    .tpg-cta { flex: 1 1 100%; }
    .tpg-mode b { font-size: 18px; }
    .tpg-mode span { padding: 12px; }
    .tpg-h2 { font-size: 21px; }
    .tpg-rules { gap: 6px; }
    .tpg-rule { padding: 10px; gap: 8px; }
    .tpg-rule b { font-size: 12px; flex-wrap: wrap; }
    .tpg-rule-pic { height: 26px; gap: 2px; }
    .tpg-rule-pic i { font-size: 8px; border-radius: 5px; }
    .tpg-deckbox-stage { height: 150px; }
    .tpg-fan.is-md { --fw: 80px; }
    .tpg-poolgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
    .tpg-pick-text { font-size: 11px; }
    .tpg-pick.is-on .tpg-pick-btn::after { content: "Pris"; }
    .tpg-costs { width: 100%; justify-content: space-between; }
    .tpg-cost { min-width: 38px; height: 38px; }
    .tpg-fan.is-swap { --fw: 64px; }
    .tpg-swap-vs { margin: 0 -10px; padding: 7px 9px; font-size: 12px; }
    .tpg-hand .tc { --tc-w: 64px; }
    .tpg-hand > a { margin-left: -26px; }
    .tpg-hero-rank, .tpg-hero-prof { padding-bottom: 0; }
    .tpg-mypos b { font-size: 34px; }
    .tpg-tabs a { padding: 8px 12px; font-size: 13px; }
    .tpg-podium { gap: 6px; }
    .tpg-podium-card .tc { --tc-w: 84px; }
    .tpg-podium .is-1 .tpg-podium-card .tc { --tc-w: 104px; }
    .tpg-podium-who b { font-size: 14px; }
    .tpg-podium-v { font-size: 15px; }
    .tpg-podium-v small { display: none; }
    .tpg-podium .is-1 .tpg-podium-step { --hh: 118px; }
    .tpg-podium .is-2 .tpg-podium-step { --hh: 90px; }
    .tpg-podium .is-3 .tpg-podium-step { --hh: 70px; }
    .tpg-podium-step i { font-size: 40px; }
    .tpg-podium .is-1 .tpg-podium-step i { font-size: 54px; }
    .tpg-podium-who .avatar-lg { width: 56px; height: 56px; }
    .tpg-ladder a { grid-template-columns: 28px auto minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px 10px 8px; }
    .tpg-ladder-cards { display: none; }
    .tpg-ladder-n { font-size: 20px; }
    .tpg-prof-id { grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; }
    .tpg-prof-ava .avatar { width: 64px; height: 64px; }
    .tpg-prof-id .tpg-title { font-size: 34px; }
    .tpg-ring { grid-column: 1 / -1; justify-self: start; width: auto; aspect-ratio: auto; grid-auto-flow: column; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(12, 6, 30, .5); }
    .tpg-ring::before { content: ""; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(closest-side, #1d1140 66%, transparent 67% 100%), conic-gradient(var(--accent, #ff5b3a) calc(var(--v) * 1%), rgba(255, 255, 255, .16) 0); }
    .tpg-ring b { font-size: 22px; }
    .tpg-stage { gap: 6px; }
    .tpg-stage-card .tc { --tc-w: 92px; }
    .tpg-stage .is-1 .tpg-stage-card .tc { --tc-w: 120px; }
    .tpg-socle { width: calc(100% + 8px); }
    .tpg-stage .is-1 .tpg-socle { --hh: 70px; }
    .tpg-stage .is-2 .tpg-socle { --hh: 52px; }
    .tpg-stage .is-3 .tpg-socle { --hh: 40px; }
    .tpg-socle > b { font-size: 20px; }
    .tpg-socle .tc-rar { display: none; }
    .tpg-edit { position: static; justify-self: center; margin: 4px 0 16px; }
    .tpg-hero-prof:has(.tpg-edit) { padding-bottom: 0; }
    .tpg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tpg-kpi { padding: 14px; }
    .tpg-kpi-v { font-size: 34px; }
    .tpg-ladderbars { gap: 4px; }
    .tpg-ladderbars-bar { height: 90px; }
    .tpg-ladderbars-n { font-size: 15px; }
    .tpg-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
    .tpg-shelf .tc { --tc-w: 96px; }
    .tpg-shelf-n { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .tpg *, .tpg *::before, .tpg *::after { animation: none !important; transition: none !important; }
}

/* ---------- Composition par type (decks, éditeur) ---------- */
.tpg-types { display: grid; gap: 7px; }
.tpg-types-bar { display: flex; gap: 2px; height: 8px; overflow: hidden; border-radius: 999px; background: var(--panel-3); }
.tpg-types-bar i { flex: var(--q, 1) 1 0; background: var(--m, #d6d3d1); }
.tpg-types-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tpg-types-leg small { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 12px; }
.tpg-types-leg small::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--m, #d6d3d1); }
.tpg-types-leg b { color: var(--text); font-family: var(--f-display, sans-serif); }
.tpg-typechips { display: flex; flex-wrap: wrap; gap: 6px; }
.tpg-typechip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); color: var(--text-2); font: 700 13px/1 var(--f-display, sans-serif); white-space: nowrap; cursor: pointer; transition: transform .15s, background .15s, border-color .15s, color .15s; }
.tpg-typechip::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--m, transparent); }
.tpg-typechip:first-child::before { display: none; }
.tpg-typechip:hover { transform: translateY(-2px); color: var(--text); }
.tpg-typechip[aria-pressed="true"] { border-color: var(--m, var(--text)); background: color-mix(in srgb, var(--m, #ffffff) 22%, var(--panel)); color: var(--text); }

/* Bouton d'aide des héros : dans le coin */
.tpg-hero .tpg-hero-top > [data-tcg-help-open] { position: absolute; top: 18px; right: 18px; z-index: 5; }

@media (max-width: 720px) {
    .tpg-typechips { flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .tpg-typechips::-webkit-scrollbar { display: none; }
    .tpg-hero .tpg-hero-top > [data-tcg-help-open] { top: 14px; right: 14px; }
}
@media (max-width: 720px) {
    .tpg-foes { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
    .tpg-foes::-webkit-scrollbar { display: none; }
    .tpg-foes > * { scroll-snap-align: start; }
    .tpg-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
    .tpg-tabs::-webkit-scrollbar { display: none; }
    .tpg-tabs a { white-space: nowrap; }
    .tpg-stage .is-1 .tpg-socle { --hh: 78px; }
    .tpg-stage .is-2 .tpg-socle { --hh: 62px; }
    .tpg-stage .is-3 .tpg-socle { --hh: 52px; }
}
.tpg-pool > *, .tpg-toolbar > *, .tpg-sec > *, .tpg-hero > * { min-width: 0; }

/* ---------- Éditeur (règles Pocket : exemplaires, niveaux) ---------- */
.tpg-dnum { color: #fff; font: 800 30px/1 var(--f-display, sans-serif); letter-spacing: -.03em; transition: color .2s; }
.tpg-dnum.is-ok { color: var(--mint, #3ddc97); }
.tpg-dmix { display: grid; gap: 12px; }
.tpg-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tpg-levels > span { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; overflow: hidden; border-radius: 10px; background: rgba(12, 6, 30, .45); isolation: isolate; }
.tpg-levels > span::before { content: ""; position: absolute; inset: auto 0 0; z-index: -1; height: var(--v, 0%); background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .08)); transition: height .3s var(--ease, ease); }
.tpg-levels b { font: 800 20px/1 var(--f-display, sans-serif); }
.tpg-levels small { color: rgba(255, 255, 255, .72); font-size: 10px; white-space: nowrap; }
.tpg-dwarn { grid-area: warn; margin: 0; padding: 8px 10px; border-radius: 10px; background: rgba(255, 77, 106, .2); color: #ffd1d9; font-size: 13px; }
.tpg-dwarn[hidden] { display: none; }
.tpg-slots .tcg-slot-mini.t-fighter, .tpg-slots .tcg-slot-mini[class*=" t-"] { border-color: color-mix(in srgb, var(--m, #fff) 70%, transparent); }
.tpg-pick-n { position: absolute; top: auto; bottom: 27%; left: 50%; z-index: 6; display: grid; place-items: center; min-width: 34px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--accent, #ff5b3a); color: var(--accent-ink, #1d0700); font: 800 20px/1 var(--f-display, sans-serif); transform: translateX(-50%); font-size: 15px; box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .7); pointer-events: none; }
.tpg-pick-n:empty { display: none; }
.tpg-pick.is-on .tpg-pick-btn::after { content: none; }
.tpg-pick-btn.is-bump { animation: tpg-bump .26s var(--ease, ease); }
.tpg-pick.is-max .tpg-pick-btn { cursor: default; }
.tpg-pick-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tpg-pips { display: flex; gap: 3px; flex: none; }
.tpg-pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: background .15s, transform .15s; }
.tpg-pips i.is-on { background: var(--accent, #ff5b3a); transform: scale(1.15); }
.tpg-pick-meta { flex: 1; min-width: 0; overflow: hidden; color: var(--text-2); font: 600 11px/1.2 var(--f-mono, monospace); text-overflow: ellipsis; white-space: nowrap; }
.tpg-minus { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel); color: var(--text); font: 800 18px/1 var(--f-display, sans-serif); cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.tpg-minus:hover:not(:disabled) { border-color: var(--loss, #ff4d6a); background: color-mix(in srgb, var(--loss, #ff4d6a) 18%, var(--panel)); }
.tpg-minus:active:not(:disabled) { transform: scale(.92); }
.tpg-minus:disabled { opacity: .3; cursor: default; }
.tpg-typechips.is-levels .tpg-typechip::before { display: none; }
@keyframes tpg-bump { 0% { transform: scale(1); } 40% { transform: scale(.94) rotate(-2deg); } 100% { transform: scale(1); } }

/* ---------- Combat : règles en images (Pocket) ---------- */
.tpg-rules { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tpg-rule-pic.is-board { align-items: end; gap: 4px; }
.tpg-rule-pic.is-board i { height: 70%; background: color-mix(in srgb, var(--tpg-cat) 40%, var(--panel-2)); }
.tpg-rule-pic.is-board i.is-act { flex: 1.8; height: 100%; background: var(--tpg-cat); }
.tpg-rule-pic.is-orbs { align-items: center; gap: 6px; }
.tpg-rule-pic.is-orbs i { flex: none; width: calc(12px + var(--k) * 4px); height: calc(12px + var(--k) * 4px); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--m, #8b5cf6) 60%); }
.tpg-rule-pic.is-evo { align-items: end; gap: 6px; }
.tpg-rule-pic.is-evo i { font: 800 11px/1 var(--f-display, sans-serif); color: #fff; background: linear-gradient(180deg, var(--accent, #ff5b3a), #b8361f); }
.tpg-rule-pic.is-evo i:nth-child(1) { height: 45%; opacity: .6; }
.tpg-rule-pic.is-evo i:nth-child(2) { height: 72%; opacity: .8; }
.tpg-rule-pic.is-evo i:nth-child(3) { height: 100%; }
.tpg-rule-pic.is-pts { align-items: center; justify-content: center; gap: 8px; }
.tpg-rule-pic.is-pts i { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--gold, #f5b941); background: color-mix(in srgb, var(--gold, #f5b941) 30%, transparent); }
.tpg-rule-pic.is-pts i:last-child { background: var(--gold, #f5b941); box-shadow: 0 0 14px rgba(245, 185, 65, .6); }
@media (max-width: 720px) {
    .tpg-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tpg-dnum { font-size: 22px; }
    .tpg-pick-n { min-width: 32px; height: 32px; font-size: 16px; }
    .tpg-pick-meta { display: none; }
    .tpg-pick-row { justify-content: space-between; }
}
@media (max-width: 900px) {
    .tpg-dpanel .tpg-dmix { display: none; }
}
