/* Télécommande téléphone / tablette – charte Mizu (fond blanc comme le site) */
:root {
  --mizu: #29b8ec;
  --mizu-dark: #1a9ccb;
  --mizu-light: #9ddbfa;
  --ink: #414042;
  --ink-2: #282828;
  --grey: #868487;
  --line: #e6e6e8;
  --bg: #f5f6f7;
  --alert: #e5484d;
  --belt-white: #f1f1f1;
  --belt-blue: #1f5fbf;
  --belt-purple: #6a3fa0;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Lato, Arial, sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
}
.topbar img { height: 34px; }
.topbar .ttl { flex: 1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--ink-2); line-height: 1.3; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--alert); }
.dot.on { background: #2fbf71; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; color: var(--grey); margin: 22px 0 10px; }
.card { background: #fff; border: 1px solid var(--line); padding: 16px; margin-bottom: 12px; }

/* ---- mini scoreboard ---- */
.mini { display: grid; grid-template-columns: 1fr auto; gap: 0; border: 1px solid var(--line); background: #fff; }
.mini .side { padding: 12px 14px 12px 20px; position: relative; min-width: 0; }
.mini .side .nm { font-weight: 900; text-transform: uppercase; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .side .ac { font-size: 12px; text-transform: uppercase; letter-spacing: .15em; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .side.a { background: var(--mizu); color: #fff; }
.mini .side.b { background: #fff; color: var(--ink); border-top: 1px solid var(--line); }
.mini .belt { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; }
.belt.white { background: var(--belt-white); box-shadow: inset -1px 0 0 rgba(0,0,0,.15); }
.belt.blue { background: var(--belt-blue); }
.belt.purple { background: var(--belt-purple); }
.belt.brown { background: #6b4423; }
.belt.black { background: #111; }
.seg.belts button { font-size: 12px; letter-spacing: 0; padding: 12px 2px; }
.photo-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.photo-row .photo-prev { width: 64px; height: 64px; object-fit: cover; background: #3a393c; }
.mini .clock {
  grid-row: 1 / span 2; grid-column: 2; background: var(--ink-2); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 0 18px; min-width: 128px;
}
.mini .clock .tm { font-size: 40px; font-weight: 300; font-variant-numeric: tabular-nums; }
.mini .clock .tm.low { color: #ff7b7f; }
.mini .clock .ph { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--mizu-light); }

/* ---- boutons ---- */
.btn {
  display: block; width: 100%; border: 0; background: var(--mizu); color: #fff; font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; font-size: 16px; padding: 16px; cursor: pointer; user-select: none;
}
.btn:active { background: var(--mizu-dark); }
.btn.xl { font-size: 26px; padding: 26px 16px; }
.btn.dark { background: var(--ink-2); }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn.danger { background: var(--alert); }
.btn.white-side { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.btn:disabled { opacity: .4; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 10px; }
.small { font-size: 13px; color: var(--grey); }

/* ---- formulaires ---- */
label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--grey); margin: 12px 0 6px; }
input[type=text], input[type=number], input[type=password], select {
  width: 100%; border: 1px solid var(--line); background: #fff; padding: 13px 12px; font-size: 17px; border-radius: 0;
}
input:focus, select:focus { outline: 2px solid var(--mizu); border-color: transparent; }
.side-title { display: flex; align-items: center; gap: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: 14px; }
.swatch { width: 14px; height: 14px; display: inline-block; border: 1px solid var(--ink); }
.swatch.a { background: var(--mizu); border-color: var(--mizu); }
.swatch.b { background: #fff; }
.seg { display: flex; border: 1px solid var(--line); background: #fff; }
.seg button { flex: 1; border: 0; background: none; padding: 12px 4px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.seg button.on { background: var(--mizu); color: #fff; }
.seg button { min-width: 0; }
#seg-screen button { font-size: 11px; letter-spacing: 0; padding: 12px 2px; line-height: 1.2; }

/* ---- techniques ---- */
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tech-grid button { border: 1px solid var(--line); background: #fff; padding: 14px 8px; font-weight: 700; font-size: 14px; cursor: pointer; }
.tech-grid button:active { background: var(--mizu-light); }

/* ---- feuille modale ---- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: none; }
.sheet-bg.show { display: block; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--bg); max-height: 88vh; overflow: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .2s;
}
.sheet.show { transform: none; }
.sheet h3 { margin: 0 0 12px; font-size: 18px; text-transform: uppercase; letter-spacing: .1em; }

/* ---- résultats ---- */
.res { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.res:last-child { border-bottom: 0; }
.res .w { font-weight: 700; }
.res .m { font-size: 13px; color: var(--grey); }
.res .tm { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--mizu-dark); white-space: nowrap; }
.res .x { border: 0; background: none; color: var(--grey); font-size: 20px; padding: 4px 8px; cursor: pointer; }
.trophy { color: #d4a017; }

/* ---- navigation basse ---- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button { flex: 1; min-width: 0; border: 0; background: none; padding: 12px 2px 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--grey); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.tabs button .ic { display: block; font-size: 20px; margin-bottom: 2px; }
nav.tabs button.on { color: var(--mizu); }

/* ---- login ---- */
.login { max-width: 360px; margin: 12vh auto 0; padding: 16px; text-align: center; }
.login img { height: 110px; }
.login .ttl { margin: 18px 0 30px; font-weight: 300; text-transform: uppercase; letter-spacing: .25em; font-size: 15px; }
.login input { text-align: center; font-size: 28px; letter-spacing: .4em; }
.err { color: var(--alert); font-weight: 700; margin-top: 12px; min-height: 22px; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink-2); color: #fff;
  padding: 10px 18px; font-size: 14px; z-index: 30; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.hide { display: none !important; }

/* ajustements petits écrans */
.row > .btn { min-width: 0; }
.row .btn.ghost[data-adj] { padding: 14px 2px; font-size: 15px; letter-spacing: .02em; text-transform: none; white-space: nowrap; }
#btn-sub-a, #btn-sub-b { font-size: 18px; letter-spacing: .04em; padding: 22px 8px; overflow-wrap: anywhere; line-height: 1.2; }

/* ---- Quintet : mini-tableau ---- */
.mini .side .tm-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; opacity: .85; }
.dots { display: flex; gap: 4px; margin-top: 6px; }
.dots span { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border: 1px solid currentColor; opacity: .9;
  max-width: 33%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots span.out { opacity: .3; text-decoration: line-through; }
.dots span.cur { background: currentColor; }
.mini .side.a .dots span.cur { color: #fff; }
.mini .side.a .dots span.cur b { color: var(--mizu); }
.mini .side.b .dots span.cur b { color: #fff; }
.dots b { font-weight: 700; }

/* ---- choix / repos ---- */
.pick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pick-row:last-child { border-bottom: 0; }
.pick-row .tn { font-weight: 900; text-transform: uppercase; }
.pick-row .st { font-size: 13px; color: var(--grey); }
.pick-row .st.ok { color: #1f9d55; font-weight: 700; }
.pick-row .btn { width: auto; padding: 10px 12px; font-size: 12px; }
.rest-line { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 14px; margin-bottom: 10px; }
.rest-line b { font-size: 34px; font-weight: 300; letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* ---- points dernier contre dernier ---- */
.pts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pts-col { border: 1px solid var(--line); background: #fff; padding: 10px; }
.pts-col.a { border-top: 6px solid var(--mizu); }
.pts-col.b { border-top: 6px solid var(--ink-2); }
.pts-col .who { font-weight: 900; text-transform: uppercase; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pts-col .score { font-size: 40px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pts-col .sub { font-size: 12px; color: var(--grey); margin-bottom: 8px; }
.pts-col .bt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pts-col .bt button { border: 1px solid var(--line); background: var(--bg); font-weight: 700; padding: 11px 0; font-size: 14px; cursor: pointer; }
.pts-col .bt button.minus { color: var(--grey); font-weight: 400; font-size: 12px; padding: 7px 0; }

/* ---- programme / équipes ---- */
.sched { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sched:last-child { border-bottom: 0; }
.sched .info { flex: 1; min-width: 0; }
.sched .ty { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mizu-dark); }
.sched .vs { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched.done .vs { color: var(--grey); text-decoration: line-through; }
.sched.live .ty::after { content: ' · LIVE'; color: var(--alert); }
.sched .ib { border: 1px solid var(--line); background: #fff; min-width: 36px; height: 36px; font-size: 14px; cursor: pointer; }
.sched .ib.go { background: var(--mizu); color: #fff; border-color: var(--mizu); font-weight: 700; padding: 0 10px; }
.team-card { background: #fff; border: 1px solid var(--line); padding: 14px 16px; margin-bottom: 10px; }
.team-card .tn { font-weight: 900; text-transform: uppercase; font-size: 18px; }
.team-card .mb { font-size: 14px; margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.team-card .mb .belt { width: 6px; height: 16px; display: inline-block; }
.team-card .pin { margin-top: 10px; font-size: 14px; }
.team-card .pin b { font-size: 20px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.team-card .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.team-card .acts .btn { width: auto; flex: 1; padding: 10px 8px; font-size: 12px; }
.qr { display: block; width: 220px; height: 220px; margin: 12px auto 4px; background: #fff; }
.qr-url { font-size: 12px; color: var(--grey); text-align: center; word-break: break-all; }
.member-form { border-left: 4px solid var(--line); padding-left: 12px; margin-top: 16px; }
.btn.small-btn { width: auto; padding: 10px 14px; font-size: 12px; }
.team-card .mb .ph { width: 30px; height: 30px; object-fit: cover; background: #3a393c; }
.team-card .mb .wt { margin-left: auto; color: var(--grey); font-variant-numeric: tabular-nums; }

/* ---- lumières ---- */
.lamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lamp { border: 2px solid var(--line); background: #fff; padding: 14px 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lamp b { font-size: 26px; font-weight: 900; }
.lamp span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--grey); }
.lamp.on { border-color: var(--mizu); background: #e9f7fd; }
.lamp.on span { color: var(--mizu-dark); }
.test-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.test-grid button { border: 1px solid var(--line); background: #fff; padding: 14px 6px; font-weight: 700; font-size: 14px; cursor: pointer; }
.test-grid button:active { background: var(--mizu-light); }
.test-grid button.clear { grid-column: 1 / -1; background: var(--ink-2); color: #fff; border-color: var(--ink-2); }

/* ---- mode test ---- */
.test-bar { background: #f5a524; color: #1f1e20; text-align: center; font-weight: 900; font-size: 12px; letter-spacing: .2em; padding: 6px; position: sticky; top: 0; z-index: 6; }

/* ---- tableau ---- */
.bk-scroll { overflow-x: auto; margin: 0 -16px 10px; padding: 4px 16px 10px; }
.bk-scroll .bk { --bk-w: 150px; --bk-gap: 26px; --bk-fs: 12px; --bk-pad: 7px 8px; --bk-round: 10px; }
.bk-fixes { margin-top: 8px; }
.bk-fix { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bk-fix .small { flex: 0 0 100%; }
.bk-fix .ib { flex: 1; border: 1px solid var(--line); background: #fff; padding: 8px; font-weight: 700; font-size: 13px; cursor: pointer; }
.bk-fix .ib.on { background: var(--mizu); color: #fff; border-color: var(--mizu); }
details summary { cursor: pointer; margin: 8px 0; }

/* ---- plein écran ---- */
.fs-btn { border: 1px solid var(--line); background: #fff; width: 36px; height: 34px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink); }
