/* KC Score — style « Liquid Glass » (iOS 26), pensé d'abord pour le téléphone */

/* ---------- Jetons : thème sombre par défaut ---------- */
:root {
  --bg: #04060d;
  --text: #f6f8ff;
  --text-soft: rgba(246, 248, 255, .86);
  --muted: rgba(225, 232, 255, .58);
  --glass: rgba(255, 255, 255, .06);
  --glass-2: rgba(255, 255, 255, .10);
  --glass-3: rgba(255, 255, 255, .16);
  --stroke: rgba(255, 255, 255, .13);
  --edge: rgba(255, 255, 255, .32); /* reflet du bord haut */
  --blue: #2a6bff;
  --cyan: #3fd4ff;
  --violet: #8b5cff;
  --grad: linear-gradient(120deg, var(--blue) 0%, var(--cyan) 55%, var(--violet) 100%);
  --live: #ff375f;
  --win: #34d17a;
  --loss: #ff6b7a;
  --radius: 28px;
  --blur: blur(30px) saturate(190%);
  --chip: rgba(255, 255, 255, .92); /* pastille claire sous les logos (logo KC noir) */
  --sheet: linear-gradient(170deg, rgba(42, 107, 255, .16), rgba(4, 6, 13, .92) 40%), rgba(8, 11, 22, .94);
  --sheet-head: rgba(8, 11, 22, .72);
  --dim: rgba(0, 0, 0, .22);
}

/* Thème clair : suit le téléphone (réglage « Auto »), ou forcé dans les réglages */
@media (prefers-color-scheme: light) {
  :root:not([data-mode="dark"]) {
    --bg: #eaf0fb;
    --text: #0a1022;
    --text-soft: rgba(10, 16, 34, .85);
    --muted: rgba(20, 30, 60, .55);
    --glass: rgba(255, 255, 255, .45);
    --glass-2: rgba(255, 255, 255, .6);
    --glass-3: rgba(255, 255, 255, .8);
    --stroke: rgba(255, 255, 255, .85);
    --edge: rgba(255, 255, 255, 1);
    --sheet: linear-gradient(170deg, rgba(42, 107, 255, .12), rgba(255, 255, 255, .6) 40%), rgba(245, 248, 255, .94);
    --sheet-head: rgba(245, 248, 255, .75);
    --dim: rgba(20, 30, 60, .12);
  }
}
:root[data-mode="light"] {
  --bg: #eaf0fb;
  --text: #0a1022;
  --text-soft: rgba(10, 16, 34, .85);
  --muted: rgba(20, 30, 60, .55);
  --glass: rgba(255, 255, 255, .45);
  --glass-2: rgba(255, 255, 255, .6);
  --glass-3: rgba(255, 255, 255, .8);
  --stroke: rgba(255, 255, 255, .85);
  --edge: rgba(255, 255, 255, 1);
  --sheet: linear-gradient(170deg, rgba(42, 107, 255, .12), rgba(255, 255, 255, .6) 40%), rgba(245, 248, 255, .94);
  --sheet-head: rgba(245, 248, 255, .75);
  --dim: rgba(20, 30, 60, .12);
}

