/* ─── Reset & Base ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #0a0e1a;
    --bg2:          #111827;
    --bg3:          #1f2937;
    --border:       #1f2937;
    --border2:      #374151;
    --text:         #f1f5f9;
    --text2:        #94a3b8;
    --text3:        #64748b;
    --accent:       #5e17eb;
    --accent2:      #7c3aed;
    --accent-text:  #a78bfa;
    --accent-soft:  rgba(94,23,235,0.12);
    --gold:         #f59e0b;
    --gold2:        #fbbf24;
    --blue:         #5e17eb;
    --green:        #22c55e;
    --red:          #ef4444;
    --orange:       #f97316;
    --yellow:       #eab308;
}

html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }

/* ─── Header ────────────────────────────────────────────────────────────────── */

.site-header {
    background: #5e17eb;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 56px;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.site-logo span { color: rgba(255,255,255,0.7); }

.site-nav { display: flex; gap: 1.25rem; }
.site-nav a {
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    transition: color 0.15s;
}
.site-nav a:hover { color: #fff; }

.header-search { position: relative; margin-left: auto; }
.header-search-icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.6); pointer-events: none; }

.header-search input {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 0.4rem 0.9rem 0.4rem 2.1rem;
    font-size: 0.875rem;
    color: #fff;
    width: 240px;
    outline: none;
    transition: border-color 0.15s;
}
.header-search input::placeholder { color: rgba(255,255,255,0.55); }
.header-search input:focus { border-color: #fff; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 200;
}
.search-dropdown.open { display: block; }

.search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
    transition: background 0.1s;
}
.search-item:hover { background: var(--bg3); }
.search-item img { border-radius: 50%; border: 1px solid var(--border2); }
.search-item.is-active { background: var(--bg3); }
.search-item img.is-square, .hp-sr-item img.is-square { border-radius: 6px; }
.search-item small, .hp-sr-item small { margin-left: auto; font-size: 0.72rem; color: var(--text3); white-space: nowrap; }
.search-group, .hp-sr-group { display: flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.9rem 0.2rem; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); }
.search-group + .search-item, .hp-sr-group + li .hp-sr-item { border-top: 0; }

/* ─── Footer ────────────────────────────────────────────────────────────────── */

.site-footer {
    margin-top: auto;
    border-top: 1px solid #1f2a3f;
    padding: 2rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text3);
}
.footer-disclaimer { font-size: 0.68rem; margin-top: 0.4rem; opacity: 0.7; }
.footer-legal { margin-top: 0.75rem; display: flex; gap: 0.5rem; justify-content: center; align-items: center; }
.footer-legal a { font-size: 0.72rem; color: var(--text3); text-decoration: none; }
.footer-legal a:hover { color: var(--text2); text-decoration: underline; }
.footer-sep { color: var(--text3); font-size: 0.7rem; }

/* ─── Legal pages */
.legal-page { max-width: 780px; margin: 0 auto; }
.legal-page h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 2rem; }
.legal-content h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 2rem 0 0.6rem; }
.legal-content h3 { font-size: 0.95rem; font-weight: 600; color: var(--text2); margin: 1.25rem 0 0.4rem; }
.legal-content p { font-size: 0.9rem; color: var(--text2); line-height: 1.7; margin-bottom: 0.75rem; }
.legal-content ul { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.legal-content ul li { font-size: 0.9rem; color: var(--text2); line-height: 1.7; }
.legal-content a { color: var(--accent-text); text-decoration: underline; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.25rem; font-size: 0.85rem; }
.legal-content th { background: var(--bg3); color: var(--text); font-weight: 600; padding: 0.5rem 0.75rem; text-align: left; border: 1px solid var(--border2); }
.legal-content td { padding: 0.45rem 0.75rem; border: 1px solid var(--border); color: var(--text2); }

/* ─── Hero ──────────────────────────────────────────────────────────────────── */

.hero { text-align: center; margin-bottom: 2.5rem; }
.hero h1 { font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; }
.hero p { color: var(--text2); }

/* ─── Filters ───────────────────────────────────────────────────────────────── */

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.role-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.role-btn {
    padding: 0.3rem 1rem;
    border-radius: 999px;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg3);
    color: var(--text2);
    transition: all 0.15s;
}
.role-btn:hover { background: var(--border2); color: var(--text); }
.role-btn.active { background: var(--accent); color: #fff; }

.sort-btns { display: flex; gap: 0.4rem; margin-left: auto; }

.sort-btn {
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    border: none;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg3);
    color: var(--text2);
    transition: all 0.15s;
}
.sort-btn.active { background: var(--accent); color: #fff; }

/* ─── Champion Table ────────────────────────────────────────────────────────── */

.champion-table-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }

