/* Habillage « arcade » : fond sombre quadrillé, néons cyan / magenta / jaune, polices rétro (Press Start 2P, Orbitron, Rajdhani). */
:root {
  --bg: #06070f; --bg2: #0b0d1c; --card: rgba(12, 14, 30, .92); --card2: #141733; --ink: #eef2ff; --muted: #8b93b8; --line: #27305c;
  --cyan: #00e5ff; --magenta: #ff2bd6; --yellow: #ffe600; --green: #39ff14; --red: #ff3b3b; --orange: #ff8a00;
  --p1: var(--cyan); --p2: var(--magenta); --ok: var(--green); --warn: var(--yellow); --bad: var(--red); --mine: var(--cyan);
  --font-body: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --font-num: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --font-pixel: "Press Start 2P", "Orbitron", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 500 18px/1.4 var(--font-body); }
body {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 43, 214, .18), transparent 55%),
    radial-gradient(ellipse at 50% 110%, rgba(0, 229, 255, .14), transparent 55%),
    linear-gradient(rgba(0, 229, 255, .06) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(0, 229, 255, .06) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--bg);
  min-height: 100vh;
}
/* fond à la couleur du joueur qui lance (--turn-rgb posé par app.js) */
body.tinted { background:
    radial-gradient(ellipse at 50% 50%, rgba(var(--turn-rgb), .40), rgba(var(--turn-rgb), .18) 75%),
    linear-gradient(rgba(0, 229, 255, .06) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(0, 229, 255, .06) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--bg); }
/* balayage façon écran cathodique */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 4px); opacity: .5; }
main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; position: relative; }

/* --- scène fixe (page de jeu) : 1280×800 à l'échelle --k calculée par app.js ; rien ne bouge avec la résolution */
html.staged, html.staged body { height: 100%; overflow: hidden; }
#stage { position: absolute; left: 50%; top: 50%; width: var(--sw, 1280px); height: 800px; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(var(--k, 1));
  transform-origin: center; overflow: hidden; }
#stage main { max-width: none; height: 100%; padding: 0; }
#stage .screen { height: 100%; overflow-y: auto; padding: 20px 28px; }
#screen-home, #screen-lobby { max-width: 900px; margin: 0 auto; }
#stage .toast { position: absolute; }
h1 { font-family: var(--font-pixel); font-size: clamp(14px, 2.6vw, 24px); line-height: 1.5; margin: 14px 0 10px;
  color: var(--yellow); text-shadow: 0 0 8px rgba(255, 230, 0, .8), 0 0 24px rgba(255, 230, 0, .35), 3px 3px 0 #7a1fa2; text-transform: uppercase; }
.lead { color: var(--muted); margin: 0 0 18px; font-size: 18px; }
.hint { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.muted { color: var(--muted); }
.rules-link { color: var(--magenta); white-space: nowrap; }
.hidden { display: none !important; }

/* --- en-tête */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #04050c;
  border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, var(--cyan), var(--magenta), var(--yellow)) 1;
  box-shadow: 0 2px 24px rgba(0, 229, 255, .25); position: relative; z-index: 2; }
.brand { color: var(--cyan); text-decoration: none; font-family: var(--font-pixel); font-size: 13px; letter-spacing: 1px;
  text-shadow: 0 0 6px var(--cyan), 0 0 18px rgba(0, 229, 255, .6); white-space: nowrap; }
.board-status { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); font-weight: 600; letter-spacing: .5px; }
.board-status.on #boardText { color: var(--green); text-shadow: 0 0 8px rgba(57, 255, 20, .7); }
.board-status.on #boardText::before { content: "● "; animation: blink-dot 1.6s infinite; }
@keyframes blink-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.top .led { margin: 0; font-size: 14px; color: var(--muted); }
.top .led input { accent-color: var(--magenta); }