/* Couleur d'accent (réglages) : seules trois couleurs changent, le reste suit */
:root[data-accent="violet"] { --blue: #6a3dff; --cyan: #b48cff; --violet: #ff6ad5; }
:root[data-accent="emerald"] { --blue: #0fb981; --cyan: #5ef2c4; --violet: #2a8bff; }
:root[data-accent="rose"] { --blue: #ff375f; --cyan: #ff8fb1; --violet: #ffb36b; }

/* Taille du texte (réglages) */
:root[data-size="s"] body { zoom: .92; }
:root[data-size="l"] body { zoom: 1.12; }

/* Animations coupées (réglages) */
:root[data-motion="off"] *,
:root[data-motion="off"] *::before,
:root[data-motion="off"] *::after { animation: none !important; transition: none !important; }

/* MVP masqué (réglages) */
:root[data-mvp="off"] .mvpchip { display: none; }

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: max(14px, env(safe-area-inset-top)) 16px max(40px, env(safe-area-inset-bottom));
  max-width: 980px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- Fond : nappes de couleur floues ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: float 24s ease-in-out infinite; }
.b1 { width: 80vw; height: 80vw; max-width: 700px; max-height: 700px; background: var(--blue); top: -25vw; left: -25vw; }
.b2 { width: 70vw; height: 70vw; max-width: 600px; max-height: 600px; background: var(--cyan); bottom: -20vw; right: -25vw; animation-delay: -8s; opacity: .32; }
.b3 { width: 60vw; height: 60vw; max-width: 520px; max-height: 520px; background: var(--violet); top: 35%; left: 30%; animation-delay: -16s; opacity: .3; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(6vw, 5vw) scale(1.08); }
  66% { transform: translate(-5vw, 7vw) scale(.95); }
}
@keyframes sheen { from { background-position: 0% 0; } to { background-position: 200% 0; } }
@keyframes in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes flash { 30% { transform: scale(1.18); filter: drop-shadow(0 0 16px var(--cyan)); } }
@keyframes shimmer { 50% { opacity: .5; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(100%); } }

/* ---------- Verre ---------- */
.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .03) 60%), var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 var(--edge), inset 0 -1px 0 rgba(255, 255, 255, .04), 0 18px 50px rgba(0, 0, 0, .35);
}
/* Capsules de verre : texte légèrement transparent, comme les bulles iOS */
.cap, .pill, .more {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 600; color: var(--text-soft);
  padding: 9px 15px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 var(--edge), 0 4px 14px rgba(0, 0, 0, .18);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: transform .15s ease, background .2s;
}
.cap:active, .pill:active, .more:active, .icon:active { transform: scale(.95); }
.cap.accent, .cap.recap, .pill.on { color: #fff; background: var(--grad); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 20px rgba(42, 107, 255, .4); }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: max(10px, env(safe-area-inset-top)); z-index: 10; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 10px 10px 12px; border-radius: 26px;
}
/* Filet lumineux qui glisse sur le bord haut */
.topbar::after {
  content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
  background-size: 200% 100%; animation: sheen 5s linear infinite;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.brand > div { min-width: 0; }
.logo { flex: none; width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 8px 22px rgba(42, 107, 255, .4); }
.contact { margin-top: 40px; padding: 22px; border-radius: var(--radius); text-align: center; }
.contact h2 { justify-content: center; margin: 0 0 8px; }
.contact p { font-size: 15px; color: var(--muted); margin-bottom: 16px; line-height: 1.45; }
.contact .cap { margin: 4px; }
h1 { font-size: 18px; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
#updated { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hactions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon {
  width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; padding: 0; font-size: 17px; cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
  border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 var(--edge), 0 4px 14px rgba(0, 0, 0, .18);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: transform .15s ease, background .2s;
}
#notifBtn.on { background: var(--grad); border-color: transparent; }
.livepill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap;
  background: var(--live); box-shadow: 0 6px 18px rgba(255, 55, 95, .35);
}
.livepill[hidden] { display: none; }
.livepill .dot { background: #fff; width: 8px; height: 8px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 2px 6px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .pill { flex: none; }

section { margin-top: 30px; }
h2 { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin: 0 6px 14px; display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 1.6s infinite; flex: none; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); align-items: start; }