.champion-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.champion-table thead tr {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
}
.champion-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text2);
    font-weight: 800;
}
.champion-table .th-wr,
.champion-table .th-pr { text-align: right; }

.champ-row {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    transition: background 0.1s;
}
.champ-row:nth-child(even) { background: var(--bg2); }
.champ-row:hover { background: var(--bg3); }
.champ-row:last-child { border-bottom: none; }
.champ-row td { padding: 0.6rem 1rem; }
.champ-row.hidden { display: none; }

.champ-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.champ-name-cell img { border-radius: 50%; border: 1px solid var(--border2); }
.champ-name-cell span { font-weight: 500; }

.td-role { color: var(--text2); }
.td-wr { text-align: right; }
.td-pr { text-align: right; color: var(--text2); }

.counters-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-text);
    transition: color 0.15s;
}
.counters-link:hover { color: #fff; }

/* ─── Badges ────────────────────────────────────────────────────────────────── */

.wr-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.8rem;
}
.wr-good { color: var(--green); }
.wr-bad  { color: var(--red); }
.wr-neutral { color: var(--text); }

.delta-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}
.delta-pos { background: rgba(34,197,94,0.15); color: var(--green); }
.delta-neg { background: rgba(239,68,68,0.15); color: var(--red); }

/* ─── All Champions Grid ─────────────────────────────────────────────────────── */

.page-title { font-size: 1.75rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; }
.champ-count { color: var(--text2); font-size: 0.875rem; margin-bottom: 1.5rem; }

.all-champions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.champ-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.6rem;
    width: 100px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.15s;
    text-align: center;
}
.champ-card:hover { border-color: var(--accent2); background: var(--bg3); }
.champ-card img { border-radius: 50%; border: 1px solid var(--border2); }
.champ-card span { font-size: 0.72rem; color: var(--text2); line-height: 1.3; }
.champ-card:hover span { color: var(--text); }

/* ─── Single Champion ────────────────────────────────────────────────────────── */

.champ-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.champ-hero img { border-radius: 50%; border: 3px solid var(--accent2); }
.champ-hero h1 { font-size: 1.75rem; font-weight: 800; color: #fff; margin-bottom: 0.25rem; }
.champ-subtitle { color: var(--text2); font-size: 0.875rem; margin-bottom: 0.75rem; }
.champ-meta { display: flex; gap: 1.5rem; font-size: 0.875rem; color: var(--text2); }
.champ-meta strong { color: var(--text); }

.counters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}
.section-title.bad  { color: var(--red); border-color: var(--red); }
.section-title.good { color: var(--green); border-color: var(--green); }

.counter-list { display: flex; flex-direction: column; gap: 0.5rem; }

.counter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.15s;
}
.counter-row:hover { background: var(--bg3); border-color: var(--border2); }
.counter-row img { border-radius: 50%; border: 1px solid var(--border2); flex-shrink: 0; }
.counter-info { flex: 1; }
.counter-name { font-size: 0.875rem; font-weight: 500; }
.counter-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }

.back-link { margin-top: 2.5rem; }
.back-link a { color: var(--text2); font-size: 0.875rem; transition: color 0.15s; }
.back-link a:hover { color: var(--text); }

.matchup-link {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text3);
    margin-top: 0.2rem;
    transition: color 0.15s;
}
.matchup-link:hover { color: var(--accent-text); }

/* ─── Matchup page ───────────────────────────────────────────────────────────── */

.mu-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin-bottom: 1rem;
}

.matchup-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.mu-champ {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}
.mu-champ img { border-radius: 50%; border: 3px solid var(--border2); transition: border-color 0.15s; }
.mu-champ:hover img { border-color: var(--accent2); }
.mu-champ span { font-size: 0.875rem; font-weight: 600; color: var(--text); }

