/* ==========================================================================
   Libéropoly — feuille de style (plateau 3D CSS, HUD, modales)
   ========================================================================== */
:root {
  --navy: #071d49;
  --navy-2: #0c2a66;
  --ink: #14213d;
  --accent: #00a3e0;
  --accent-2: #7fd6ff;
  --gold: #f2c14e;
  --danger: #e63946;
  --ok: #2a9d4b;
  --paper: #f7f7f2;
  --board: #e4ebdc;
  --board-edge: #b9c3ae;
  --face: #f6f7f1;
  --line: #1b2540;
  --text: #16213e;
  --muted: #5d6b85;
  --panel: rgba(9, 22, 52, .82);
  --panel-border: rgba(255,255,255,.08);
  --shadow: 0 18px 40px rgba(0,0,0,.45);
  --u: 92px;             /* unité de plateau (largeur d'une case latérale) */
  --corner: calc(var(--u) * 1.55);
  --board-size: calc(var(--corner) * 2 + var(--u) * 6);
  --tilt: 52deg;
  --spin: 0deg;
  --font: "Montserrat", "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Montserrat", "Arial Black", "Segoe UI Black", "Helvetica Neue", Arial, sans-serif;
  /* couleurs d'équipes par défaut */
  --team-0: #e63946; --team-1: #1d7bd8; --team-2: #2a9d4b; --team-3: #f4a300;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: #fff;
  background: radial-gradient(1200px 800px at 20% 10%, #123a86 0%, var(--navy) 45%, #040f2a 100%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
[hidden] { display: none !important; }
.screen { position: fixed; inset: 0; }

/* ---------- boutons ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 12px 22px; font-size: 16px; font-weight: 700; cursor: pointer;
  color: #fff; background: rgba(255,255,255,.12); transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  letter-spacing: .01em;
}
.btn:hover { background: rgba(255,255,255,.2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #2bb8f0, #0088c4); box-shadow: 0 8px 22px rgba(0,163,224,.35); }
.btn-primary:hover { background: linear-gradient(180deg, #45c4f5, #0a95d3); }
.btn-secondary { background: linear-gradient(180deg, #f6d06f, #d9a521); color: #2b1d00; }
.btn-danger { background: linear-gradient(180deg, #ff5d6a, #c8202d); }
.btn-ok { background: linear-gradient(180deg, #3fc26a, #1f8a3e); }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.25); }
.btn-xl { font-size: 20px; padding: 16px 34px; border-radius: 16px; }
.btn-big { font-size: 22px; padding: 18px 28px; border-radius: 18px; width: 100%; }
.btn-pulse { position: relative; }
.btn-pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 3px rgba(0,163,224,.6); animation: pulseRing 1.4s ease-out infinite; pointer-events: none; }
@keyframes pulseRing { from { transform: scale(1); opacity: .9; } to { transform: scale(1.22); opacity: 0; } }

/* ==========================================================================
   ACCUEIL — plateau 3D vivant en fond, console en verre
   ========================================================================== */
#screen-setup { overflow: auto; }
.home-gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.home-vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(70% 60% at 50% 45%, rgba(4,12,32,.35) 0%, rgba(4,12,32,.72) 60%, rgba(3,9,26,.92) 100%); }
.home { position: relative; z-index: 2; min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: clamp(18px, 4vh, 40px) 16px 28px; gap: 18px; animation: homeIn .8s cubic-bezier(.2,.9,.3,1) both; }
@keyframes homeIn { from { transform: translateY(14px); } to { transform: none; } }
.hero { text-align: center; }
.hero-brand { display: block; width: clamp(120px, 14vw, 190px); height: auto; margin: 0 auto 14px; filter: brightness(0) invert(1) drop-shadow(0 6px 18px rgba(0,0,0,.45)); opacity: .95; }
.topbar-brand { width: 92px; height: auto; margin-right: 12px; filter: brightness(0) invert(1); opacity: .92; vertical-align: middle; }
.hero-logo { font-family: var(--font-display); font-weight: 900; font-size: clamp(46px, 7.2vw, 96px); letter-spacing: .08em; line-height: 1; color: #fff; text-shadow: 0 10px 40px rgba(0,0,0,.55), 0 2px 0 rgba(0,0,0,.25); }
.logo-accent { color: var(--accent); display: inline-block; transform: rotate(-8deg); text-shadow: 0 0 24px rgba(0,163,224,.6); }
.hero-tagline { font-size: clamp(16px, 2vw, 24px); margin: 12px 0 6px; font-weight: 700; color: #eef3ff; letter-spacing: .01em; }
.hero-event { font-size: 12.5px; letter-spacing: .32em; text-transform: uppercase; color: rgba(255,255,255,.62); margin: 0; font-weight: 600; }

.console { width: min(1120px, 100%); background: rgba(8, 20, 50, .58); border: 1px solid rgba(255,255,255,.13); border-radius: 26px; backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12); padding: 18px; display: grid; gap: 18px; }
.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mode-card { position: relative; background: rgba(255,255,255,.05); border: 1.5px solid rgba(255,255,255,.12); border-radius: 18px; padding: 16px 16px 14px; color: #fff; text-align: left; cursor: pointer; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center; transition: transform .18s ease, border-color .18s, background .18s, box-shadow .18s; }
.mode-card:hover { transform: translateY(-2px); background: rgba(255,255,255,.09); }
.mode-card.is-active { border-color: rgba(76,201,240,.9); background: linear-gradient(160deg, rgba(0,163,224,.28), rgba(0,163,224,.08)); box-shadow: 0 0 0 4px rgba(0,163,224,.14), 0 14px 30px rgba(0,0,0,.3); }
.mode-card.is-active::after { content: "✓"; position: absolute; top: 10px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #041226; font-weight: 900; font-size: 13px; display: grid; place-items: center; }
.mode-glyph { grid-row: 1 / 3; width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: var(--accent-2); }
.mode-glyph svg { width: 34px; height: 34px; }
.mode-card.is-active .mode-glyph { background: rgba(0,163,224,.25); color: #fff; }
.mode-title { font-family: var(--font-display); font-weight: 800; font-size: 16.5px; letter-spacing: .01em; }
.mode-desc { font-size: 12.8px; color: rgba(255,255,255,.72); line-height: 1.35; }

.section-title { margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.7); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-hint { font-family: var(--font); font-weight: 500; font-size: 12.5px; letter-spacing: 0; text-transform: none; color: rgba(255,255,255,.5); }
.roster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tcard { position: relative; border-radius: 18px; padding: 14px 12px 12px; background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; align-items: center; gap: 10px; transition: opacity .2s, transform .18s; overflow: hidden; }
.tcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.tcard.kind-none { opacity: .45; }
.tcard.kind-none .tcard-pawn { filter: grayscale(1); }
.tcard-pawn { position: relative; width: 78px; height: 78px; border-radius: 50%; border: 0; cursor: pointer; background: radial-gradient(circle at 35% 30%, #fff8 0, transparent 40%), var(--c); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 22px rgba(0,0,0,.45), inset 0 -8px 0 rgba(0,0,0,.18); transition: transform .15s; }
.tcard-pawn:hover { transform: translateY(-2px) scale(1.04); }
.tcard-pawn svg { width: 40px; height: 40px; position: relative; }
.tcard-ring { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid rgba(255,255,255,.75); }
.tcard-pawn.is-pop { animation: pop .35s cubic-bezier(.2,1.4,.3,1); }
@keyframes pop { 50% { transform: scale(1.14) rotate(-6deg); } }
.tcard-name { width: 100%; font: inherit; font-weight: 800; font-size: 15px; text-align: center; color: #fff; background: transparent; border: 0; border-bottom: 1.5px dashed rgba(255,255,255,.25); padding: 6px 4px; border-radius: 0; outline: none; transition: border-color .15s, background .15s; }
.tcard-name:hover { background: rgba(255,255,255,.05); }
.tcard-name:focus { border-bottom-color: var(--accent); background: rgba(0,163,224,.1); }
.tcard.kind-bot .tcard-name { color: rgba(255,255,255,.85); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; background: rgba(0,0,0,.35); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: rgba(255,255,255,.65); font: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 2px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: #fff; }
.seg button.is-on { background: linear-gradient(180deg, #2bb8f0, #0088c4); color: #fff; box-shadow: 0 4px 12px rgba(0,163,224,.35); }
.tcard.kind-bot .seg button.is-on { background: linear-gradient(180deg, #8b93a7, #5d6578); box-shadow: none; }
.tcard.kind-none .seg button.is-on { background: rgba(255,255,255,.25); box-shadow: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13.5px; cursor: pointer; transition: background .15s; }
.chip b { font-weight: 800; color: #fff; }
.chip:hover { background: rgba(255,255,255,.12); }
.chip-more { margin-left: auto; color: var(--accent-2); border-color: rgba(76,201,240,.4); }
.advanced { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; background: rgba(0,0,0,.25); border-radius: 14px; padding: 12px 16px; }
.setup-form label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0; font-size: 14px; color: rgba(255,255,255,.9); }
.setup-form label.check { justify-content: flex-start; }
.setup-form input[type=number], .setup-form input[type=text], .setup-form select, .setup-form textarea { font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; min-width: 90px; }
.setup-form select option { color: #000; }
.setup-form textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.input-suffix { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.65); }
.input-suffix input { width: 92px; }
.hint { font-size: 12.5px; color: rgba(255,255,255,.6); margin: 8px 0 0; line-height: 1.4; }
.online-box { background: rgba(0,163,224,.1); border: 1px solid rgba(0,163,224,.35); border-radius: 16px; padding: 14px 18px; display: grid; gap: 8px; }
.online-box p { margin: 0; }
.online-box code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 5px; }
.online-box details summary { cursor: pointer; font-weight: 700; }
.net-status { font-size: 13.5px; margin: 0; min-height: 1.2em; color: rgba(255,255,255,.9); }
.net-status.err { color: #ffb4b4; }
.code-label { flex-direction: column; align-items: center !important; gap: 8px !important; font-family: var(--font-display); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px !important; color: rgba(255,255,255,.7) !important; }
.code-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 40px !important; letter-spacing: .45em; text-transform: uppercase; width: 260px; text-align: center; padding: 10px 0 10px .45em !important; background: rgba(0,0,0,.35) !important; border: 2px solid rgba(76,201,240,.5) !important; border-radius: 16px !important; }
.code-input:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 4px rgba(0,163,224,.2); }
.join-slots { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.setup-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; padding-top: 4px; }
.btn .arrow { display: inline-block; transition: transform .15s; margin-left: 4px; }
.btn:hover .arrow { transform: translateX(4px); }
.setup-footer { font-size: 12px; color: rgba(255,255,255,.45); text-align: center; }

/* ==========================================================================
   ÉCRAN DE JEU — structure
   ========================================================================== */
#screen-game { display: flex; flex-direction: column; }
#topbar { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: linear-gradient(180deg, rgba(3,10,30,.85), rgba(3,10,30,.55)); border-bottom: 1px solid var(--panel-border); z-index: 5; backdrop-filter: blur(10px); }
.topbar-left, .topbar-right, .topbar-center { display: flex; align-items: center; gap: 10px; }
.topbar-logo { font-family: var(--font-display); font-size: 22px; letter-spacing: .06em; }
.room-badge { font-family: ui-monospace, Menlo, Consolas, monospace; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); padding: 4px 10px; border-radius: 8px; font-size: 15px; letter-spacing: .2em; }
.timer { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 800; padding: 3px 18px; border-radius: 999px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.1); letter-spacing: .06em; min-width: 132px; text-align: center; transition: color .3s, background .3s; }
.timer.is-low { color: #ffd166; }
.timer.is-critical { color: #ff6b6b; animation: blink 1s steps(2) infinite; }
.timer.is-paused { color: #9ec5ff; background: rgba(0,163,224,.25); }
@keyframes blink { 50% { opacity: .5; } }
.turn-indicator { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); }
.turn-indicator .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c, #fff); box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.tb-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: #fff; font-size: 18px; cursor: pointer; }
.tb-btn:hover { background: rgba(255,255,255,.18); }
.tb-btn.is-on { background: rgba(0,163,224,.4); border-color: var(--accent); }

#stage { flex: 1; display: grid; grid-template-columns: 1fr 360px; min-height: 0; position: relative; }
#panel { background: linear-gradient(180deg, rgba(9,22,52,.86), rgba(6,16,40,.92)); border-left: 1px solid var(--panel-border); display: flex; flex-direction: column; min-height: 0; backdrop-filter: blur(12px); }

/* ==========================================================================
   SCÈNE 3D
   ========================================================================== */
.scene { position: relative; perspective: 1900px; perspective-origin: 50% 38%; display: grid; place-items: center; overflow: hidden; min-height: 0; }
.world { transform-style: preserve-3d; transform: rotateX(var(--tilt)) rotateZ(var(--spin)); transition: transform .8s cubic-bezier(.4,0,.2,1); will-change: transform; }
.board { position: relative; width: var(--board-size); height: var(--board-size); background: var(--board); transform-style: preserve-3d; border-radius: 6px;
  box-shadow: 0 0 0 3px var(--line), 0 40px 80px rgba(0,0,0,.55); }
.board-edge { position: absolute; inset: 0; background: var(--board-edge); transform: translateZ(-14px); border-radius: 6px; box-shadow: 0 0 0 3px #101a30; }
.squares { position: absolute; inset: 0; transform-style: preserve-3d; }

.square { position: absolute; background: var(--face); border: 1.5px solid var(--line); overflow: hidden; transform-style: preserve-3d; cursor: pointer; }
.square:hover .face { background: #fff; }
.square .face { position: absolute; left: 50%; top: 50%; width: var(--fw); height: var(--fh); transform: translate(-50%, -50%) rotate(var(--rot)); display: flex; flex-direction: column; align-items: center; color: var(--text); background: var(--face); transition: background .15s; }
.square.is-highlight .face { background: #fff9d6; }
.square.is-corner .face { justify-content: center; text-align: center; padding: 6px; gap: 4px; }
.square .band { width: 100%; height: 22%; background: var(--gc, #999); border-bottom: 1.5px solid var(--line); flex: none; position: relative; display: flex; align-items: center; justify-content: center; }
.square .name { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 3px 4px; font-weight: 700; font-size: calc(var(--u) * .115); line-height: 1.12; text-transform: uppercase; letter-spacing: .01em; word-break: break-word; hyphens: auto; }
.square .price { font-size: calc(var(--u) * .12); font-weight: 700; padding-bottom: 4px; color: #2b3a55; }
.square .pict { width: calc(var(--u) * .34); height: calc(var(--u) * .34); color: var(--pc, var(--navy)); margin-top: 6px; }
.square .pict svg { width: 100%; height: 100%; }
.square.is-corner .pict { width: calc(var(--u) * .55); height: calc(var(--u) * .55); margin: 0; }
.square.is-corner .name { flex: none; font-size: calc(var(--u) * .14); }
.square.is-corner .sub { font-size: calc(var(--u) * .1); color: var(--muted); font-weight: 600; text-transform: uppercase; }
.square.type-go .face { background: linear-gradient(160deg, #e9f8ee, #c7ecd3); }
.square.type-go .name { color: #1e6b36; font-size: calc(var(--u) * .16); }
.square.type-lost .face { background: linear-gradient(160deg, #fff, #f6dede); }
.square.type-lost .name { color: #a11e28; }
.square.type-lose .face { background: linear-gradient(160deg, #fff4e0, #ffd9a6); }
.square.type-lose .name { color: #a34d00; }
.square.type-break .face { background: linear-gradient(160deg, #fdf6e8, #f3e0b8); }
.square.type-correction .face { background: linear-gradient(160deg, #fff, #ffe9c7); }
.square.type-correction .name { color: #8a4b00; }
.square.type-correction .pict { color: #b45309; }
.dice.is-single .die:nth-child(2) { visibility: hidden; }
.square.type-chance .pict, .square.type-event .pict { width: calc(var(--u) * .42); height: calc(var(--u) * .42); }
.square.type-chance .pict { color: #d97706; }
.square.type-event .pict { color: #2563eb; }
.square.type-tax .pict { color: #7c2d12; }
.square.type-system .pict { color: #1f2937; }
.square.type-utility .pict { color: #0f766e; }
.square .owner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 78%; height: 70%; border-radius: 6px; background: var(--oc, #fff); border: 2px solid rgba(255,255,255,.85); box-shadow: 0 2px 4px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; color: #fff; }
.square .owner svg { width: 80%; height: 80%; }
.square .owner.is-mastered { box-shadow: 0 0 0 2px var(--gold), 0 2px 4px rgba(0,0,0,.35); }
.square .owner .star { position: absolute; top: -8px; right: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); color: #4a3000; font-size: 11px; line-height: 16px; text-align: center; font-weight: 900; }

/* centre du plateau */
.center { position: absolute; left: var(--corner); top: var(--corner); width: calc(var(--u) * 6); height: calc(var(--u) * 6); transform-style: preserve-3d; }
.center-title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-38deg); pointer-events: none; }
.center-title span { font-family: var(--font-display); font-size: calc(var(--u) * .5); color: var(--navy); letter-spacing: .08em; text-shadow: 0 3px 0 rgba(255,255,255,.7), 0 10px 20px rgba(0,0,0,.15); background: rgba(255,255,255,.5); padding: 0 .3em; border-radius: 10px; }
.center-title small { font-size: calc(var(--u) * .16); letter-spacing: .3em; text-transform: uppercase; color: var(--navy); font-weight: 800; margin-top: 6px; }
.deck { position: absolute; width: calc(var(--u) * 1.45); height: calc(var(--u) * .95); transform-style: preserve-3d; }
.deck-event { left: calc(var(--u) * .45); top: calc(var(--u) * .45); transform: rotate(45deg); }
.deck-chance { right: calc(var(--u) * .45); bottom: calc(var(--u) * .45); transform: rotate(45deg); }
.deck-card { position: absolute; inset: 0; border-radius: 8px; display: grid; place-items: center; font-weight: 900; text-align: center; font-size: calc(var(--u) * .13); letter-spacing: .08em; border: 2px solid rgba(0,0,0,.25);
  box-shadow: 0 2px 0 #cfd6c8, 0 4px 0 #b9c3ae, 0 6px 0 #a8b39c, 0 10px 14px rgba(0,0,0,.3); transform: translateZ(8px); }
.deck-event .deck-card { background: linear-gradient(135deg, #2f6fdb, #1d4ed8); color: #fff; }
.deck-chance .deck-card { background: linear-gradient(135deg, #ffb703, #f59e0b); color: #4a2a00; }
.deck.is-drawing .deck-card { animation: deckPop .6s ease; }
@keyframes deckPop { 0% { transform: translateZ(8px); } 40% { transform: translateZ(60px) rotate(-6deg); } 100% { transform: translateZ(8px); } }

/* dés 3D */
.dice { position: absolute; left: 36%; top: 80%; transform: translate(-50%, -50%); display: flex; gap: calc(var(--u) * .45); transform-style: preserve-3d; }
.die { --s: calc(var(--u) * .5); width: var(--s); height: var(--s); position: relative; transform-style: preserve-3d; transform: translateZ(calc(var(--s) / 2)) rotateX(0) rotateY(0); transition: transform 1.1s cubic-bezier(.2,.9,.3,1); }
.die.is-rolling { animation: tumble .9s linear infinite; }
@keyframes tumble { 0% { transform: translateZ(calc(var(--s) / 2)) rotateX(0) rotateY(0); } 100% { transform: translateZ(calc(var(--s) * 1.4)) rotateX(720deg) rotateY(540deg); } }
.die .f { position: absolute; inset: 0; background: #fff; border: 2px solid #c9cfd6; border-radius: 12%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 12%; backface-visibility: hidden; box-shadow: inset 0 0 8px rgba(0,0,0,.08); }
.die .f i { width: 70%; height: 70%; border-radius: 50%; background: #16213e; place-self: center; visibility: hidden; }
.die .f i.on { visibility: visible; }
.die .f1 { transform: translateZ(calc(var(--s) / 2)); }
.die .f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.die .f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.die .f5 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.die .f3 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.die .f4 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.die-shadow { position: absolute; left: 36%; top: 80%; width: calc(var(--u) * 1.6); height: calc(var(--u) * .7); transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(0,0,0,.28), transparent); border-radius: 50%; }

/* pions (billboards) */
.pawns { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.pawn-shadow { position: absolute; width: calc(var(--u) * .42); height: calc(var(--u) * .22); border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.4), transparent); transform: translate(-50%, -50%); transition: left .22s linear, top .22s linear; }
.pawn { position: absolute; width: calc(var(--u) * .46); height: calc(var(--u) * .64); transform-origin: 50% 100%; transition: left .22s linear, top .22s linear; transform-style: preserve-3d;
  transform: translate(-50%, -100%) rotateZ(calc(-1 * var(--spin))) rotateX(calc(-1 * var(--tilt))); }
.pawn .body { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; }
.pawn .disc { width: calc(var(--u) * .42); height: calc(var(--u) * .42); border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 6px 10px rgba(0,0,0,.35), inset 0 -6px 0 rgba(0,0,0,.18); display: grid; place-items: center; color: #fff; }
.pawn .disc svg { width: 62%; height: 62%; }
.pawn .stem { width: 4px; flex: 1; background: linear-gradient(#fff, var(--c)); box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.pawn .base { width: calc(var(--u) * .3); height: 6px; border-radius: 50%; background: var(--c); border: 2px solid #fff; }
.pawn.is-hop .body { animation: hop .22s ease-out; }
@keyframes hop { 0% { transform: translateY(0); } 50% { transform: translateY(calc(var(--u) * -.35)); } 100% { transform: translateY(0); } }
.pawn.is-active .disc { box-shadow: 0 0 0 4px #fff, 0 0 22px 6px var(--c), 0 6px 10px rgba(0,0,0,.35); }
.pawn.is-lost .disc { filter: grayscale(.4); }
.pawn.is-lost::after { content: "?"; position: absolute; top: -10px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff; font-weight: 900; font-size: 13px; display: grid; place-items: center; border: 2px solid #fff; }
.pawn-tag { position: absolute; transform: translate(-50%, 0) rotateZ(calc(-1 * var(--spin))); background: var(--c); color: #fff; font-size: calc(var(--u) * .1); font-weight: 800; padding: 1px 6px; border-radius: 6px; white-space: nowrap; opacity: 0; transition: left .22s linear, top .22s linear, opacity .2s; border: 1px solid rgba(255,255,255,.8); box-shadow: 0 2px 4px rgba(0,0,0,.3); pointer-events: none; }
.pawn-tag.is-on { opacity: 1; }

/* effets flottants */
.fx { position: absolute; inset: 0; pointer-events: none; transform-style: preserve-3d; }
.float { position: absolute; transform-origin: 50% 100%; transform: translate(-50%, -100%) rotateZ(calc(-1 * var(--spin))) rotateX(calc(-1 * var(--tilt))); font-weight: 900; font-size: calc(var(--u) * .3); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 12px rgba(0,0,0,.6); animation: floatUp 1.4s ease-out forwards; white-space: nowrap; }
.float.plus { color: #7dffb0; }
.float.minus { color: #ff8a8a; }
@keyframes floatUp { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -100%) rotateZ(calc(-1 * var(--spin))) rotateX(calc(-1 * var(--tilt))) translateY(calc(var(--u) * -1.2)); } }

/* tampon LOT LIBÉRÉ (HUD 2D au-dessus de la scène) */
.stamp { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 4; }
.stamp span { display: inline-block; font-family: var(--font-display); font-size: clamp(48px, 9vw, 120px); line-height: .95; color: #d7263d; border: 10px solid #d7263d; border-radius: 18px; padding: 12px 32px; text-align: center; transform: rotate(-14deg); background: rgba(255,255,255,.08); letter-spacing: .05em;
  mask-image: radial-gradient(circle at 30% 30%, #000 60%, transparent 62%), radial-gradient(circle at 70% 70%, #000 62%, transparent 64%), linear-gradient(#000, #000); mask-composite: add;
  text-shadow: 0 0 20px rgba(215,38,61,.4); animation: stampIn .8s cubic-bezier(.2,1.2,.3,1) forwards; }
@keyframes stampIn { 0% { transform: rotate(-14deg) scale(3); opacity: 0; } 55% { transform: rotate(-14deg) scale(.92); opacity: 1; } 75% { transform: rotate(-14deg) scale(1.05); } 100% { transform: rotate(-14deg) scale(1); opacity: 1; } }
.stamp.is-out span { animation: stampOut .5s ease-in forwards; }
@keyframes stampOut { to { opacity: 0; transform: rotate(-14deg) scale(1.15); } }

/* ==========================================================================
   PANNEAU LATÉRAL
   ========================================================================== */
.teams { padding: 12px; display: grid; gap: 10px; }
.team-card { position: relative; border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.1); padding: 10px 12px 10px 16px; display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; transition: transform .2s, background .2s, box-shadow .2s; overflow: hidden; }
.team-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.team-card.is-active { background: rgba(255,255,255,.14); box-shadow: 0 0 0 2px var(--c), 0 10px 24px rgba(0,0,0,.35); transform: translateX(4px); animation: cardIn .25s ease; }
@keyframes cardIn { from { transform: translateX(0); } to { transform: translateX(4px); } }
.team-card.is-me { border-color: var(--accent); }
.team-card .avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--c); display: grid; place-items: center; border: 2px solid rgba(255,255,255,.7); color: #fff; }
.team-card .avatar svg { width: 24px; height: 24px; }
.team-card .name { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.team-card .tag { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.15); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.team-card .tag.bot { background: rgba(255,255,255,.12); }
.team-card .tag.me { background: rgba(0,163,224,.5); }
.team-card .tag.lost { background: var(--danger); }
.team-card .tag.card { background: #6d28d9; }
.team-card .tag.off { background: #7c2d12; }
.team-card .money { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 800; text-align: right; transition: color .3s; letter-spacing: .01em; }
.team-card .money.flash-up { color: #7dffb0; }
.team-card .money.flash-down { color: #ff8a8a; }
.team-card .sub { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; opacity: .9; }
.team-card .lots { display: inline-flex; gap: 3px; align-items: center; }
.team-card .lots i { width: 14px; height: 14px; border-radius: 3px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); }
.team-card .lots i.on { background: var(--gold); border-color: #fff; box-shadow: 0 0 6px var(--gold); }
.team-card .lots i.on.is-new, .team-card .lots b.is-new { animation: pop .5s cubic-bezier(.2,1.4,.3,1); }
.team-card .chips .none { opacity: .7; }
.team-card .lots b { font-family: var(--font-display); font-size: 15px; color: var(--gold); }
.team-card .chips { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.team-card .chips i { width: 12px; height: 12px; border-radius: 3px; background: var(--gc); border: 1px solid rgba(255,255,255,.5); }
.team-card .chips i.sys { border-radius: 50%; background: #1f2937; }
.team-card .chips i.util { border-radius: 50%; background: #0f766e; }

.dock { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 300px; max-width: min(560px, 92%); padding: 12px 18px 14px; border-radius: 22px; background: rgba(6,16,40,.72); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(14px); box-shadow: 0 18px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.1); animation: dockIn .35s ease; }
.dock:empty { display: none; }
@keyframes dockIn { from { transform: translate(-50%, 12px); } to { transform: translate(-50%, 0); } }
.dock .status { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.9); text-align: center; }
.dock .dice-result { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 800; color: #fff; text-align: center; }
.dock .btn { min-width: 220px; }
.dock .btn-big { font-size: 21px; padding: 14px 30px; border-radius: 999px; width: auto; }
.banner { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 7; pointer-events: none; }
.banner span { background: var(--c); }
.banner span { display: inline-block; font-family: var(--font-display); font-weight: 900; font-size: clamp(26px, 3.6vw, 54px); letter-spacing: .04em; color: #fff; padding: 10px 34px; border-radius: 999px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 82%, #000) 18%, color-mix(in srgb, var(--c) 82%, #000) 82%, transparent); text-shadow: 0 3px 0 rgba(0,0,0,.35); animation: bannerIn .45s cubic-bezier(.2,1.2,.3,1); }
.banner.is-out span { animation: bannerOut .4s ease-in forwards; }
@keyframes bannerIn { from { opacity: 0; transform: scale(.7) translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes bannerOut { to { opacity: 0; transform: scale(1.05) translateY(-10px); } }
.log { flex: 1; min-height: 0; overflow: auto; padding: 8px 12px 14px; font-size: 13px; line-height: 1.35; border-top: 1px solid var(--panel-border); display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; }
.log .entry { padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.05); border-left: 3px solid var(--c, rgba(255,255,255,.3)); animation: logIn .3s ease; }
.log .entry.turn { background: transparent; opacity: .7; font-weight: 700; border-left-color: transparent; padding-top: 8px; }
@keyframes logIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   MODALES
   ========================================================================== */
.overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(3, 10, 30, .55); backdrop-filter: blur(3px); padding: 20px; animation: fadeIn .2s ease; }
.overlay.is-closing { animation: fadeOut .18s ease forwards; pointer-events: none; }
.overlay.is-closing .modal { animation: modalOut .18s ease-in forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal .btn-ghost { color: var(--text); border-color: rgba(22,33,62,.35); }
.modal .btn-ghost:hover { background: rgba(22,33,62,.06); }
.lobby .lslot select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid #cfd6e4; background: #fff; color: var(--text); }
.overlay.is-side { place-items: center end; padding-right: 400px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 100px); overflow: auto; background: var(--paper); color: var(--text); border-radius: 20px; box-shadow: var(--shadow); animation: modalIn .35s cubic-bezier(.2,1.1,.3,1); position: relative; }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.modal .m-band { padding: 18px 22px 14px; color: #fff; background: var(--gc, var(--navy)); border-radius: 20px 20px 0 0; }
.modal .m-band .kicker { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; opacity: .85; font-weight: 700; }
.modal .m-band h2 { margin: 4px 0 0; font-size: 26px; line-height: 1.15; }
.modal .m-body { padding: 18px 22px; font-size: 16px; line-height: 1.5; }
.modal .m-body p { margin: 0 0 10px; }
.modal .m-body .tip { background: #fff5d6; border-left: 4px solid var(--gold); padding: 8px 12px; border-radius: 8px; font-size: 14px; margin-top: 8px; }
.modal .m-body .price-row { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin: 10px 0; background: #eef1f6; padding: 10px 12px; border-radius: 10px; }
.modal .m-body .price-row b { font-size: 20px; }
.modal .m-body .fees { font-size: 13.5px; color: var(--muted); }
.modal .m-actions { padding: 0 22px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal .m-actions .btn { min-width: 150px; }
.modal .m-for { position: absolute; top: 10px; right: 14px; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.35); color: #fff; padding: 4px 10px 4px 4px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.modal .m-for .avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--c); display: grid; place-items: center; }
.modal .m-for .avatar svg { width: 15px; height: 15px; color: #fff; }
.modal .waiting { font-size: 14px; color: var(--muted); font-style: italic; }

/* carte chance / événement */
.modal.card-modal { width: min(520px, 100%); }
.modal.card-modal .m-band { background: linear-gradient(135deg, #ffb703, #f59e0b); color: #3b2300; }
.modal.card-modal.event .m-band { background: linear-gradient(135deg, #2f6fdb, #1d4ed8); color: #fff; }
.modal.card-modal .m-body { font-size: 19px; line-height: 1.45; }
.modal.card-modal .effect { display: inline-block; margin-top: 8px; padding: 6px 12px; border-radius: 8px; background: #eef1f6; font-weight: 800; font-size: 16px; }

/* quiz */
.quiz-options { display: grid; gap: 8px; margin-top: 8px; }
.quiz-option { text-align: left; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 2px solid #d5dbe7; background: #fff; cursor: pointer; color: var(--text); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.quiz-option .letter { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; }
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: #f0faff; }
.quiz-option { transition: border-color .25s, background .25s, transform .25s; }
.quiz-option.is-right { border-color: var(--ok); background: #e9f9ee; transform: scale(1.03); animation: pop .4s ease; }
.quiz-option.is-wrong { border-color: var(--danger); background: #fde8ea; animation: shake .35s ease; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.quiz-option:disabled { cursor: default; opacity: .9; }
.quiz-result { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 700; }
.quiz-result.ok { background: #e9f9ee; color: #1e6b36; }
.quiz-result.ko { background: #fde8ea; color: #a11e28; }

/* fin de partie */
.modal.end-modal { width: min(760px, 100%); }
.podium { display: grid; gap: 8px; margin-top: 8px; }
.podium-row { display: grid; grid-template-columns: 44px 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: #fff; border: 2px solid #e6e9f0; }
.podium-row.rank-1 { border-color: var(--gold); background: #fff9e6; transform: scale(1.02); }
.podium-row .rank { font-size: 26px; font-weight: 900; text-align: center; }
.podium-row .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--c); display: grid; place-items: center; color: #fff; }
.podium-row .avatar svg { width: 22px; height: 22px; }
.podium-row .who { font-weight: 800; font-size: 18px; }
.podium-row .detail { font-size: 13px; color: var(--muted); }
.podium-row .score { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 800; text-align: right; display: grid; line-height: 1.1; }
.podium-row .score b { font-size: 26px; color: #1e6b36; }
.podium-row .score small { font-size: 12px; color: var(--muted); font-weight: 600; }
.confetti { position: fixed; top: -12px; width: 10px; height: 16px; z-index: 30; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .8; } }

/* règles / infos */
.rules-list { padding-left: 20px; margin: 0; }
.rules-list li { margin-bottom: 6px; }
.menu-list { display: grid; gap: 8px; }
.menu-list .btn { width: 100%; text-align: left; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: rgba(0,0,0,.75); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 16px; animation: toastIn .3s ease, toastOut .4s ease 2.6s forwards; box-shadow: var(--shadow); border-left: 5px solid var(--c, var(--accent)); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* lobby en ligne (dans l'écran de jeu, avant démarrage) */
.lobby { width: min(900px, 100%); }
.lobby .slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0; }
.lobby .lslot { border-radius: 14px; padding: 12px; background: #fff; border: 2px solid #e6e9f0; border-top: 8px solid var(--c); display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.lobby .lslot.is-mine { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,163,224,.2); }
.lobby .lslot .who { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.lobby .lslot .st { font-size: 12.5px; color: var(--muted); }
.lobby .lslot input { font: inherit; font-size: 15px; padding: 6px 8px; border-radius: 8px; border: 1px solid #cfd6e4; width: 100%; }
.lobby .lslot .btn { font-size: 13px; padding: 8px 10px; }
.lobby .big-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 54px; letter-spacing: .3em; font-weight: 800; color: var(--navy); text-align: center; background: #eef1f6; border-radius: 14px; padding: 8px; margin: 6px 0 4px; }
.lobby .lobby-opts { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 10px 0; font-size: 15px; }
.lobby .lobby-opts label { display: inline-flex; align-items: center; gap: 6px; }
.lobby .lobby-opts input[type=number] { width: 70px; font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid #cfd6e4; }

/* ==========================================================================
   Vue de dessus, textes droits, responsive
   ========================================================================== */
#app.view-top { --tilt: 0deg; }
#app.upright .square .face { --rot: 0deg !important; }
@media (max-width: 1100px) {
  #stage { grid-template-columns: 1fr calc(300px * var(--hud)); }
  .roster { grid-template-columns: repeat(2, 1fr); }
  .overlay.is-side { padding-right: 320px; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  #screen-game { position: static; min-height: 100vh; }
  #stage { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .scene { min-height: 60vh; }
  #panel { border-left: 0; border-top: 1px solid var(--panel-border); }
  .overlay { position: fixed; }
  .overlay.is-side { padding-right: 20px; place-items: center; }
  .mode-cards, .roster, .lobby .slots, .advanced { grid-template-columns: 1fr; }
  .mode-card { grid-template-columns: 44px 1fr; }
  .dock { min-width: 0; width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .world, .pawn, .pawn-shadow { transition: none; }
  .btn-pulse { animation: none; }
}

/* caméra centrée sur le pion */
#app.view-follow .scene { perspective: 2400px; perspective-origin: 50% 45%; }
.cam-badge { position: absolute; left: 14px; top: 12px; z-index: 6; display: flex; gap: 6px; }
.cam-badge .btn { padding: 8px 12px; font-size: 13px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.2); }
.cam-badge .btn.is-on { background: rgba(0,163,224,.55); border-color: var(--accent); }
.spectator-banner { position: absolute; right: 14px; top: 12px; z-index: 6; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.2); padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; letter-spacing: .05em; }

/* ==========================================================================
   Rendu WebGL (Three.js) et effets 2D projetés
   ========================================================================== */
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#gl:active { cursor: grabbing; }
#app.render-3d .scene::before { display: none; }
.scene::before { content: ""; position: absolute; inset: -20%; pointer-events: none; z-index: 0;
  background: radial-gradient(45% 40% at 30% 30%, rgba(0,163,224,.22), transparent 70%), radial-gradient(40% 35% at 75% 70%, rgba(242,193,78,.12), transparent 70%);
  animation: ambient 18s ease-in-out infinite alternate; }
@keyframes ambient { from { transform: translate(-3%, -2%) scale(1); } to { transform: translate(3%, 3%) scale(1.08); } }
.fx2d { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.float2d { position: absolute; transform: translate(-50%, -100%); font-weight: 900; font-size: clamp(22px, 2.6vw, 40px); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 14px rgba(0,0,0,.6); animation: floatUp2d 1.5s cubic-bezier(.2,.8,.3,1) forwards; white-space: nowrap; font-family: var(--font-display); letter-spacing: .02em; will-change: transform, opacity; }
.float2d.plus { color: #7dffb0; }
.float2d.minus { color: #ff8a8a; }
@keyframes floatUp2d { 0% { opacity: 0; transform: translate(-50%, -100%) translateY(10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -100%) scale(1.06); } 100% { opacity: 0; transform: translate(-50%, -100%) translateY(-90px); } }
.flash2d { position: absolute; inset: 0; opacity: .35; animation: flashOut .7s ease-out forwards; }
@keyframes flashOut { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .timer.is-critical { animation: none; outline: 3px solid #ff6b6b; }
}

/* musique d'ambiance */
.music-pill { position: fixed; right: 18px; top: 16px; z-index: 5; border: 1px solid rgba(255,255,255,.2); background: rgba(6,16,40,.6); color: #fff; border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 13.5px; cursor: pointer; backdrop-filter: blur(10px); transition: background .15s; }
.music-pill:hover { background: rgba(0,163,224,.35); }
.music-pill.is-off { opacity: .7; }
/* « en attente » : le navigateur exige un geste avant d'autoriser le son — la pastille appelle le clic */
.music-pill.is-waiting { border-color: rgba(0,163,224,.65); background: rgba(0,163,224,.28); animation: musicWait 2.2s ease-in-out infinite; }
@keyframes musicWait { 0%, 100% { box-shadow: 0 0 0 0 rgba(0,163,224,.45); } 50% { box-shadow: 0 0 0 7px rgba(0,163,224,0); } }
.setup-form input[type=range] { min-width: 160px; accent-color: var(--accent); }

.chip-static { cursor: default; }
.team-card .money.losses { color: #ffd2d2; }
.team-card .money.losses small { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-right: 4px; font-family: var(--font); }

/* ---------- Tutoriel cinématique ---------- */
.tutorial #topbar, .tutorial #panel, .tutorial #action-bar, .tutorial #banner, .tutorial .cam-badge { display: none !important; }
.tutorial #stage { grid-template-columns: 1fr; }
.tutorial #scene { cursor: default; }
.tut-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.tut-controls { position: absolute; right: 18px; bottom: 14px; z-index: 8; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 999px; background: rgba(5,9,26,.7); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(10px); animation: dockIn .5s ease; }
.tut-controls button { appearance: none; border: 0; background: rgba(255,255,255,.1); color: #fff; font: 700 15px var(--font-body, inherit); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; transition: background .15s, transform .15s; }
.tut-controls button:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); }
.tut-controls button.is-on { background: #00a3e0; }
.tut-controls button.is-rec { background: #e63946; animation: recPulse 1s ease-in-out infinite; }
.tut-controls .tut-chapters { display: flex; gap: 4px; margin: 0 6px; }
.tut-controls .tut-chapters button { width: auto; height: 30px; padding: 0 10px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.08); white-space: nowrap; }
.tut-controls .tut-quit { width: auto; padding: 0 14px; border-radius: 999px; background: rgba(230,57,70,.85); }
@keyframes recPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,.6); } 50% { box-shadow: 0 0 0 8px rgba(230,57,70,0); } }
.btn-tutorial { border-color: rgba(0,163,224,.55) !important; }
@media (max-width: 900px) { .tut-controls .tut-chapters { display: none; } }

/* ---------- Grand écran (vidéoprojecteur) : échelle du HUD ---------- */
:root { --hud: 1; }
#app.big-ui { --hud: 1.3; }
#stage { grid-template-columns: 1fr calc(360px * var(--hud)); }
.team-card .name { font-size: calc(15px * var(--hud)); }
.team-card .money { font-size: calc(19px * var(--hud)); }
.team-card .tag { font-size: calc(11px * var(--hud)); }
.team-card .sub { font-size: calc(13px * var(--hud)); color: rgba(255,255,255,.85); }
.team-card .money.losses small { font-size: calc(11px * var(--hud)); color: rgba(255,255,255,.75); }
.log { font-size: calc(14px * var(--hud)); }
.dock .status, .turn-indicator { font-size: calc(16px * var(--hud)); }
.cam-badge .btn, .spectator-banner { font-size: calc(14px * var(--hud)); }
.section-hint, .hero-event, .setup-footer { color: rgba(255,255,255,.8); }
.section-hint, .setup-footer { font-size: 13.5px; }
/* ---------- Pause visible pour toute la salle ---------- */
#app.is-paused .scene::after { content: "⏸  PAUSE"; position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; font: 900 clamp(48px, 8vw, 110px)/1 var(--font-display); letter-spacing: .1em; color: #fff; background: rgba(3,10,30,.45); backdrop-filter: blur(2px); }
#app.is-paused .dock .btn { pointer-events: none; opacity: .5; }