/* ---------- Carte de match ---------- */
/* L'entrée ne se joue qu'une fois, à l'apparition de la carte (pas à chaque actualisation) */
.card { border-radius: var(--radius); padding: 20px; }
.card.fresh { animation: in .45s cubic-bezier(.2, .8, .2, 1) both; }
.card.live { border-color: rgba(255, 55, 95, .5); box-shadow: inset 0 1px 0 var(--edge), 0 0 50px rgba(255, 55, 95, .22); }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.meta .league { display: flex; align-items: center; gap: 8px; min-width: 0; }
.meta .league span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta img { width: 20px; height: 20px; object-fit: contain; }
.tag { padding: 5px 11px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--stroke); font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--text-soft); }
.tag.live { background: var(--live); border-color: transparent; color: #fff; }
.tag.win { background: rgba(52, 209, 122, .16); border-color: rgba(52, 209, 122, .3); color: var(--win); }
.tag.loss { background: rgba(255, 107, 122, .14); border-color: rgba(255, 107, 122, .3); color: var(--loss); }

.match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 18px; }
.team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.team img, .team .ph {
  width: 64px; height: 64px; object-fit: contain; padding: 11px; border-radius: 22px;
  background: var(--chip); box-shadow: inset 0 1px 0 #fff, 0 8px 22px rgba(0, 0, 0, .3);
}
.team .ph { display: grid; place-items: center; color: #0a1022; font-weight: 800; font-size: 14px; }
.team b { font-size: 15px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { font-size: 42px; font-weight: 900; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; display: flex; gap: 10px; align-items: center; }
.score .sep { color: var(--muted); font-weight: 300; }
.score .lead { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score.flash { animation: flash 1s; }
.res { display: flex; flex-direction: column; align-items: center; }
.res small { font-size: 12px; color: var(--muted); font-weight: 600; }
.when { font-size: 18px; font-weight: 800; text-align: center; letter-spacing: -.3px; }
.when small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; letter-spacing: 0; }

/* MVP affiché directement sur la carte, avec un reflet qui glisse */
.mvpchip {
  display: flex; width: fit-content; margin: 16px auto 0; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(100deg, var(--blue), var(--cyan), var(--violet), var(--cyan), var(--blue));
  background-size: 250% 100%; animation: sheen 4s linear infinite;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 22px rgba(42, 107, 255, .35);
}
.mvpchip small { font-size: 12px; font-weight: 700; opacity: .9; font-variant-numeric: tabular-nums; }

.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: nowrap; gap: 8px; margin-top: 18px; font-size: 13px; color: var(--muted); }
.foot .actions { flex-wrap: wrap; min-width: 0; }
.gameTag { font-weight: 600; }
.foot .actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.more { font-size: 13px; padding: 8px 13px; }
.more[aria-expanded="true"] { color: #fff; background: var(--grad); border-color: transparent; }
.recap { font-size: 13px; padding: 8px 13px; }

.empty, .error { border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); font-size: 15px; }
.error { color: var(--loss); }
.skeleton { height: 190px; border-radius: var(--radius); background: var(--glass); animation: shimmer 1.4s infinite; }
.skeleton + .skeleton { margin-top: 16px; }

.toast {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  padding: 13px 20px; border-radius: 22px; font-size: 14px; font-weight: 700; max-width: calc(100% - 32px);
}
footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 44px; }

/* ---------- Scoreboard ---------- */
.details { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--stroke); }
.dloading, .derror, .note { font-size: 14px; color: var(--muted); text-align: center; padding: 8px 0 14px; }
.derror { color: var(--loss); }
.dfoot { font-size: 11px; color: var(--muted); text-align: center; margin-top: 16px; }

/* Onglets façon contrôle segmenté iOS */
.gtabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px;
  padding: 4px; border-radius: 999px; background: var(--dim); border: 1px solid var(--stroke);
}
.gtabs::-webkit-scrollbar { display: none; }
.gtab {
  flex: 1 0 auto; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
  padding: 8px 14px; border-radius: 999px; background: transparent; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: background .2s, color .2s;
}
.gtab.kc { color: var(--win); }
.gtab.opp { color: var(--loss); }
.gtab.on { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .08)); color: var(--text); box-shadow: inset 0 1px 0 var(--edge), 0 3px 10px rgba(0, 0, 0, .25); }
.gtab .dot { width: 7px; height: 7px; }