.mu-vs-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.mu-vs-label { font-size: 1.5rem; font-weight: 900; color: var(--text3); }
.mu-wr { font-size: 1.75rem; font-weight: 800; }
.mu-games { font-size: 0.75rem; color: var(--text3); }

.mu-summary-text {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text2);
    margin: -1.5rem 0 2rem;
    line-height: 1.6;
}
.mu-summary-text strong { color: var(--text); }

.matchup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.mu-section-skills { grid-column: 1 / -1; }

.mu-section {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}
.mu-section h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text3);
    margin-bottom: 1rem;
    font-weight: 700;
}

.mu-items, .mu-runes, .mu-spells {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mu-item, .mu-rune, .mu-spell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
    width: 60px;
}
.mu-item img, .mu-rune img, .mu-spell img { border-radius: 6px; border: 1px solid var(--border2); }
.mu-rune img { border-radius: 50%; }
.mu-item span, .mu-rune span, .mu-spell span { font-size: 0.6rem; color: var(--text2); line-height: 1.2; }

/* Tier badge */
.mu-tier {
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--accent-soft);
    border: 1px solid var(--accent2);
    border-radius: 6px;
    padding: 2px 8px;
    color: var(--accent-text);
}

/* Subsection headers inside mu-section */
.mu-subsection {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text3);
    margin: 0.75rem 0 0.5rem;
    font-weight: 700;
}

/* Item win rate badge */
.item-wr, .spell-wr {
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    background: var(--bg3);
}
.item-pick { font-size: 0.55rem; color: var(--text3); }
.mu-rune-trees { font-size: 0.8rem; color: var(--text2); margin-bottom: 0.75rem; }
.mu-rune-sec { opacity: 0.8; }
.mu-rune-sec img { width: 34px; height: 34px; }

/* Rune tree name label */
.mu-rune-trees strong { color: var(--text); }

/* Skill letter colors — shared across priority + levels */
.sk { font-weight: 800; }
.sk-q { color: #60a5fa; }
.sk-w { color: #34d399; }
.sk-e { color: #fbbf24; }
.sk-r { color: #c084fc; }

/* Skills section layout — priorities left, levels right */
.mu-section-skills .mu-skills-inner {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Skill priority rows */
.mu-skill-prios { display: flex; flex-direction: column; gap: 0.35rem; }

.mu-skill-prio {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg3);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border2);
}
.mu-skill-prio.prio-top {
    border-color: rgba(94, 23, 235, 0.4);
    background: rgba(94, 23, 235, 0.08);
}

.mu-prio-letters {
    display: flex;
    gap: 3px;
    width: 52px;
    flex-shrink: 0;
}
.mu-prio-letters .sk {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border-radius: 4px;
    background: var(--bg);
    border: 1px solid currentColor;
    opacity: 0.85;
}

.mu-prio-bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    overflow: hidden;
}
.mu-prio-bar {
    height: 100%;
    background: var(--border2);
    border-radius: 2px;
    transition: width 0.3s;
}
.prio-top .mu-prio-bar { background: var(--accent2); }

.mu-prio-pick { font-size: 0.7rem; color: var(--text3); width: 34px; text-align: right; flex-shrink: 0; }
.mu-prio-wr   { font-size: 0.75rem; font-weight: 700; width: 46px; text-align: right; flex-shrink: 0; }
.mu-levels-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); margin-bottom: 0.5rem; }

/* Skill order level-by-level */
.mu-skill-levels { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.mu-skill-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.level-num { font-size: 0.45rem; color: var(--text3); }
.level-key {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 1px solid currentColor;
    font-weight: 800;
    font-size: 0.75rem;
    opacity: 0.85;
    background: var(--bg);
}

/* Legacy skill badges */
.mu-skills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mu-skill {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--accent-soft);
    border: 1px solid var(--accent2);
    font-weight: 800;
    font-size: 1rem;
    color: var(--accent-text);
}

/* ─── Items archive ─────────────────────────────────────────────────────────── */

.items-cat-heading {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text2);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.items-cat-heading span { color: var(--text3); font-weight: 400; font-size: 0.8rem; }

.item-grid-card img { border-radius: 6px !important; }
.item-grid-cost { font-size: 0.65rem; color: var(--gold); font-weight: 600; }