/* --- bouton de la cible (jeu) : rond, en haut à droite, défile avec la page ; gris = pas de cible, vert = connectée */
.board-dock { position: absolute; top: 12px; right: 14px; z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.board-btn { width: 52px; height: 52px; padding: 0; border-radius: 50%; font-size: 26px; line-height: 1; position: relative;
  color: inherit; border-color: var(--muted); box-shadow: none; filter: grayscale(1); opacity: .75; }
.board-btn::after { content: ""; position: absolute; right: 1px; top: 1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg); }
.board-dock.on .board-btn { filter: none; opacity: 1; border-color: var(--green); box-shadow: 0 0 14px rgba(57, 255, 20, .6), inset 0 0 10px rgba(57, 255, 20, .2); }
.board-dock.on .board-btn::after { background: var(--green); }
.board-dock.wait .board-btn::after { background: var(--yellow); animation: blink-dot 1s infinite; }
.board-dock.armed .board-btn { border-color: var(--red); box-shadow: 0 0 16px rgba(255, 59, 59, .8); }
.led-btn { position: relative; width: 40px; height: 40px; margin: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: #0a0d20; border: 2px solid var(--magenta); box-shadow: 0 0 10px rgba(255, 43, 214, .5); cursor: pointer; }
.led-btn input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.led-btn:has(input:not(:checked)) { border-color: var(--line); box-shadow: none; filter: grayscale(1); opacity: .5; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* place pour le bouton rond à droite de la première ligne de chaque écran */
#screen-home > h1, .room-head, .game-head { padding-right: 64px; }
#stage .game-head { padding-right: 120px; }   /* bouton de la cible + interrupteur des lumières */
#stage .board-dock { top: 16px; right: 20px; flex-direction: row-reverse; }
#stage .led-btn { width: 44px; height: 44px; }

/* --- boutons et champs */
button { font: 700 16px/1.2 var(--font-num); letter-spacing: .5px; text-transform: uppercase; color: var(--cyan); background: #0a0d20;
  border: 2px solid var(--cyan); border-radius: 6px; padding: 10px 16px; cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 229, 255, .35), inset 0 0 10px rgba(0, 229, 255, .12); transition: transform .08s, box-shadow .15s, filter .15s; }
button:hover { box-shadow: 0 0 18px rgba(0, 229, 255, .7), inset 0 0 14px rgba(0, 229, 255, .25); transform: translateY(-1px); }
button:active { transform: translateY(1px) scale(.98); }
button:disabled { opacity: .35; cursor: default; transform: none; box-shadow: none; filter: grayscale(.4); }
button.primary { color: #fff; background: linear-gradient(135deg, #ff2bd6, #8a2be2); border-color: var(--magenta);
  box-shadow: 0 0 14px rgba(255, 43, 214, .55), inset 0 0 12px rgba(255, 255, 255, .15); }
button.primary:hover { box-shadow: 0 0 26px rgba(255, 43, 214, .9), inset 0 0 14px rgba(255, 255, 255, .2); }
button.big { padding: 16px 20px; font-size: 20px; width: 100%; }
button.link { background: none; border: none; box-shadow: none; color: var(--magenta); padding: 4px 0; text-transform: none; font-family: var(--font-body); font-size: 17px; }
button.link:hover { transform: none; text-shadow: 0 0 8px var(--magenta); }
button.danger { color: var(--red); border-color: var(--red); box-shadow: 0 0 10px rgba(255, 59, 59, .3), inset 0 0 10px rgba(255, 59, 59, .1); }
button.danger:hover { box-shadow: 0 0 18px rgba(255, 59, 59, .7); }
.top button { padding: 7px 12px; font-size: 13px; }

input, select { font: 600 18px var(--font-body); color: var(--ink); background: #05060f; border: 2px solid var(--line); border-radius: 6px; padding: 10px 12px; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 12px rgba(0, 229, 255, .5); }
select option { background: #0b0d1c; }
label { display: block; margin: 0 0 14px; font-weight: 700; color: var(--cyan); letter-spacing: .5px; text-transform: uppercase; font-size: 15px; }
label input, label select { margin-top: 6px; font-weight: 600; text-transform: none; }
label small { color: var(--muted); font-weight: 500; text-transform: none; }
.field { margin: 0 0 14px; }
.field .label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--cyan); text-transform: uppercase; font-size: 15px; letter-spacing: .5px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; text-transform: none; color: var(--ink); font-size: 17px; }
label.check input { width: auto; margin: 0; accent-color: var(--magenta); }
.code-input { text-transform: uppercase; letter-spacing: .35em; font-family: var(--font-num); font-size: 26px; font-weight: 900; text-align: center;
  color: var(--yellow); text-shadow: 0 0 10px rgba(255, 230, 0, .6); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 0 0 16px;
  box-shadow: 0 0 0 1px rgba(0, 229, 255, .08), 0 8px 30px rgba(0, 0, 0, .5); position: relative; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: 10px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 40%); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row label { flex: 1; min-width: 160px; margin: 0; }
.player-inputs { display: flex; flex-direction: column; gap: 8px; }
.player-inputs .pi { display: flex; gap: 8px; }
.player-inputs .pi button { padding: 6px 12px; }
details summary { cursor: pointer; font-weight: 700; color: var(--cyan); text-transform: uppercase; letter-spacing: .5px; font-size: 15px; }
details .player-inputs { margin-top: 12px; }
details .row { margin-top: 10px; }

/* --- salon */
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.code { font-family: var(--font-num); font-size: 36px; font-weight: 900; letter-spacing: .25em; margin-left: 8px; color: var(--yellow);
  text-shadow: 0 0 10px rgba(255, 230, 0, .8), 0 0 30px rgba(255, 230, 0, .4); }
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.client { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--magenta); border-radius: 8px; padding: 12px; box-shadow: 0 0 14px rgba(255, 43, 214, .15); }
.client.off { opacity: .45; border-left-color: var(--muted); box-shadow: none; }
.client-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 19px; }
.tag { font-size: 12px; font-family: var(--font-num); font-weight: 700; text-transform: uppercase; background: #0a0d20; border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; color: var(--muted); }
.tag.you { background: var(--cyan); border-color: var(--cyan); color: #04050c; box-shadow: 0 0 8px rgba(0, 229, 255, .6); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #0a0d20; border: 1px solid rgba(0, 229, 255, .35); border-radius: 4px; padding: 3px 10px; font-size: 16px; font-weight: 600; }

/* --- partie : en-tête, puis [3 fléchettes | tour | cible à l'écran], puis le carrousel des joueurs */
#stage #screen-game { display: grid; grid-template-rows: 46px minmax(0, 1fr) 176px; gap: 10px; overflow: hidden; padding: 12px 22px 14px; position: relative; }
#stage #screen-game.hidden { display: none !important; }
.game-head { display: flex; align-items: center; gap: 16px; margin: 0; font-size: 17px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--muted); white-space: nowrap; }
#gameTitle { font-family: var(--font-pixel); font-size: 14px; color: var(--magenta); text-shadow: 0 0 8px rgba(255, 43, 214, .8), 0 0 20px rgba(255, 43, 214, .4); }
.game-head b { color: var(--yellow); }
.head-btns { margin-left: auto; display: flex; gap: 10px; }
.head-btns button { padding: 7px 12px; font-size: 13px; }
.game-main { display: grid; grid-template-columns: 280px minmax(0, 1fr) 270px; gap: 20px; min-height: 0; }
.game-center { display: flex; flex-direction: column; min-height: 0; min-width: 0; margin-top: -56px; position: relative; z-index: 1; pointer-events: none; }
.game-center > .hint, .center-row > * { pointer-events: auto; }   /* seuls la cible et le tableau captent les appuis */
.game-center .hint:empty { display: none; }
.game-center .hint { margin: 4px 0 0; text-align: center; }
.manual { flex: none; height: 100%; display: flex; align-items: center; justify-content: center; }
.center-row { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 16px; }
.center-board:empty { display: none; }
/* Cricket : tableau et cible côte à côte, la cible plus petite et le tableau resserré */
.center-row.both .manual .dartboard { height: auto; width: 300px; }
.center-row.both .center-board { flex: 1 1 auto; }
.center-row.both:has(.manual) .cricket th, .center-row.both:has(.manual) .cricket td { padding: 3px 3px; }
.center-row.both:has(.manual) .cricket td.who { max-width: 96px; font-size: 16px; }
.center-row.both:has(.manual) .cricket td.who small { display: none; }

/* annonces (bust, victoire, tour terminé) : place réservée, rien ne bouge quand elles apparaissent */
.side .banner-slot { flex: none; height: 64px; margin: 0; }
.side .banner { font-size: 12px; padding: 4px 8px; line-height: 1.5; }
.side .banner.win { font-size: 14px; }
.side .banner.finish { border-color: rgb(var(--turn-rgb, 255,230,0)); color: #fff; font-family: var(--font-num); font-weight: 900; font-size: 17px; line-height: 1.3;
  text-shadow: 0 0 8px rgb(var(--turn-rgb, 255,230,0)); box-shadow: 0 0 12px rgba(var(--turn-rgb, 255,230,0), .5); }
.banner { border-radius: 8px; margin: 0; height: 100%; display: flex; align-items: center; justify-content: center; padding: 6px 12px;
  font-family: var(--font-pixel); font-size: 15px; line-height: 1.5; text-align: center; background: #0a0d20; border: 2px solid var(--line); color: var(--ink); }
.banner.bust { border-color: var(--red); color: var(--red); text-shadow: 0 0 8px rgba(255, 59, 59, .9); box-shadow: 0 0 20px rgba(255, 59, 59, .5), inset 0 0 20px rgba(255, 59, 59, .15);
  animation: shake .4s ease-in-out 1, flash-red 1s ease-in-out 3; }
.banner.win { border-color: var(--green); color: var(--green); text-shadow: 0 0 8px rgba(57, 255, 20, .9), 0 0 20px rgba(57, 255, 20, .5); box-shadow: 0 0 24px rgba(57, 255, 20, .5), inset 0 0 20px rgba(57, 255, 20, .12);
  animation: win-blink 1.2s steps(2, end) 4; font-size: 18px; }
.banner.info { border-color: var(--yellow); color: var(--yellow); font-family: var(--font-num); font-weight: 700; font-size: 15px; line-height: 1.3; text-shadow: 0 0 6px rgba(255, 230, 0, .7); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes flash-red { 0%, 100% { background: #0a0d20; } 50% { background: #3a0a0f; } }
@keyframes win-blink { 50% { opacity: .55; } }

.center-board { min-width: 0; overflow: hidden; }
#nextBtn.ready { position: relative; }
#nextBtn.ready::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 30px rgba(255, 43, 214, 1); opacity: 0; will-change: opacity; animation: glow-fade 1.2s infinite; }

/* les 3 fléchettes du tour : une fléchette dessinée tant qu'elle n'est pas lancée, puis le coup (T20) et ses points */
.throws { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)) 56px 60px; gap: 10px; min-height: 0; }
#undoBtn { font-size: 18px; padding: 12px; }
.dart { --dc: var(--turn-rgb, 0,229,255); position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px;
  background: rgba(5, 6, 15, .85); border: 2px dashed rgba(var(--dc), .45); font-family: var(--font-num); font-variant-numeric: tabular-nums; min-height: 0; }
.dart svg { width: 150px; height: 44px; color: rgb(var(--dc)); filter: drop-shadow(0 0 4px rgba(var(--dc), .7)); opacity: .9; }
.dart .dl { font-size: 72px; font-weight: 900; color: #fff; line-height: 1; }
.dart .dp { font-size: 40px; font-weight: 700; color: rgb(var(--dc)); }
.dart.filled { border-style: solid; border-color: rgb(var(--dc)); box-shadow: 0 0 12px rgba(var(--dc), .45); }
.dart.filled .dl { text-shadow: 0 0 10px rgba(var(--dc), .9); }
.dart.pop { animation: pop .3s ease-out; }
.dart.m2 { --dc: 0,229,255; background: rgba(0, 60, 80, .55); }
.dart.m3 { --dc: 255,200,0; background: rgba(90, 60, 0, .55); }
.dart.bull { --dc: 255,43,80; background: rgba(90, 0, 20, .5); }
.dart.out { --dc: 120,128,160; }
.dart.out .dl { font-size: 52px; color: var(--muted); text-shadow: none; }
.dart.m2 .dl::before, .dart.m3 .dl::before { content: attr(data-tag); display: block; font-size: 14px; letter-spacing: 3px; color: rgb(var(--dc)); margin-bottom: 2px; text-align: center; }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.1); } 100% { transform: scale(1); } }
.turn-total { display: flex; align-items: center; justify-content: center; font-family: var(--font-num); font-size: 46px; font-weight: 900; color: var(--cyan); text-shadow: 0 0 10px rgba(0, 229, 255, .8); }

/* à droite : derniers tours du joueur qui lance, les uns au-dessus des autres (le plus récent en haut), « Suivant » en bas */
.side { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding-top: 14px; }   /* sous le bouton rond de la cible */
/* moyennes du joueur qui lance */
.pstats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: none; }
.pstats .stat { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; background: rgba(5, 6, 15, .85);
  border: 1px solid rgba(var(--turn-rgb, 0,229,255), .6); border-radius: 8px; }