.ghead { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.vlinks { display: flex; flex-wrap: wrap; gap: 8px; }
.ghead .vlinks { margin-left: auto; }
.vlinks .cap { font-size: 13px; padding: 7px 12px; }

.board { border-radius: 24px; background: var(--glass); border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 var(--edge); padding: 14px; margin-top: 12px; }
.board.kc { background: linear-gradient(160deg, rgba(63, 212, 255, .14), rgba(42, 107, 255, .04) 55%), var(--glass); }
.board.opp { background: linear-gradient(160deg, rgba(255, 107, 122, .12), rgba(255, 107, 122, .02) 55%), var(--glass); }
.bhead { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; }
.bhead .chip { width: 34px; height: 34px; border-radius: 12px; padding: 5px; background: var(--chip); display: grid; place-items: center; flex: none; }
.bhead .chip img { width: 100%; height: 100%; object-fit: contain; }
.bhead .k { margin-left: auto; font-weight: 900; font-size: 26px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.bhead .k small { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.objs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.objs span { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--stroke); color: var(--text-soft); font-variant-numeric: tabular-nums; }

.row {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 8px; align-items: center;
  padding: 14px 0 12px; border-top: 1px solid rgba(255, 255, 255, .07); font-variant-numeric: tabular-nums;
}
.bhead + .objs + .row, .bhead + .row { margin-top: 10px; }
.pick { width: 46px; height: 46px; border-radius: 15px; object-fit: cover; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.pick.ph { display: block; background: var(--glass-3); }
.who { min-width: 0; }
.who b { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.mvp { font-size: 10px; font-weight: 900; letter-spacing: .3px; padding: 2px 7px; border-radius: 8px; background: var(--grad); color: #fff; }
.kda { text-align: right; white-space: nowrap; }
.kda span { font-size: 17px; font-weight: 800; color: var(--muted); }
.kda b { color: var(--text); }
.kda b.d { color: var(--loss); }
.kda small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 1px; }
.stats { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.stats span { font-size: 12px; color: var(--muted); padding: 4px 9px; border-radius: 999px; background: var(--glass-2); border: 1px solid rgba(255, 255, 255, .08); }
.stats b { color: var(--text-soft); font-weight: 700; }
.items { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.items img { width: 24px; height: 24px; border-radius: 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }

.rosters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.roster h4 { font-size: 14px; margin: 0 2px 10px; }
.roster ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.roster li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.roster li img, .roster li .ph { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--glass-3); }
.roster li div { min-width: 0; }
.roster li b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster li small { display: block; font-size: 12px; color: var(--muted); }
.roster li.none { font-size: 13px; color: var(--muted); }

/* ---------- Bilan de la série ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center; padding: 22px 16px 18px; border-radius: 24px;
  background: linear-gradient(140deg, rgba(42, 107, 255, .35), rgba(63, 212, 255, .18) 50%, rgba(139, 92, 255, .3));
  border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 var(--edge);
}
.hero.l { background: linear-gradient(140deg, rgba(255, 107, 122, .28), rgba(139, 92, 255, .18)); }
.hero .verdict { display: block; font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-soft); }
.hero .big { display: block; font-size: 52px; font-weight: 900; letter-spacing: -2px; line-height: 1.1; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.hero .cap { cursor: default; }
.glist { display: grid; gap: 10px; margin-top: 12px; }
.gitem { border-radius: 20px; padding: 12px 14px; background: var(--glass); border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 var(--edge); }
.gtop { display: flex; align-items: center; gap: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.gtop .res { font-weight: 800; }
.gitem.w .res { color: var(--win); }
.gitem.l .res { color: var(--loss); }
.gtop .gmeta { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; }
.gitem .vlinks { margin-top: 10px; }

/* ---------- Feuilles (tableau, réglages) ---------- */
.sheet {
  width: min(1100px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 40px);
  margin: auto; padding: 0; border-radius: 30px; color: var(--text); overflow: auto; overscroll-behavior: contain;
  background: var(--sheet);
}
.sheet[open] { animation: up .35s cubic-bezier(.2, .8, .2, 1); }
.sheet::backdrop { background: rgba(0, 0, 0, .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.shead {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 18px 18px 14px; background: var(--sheet-head); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--stroke);
}
.shead h3 { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
#bracketBody { padding: 4px 18px 26px; }
.stage h4 { font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; margin: 22px 2px 12px; color: var(--muted); }

.tree { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(130px, 1fr); gap: 14px; }
.bcol { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; }
.bcol h5 { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: center; }
.bcol.final h5 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bm { border-radius: 16px; background: var(--glass); border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 var(--edge); padding: 6px 10px; }
.bcol.final .bm { border-color: rgba(63, 212, 255, .6); background: linear-gradient(150deg, rgba(42, 107, 255, .3), rgba(139, 92, 255, .2)); box-shadow: inset 0 1px 0 var(--edge), 0 0 34px rgba(63, 212, 255, .25); }
.bm.inProgress { border-color: var(--live); }
.bt { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.bt + .bt { border-top: 1px solid rgba(255, 255, 255, .07); }
.bt img, .bt .ph { width: 24px; height: 24px; object-fit: contain; padding: 3px; border-radius: 8px; background: var(--chip); flex: none; }
.bt .ph { background: var(--glass-3); }
.bt b { font-weight: 700; }
.bt span { margin-left: auto; font-weight: 800; }
.bt.loss { opacity: .45; }
.bt.kc b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.blist { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.records { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.records li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: var(--glass); border: 1px solid var(--stroke); font-size: 14px; font-variant-numeric: tabular-nums; }
.records li img, .records li > span:first-child { width: 24px; height: 24px; object-fit: contain; padding: 3px; border-radius: 8px; background: var(--chip); flex: none; }
.records li > span:last-child { margin-left: auto; color: var(--muted); font-weight: 700; }
.records li.kc { border-color: rgba(63, 212, 255, .6); background: linear-gradient(150deg, rgba(42, 107, 255, .25), rgba(139, 92, 255, .12)); }

/* Réglages */
#settings { width: 100%; }
#settingsBody { padding: 4px 18px 0; }
.setting { margin-top: 20px; }
.slabel { font-size: 12px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: var(--muted); margin: 0 4px 10px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--dim); border: 1px solid var(--stroke); }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 9px 10px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, color .2s;
}
.seg button.on { background: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .08)); color: var(--text); box-shadow: inset 0 1px 0 var(--edge), 0 3px 10px rgba(0, 0, 0, .25); }
.seg.swatches button { flex-direction: column; gap: 6px; font-size: 12px; padding: 10px 4px; }
.sw { width: 34px; height: 34px; border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.seg.swatches button.on .sw { outline: 2px solid var(--text); outline-offset: 2px; }
.sfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 18px 26px; font-size: 12px; color: var(--muted); }

/* ---------- Téléphone ---------- */
@media (max-width: 640px) {
  .card { padding: 18px 16px; }
  .board { padding: 12px; border-radius: 22px; }
  /* Arbre vertical : moitié haute, finale au milieu, moitié basse */
  .tree { display: flex; flex-direction: column; gap: 10px; }
  .bcol { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px; }
  .bcol h5 { flex-basis: 100%; }
  .bcol .bm { flex: 1 1 0; min-width: 0; max-width: 220px; }
  .bcol.final { padding: 8px 0; }
  .bcol.final .bm { max-width: 260px; flex-basis: 260px; padding: 10px 14px; }
  /* Feuilles collées en bas, comme une fiche iOS */
  .sheet { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 30px 30px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet[open] { animation-name: sheetUp; }
}
/* Ordinateur : réglages en petite fenêtre centrée */
@media (min-width: 641px) {
  #settings { width: min(460px, calc(100% - 32px)); }
}
@media (max-width: 370px) {
  .score { font-size: 36px; }
  .team img, .team .ph { width: 54px; height: 54px; padding: 9px; border-radius: 18px; }
  .rosters { grid-template-columns: 1fr; }
}
@media (max-width: 400px) { h1 { font-size: 16px; } }
.nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }

/* Bonjour + pages dans la barre (pages en haut sur ordinateur seulement) */
#hello { font-size: 13px; font-weight: 700; color: var(--text-soft); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pages { display: flex; gap: 8px; }
@media (max-width: 640px) { .pages { display: none; } }
@media (min-width: 641px) { body > .nav { display: none; } }
.namef { display: grid; gap: 14px; padding: 24px; }
.namef input { font: inherit; font-size: 16px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--stroke); background: var(--glass-2); color: var(--text); }
#nameDlg { width: min(420px, calc(100% - 32px)); }

/* Pixel art du joueur à droite du nom (ordinateur seulement : la barre est trop étroite sur téléphone) */
#pixel { flex: none; width: 128px; height: 48px; image-rendering: pixelated; }
@media (max-width: 640px) { #pixel { display: none; } }

/* Agenda : boutons d'abonnement */
.agenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.contact + .contact { margin-top: 14px; }
