:root {
  --bg: #0b0c0e;          /* noir */
  --panel: #17191d;       /* gris anthracite */
  --panel2: #212429;
  --line: #2e3238;
  --text: #f4f6f8;
  --muted: #9ba3ad;
  --accent: #2ef27a;      /* vert électrique */
  --accent-ink: #03150a;
  --display: "Barlow Condensed", "DIN Condensed", "Arial Narrow", -apple-system, system-ui, sans-serif;
  --good: #3ecf8e;
  --bad: #ff6262;
  --blue: #63a8ff;
  --r: 14px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --badge: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body { font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
input { font: inherit; color: inherit; }
h1, h2 { margin: 0; }
[hidden] { display: none !important; }
/* Place laissée au badge « Powered by Netlify » s'il réapparaît (plus utilisé depuis Cloudflare Pages) */
body.has-badge { --badge: 58px; }

.primary { background: var(--accent); color: var(--accent-ink); font-weight: 800; box-shadow: 0 0 24px rgba(46,242,122,.22); border-radius: 12px; padding: 12px 18px; }
.primary:disabled { opacity: .4; }
.ghost { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; font-weight: 600; }
.link { color: var(--muted); text-decoration: underline; padding: 10px; font-size: 14px; }
.xl { width: 100%; font-size: 19px; padding: 16px; border-radius: 14px; }
.wide { width: 100%; }
.icon { width: 42px; height: 42px; border-radius: 12px; font-size: 22px; display: grid; place-items: center; background: var(--panel2); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.screen { position: fixed; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }

/* ---------- Préparer la partie ---------- */
#scr-setup { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.setup { width: 100%; max-width: 560px; margin: 0 auto; padding: calc(18px + var(--sat)) calc(16px + var(--sar)) calc(28px + var(--sab) + var(--badge)) calc(16px + var(--sal)); }
.brand { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.brand canvas { width: 64px; height: 64px; flex: none; }
.brand h1 { font-size: 30px; letter-spacing: -.02em; }
.brand p { margin: 2px 0 0; color: var(--muted); }
.setup h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modes button { text-align: left; background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.modes button b { font-size: 19px; }
.modes button span { font-size: 13px; color: var(--muted); }
.modes button.on { border-color: var(--accent); background: #0f2a1a; }
.modes button:last-child:nth-child(odd) { grid-column: span 2; }
.opts { margin-top: 10px; display: grid; gap: 8px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); border-radius: 12px; padding: 10px 14px; }
.opt input[type=checkbox] { order: 2; appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.opt input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.opt input[type=checkbox]:checked { background: var(--good); }
.opt input[type=checkbox]:checked::after { transform: translateX(20px); }
.seg { display: flex; background: var(--panel); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 8px 12px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--panel2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.seg.big button { padding: 13px 10px; }
.seg.big button.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.plist { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.plist li { display: flex; align-items: center; gap: 8px; background: var(--panel); border-radius: 12px; padding: 6px 6px 6px 14px; }
.plist .num { color: var(--muted); font-weight: 700; width: 18px; }
.plist input { flex: 1; min-width: 0; background: transparent; border: 0; font-size: 18px; padding: 8px 0; outline: none; -webkit-user-select: text; user-select: text; }
.plist .x { width: 38px; height: 38px; border-radius: 10px; color: var(--muted); font-size: 22px; }
#start { margin-top: 24px; }
.foot { color: var(--muted); font-size: 13px; text-align: center; margin: 14px 0 0; }

/* ---------- Caméra ---------- */
#stage-park { position: fixed; left: -10px; top: -10px; width: 4px; height: 4px; overflow: hidden; opacity: 0; pointer-events: none; }
#stage { position: relative; width: 100%; height: 100%; background: #000; overflow: hidden; }
#stage video, #stage canvas.src { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#ov { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#scr-cam { background: #000; }
#scr-cam .slot { position: absolute; inset: 0; }
.cam-top { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 10px; align-items: flex-start; padding: calc(10px + var(--sat)) calc(12px + var(--sar)) 10px calc(12px + var(--sal)); pointer-events: none; }
.cam-top > * { pointer-events: auto; }
.cam-msg { flex: 1; background: rgba(14,16,19,.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 12px; padding: 10px 14px; font-size: 16px; font-weight: 600; min-height: 42px; }
.cam-msg small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; align-items: flex-end; padding: 10px calc(12px + var(--sar)) calc(12px + var(--sab) + var(--badge)) calc(12px + var(--sal)); pointer-events: none; }
.cam-bar > * { pointer-events: auto; }
#cam-guide { width: 88px; height: 88px; flex: none; background: rgba(14,16,19,.82); border-radius: 14px; padding: 4px; }
.cam-actions { flex: 1; display: grid; gap: 8px; background: rgba(14,16,19,.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 14px; padding: 10px; }
.zoom { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.zoom input { flex: 1; accent-color: var(--accent); }
#loupe { position: absolute; width: 168px; height: 168px; border-radius: 50%; border: 3px solid var(--accent); box-shadow: 0 6px 24px rgba(0,0,0,.6); pointer-events: none; top: calc(128px + var(--sat)); left: 12px; }
#loupe.right { left: auto; right: 12px; }
.intro { position: absolute; inset: 0; background: rgba(8,9,11,.92); overflow-y: auto; display: flex; padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab) + var(--badge)); }
.intro-card { margin: auto; width: 100%; max-width: 520px; display: grid; gap: 14px; }
.intro h2 { font-size: 24px; }
.tips { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: #d9dee5; }
.tips b { color: var(--text); }
.placement { width: 100%; max-width: 360px; margin: 0 auto; background: var(--panel); border-radius: 12px; }
.err { color: var(--bad); margin: 0; min-height: 1em; }

/* ---------- Partie ---------- */
#scr-game { padding: var(--sat) var(--sar) 0 var(--sal); }
.g-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
/* Appli installée sur l'iPhone : l'en-tête passait sous l'heure et l'encoche, le bouton retour était caché. */
.screen > .g-top { padding-top: calc(8px + var(--sat)); padding-left: calc(12px + var(--sal)); padding-right: calc(12px + var(--sar)); }
#scr-game > .g-top, #scr-tour > .g-top { padding: 8px 12px; } /* ces deux écrans ont déjà la marge */
.screen > .t-body:last-child { padding-bottom: calc(16px + var(--sab) + var(--badge)); }
.icon.back { font-size: 30px; line-height: 1; color: var(--accent); }
.g-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.g-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-title span { font-size: 13px; color: var(--muted); }
.pill { font-size: 13px; font-weight: 700; padding: 7px 11px; border-radius: 999px; background: var(--panel2); color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ready { color: var(--good); }
.pill.motion { color: var(--accent); }
.pill.pull { color: var(--blue); }
.pill.blocked, .pill.off { color: var(--bad); }
.pill:empty { display: none; }

.g-body { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(150px, 1fr) auto; gap: 10px; padding: 0 12px 10px; }
body.manual .g-body { grid-template-rows: auto auto minmax(0, 1fr); }
.g-cur { background: var(--panel); border-radius: 18px; padding: 12px 14px 12px; display: grid; gap: 6px; }
.cur-name { font-size: 20px; font-weight: 700; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cur-main { display: flex; align-items: baseline; gap: 10px; line-height: .9; }
.cur-score { font-family: var(--display); font-size: clamp(72px, 27vw, 170px); font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.cur-unit { color: var(--muted); font-size: 16px; }
.cur-darts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cur-darts .slot { background: var(--panel2); border: 1.5px solid var(--line); border-radius: 12px; height: 54px; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cur-darts .slot.empty { color: #4b525d; font-weight: 400; }
.cur-darts .slot.next { border-color: var(--accent); border-style: dashed; }
.cur-darts .slot.auto { border-color: #2f4a3e; }
.cur-darts .slot.miss { color: var(--muted); font-size: 18px; }
.cur-line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; min-height: 22px; }
#g-turn { font-weight: 700; font-size: 18px; white-space: nowrap; }
#g-turn.bust { color: var(--bad); }
#g-hint { color: var(--muted); font-size: 15px; text-align: right; }
#g-hint b { color: var(--text); }

.g-visual { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; min-height: 0; }
.g-boardwrap { position: relative; min-height: 150px; }
#g-board { position: absolute; inset: 0; width: 100%; height: 100%; }
#g-camslot { width: 34vw; max-width: 220px; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: #000; position: relative; }
#g-camslot::after { content: "Toucher pour agrandir"; position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; text-align: center; padding: 3px; background: rgba(0,0,0,.55); color: #ccd; pointer-events: none; }
body.cam-big #g-camslot { position: fixed; inset: calc(54px + var(--sat)) 8px calc(8px + var(--sab) + var(--badge)) 8px; width: auto; max-width: none; aspect-ratio: auto; z-index: 20; border: 2px solid var(--accent); }
body.cam-big #g-camslot::after { content: "Toucher pour réduire"; }
body.manual .g-boardwrap, body.manual #g-camslot { display: none; }
body:not(.manual) #g-keypad { display: none; }
body.manual .g-visual { grid-template-columns: 1fr; }

.keypad { display: grid; gap: 8px; align-content: start; }
.kp-mult { display: flex; background: var(--panel); border-radius: 12px; padding: 4px; gap: 4px; }
.kp-mult button { flex: 1; padding: 9px 4px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.kp-mult button.on[data-m="1"] { background: var(--panel2); color: var(--text); }
.kp-mult button.on[data-m="2"] { background: #1f5a3b; color: #fff; }
.kp-mult button.on[data-m="3"] { background: #7a1f24; color: #fff; }
.kp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.kp-grid button { background: var(--panel2); border-radius: 10px; padding: 0; height: 44px; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kp-grid button:active { background: var(--line); }
.kp-grid .kp-w { grid-column: span 2; font-size: 16px; }
body.manual .cur-score { font-size: clamp(56px, 19vw, 130px); }
@media (max-height: 700px) { .kp-grid button { height: 38px; } .cur-darts .slot { height: 46px; } }
.kp-grid .kp-miss { grid-column: span 1; color: var(--muted); font-size: 15px; }

.g-players { min-height: 0; max-height: 36vh; overflow-y: auto; background: var(--panel); border-radius: 18px; padding: 6px; }
body.manual .g-players { max-height: none; }
.plrow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 9px 10px; border-radius: 12px; }
.plrow.cur { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.plrow .pn { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plrow .pv { font-family: var(--display); font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; grid-row: span 2; }
.plrow .ps { font-size: 13px; color: var(--muted); }
.cricket { width: 100%; border-collapse: collapse; text-align: center; font-variant-numeric: tabular-nums; }
.cricket th { font-size: 14px; padding: 6px 4px; color: var(--muted); font-weight: 700; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cricket th.cur { color: var(--accent); }
.cricket td { padding: 4px; font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); height: 34px; }
.cricket td.n { color: var(--muted); font-size: 16px; width: 52px; }
.cricket tr.closed td.n { text-decoration: line-through; opacity: .5; }
.cricket td.m3 { color: var(--good); }
.cricket tr.pts td { font-size: 22px; color: var(--accent); }

.g-actions { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 8px; padding: 8px 12px calc(10px + var(--sab) + var(--badge)); background: var(--bg); border-top: 1px solid var(--line); }
.g-actions button { padding: 14px 8px; font-size: 16px; }

@media (orientation: landscape) and (min-width: 640px) {
  .g-body { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .g-cur { grid-column: 1; grid-row: 1; }
  .g-players { grid-column: 1; grid-row: 2; max-height: none; }
  .g-visual { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .cur-score { font-size: clamp(56px, 17vh, 140px); }
  #g-camslot { width: 100%; max-width: none; aspect-ratio: 16 / 9; max-height: 34vh; }
  body.manual .g-visual { grid-template-rows: 1fr; }
  body.manual .g-body { grid-template-rows: auto 1fr; }
}

/* ---------- Feuille du bas ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 560px; max-height: 92%; background: var(--panel); border-radius: 20px 20px 0 0; padding: 12px 14px calc(16px + var(--sab) + var(--badge)); display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head b { font-size: 18px; }
.sheet-body { overflow-y: auto; display: grid; gap: 12px; }
.sb-wrap { display: grid; grid-template-columns: 1fr; gap: 8px; justify-items: center; }
#sb { width: min(100%, 300px); aspect-ratio: 1; touch-action: none; }
.sb-pick { display: flex; gap: 10px; align-items: center; width: 100%; }
.sb-pick span { flex: 1; font-size: 18px; font-weight: 700; }
.menu { display: grid; gap: 8px; }
.menu button { text-align: left; background: var(--panel2); border-radius: 12px; padding: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.menu button em { font-style: normal; color: var(--muted); font-weight: 500; }
.menu button.danger { color: var(--bad); }

/* ---------- Victoire ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 16px 16px calc(16px + var(--badge)); }
.modal-card { width: 100%; max-width: 420px; background: var(--panel); border-radius: 22px; padding: 22px 18px 12px; display: grid; gap: 14px; text-align: center; }
.trophy svg { width: 64px; height: 64px; }
.modal-card h2 { font-size: 26px; }
.stats { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stats th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 4px; }
.stats td { padding: 7px 4px; border-top: 1px solid var(--line); }
.stats td:first-child { text-align: left; font-weight: 700; }
.stats tr.w td:first-child { color: var(--accent); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--sab) + var(--badge)); z-index: 60; background: #2b313b; color: var(--text); border-radius: 12px; padding: 11px 16px; font-size: 15px; max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.5); text-align: center; }

.simbar { position: fixed; right: 8px; top: 50%; transform: translateY(-50%); z-index: 70; display: grid; gap: 6px; background: rgba(30,30,40,.9); padding: 8px; border-radius: 12px; font-size: 12px; }
.simbar button { background: #444; border-radius: 8px; padding: 6px 8px; }

/* ---------- Tournois ---------- */
#opt-kind { margin-top: 6px; }
.opt.col { flex-direction: column; align-items: stretch; gap: 8px; }
.opt.col > span { color: var(--muted); font-size: 14px; }
.opt.col .seg { background: var(--bg); }
.opt.col .seg button { padding: 9px 6px; font-size: 14px; }
.tour-opts .opts, .tour-opts { display: grid; gap: 8px; }
.pot { margin: 2px 0 0; background: #1d2a22; border: 1px solid #2c4636; color: #cfeedd; border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.pot b { color: #fff; }
.resume { background: var(--panel); border: 1.5px solid var(--accent); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; margin-bottom: 12px; }
.resume b { font-size: 17px; }
.resume span { color: var(--muted); font-size: 14px; }
.resume .row button { padding: 10px; }

#scr-tour { padding: var(--sat) var(--sar) 0 var(--sal); }
.t-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 12px 16px; display: grid; gap: 12px; align-content: start; }
.t-card { background: var(--panel); border-radius: 18px; padding: 12px 14px; display: grid; gap: 8px; }
.t-card h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.t-next { border: 1.5px solid var(--accent); }
.t-next .vs { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-next .vs i { font-style: normal; color: var(--muted); font-size: 16px; font-weight: 600; }
.t-next small { color: var(--muted); }
.mrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel2); font-variant-numeric: tabular-nums; }
.mrow .pa { text-align: right; }
.mrow .sc { font-weight: 800; color: var(--muted); min-width: 44px; text-align: center; }
.mrow .w { font-weight: 800; color: var(--text); }
.mrow .l { color: var(--muted); }
.mrow .tbd { color: #5b636e; font-style: italic; }
.mrow.cur { box-shadow: inset 0 0 0 1.5px var(--accent); }
.mrow.bye { grid-template-columns: 1fr; color: var(--muted); font-size: 14px; }
.rgrid { display: grid; gap: 6px; }
.stand { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stand th { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px; text-align: center; }
.stand td { padding: 7px 4px; border-top: 1px solid var(--line); text-align: center; }
.stand td:nth-child(2) { text-align: left; font-weight: 700; }
.podium { display: grid; gap: 8px; }
.podium .pl { display: flex; align-items: center; gap: 12px; background: var(--panel2); border-radius: 12px; padding: 10px 12px; }
.podium .pl b { font-size: 22px; width: 34px; color: var(--muted); }
.podium .pl:first-child { border: 1.5px solid var(--accent); }
.podium .pl:first-child b { color: var(--accent); }
.podium .pl span { flex: 1; font-weight: 700; font-size: 18px; }
.podium .pl em { font-style: normal; font-weight: 800; color: var(--good); font-size: 18px; }
.t-actions { grid-template-columns: 1fr; }

/* Correction faite à la main */
.cur-darts .slot.fix { border-color: var(--accent); border-style: dashed; color: var(--accent); }

/* Photos des volées */
.shots { display: grid; gap: 12px; }
.shots figure { margin: 0; background: var(--panel2); border-radius: 12px; overflow: hidden; }
.shots img { display: block; width: 100%; }
.shots figcaption { padding: 8px 10px; font-size: 14px; }
.shots figcaption b { display: block; }
.shots .fixnote { color: var(--accent); }
.empty-note { color: var(--muted); text-align: center; padding: 20px; }
.muted { color: var(--muted); }

/* ---------- Accueil ---------- */
#scr-home { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.home { width: 100%; max-width: 620px; margin: 0 auto; padding-bottom: calc(24px + var(--sab) + var(--badge)); }
.hero { position: relative; height: min(62vh, 470px); overflow: hidden; }
#hero-board { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(11,12,14,.25) 0%, rgba(11,12,14,.72) 62%, var(--bg) 100%), linear-gradient(to bottom, rgba(11,12,14,.2), var(--bg) 96%); }
.hero-txt { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 1; text-align: center; padding: 0 20px; }
.logo { font-family: var(--display); font-weight: 800; font-size: clamp(76px, 25vw, 132px); line-height: .85; letter-spacing: -.01em; text-shadow: 0 4px 30px rgba(0,0,0,.8); }
.logo span { color: var(--accent); margin-left: .08em; text-shadow: 0 0 28px rgba(46,242,122,.55); }
.hero-txt p { margin: 10px 0 0; color: #d6dbe1; font-size: 16px; text-shadow: 0 2px 10px #000; }
.home-main { padding: 6px 16px 0; display: grid; gap: 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 3px; min-height: 86px; }
.tile b { font-family: var(--display); font-size: 24px; letter-spacing: .01em; }
.tile span { color: var(--muted); font-size: 13px; }
.tile:first-child { grid-column: span 2; border-color: #1f4a30; background: linear-gradient(135deg, #12261a, var(--panel)); }
.home .foot { text-align: left; margin: 2px 2px 0; }
.home .foot b { color: var(--text); }

.topbar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.topbar h1 { font-family: var(--display); font-size: 30px; font-weight: 800; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.chips:empty { display: none; }
.chips button { background: var(--panel); border: 1px dashed #3a4048; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 15px; }
.chips button::before { content: "+ "; color: var(--accent); font-weight: 800; }

/* ---------- Joueurs ---------- */
.pcard { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; background: var(--panel); border-radius: 16px; padding: 12px 14px; text-align: left; width: 100%; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--accent-ink); grid-row: span 2; }
.pcard b { font-size: 18px; }
.pcard .sub { color: var(--muted); font-size: 14px; }
.stats4 { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.stats4 div { background: var(--panel2); border-radius: 10px; padding: 7px 4px; text-align: center; }
.stats4 b { display: block; font-family: var(--display); font-size: 22px; color: var(--accent); }
.stats4 span { font-size: 11px; color: var(--muted); }
.field { display: grid; gap: 6px; }
.field input { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 18px; outline: none; -webkit-user-select: text; user-select: text; }
.field input:focus { border-color: var(--accent); }

/* ---------- Historique ---------- */
.hcard { display: grid; gap: 4px; background: var(--panel); border-radius: 16px; padding: 12px 14px; text-align: left; width: 100%; }
.hcard .when { color: var(--muted); font-size: 13px; }
.hcard .what { font-weight: 700; }
.hcard .res { font-size: 15px; }
.hcard .res b { color: var(--accent); }
.hcard .res span { color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); border: 1px solid #1f4a30; border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }

/* Caméra coupée par l'iPhone */
.cam-wake { position: fixed; left: 50%; transform: translateX(-50%); top: calc(64px + var(--sat)); z-index: 65; background: #3a1214; border: 1.5px solid var(--bad); color: #fff; border-radius: 14px; padding: 12px 18px; font-size: 15px; display: grid; gap: 2px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.6); width: max-content; max-width: calc(100% - 32px); }
.cam-wake b { color: var(--bad); font-size: 17px; }

/* ---------- Rubriques, grades, trophées ---------- */
.tiles .tile { position: relative; }
.tile .soon, .troph .soon { position: static; align-self: flex-start; margin-top: 6px; font-style: normal; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #ffc940; border: 1px solid #5a4a14; border-radius: 6px; padding: 2px 6px; }
.tile:first-child { grid-column: auto; border-color: var(--line); background: var(--panel); }
.tile-premium { background: linear-gradient(135deg, #2a2108, var(--panel)) !important; border-color: #5a4a14 !important; }
.tile-premium b { color: #ffc940; }
.dart-ico { vertical-align: -3px; flex: none; }
.me-card { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; text-align: left; }
.me-txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.me-txt b { font-size: 18px; }
.me-txt span { color: var(--muted); font-size: 13px; }
.bar { height: 10px; border-radius: 6px; background: var(--panel2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .8s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 12px rgba(46,242,122,.35); }
.bar.slim { height: 6px; }
.grade { display: grid; gap: 8px; }
.grade-top { display: flex; align-items: center; gap: 12px; }
.grade-top b { display: block; font-family: var(--display); font-size: 24px; }
.grade-top span { color: var(--muted); font-size: 14px; }
.grade small { color: var(--muted); }
.grade small b { color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpis div { background: var(--panel); border-radius: 14px; padding: 12px 8px; text-align: center; }
.kpis b { display: block; font-family: var(--display); font-size: 30px; color: var(--accent); line-height: 1.05; }
.kpis span { font-size: 12px; color: var(--muted); }
.recs { display: grid; }
.recs div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.recs div:first-child { border-top: 0; }
.recs b { font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 64px; display: block; }
.ladder { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.rung { display: grid; justify-items: center; gap: 2px; text-align: center; opacity: .55; padding: 6px 2px; border-radius: 10px; }
.rung.on { opacity: 1; }
.rung.cur { background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line); }
.rung b { font-size: 11px; }
.rung span { font-size: 10px; color: var(--muted); }
.trophies { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.troph { position: relative; background: var(--panel); border-radius: 16px; padding: 14px 10px; display: grid; justify-items: center; gap: 4px; text-align: center; opacity: .75; }
.troph.on { opacity: 1; background: linear-gradient(160deg, #1d1a0c, var(--panel)); box-shadow: inset 0 0 0 1px #4d4114; }
.troph b { font-size: 15px; }
.troph span { font-size: 12px; color: var(--muted); }
.troph .bar { width: 80%; margin-top: 4px; }
.troph small { font-size: 11px; color: var(--muted); }
.troph .ok { font-style: normal; font-size: 12px; font-weight: 800; color: var(--accent); }
.troph .soon { position: static; }
.medal { filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); }
.troph.on .medal { animation: shine 3.5s ease-in-out infinite; }
@keyframes shine { 0%, 100% { filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); } 50% { filter: drop-shadow(0 0 14px rgba(255,201,64,.55)); } }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button { width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.swatches button.on { outline: 3px solid var(--text); outline-offset: 2px; }
.chips.pick button::before { content: none; }
.chips.pick button { border-style: solid; }
.chips.pick button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.inp { flex: 1; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 18px; outline: none; -webkit-user-select: text; user-select: text; }
.inp:focus { border-color: var(--accent); }
.prof-head { grid-template-columns: auto 1fr; align-items: center; gap: 14px; }
.prof-name { font-family: var(--display); font-size: 34px; }
.feat { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: #d9dee5; }
.prem.gold { background: linear-gradient(150deg, #2a2108, var(--panel)); box-shadow: inset 0 0 0 1px #5a4a14; }
.prem.gold h3 { color: #ffc940; }
.t-card p { margin: 0; color: #d9dee5; }
.podium .pl em.cup { color: #ffc940; font-size: 13px; }
#g-name .dart-ico { vertical-align: -2px; }

/* Animation : trophée ou grade débloqué */
.celebrate { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.78); display: grid; place-items: center; padding: 20px; }
.cel-card { position: relative; width: 100%; max-width: 360px; background: radial-gradient(circle at 50% 30%, #1c2a20, var(--panel) 70%); border-radius: 24px; padding: 30px 20px 20px; text-align: center; display: grid; gap: 8px; justify-items: center; overflow: hidden; box-shadow: 0 0 0 1px #2c4a36, 0 20px 60px rgba(0,0,0,.6); }
.cel-rays { position: absolute; left: 50%; top: 92px; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(rgba(46,242,122,.14) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 14s linear infinite; pointer-events: none; }
.cel-ico { position: relative; height: 110px; display: grid; place-items: center; }
.cel-kicker { position: relative; margin: 0; color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.cel-card h2 { position: relative; font-family: var(--display); font-size: 36px; }
.cel-card p { position: relative; margin: 0; color: #d9dee5; }
.cel-card .primary { position: relative; margin-top: 8px; min-width: 160px; }
.celebrate.go .cel-card { animation: pop .55s cubic-bezier(.2,1.4,.4,1); }
.celebrate.go .cel-ico { animation: drop .8s cubic-bezier(.2,1.5,.4,1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drop { 0% { transform: translateY(-60px) scale(.4) rotate(-25deg); opacity: 0; } 70% { transform: translateY(6px) scale(1.12) rotate(6deg); opacity: 1; } 100% { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cel-rays, .troph.on .medal { animation: none; } .celebrate.go .cel-card, .celebrate.go .cel-ico { animation: none; } }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } .trophies { grid-template-columns: repeat(4, 1fr); } .kpis { grid-template-columns: repeat(6, 1fr); } }

/* ---------- Compte en ligne, Premium, admin ---------- */
.acct { gap: 10px; }
.acct .field span { color: var(--muted); font-size: 14px; }
.acct-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.acct-line span { overflow: hidden; text-overflow: ellipsis; }
.prem-badge, .free-badge { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .08em; border-radius: 6px; padding: 3px 7px; }
.prem-badge { color: #3b2a00; background: #ffc940; }
.free-badge { color: var(--muted); border: 1px solid var(--line); }
.adm-list { display: grid; }
.adm-list div { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.adm-list div:first-child { border-top: 0; }
.adm-list span { color: var(--muted); }
.adm-list span:nth-of-type(1) { grid-column: 1; overflow: hidden; text-overflow: ellipsis; }
.adm-list span:nth-of-type(2) { grid-column: 2; grid-row: 1; text-align: right; }
.adm-list .prem-badge { grid-column: 2; justify-self: end; }