.pstats .stat span { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.pstats .stat b { font-family: var(--font-num); font-size: 30px; font-weight: 900; color: rgb(var(--turn-rgb, 0,229,255)); text-shadow: 0 0 8px rgba(var(--turn-rgb, 0,229,255), .7); }
.pstats .where { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 15px; font-weight: 600; margin-top: -2px; }
.side .cap { color: var(--muted); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; text-align: center; }
.last-turns { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.last-turns .vol { flex-direction: row; justify-content: space-between; padding: 10px 14px; }
.last-turns .vd { font-size: 18px; }
.last-turns .vp { font-size: 30px; }
#nextBtn { flex: none; font-size: 26px; padding: 22px 12px; }
.vol { min-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px;
  background: #05060f; border: 1px solid var(--line); border-radius: 6px; font-variant-numeric: tabular-nums; }
.vol .vd { font-family: var(--font-num); font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.vol .vp { font-family: var(--font-num); font-size: 22px; font-weight: 900; color: var(--cyan); }
.vol.bust .vp { color: var(--red); }
.vol:nth-child(n+2) { opacity: .75; }
.vol:nth-child(n+3) { opacity: .5; }

/* carrousel des joueurs : toutes les cartes ont la taille de la grande et sont réduites par transform (animation fluide,
   composée par le GPU) ; app.js place chaque carte (--x, --s) : celle qui lance au milieu, les suivantes à sa droite */
.carousel { position: relative; min-height: 0; }
.pcard { --pc: 0,229,255; --x: 0px; --s: 1; position: absolute; left: 0; bottom: 0; width: 300px; height: 168px; box-sizing: border-box;
  transform-origin: 50% 100%; transform: translateX(var(--x)) scale(var(--s)); transition: transform .28s cubic-bezier(.2, .8, .3, 1), opacity .28s;
  background: rgba(10, 12, 28, .94); border: 3px solid rgba(var(--pc), .55); border-radius: 16px; padding: 12px 14px 10px; text-align: center;
  display: flex; flex-direction: column; justify-content: center; overflow: hidden; will-change: transform; }
.pcard.jump { transition: none; animation: card-in .35s ease-out; }
@keyframes card-in { from { opacity: 0; } to { opacity: 1; } }
.pcard .pname { font-size: 36px; font-weight: 700; line-height: 1.1; text-transform: uppercase; letter-spacing: 1px; color: rgb(var(--pc));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pscore { font-family: var(--font-num); font-size: 88px; font-weight: 900; line-height: 1.05; margin: 2px 0; color: #fff;
  text-shadow: 0 0 10px rgba(var(--pc), .8), 0 0 28px rgba(var(--pc), .4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcard:not(.active) .pname { font-size: 44px; }
.pcard:not(.active) .pscore { font-size: 96px; }
.pcard.active { background: rgba(var(--pc), .22); border-color: rgb(var(--pc)); box-shadow: 0 0 22px rgba(var(--pc), .6), inset 0 0 30px rgba(var(--pc), .18); z-index: 2; }
.pcard.active .pname { color: #fff; text-shadow: 0 0 10px rgb(var(--pc)); }
.pcard.winner { border-color: var(--green); background: rgba(57, 255, 20, .14); box-shadow: 0 0 22px rgba(57, 255, 20, .6); }
.pcard.winner .pscore { color: var(--green); }

/* effet plein écran sur un double, un triple ou le bull : mot géant, coup joué et ondes à la couleur du joueur */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 20; display: flex; align-items: center; justify-content: center; }
.fx:empty { display: none; }
.fx .burst { --fc: 255,200,0; position: relative; display: flex; flex-direction: column; align-items: center; animation: fx-in 2.8s cubic-bezier(.2, .9, .3, 1) forwards; }
.fx .burst.m2 { --fc: 0,229,255; }
.fx .burst.bull { --fc: 255,43,80; }
.fx .word { font-family: var(--font-pixel); font-size: 88px; line-height: 1.2; color: rgb(var(--fc));
  text-shadow: 0 0 18px rgba(var(--fc), 1), 0 0 50px rgba(var(--fc), .7), 6px 6px 0 rgba(var(--pr, 255,43,214), .9); }
.fx .hit { font-family: var(--font-num); font-size: 64px; font-weight: 900; color: #fff; text-shadow: 0 0 16px rgba(var(--fc), 1); }
.fx .wave { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%;
  border: 8px solid rgba(var(--pr, 255,230,0), .9); box-shadow: 0 0 30px rgba(var(--pr, 255,230,0), .8); opacity: 0; animation: fx-wave 1.1s ease-out 2; }
.fx .wave.w2 { animation-delay: .18s; border-color: rgba(var(--fc), .9); }
.fx .wave.w3 { animation-delay: .36s; }
.fx .flash { position: absolute; inset: 0; background: radial-gradient(circle, rgba(var(--fc), .45), transparent 65%); animation: fx-flash .7s ease-out forwards; }
@keyframes fx-in { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 9% { transform: scale(1.15) rotate(2deg); opacity: 1; }
  15% { transform: scale(1); } 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes fx-wave { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(4); opacity: 0; } }
@keyframes fx-flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* Cricket : tableau des marques au centre */
.cricket { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cricket th, .cricket td { padding: 3px 6px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.cricket th { color: var(--magenta); font-family: var(--font-num); font-weight: 700; font-size: 15px; text-shadow: 0 0 6px rgba(255, 43, 214, .6); background: #0a0d20; }
.cricket td.who { text-align: left; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; font-size: 18px; border-left: 6px solid rgb(var(--pc)); color: rgb(var(--pc));
  white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.cricket td.who small { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 6px; letter-spacing: 0; }
.cricket tr.active td { background: rgba(var(--pc), .25); }
.cricket tr.active td.who { color: #fff; text-shadow: 0 0 8px rgb(var(--pc)); }
.cricket td.m { font-family: var(--font-num); font-size: 20px; font-weight: 700; line-height: 1; color: var(--cyan); text-shadow: 0 0 6px rgba(0, 229, 255, .5); }
.cricket td.m.closed { color: var(--green); text-shadow: 0 0 8px rgba(57, 255, 20, .7); }
.cricket td.m.dead { color: var(--line); text-shadow: none; }
.cricket td.pts { font-family: var(--font-num); font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 0 10px rgba(0, 229, 255, .7); }
.cricket .prow { --pc: 0,229,255; }

@keyframes glow-fade { 50% { opacity: 1; } }

/* Halo de la cible : box-shadow rond (rasterisé une fois) au lieu de filter: drop-shadow sur tout le SVG */
.dartboard { display: block; height: 100%; width: auto; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; box-shadow: 0 0 14px rgba(0, 229, 255, .35);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }   /* tactile : pas de délai ni de zoom au double appui */
.dartboard .seg { cursor: pointer; stroke: #0b0c0e; stroke-width: .6; transition: filter .1s; }
@media (hover: hover) { .dartboard .seg:hover { filter: brightness(1.5) drop-shadow(0 0 4px #fff); } }   /* pas sur écran tactile : le survol y reste collé après un appui */
.dartboard .num { fill: var(--cyan); font-family: var(--font-num); font-size: 12px; font-weight: 700; pointer-events: none; }
#manualWrap.disabled .dartboard { box-shadow: none; }
#manualWrap.disabled .seg:not(.aim) { opacity: .35; }
/* combinaison pour finir : cases à viser à la couleur du joueur, la prochaine clignote entre blanc et sa couleur */
.dartboard .seg.aim { fill: rgba(var(--turn-rgb, 255,230,0), .75); stroke: #fff; stroke-width: 1.4; }
.dartboard .seg.aim1 { animation: seg-aim .9s ease-in-out infinite; }
@keyframes seg-aim { 0%, 100% { fill: #fff; } 50% { fill: rgb(var(--turn-rgb, 255,230,0)); } }
/* appui : flash blanc immédiat sous le doigt */
.dartboard .seg.tap { animation: seg-tap .35s ease-out; }
@keyframes seg-tap { 0% { fill: #fff; } 100% { } }
/* case touchée : flash blanc puis fondu doux vers la couleur normale en 2 secondes, avec un halo à la couleur du joueur
   (le halo n'est pas animé : filter sur un seul segment, retiré avec la classe à la fin) */
.dartboard .seg.hit { stroke: rgb(var(--turn-rgb, 255,230,0)); stroke-width: 2; filter: drop-shadow(0 0 4px rgb(var(--turn-rgb, 255,230,0)));
  animation: seg-hit 2.2s ease-out forwards; }
@keyframes seg-hit { 0% { fill: #fff; stroke-opacity: 1; opacity: 1; } 35% { fill: #fff; stroke-opacity: 1; }
  100% { stroke-opacity: 0; filter: drop-shadow(0 0 0 transparent); } }


.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0a0d20; color: var(--yellow); border: 2px solid var(--yellow);
  padding: 10px 18px; border-radius: 6px; font-family: var(--font-num); font-weight: 700; font-size: 15px; box-shadow: 0 0 20px rgba(255, 230, 0, .5), 0 8px 30px rgba(0, 0, 0, .6); max-width: 90vw; z-index: 50; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
