/*
 * Tier lists Pokémon (inc/tierlists.php) : hub, listes, vue d'ensemble GO et créateur.
 * Couleurs des tiers : S rose-rouge, A orange, B jaune, C vert, D bleu. Thème : jetons de tokens.css.
 */

.tl {
    --tl-S: #FF4F6D; --tl-A: #FF9A3C; --tl-B: #F7C531; --tl-C: #22C493; --tl-D: #4C8DF6;
    --tl-night: #12142E; --tl-night-2: #262A5C;
    background: var(--cream);
    padding-bottom: 64px;
}
.tl a { text-underline-offset: 3px; }
.tl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- En-tête ---------- */
.tl-hero { position: relative; overflow: hidden; padding: 26px 0 30px; color: #fff;
    background: radial-gradient(1200px 400px at 85% -10%, rgba(255, 79, 109, .35), transparent 60%),
                radial-gradient(900px 380px at 0% 120%, rgba(76, 141, 246, .35), transparent 60%),
                linear-gradient(135deg, var(--tl-night) 0%, var(--tl-night-2) 100%); }
.tl-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
    background: linear-gradient(90deg, var(--tl-S) 0 20%, var(--tl-A) 20% 40%, var(--tl-B) 40% 60%, var(--tl-C) 60% 80%, var(--tl-D) 80% 100%); }