/* ─── Item detail ────────────────────────────────────────────────────────────── */

.item-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
}
.item-hero img { border-radius: 10px; border: 2px solid var(--border2); flex-shrink: 0; }
.item-hero h1 { font-size: 1.75rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; }

.item-hero-meta { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

.item-cat-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 6px;
    padding: 3px 10px;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.item-cost-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold);
}
.item-sell-badge {
    font-size: 0.75rem;
    color: var(--text3);
}

.item-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.item-stats-section {}
.item-stats-list { display: flex; flex-direction: column; gap: 0.4rem; }
.item-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: var(--bg3);
    border-radius: 6px;
    font-size: 0.875rem;
}
.item-stat-label { color: var(--text2); }
.item-stat-val { font-weight: 700; color: var(--text); }

.item-build-section {}
.item-build-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.build-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.15s;
}
.build-item img { border-radius: 6px; border: 1px solid var(--border2); }
a.build-item:hover img { border-color: var(--accent2); }

.item-champs-section { margin-bottom: 2.5rem; }
.item-champs-sub { color: var(--text2); font-size: 0.875rem; margin-bottom: 1rem; }
.td-rank { color: var(--text3); font-size: 0.8rem; width: 36px; }

/* ─── Tier List ─────────────────────────────────────────────────────────────── */

.tl-header { text-align: center; margin-bottom: 2rem; }
.tl-header h1 { font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: 0.35rem; }
.tl-sub { color: var(--text2); font-size: 0.875rem; }

.tl-elo-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tl-role-nav {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
    position: sticky;
    top: 56px;
    background: var(--bg);
    padding: 0.75rem 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
}

.tl-role-link {
    padding: 0.35rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border2);
    background: var(--bg2);
    color: var(--text2);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.tl-role-link:hover { border-color: var(--accent2); color: var(--text); }
.tl-role-link.active { background: var(--accent); border-color: var(--accent2); color: #fff; }

.tl-role-section { margin-bottom: 3rem; scroll-margin-top: 120px; }
.tl-role-h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}
.tl-elo-btn {
    padding: 0.4rem 1.1rem;
    border: 1px solid var(--border2);
    background: var(--bg2);
    color: var(--text2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.tl-elo-btn.active {
    background: var(--accent);
    border-color: var(--accent2);
    color: #fff;
}
.tl-elo-btn:hover:not(.active) { border-color: var(--accent2); color: var(--text); }

.tl-tier-row {
    display: flex;
    align-items: stretch;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    min-height: 80px;
    background: var(--bg2);
    border: 1px solid var(--border);
}
.tl-tier-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    flex-shrink: 0;
    font-size: 1.75rem;
    font-weight: 900;
}
.tier-s .tl-tier-label { background: #e84057; color: #fff; }
.tier-a .tl-tier-label { background: #f39c12; color: #fff; }
.tier-b .tl-tier-label { background: #27ae60; color: #fff; }
.tier-c .tl-tier-label { background: #2980b9; color: #fff; }
.tier-d .tl-tier-label { background: #555; color: #aaa; }

.tl-tier-champs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    flex: 1;
    align-content: flex-start;
}

.tl-champ {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-decoration: none;
    width: 72px;
    transition: transform 0.15s;
}
.tl-champ:hover { transform: translateY(-2px); }
.tl-champ img { border-radius: 8px; border: 2px solid var(--border2); width: 52px; height: 52px; }
.tl-champ:hover img { border-color: var(--accent2); }
.tl-champ-name { font-size: 0.6rem; color: var(--text2); text-align: center; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.tl-champ-wr { font-size: 0.65rem; font-weight: 700; }

/* ─── Champion Build Page ───────────────────────────────────────────────────── */

.build-section { margin-bottom: 3rem; }
.build-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.build-grid {
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    grid-template-rows: auto auto;
    gap: 1rem;
}

.build-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}
.build-card-wide { grid-column: span 2; }
.build-card-full { grid-column: 1 / -1; }

.build-card-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text2);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Spells */
.build-spells { display: flex; gap: 0.75rem; }
.build-spell-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
}
.build-spell-item img { border-radius: 8px; border: 2px solid var(--border2); }
.build-spell-item span { font-size: 0.65rem; color: var(--text2); }

/* Skill priority */
.build-skill-prio { display: flex; align-items: center; gap: 0.4rem; }
.bsp-key {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    font-size: 0.9rem; font-weight: 800;
    border: 2px solid currentColor;
    background: var(--bg3);
}
.bsp-arrow { color: var(--text3); font-size: 1.2rem; line-height: 1; }

/* Items */
.build-items-rows { display: flex; flex-direction: column; gap: 0.75rem; }
.build-items-row { display: flex; align-items: flex-start; gap: 0.5rem; flex-wrap: wrap; }
.build-item-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text3);
    font-weight: 700;
    width: 36px;
    flex-shrink: 0;
    padding-top: 0.75rem;
}
.build-item img { border-radius: 8px; border: 2px solid var(--border2); transition: border-color 0.15s; }
.build-item:hover img { border-color: var(--accent2); }
.build-item-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.build-item-core span { font-size: 0.6rem; color: var(--text2); text-align: center; max-width: 64px; line-height: 1.2; }
.build-item-core img { border-radius: 8px; border: 2px solid var(--accent2); }

/* Runes — 4 colonnes : 2 pages × 2 cols */
.build-runes { display: flex; align-items: flex-start; gap: 0; }
.build-rune-page { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; min-width: 0; }
.build-rune-page-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 700;
    color: var(--text3);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.build-rune-page-cols { display: flex; gap: 1rem; }
.build-rune-col { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 0; }
.build-rune-divider {
    width: 1px;
    background: var(--border);
    align-self: stretch;
    flex-shrink: 0;
    margin: 0 1.5rem;
}
.build-rune-tree {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent-text);
    font-weight: 700;
    margin-bottom: 0.1rem;
}
.build-rune-item { display: flex; align-items: center; gap: 0.55rem; }
.build-rune-item img { border-radius: 50%; flex-shrink: 0; }
.rune-item-info { display: flex; flex-direction: column; gap: 0.08rem; min-width: 0; }
.rune-name { font-size: 0.72rem; color: var(--text2); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rune-stats { font-size: 0.58rem; color: var(--text3); }
.build-rune-keystone img { border-radius: 50%; border: 2px solid var(--accent2); }
.build-rune-keystone .rune-name { font-weight: 600; color: var(--text); font-size: 0.78rem; }
.build-rune-shards-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.35rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
}
.build-rune-shard img { border-radius: 4px; opacity: 0.9; }

