:root {
  --bg: #0b0e19; --panel: #141a2c; --panel2: #1b2238; --line: #273050;
  --text: #e8ebf5; --muted: #8d96b3; --gold: #e3b955; --blue: #4f8cff;
  --win: #2f9e74; --win-bg: #12302a; --loss: #d9534f; --loss-bg: #34191f;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
footer { color: var(--muted); font-size: 12px; text-align: center; padding: 20px; border-top: 1px solid var(--line); max-width: 900px; margin: 0 auto; }
img { display: block; }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: rgba(11,14,25,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 22px; letter-spacing: -.5px; }
.logo span { color: var(--gold); }
.top .player-form { margin-left: auto; }

/* formulaires */
.player-form { display: flex; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.player-form select, .player-form input, .player-form button, .champ-filter { font: inherit; color: inherit; background: transparent; border: 0; padding: 12px 14px; outline: none; }
.player-form select { background: var(--panel2); border-right: 1px solid var(--line); cursor: pointer; }
.player-form input { flex: 1; min-width: 0; }
.player-form button { background: var(--gold); color: #1a1405; font-weight: 700; cursor: pointer; }
.player-form button:hover { filter: brightness(1.08); }
.player-form.small select, .player-form.small input, .player-form.small button { padding: 7px 10px; font-size: 14px; }
.player-form.small input { width: 170px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* accueil */
.hero { text-align: center; padding: 40px 0 30px; }
.hero h1 { font-size: clamp(32px, 6vw, 54px); margin: 0 0 6px; letter-spacing: -1.5px; }
.hero h1 span { color: var(--gold); }
.hero p { color: var(--muted); margin: 0 0 26px; }
.hero .player-form { max-width: 560px; margin: 0 auto; font-size: 17px; }
.recent { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); cursor: pointer; }
.chip:hover, .chip.on { color: var(--text); border-color: var(--gold); }
.chip.on { background: #2a2310; }

h2 { font-size: 20px; margin: 34px 0 14px; }
.champ-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.champ-filter { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 260px; flex: 1; max-width: 360px; }
.roles { display: flex; flex-wrap: wrap; gap: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.champ { text-align: center; font-size: 13px; }
.champ img { width: 100%; aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; transition: transform .12s, border-color .12s; background: var(--panel); }
.champ:hover img { transform: translateY(-2px); border-color: var(--gold); }
.champ div { margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); padding: 20px 0; }

/* fiche champion */
.banner { position: relative; border-radius: 14px; overflow: hidden; min-height: 340px; display: flex; align-items: flex-end; background: var(--panel); }
.banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,14,25,.97) 8%, rgba(11,14,25,.2) 70%); }
.banner .info { position: relative; z-index: 1; padding: 28px; }
.banner h1 { margin: 0; font-size: 44px; letter-spacing: -1px; }
.banner .title { color: var(--gold); text-transform: capitalize; font-size: 18px; }
.tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tag { background: rgba(255,255,255,.1); border-radius: 6px; padding: 2px 10px; font-size: 13px; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; margin-top: 22px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel + .panel { margin-top: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.lore { color: #c5cbe0; white-space: pre-line; }
.spell { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.spell:first-of-type { border-top: 0; padding-top: 0; }
.spell img { width: 52px; height: 52px; border-radius: 8px; flex: none; }
.spell .key { display: inline-block; background: var(--panel2); color: var(--gold); font-weight: 700; border-radius: 4px; padding: 0 6px; margin-right: 6px; font-size: 12px; }
.spell p { margin: 4px 0 0; color: #c5cbe0; font-size: 14px; white-space: pre-line; }
.spell .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.stats td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.bars div { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; font-size: 14px; }
.bars meter { width: 55%; height: 10px; }
.tips { margin: 0; padding-left: 18px; color: #c5cbe0; font-size: 14px; }
.tips li { margin-bottom: 6px; }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.skins figure { margin: 0; font-size: 12px; text-align: center; color: var(--muted); }
.skins img { width: 100%; border-radius: 8px; aspect-ratio: 308/560; object-fit: cover; background: var(--panel2); }
.back { display: inline-block; color: var(--muted); margin-bottom: 14px; }
.back:hover { color: var(--text); }

/* profil joueur */
.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile .icon { position: relative; }
.profile .icon img { width: 96px; height: 96px; border-radius: 16px; border: 2px solid var(--gold); }
.profile .icon span { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--gold); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.profile h1 { margin: 0; font-size: 32px; }
.profile h1 small { color: var(--muted); font-weight: 400; font-size: 22px; }
.profile .region { color: var(--muted); text-transform: uppercase; font-size: 13px; }
.ranks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
@media (max-width: 600px) { .ranks { grid-template-columns: 1fr; } }
.rank .tier { font-size: 22px; font-weight: 800; text-transform: capitalize; }
.rank .sub { color: var(--muted); font-size: 14px; }
.t-iron{color:#8a7f7a}.t-bronze{color:#b8794e}.t-silver{color:#a9b6c2}.t-gold{color:#e3b955}.t-platinum{color:#3fb6a8}.t-emerald{color:#2fc26d}.t-diamond{color:#6f8dff}.t-master{color:#b55ce6}.t-grandmaster{color:#e0494b}.t-challenger{color:#f4d47c}
.mastery { display: flex; gap: 14px; flex-wrap: wrap; }
.mastery a { text-align: center; font-size: 12px; color: var(--muted); }
.mastery img { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--line); margin: 0 auto 4px; }
.mastery b { display: block; color: var(--text); font-size: 13px; }
.match { display: grid; grid-template-columns: 110px auto 1fr auto; gap: 16px; align-items: center; padding: 12px 14px; border-radius: var(--radius); border-left: 4px solid var(--loss); background: var(--loss-bg); margin-bottom: 8px; }
.match.win { border-color: var(--win); background: var(--win-bg); }
.match.remake { border-color: var(--muted); background: var(--panel); }
.match .res { font-size: 13px; color: var(--muted); }
.match .res b { display: block; font-size: 15px; color: var(--loss); }
.match.win .res b { color: var(--win); }
.match.remake .res b { color: var(--muted); }
.match .who { display: flex; gap: 8px; align-items: center; }
.match .who > img { width: 54px; height: 54px; border-radius: 10px; }
.match .sp { display: grid; gap: 3px; }
.match .sp img { width: 24px; height: 24px; border-radius: 4px; }
.match .kda { font-weight: 700; font-size: 17px; }
.match .kda span { color: var(--muted); font-weight: 400; }
.match .det { font-size: 13px; color: var(--muted); }
.match .items { display: flex; gap: 3px; margin-top: 6px; }
.match .items img, .match .items i { width: 26px; height: 26px; border-radius: 4px; background: rgba(0,0,0,.3); }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.teams a { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.teams a:hover { color: var(--text); }
.teams a.me { color: var(--text); font-weight: 700; }
.teams img { width: 16px; height: 16px; border-radius: 3px; flex: none; }
@media (max-width: 760px) {
  .match { grid-template-columns: 1fr auto; }
  .teams { display: none; }
  .top .player-form.small input { width: 110px; }
}
.notice { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); }
.notice b { color: var(--text); display: block; font-size: 18px; margin-bottom: 6px; }
.loading { color: var(--muted); text-align: center; padding: 40px; }
.stats .sub { color: var(--muted); font-size: 12px; }