.tl-hero a { color: #fff; }
.tl-hero .breadcrumb, .tl-hero nav[aria-label*="riane"], .tl-hero .pf-breadcrumb { color: rgba(255, 255, 255, .75); font-size: 13px; }
.tl-hero .breadcrumb a, .tl-hero .pf-breadcrumb a { color: rgba(255, 255, 255, .85); }
.tl-kicker { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.tl-kicker span { padding: 4px 11px; border-radius: var(--r-full); background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.tl-title { margin: 0; max-width: 22ch; font-size: clamp(28px, 4.2vw, 46px); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; text-wrap: balance; }
.tl-lead { max-width: 70ch; margin: 14px 0 0; font-size: 16.5px; line-height: 1.6; color: rgba(255, 255, 255, .86); }
.tl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tl-tabs a { padding: 8px 16px; border-radius: var(--r-full); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); font-weight: 700; font-size: 14px; text-decoration: none; }
.tl-tabs a:hover { background: rgba(255, 255, 255, .2); }
.tl-tabs a[aria-current="page"] { background: #fff; color: var(--tl-night); border-color: #fff; }
.tl-source { margin: 14px 0 0; font-size: 13px; color: rgba(255, 255, 255, .7); }
.tl-ribbon { position: absolute; right: 4%; top: 50%; transform: translateY(-50%) rotate(-8deg); display: grid; gap: 8px; opacity: .9; }
.tl-ribbon span { display: grid; place-items: center; width: 64px; height: 44px; border-radius: 12px; font-size: 24px; font-weight: 900; color: #fff; box-shadow: var(--shadow-md); }
.tl-ribbon--S { background: var(--tl-S); } .tl-ribbon--A { background: var(--tl-A); } .tl-ribbon--B { background: var(--tl-B); color: #3A2D00 !important; } .tl-ribbon--C { background: var(--tl-C); }

/* ---------- Corps ---------- */
.tl-body { padding-top: 26px; }
.tl-body h2 { margin: 0 0 14px; font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.tl-keys { margin-bottom: 22px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--border); border-left: 6px solid var(--yellow); }
.tl-keys h2 { font-size: 18px; margin-bottom: 8px; }
.tl-keys ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15.5px; line-height: 1.5; color: var(--ink-mid); }

/* ---------- Tableau des tiers ---------- */
.tl-board { display: grid; gap: 8px; margin-bottom: 34px; }
.tl-row { display: grid; grid-template-columns: 132px minmax(0, 1fr); border-radius: var(--r-md); overflow: hidden; background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
.tl-row__label { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 12px 14px; color: #fff; }
.tl-row__label b { font-size: 34px; font-weight: 900; line-height: 1; }
.tl-row__label span { font-size: 13px; font-weight: 800; }
.tl-row__label small { font-size: 11.5px; line-height: 1.3; opacity: .92; }
.tl-row--S .tl-row__label { background: var(--tl-S); } .tl-row--A .tl-row__label { background: var(--tl-A); }
.tl-row--B .tl-row__label { background: var(--tl-B); color: #3A2D00; } .tl-row--C .tl-row__label { background: var(--tl-C); } .tl-row--D .tl-row__label { background: var(--tl-D); }
.tl-row__items { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 10px; list-style: none; }
.tl-tile { display: flex; flex-direction: column; align-items: center; width: 98px; padding: 6px 4px 7px; border-radius: 12px; text-decoration: none; color: var(--ink); text-align: center; transition: background .15s ease, transform .15s ease; }
.tl-tile:hover, .tl-tile:focus-visible { background: var(--cream); transform: translateY(-2px); }
.tl-tile img { width: 64px; height: 64px; object-fit: contain; }
.tl-tile__pair { display: flex; }
.tl-tile__pair img { width: 46px; height: 46px; }
.tl-tile__pair img + img { margin-left: -12px; }
.tl-tile__name { margin-top: 2px; font-size: 12px; font-weight: 700; line-height: 1.2; }
.tl-tile__val { margin-top: 3px; padding: 1px 7px; border-radius: var(--r-full); background: var(--border-light); font-size: 11px; font-weight: 800; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.tl--deck .tl-tile { width: 118px; }

/* ---------- Fiches détaillées ---------- */
.tl-details__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 4px; }
.tl-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-filters input, .tl-filters select { height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--white); font: inherit; font-size: 14px; color: var(--ink); }
.tl-filters input { min-width: 230px; }
.tl-noresult { padding: 14px; color: var(--ink-light); }
.tl-group { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 18px; font-weight: 800; color: var(--ink); }
.tl-group b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff; font-size: 20px; }
.tl-group--S b { background: var(--tl-S); } .tl-group--A b { background: var(--tl-A); } .tl-group--B b { background: var(--tl-B); color: #3A2D00; } .tl-group--C b { background: var(--tl-C); } .tl-group--D b { background: var(--tl-D); }
.tl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.tl-card { scroll-margin-top: 90px; padding: 14px 16px 12px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--tl-C); box-shadow: var(--shadow-xs); }
.tl-card--S { border-top-color: var(--tl-S); } .tl-card--A { border-top-color: var(--tl-A); } .tl-card--B { border-top-color: var(--tl-B); } .tl-card--D { border-top-color: var(--tl-D); }
.tl-card:target { box-shadow: 0 0 0 3px var(--yellow), var(--shadow-md); }
.tl-card__head { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.tl-card__rank { font-size: 13px; font-weight: 800; color: var(--ink-light); font-variant-numeric: tabular-nums; }
.tl-card__img { width: 72px; height: 72px; object-fit: contain; }
.tl-card__imgs { display: flex; }
.tl-card__imgs img { width: 54px; height: 54px; object-fit: contain; }
.tl-card__imgs img + img { margin-left: -14px; }
.tl-card__id h4 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.2; }
.tl-card__id h4 a { color: var(--ink); text-decoration: none; }
.tl-card__id h4 a:hover { text-decoration: underline; }
.tl-card__en { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-light); }
.tl-card__types { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 0; }
.tl-type { display: inline-block; padding: 1px 9px; border-radius: var(--r-full); background: var(--t); color: #fff; font-size: 11.5px; font-weight: 700; }
.tl-card__metric { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.tl-card__metric b { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink); }
.tl-card__metric small { font-size: 11px; color: var(--ink-light); }
.tl-delta { margin-top: 2px; font-size: 11.5px; font-weight: 800; }
.tl-delta--up { color: var(--green); } .tl-delta--down { color: var(--red); } .tl-delta--eq { color: var(--ink-faint); }
.tl-card__data { display: grid; gap: 6px; margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--border); }
.tl-card__data div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; font-size: 14px; line-height: 1.45; }
.tl-card__data dt { font-weight: 700; color: var(--ink-light); }
.tl-card__data dd { margin: 0; color: var(--ink-mid); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tl-chips span { padding: 2px 9px; border-radius: var(--r-full); background: var(--cream); border: 1px solid var(--border); font-size: 13px; }
.tl-chips small { color: var(--ink-light); font-size: 11px; }

/* ---------- Méthode, FAQ, autres listes ---------- */
.tl-method { margin-top: 38px; padding: 22px 24px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--border); }
.tl-method p { max-width: 78ch; margin: 0 0 10px; font-size: 15.5px; line-height: 1.65; color: var(--ink-mid); }
.tl-method__note { font-size: 13.5px !important; color: var(--ink-light) !important; }
.tl-faq { margin-top: 30px; display: grid; gap: 10px; }
.tl-faq__q { padding: 0 18px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--border); }
.tl-faq__q summary { cursor: pointer; padding: 15px 0; font-weight: 800; font-size: 16px; list-style: none; }
.tl-faq__q summary::-webkit-details-marker { display: none; }
.tl-faq__q summary::after { content: "+"; float: right; font-weight: 900; color: var(--tl-S); }
.tl-faq__q[open] summary::after { content: "–"; }
.tl-faq__q p { margin: 0 0 15px; line-height: 1.6; color: var(--ink-mid); }
.tl-more { margin-top: 36px; }
.tl-more__guides { margin: 0 0 22px; font-size: 15px; }
.tl-hubgroup { margin-bottom: 30px; }
.tl-hubcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.tl-hubcards--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.tl-hubcard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--border); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-xs); transition: transform .15s ease, box-shadow .15s ease; }
.tl-hubcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tl-hubcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: var(--r-md) var(--r-md) 0 0; background: linear-gradient(90deg, var(--tl-S), var(--tl-A), var(--tl-B), var(--tl-C)); }
.tl-hubcard__group { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-light); }
.tl-hubcard strong { font-size: 17px; font-weight: 800; line-height: 1.2; }
.tl-hubcard__text { font-size: 14px; line-height: 1.45; color: var(--ink-mid); }
.tl-hubcard__imgs img { width: 44px; height: 44px; object-fit: contain; }
.tl-hubcard__top { display: grid; gap: 2px; margin-top: 4px; }
.tl-hubcard__top span { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.tl-hubcard__top img { width: 36px; height: 36px; object-fit: contain; }
.tl-hubcard__date { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--ink-light); }
.tl-hubcard--maker { background: linear-gradient(135deg, var(--tl-night), var(--tl-night-2)); color: #fff; border-color: transparent; }
.tl-hubcard--maker .tl-hubcard__group { color: rgba(255, 255, 255, .7); }
.tl-hubcard__cta { font-size: 13.5px; font-weight: 700; color: var(--yellow); }
.tl-makercta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 10px 0 26px; padding: 24px 26px; border-radius: var(--r-lg); color: #fff; background: linear-gradient(135deg, var(--tl-night), var(--tl-night-2)); }
.tl-makercta h2 { color: #fff !important; margin-bottom: 6px !important; }
.tl-makercta p { margin: 0; max-width: 60ch; color: rgba(255, 255, 255, .82); }
.tl-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--r-full); background: var(--yellow); color: var(--ink) !important; font-weight: 800; text-decoration: none; }
.tl-btn--big { padding: 14px 24px; font-size: 16px; }
.tl-empty { padding: 60px 0; }