/* Skill order key with icon */
.bso-key-icon { padding: 0; overflow: hidden; border: 2px solid transparent; }
.bso-key-icon img { border-radius: 4px; display: block; }

/* Skill Order */
.build-skill-order { display: flex; flex-direction: column; gap: 0.5rem; }
.bso-row { display: flex; align-items: center; gap: 0.35rem; }
.bso-key {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 7px;
    font-size: 1rem; font-weight: 800;
    border: 2px solid currentColor;
    background: var(--bg3);
    flex-shrink: 0;
    margin-right: 0.35rem;
}
.bso-cell {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    font-size: 0.7rem;
    color: var(--text3);
    flex-shrink: 0;
    font-weight: 500;
}
.bso-cell span { pointer-events: none; }
.bso-active { border-color: transparent; color: #fff; font-weight: 800; font-size: 0.8rem; }
.sk-bg-q { background: #2563eb; }
.sk-bg-w { background: #16a34a; }
.sk-bg-e { background: #b45309; }
.sk-bg-r { background: #7c3aed; }

/* Counters section */
.counters-section { margin-bottom: 3rem; }
.counters-see-all {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}
.counters-see-all a {
    color: var(--accent-text);
    font-weight: 600;
    transition: color 0.15s;
}
.counters-see-all a:hover { color: #fff; }

/* Win Rate by Elo */
.wr-elo-section { margin-bottom: 3rem; }
.wr-elo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.wr-elo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    min-width: 88px;
    transition: border-color 0.15s;
}
.wr-elo-card:hover { border-color: var(--border2); }
.wr-elo-card img { display: block; }
.wr-elo-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3); font-weight: 600; }
.wr-elo-val { font-size: 0.95rem; font-weight: 800; }

/* ─── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .build-grid { grid-template-columns: 1fr 1fr; }
    .build-card-wide { grid-column: span 2; }
}
@media (max-width: 768px) {
    .counters-grid { grid-template-columns: 1fr; }
    .champ-meta { flex-wrap: wrap; gap: 0.75rem; }
    .hero h1 { font-size: 1.5rem; }
    .champion-table .th-pr,
    .champion-table .td-pr { display: none; }
    .build-grid { grid-template-columns: 1fr; }
    .build-card-wide { grid-column: span 1; }
    .wr-elo-grid { gap: 0.35rem; }
    .wr-elo-card { min-width: 72px; padding: 0.5rem 0.6rem; }
}

/* ─── Patch History ─────────────────────────────────────────────────────────── */
.patch-history-section { margin-top: 2rem; }
.patch-history-list { display: flex; flex-direction: column; gap: 0; }
.patch-entry { display: flex; align-items: flex-start; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.patch-entry.patch-overflow { display: none; }
.patch-history-list.expanded .patch-entry.patch-overflow { display: flex; }
.patch-version { font-size: 0.72rem; font-weight: 700; color: var(--accent); white-space: nowrap; min-width: 54px; padding-top: 0.15rem; }
.patch-changes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.2rem; }
.patch-changes li { font-size: 0.78rem; color: var(--text2); line-height: 1.45; }
.patch-show-more { margin-top: 0.75rem; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 0.45rem 1rem; font-size: 0.72rem; color: var(--text3); cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.patch-show-more:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Homepage ──────────────────────────────────────────────────────────────── */

/* Hero */
.hp-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    background:
        linear-gradient(180deg, rgba(10,14,26,0.45) 0%, rgba(10,14,26,0.65) 100%),
        url('/wp-content/themes/counterpick/assets/img/hero-bg.png') center center / cover no-repeat;
    padding: 6rem 1rem 5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    isolation: isolate;
    z-index: 30; /* les résultats de recherche doivent passer au-dessus des sections suivantes */
}
.hp-hero-inner { max-width: 640px; margin: 0 auto; }
.hp-hero-title { font-size: 2.4rem; font-weight: 800; line-height: 1.2; color: var(--text); margin-bottom: 0.75rem; }
.hp-hero-accent { color: var(--accent-text); }
.hp-hero-sub { font-size: 0.95rem; color: #fff; margin-bottom: 2.25rem; }

/* Search */
.hp-search-wrap { position: relative; width: 100%; max-width: 480px; margin: 0 auto; }
.hp-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 0 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.hp-search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94,23,235,0.18);
}
.hp-search-icon { color: var(--text3); flex-shrink: 0; }
.hp-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1rem;
    padding: 0.85rem 0;
    min-width: 0;
}
.hp-search-input::placeholder { color: var(--text3); }
.hp-search-clear { background: none; border: none; color: var(--text3); font-size: 1.2rem; cursor: pointer; padding: 0; display: none; line-height: 1; }
.hp-search-clear:hover { color: var(--text); }

.hp-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    list-style: none;
    overflow: auto;
    max-height: 420px;
    text-align: left;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.hp-search-results[hidden] { display: none; }
.hp-sr-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text2);
    transition: background 0.1s;
}
.hp-sr-item img { border-radius: 4px; }
.hp-sr-item:hover, .hp-sr-item.is-active { background: var(--bg3); color: var(--text); }

/* Sections */
.hp-section { padding: 3rem 0; border-bottom: 1px solid var(--border); }
.hp-section:last-child { border-bottom: none; }
.hp-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.hp-section-title { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.hp-about { max-width: 760px; }
.hp-about .hp-section-title { margin-bottom: 1rem; }
.hp-about p { color: var(--text2); font-size: 0.98rem; line-height: 1.7; margin-bottom: 1rem; }
.hp-about p:last-child { margin-bottom: 0; }
/* Icônes Lucide inline (inc/icons.php) */
.cp-icon { display: inline-block; flex-shrink: 0; vertical-align: -0.15em; }
h1 > .cp-icon, h2 > .cp-icon, h3 > .cp-icon { margin-right: 0.45em; }
.hp-section-title > .cp-icon, .build-section-title > .cp-icon, .mu-section h2 > .cp-icon, .tl-role-h2 > .cp-icon, .item-hero h1 > .cp-icon, .champ-hero-info h1 > .cp-icon, .mu-page-title > .cp-icon, .page-title > .cp-icon, .tl-header h1 > .cp-icon { color: var(--accent-text); }
.hp-see-all > .cp-icon, .matchup-link > .cp-icon { margin-left: 0.2em; vertical-align: -0.2em; }

/* Bouton « i » de section + modale de description */
.hp-info { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 0.4rem; vertical-align: middle; border: 1px solid var(--border2); border-radius: 50%; background: transparent; color: var(--text2); cursor: pointer; transition: color .15s, border-color .15s; }
.hp-info:hover, .hp-info:focus-visible { color: var(--accent-text); border-color: var(--accent-text); outline: none; }
/* Le reset global (* { margin: 0 }) annule le margin:auto natif qui centre une <dialog> : on le rétablit. */
.cp-dialog { position: fixed; inset: 0; margin: auto; max-width: 520px; width: calc(100% - 2rem); max-height: calc(100vh - 2rem); overflow: auto; padding: 0; border: 1px solid var(--border2); border-radius: 12px; background: var(--bg2); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.cp-dialog::backdrop { background: rgba(5, 8, 16, .7); }
.cp-dialog-body { padding: 1.5rem 1.75rem 1.75rem; }
.cp-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.cp-dialog-head h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.cp-dialog-close { flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid var(--border2); border-radius: 50%; background: transparent; color: var(--text2); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.cp-dialog-close:hover, .cp-dialog-close:focus-visible { color: var(--text); border-color: var(--text3); outline: none; }
.cp-dialog-text p { color: var(--text2); font-size: 0.95rem; line-height: 1.65; margin: 0 0 0.85rem; }
.cp-dialog-text p:last-child { margin-bottom: 0; }
.hp-see-all { font-size: 0.8rem; color: var(--accent-text); text-decoration: none; }
.hp-see-all:hover { text-decoration: underline; }

/* Champion cards */
.hp-champ-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.hp-champ-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1rem 1.2rem;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    text-align: center;
}
.hp-champ-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(94,23,235,0.2);
}
.hp-champ-img-wrap { margin-bottom: 0.4rem; }
.hp-champ-img-wrap img { border-radius: 50%; border: 2px solid var(--border2); display: block; }
.hp-champ-name { font-size: 0.85rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.hp-champ-label { display: block; font-size: 0.65rem; font-weight: 500; color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.05em; }
.hp-champ-role { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); }
.hp-champ-wr { font-size: 0.78rem; font-weight: 700; }

/* Rank badge (Top 5) */
.hp-rank-badge {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    letter-spacing: 0.04em;
}
.hp-champ-card { position: relative; }

/* Per-role compact grid */
.hp-role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.4rem;
}
.hp-role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.3rem;
    text-decoration: none;
    transition: border-color 0.12s;
}
.hp-role-card:hover { border-color: var(--accent); }
.hp-role-card img { border-radius: 6px; }
.hp-role-wr { font-size: 0.65rem; font-weight: 700; }

/* Rising champions (2-col grid of 5+5) */
.hp-rising-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}
.hp-rising-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    text-decoration: none;
    transition: border-color 0.12s;
}
.hp-rising-card:hover { border-color: var(--accent); }
.hp-rising-card img { border-radius: 6px; flex-shrink: 0; }
.hp-rising-rank { font-size: 0.68rem; font-weight: 800; color: var(--text3); min-width: 16px; }
.hp-rising-name { font-size: 0.78rem; font-weight: 600; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-rising-wr { font-size: 0.72rem; color: var(--text2); flex-shrink: 0; }
.hp-rising-delta { font-size: 0.72rem; font-weight: 700; flex-shrink: 0; min-width: 44px; text-align: right; }
.delta-pos { color: var(--green); }
.delta-neg { color: var(--red); }
.hp-patch-note { font-size: 0.78rem; color: var(--text3); }

@media (max-width: 900px) {
    .hp-champ-grid { grid-template-columns: repeat(3, 1fr); }
    .hp-role-grid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
}
@media (max-width: 600px) {
    .hp-hero-title { font-size: 1.7rem; }
    .hp-champ-grid { grid-template-columns: repeat(2, 1fr); }
    .hp-rising-grid { grid-template-columns: 1fr; }
}