/* ---------- Vue d'ensemble GO ---------- */
.tl-leagues { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tl-league { display: flex; flex-direction: column; padding: 16px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--border); }
.tl-league header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tl-league h2 { margin: 0 !important; font-size: 20px !important; }
.tl-league header span { font-size: 12.5px; color: var(--ink-light); }
.tl-league ol { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 4px; }
.tl-league li { display: grid; grid-template-columns: 22px 48px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 10px; }
.tl-league li:nth-child(odd) { background: var(--cream); }
.tl-league__rank { font-weight: 800; color: var(--ink-light); text-align: right; }
.tl-league img { width: 48px; height: 48px; object-fit: contain; }
.tl-league__id b { display: block; font-size: 14px; }
.tl-league__id small { display: block; font-size: 11.5px; color: var(--ink-light); line-height: 1.3; }
.tl-league__score { font-weight: 900; font-variant-numeric: tabular-nums; }
.tl-league .tl-btn { margin-top: auto; align-self: flex-start; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .tl-leagues { grid-template-columns: minmax(0, 1fr); }
    .tl-ribbon { display: none; }
}
@media (max-width: 640px) {
    .tl-row { grid-template-columns: 74px minmax(0, 1fr); }
    .tl-row__label { padding: 10px 8px; align-items: center; text-align: center; }
    .tl-row__label small { display: none; }
    .tl-row__label span { font-size: 11px; }
    .tl-tile { width: 76px; }
    .tl-tile img { width: 52px; height: 52px; }
    .tl-tile__name { font-size: 11px; }
    .tl-card__head { grid-template-columns: auto minmax(0, 1fr) auto; }
    .tl-card__rank { display: none; }
    .tl-card__data div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .tl-filters, .tl-filters input { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .tl-tile, .tl-hubcard { transition: none; }
}

/* ---------- Créateur de tier list ---------- */
.tlm-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--border); }
.tlm-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-light); }
.tlm-field select, .tlm-field input { height: 42px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--white); font: inherit; font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); }
.tlm-field--grow { flex: 1 1 220px; }
.tlm-actions { display: flex; gap: 8px; }
.tlm-ghost { height: 42px; padding: 0 16px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--white); font: inherit; font-weight: 700; cursor: pointer; }
.tlm-actions .tl-btn { height: 42px; border: 0; cursor: pointer; font: inherit; font-weight: 800; }
.tlm-board { display: grid; gap: 6px; }
.tlm-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); min-height: 92px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); background: var(--white); }
.tlm-row__label { justify-content: center; align-items: center; text-align: center; font-size: 26px; font-weight: 900; outline: none; cursor: text; word-break: break-word; }
.tlm-row__label:focus { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .7); }
.tlm-row__drop { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; min-height: 88px; padding: 8px; transition: background .15s ease; }
.tlm-row__drop.is-over { background: var(--yellow-bg); }
.tlm-mon { display: flex; flex-direction: column; align-items: center; width: 76px; padding: 2px 2px 4px; border: 2px solid transparent; border-radius: 10px; background: transparent; cursor: grab; font: inherit; }
.tlm-mon:hover { background: var(--cream); }
.tlm-mon img { width: 64px; height: 64px; image-rendering: pixelated; pointer-events: none; }
.tlm-mon span { font-size: 10.5px; font-weight: 700; line-height: 1.15; color: var(--ink-mid); pointer-events: none; }
.tlm-mon.is-selected { border-color: var(--yellow); background: var(--yellow-bg); }
.tlm-mon.is-dragging { opacity: .4; }
.tlm-pool { margin-top: 16px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--border); }
.tlm-pool__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 0; }
.tlm-pool__head h2 { margin: 0 !important; font-size: 18px !important; }
.tlm-pool__head input { height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border); font: inherit; }
.tlm-pool__drop { max-height: 460px; overflow-y: auto; }
.tlm-hint { margin: 10px 2px 0; font-size: 13px; color: var(--ink-light); }
@media (max-width: 640px) {
    .tlm-row { grid-template-columns: 64px minmax(0, 1fr); min-height: 76px; }
    .tlm-row__label { font-size: 18px; }
    .tlm-mon { width: 60px; }
    .tlm-mon img { width: 48px; height: 48px; }
    .tlm-mon span { display: none; }
}
