@font-face {
  font-family: 'Lilita One';
  src: url(fonts/lilita-one.woff2) format('woff2');
  font-display: swap;
}
:root {
  --bg: #1a1230;
  --panel: #2b2050;
  --panel2: #3a2c68;
  --edge: #0e0920;
  --line: rgba(255, 255, 255, .1);
  --ink: #f6f0e4;
  --ink2: #b3a8d3;
  --chips: #3f8cff;
  --mult: #ff4458;
  --x: #ff9a3d;
  --gold: #ffc93c;
  --green: #3ddc97;
  --die: #fbf3e2;
  --pip: #22183c;
  --felt: #1d6b55;
  --felt2: #134a3b;
  --wood: #7a4724;
  --wood2: #4e2b14;
  --game: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); overflow-x: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .045) 1px, transparent 0) 0 0 / 14px 14px,
    radial-gradient(ellipse 130% 70% at 50% 0%, #3d2b72 0%, var(--bg) 70%) no-repeat,
    var(--bg);
  font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
#app {
  max-width: 520px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 8px) 14px calc(env(safe-area-inset-bottom) + 14px);
}
h2, h3 { margin: 0; font-family: var(--game); font-weight: 400; letter-spacing: .02em; }
.muted { color: var(--ink2); }
.gold { color: var(--gold); }
.c { color: var(--chips); font-style: normal; font-weight: 800; }
.m { color: var(--mult); font-style: normal; font-weight: 800; }

/* panneau « de jeu » : bord sombre épais + ombre dure */
.panel, .blind-card, .item, .tile, .relic:not(.empty), .money, .icon-btn {
  border: 3px solid var(--edge); box-shadow: 0 4px 0 var(--edge);
}
.panel { background: var(--panel); border-radius: 18px; }

/* ---------- Boutons ---------- */
.btn {
  display: block; width: 100%; border: 3px solid var(--edge); border-radius: 16px; padding: 12px 16px;
  font-family: var(--game); font-size: 21px; letter-spacing: .03em; background: var(--panel2);
  box-shadow: 0 5px 0 var(--edge), inset 0 3px 0 rgba(255, 255, 255, .18);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3); transition: transform .06s, box-shadow .06s;
}
.btn small { font-size: 15px; opacity: .9; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge), inset 0 3px 0 rgba(255, 255, 255, .18); }
.btn.primary { background: linear-gradient(#ff6f5e, #e23a4b); }
.btn.blue { background: linear-gradient(#56a2ff, #2c6ad8); }
.btn.gold { background: linear-gradient(#ffd866, #eba21c); color: #3a2600; text-shadow: none; }
.btn.ghost { background: rgba(255, 255, 255, .04); box-shadow: 0 3px 0 var(--edge); font-size: 18px; }
.btn.slim { padding: 8px; font-size: 17px; }
.btn.big { padding: 15px; font-size: 25px; }
.btn:disabled { filter: saturate(.3) brightness(.7); cursor: default; }
.btn + .btn { margin-top: 12px; }
.icon-btn { background: var(--panel); border-radius: 12px; width: 42px; height: 42px; font-size: 18px; padding: 0; }

/* ---------- Barre du haut ---------- */
.top { display: flex; align-items: center; gap: 10px; }
.ante { flex: 1; font-family: var(--game); font-size: 17px; color: var(--ink2); letter-spacing: .03em; }
.ante b { color: var(--ink); font-size: 26px; font-weight: 400; }
.ante .inf { color: var(--gold); }
.money { background: var(--panel); border-radius: 12px; padding: 4px 12px; font-family: var(--game); color: var(--gold); font-size: 24px; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }

/* ---------- Écran titre ---------- */
.title-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 26px; text-align: center; }
.logo h1 {
  font-family: var(--game); font-weight: 400; font-size: 68px; letter-spacing: .06em; margin: 16px 0 4px; line-height: 1;
  color: var(--gold); -webkit-text-stroke: 3px var(--edge); paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--edge), 0 0 30px rgba(255, 201, 60, .35);
}
.logo p { color: var(--ink2); margin: 0; font-size: 16px; }
.logo-dice { display: flex; justify-content: center; gap: 12px; }
.logo-dice .die { animation: idle 3s ease-in-out infinite; }
.logo-dice .die:nth-child(1) { --r: -12deg; }
.logo-dice .die:nth-child(2) { --r: 4deg; animation-delay: -1s; }
.logo-dice .die:nth-child(3) { --r: 12deg; animation-delay: -2s; }
@keyframes idle { 0%, 100% { transform: rotate(var(--r)) translateY(0); } 50% { transform: rotate(var(--r)) translateY(-8px); } }
.menu { display: flex; flex-direction: column; }
.record { color: var(--gold); margin: 0; font-family: var(--game); font-size: 18px; letter-spacing: .03em; }
.version { color: var(--ink2); font-size: 12px; margin: 0; opacity: .6; }

/* ---------- Dés ---------- */
.dice { display: flex; justify-content: space-between; gap: 6px; }
.dice.small { justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.die {
  --s: min(16.5vw, 62px);
  display: block; position: relative; width: var(--s); height: var(--s); flex: none; padding: 0;
  border: 0; border-radius: 22%;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .7), 0 5px 0 rgba(0, 0, 0, .4);
  transition: transform .14s, opacity .15s, box-shadow .12s, filter .15s;
}
.dice.small .die { --s: 46px; }
.die.mini { --s: 50px; }
.face { position: absolute; inset: 12%; display: flex; align-items: center; justify-content: center; }
.pips { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 100%; height: 100%; }
.pips i { display: block; margin: auto; width: 64%; height: 64%; border-radius: 50%; }
.pips i.on { background: var(--pip); box-shadow: inset 0 2px 0 rgba(0, 0, 0, .35); }
.face .q { font-family: var(--game); font-size: calc(var(--s) * .5); color: rgba(34, 24, 60, .25); }
.face .star { font-size: calc(var(--s) * .62); color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.badge { position: absolute; top: -7px; right: -7px; font-size: 13px; line-height: 1; background: var(--edge); border-radius: 99px; padding: 3px 4px; min-width: 21px; color: var(--gold); font-weight: 900; }
.jv { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #3a2600; font-family: var(--game); font-size: 14px; border-radius: 99px; padding: 0 8px; border: 2px solid var(--edge); }

.die.held { transform: translateY(-10px) rotate(-3deg); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .7), 0 0 0 3px var(--gold), 0 14px 8px rgba(0, 0, 0, .45); }
.die.held::after {
  content: 'GARDÉ'; position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%);
  font-family: var(--game); font-size: 12px; letter-spacing: .06em; color: var(--edge);
  background: var(--gold); border-radius: 6px; padding: 0 5px; white-space: nowrap;
}
.die.dim { filter: brightness(.6) saturate(.6); }
.die.scoring { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .7), 0 0 0 3px var(--green), 0 5px 0 rgba(0, 0, 0, .4); }
.die.held.scoring { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .7), 0 0 0 3px var(--gold), 0 0 0 6px var(--green), 0 14px 8px rgba(0, 0, 0, .45); }
.die.rolling { animation: tumble .16s linear infinite; }
@keyframes tumble {
  0% { transform: translate(-3px, -6px) rotate(-25deg); }
  50% { transform: translate(3px, -12px) rotate(30deg); }
  100% { transform: translate(-3px, -6px) rotate(-25deg); }
}
.die.land { animation: land .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes land { 0% { transform: translateY(-14px) scale(1.1) rotate(10deg); } 100% { transform: none; } }
.die.held.land { animation: none; }

/* types de dés : --face colore la face (dé plat) ou les 6 faces (dé 3D) */
.die { background: var(--face, var(--die)); }
.t-lourd { --face: linear-gradient(#d3d6df, #9ba1b2); }
.t-d8 { --face: linear-gradient(#c6f5dd, #7fd6ab); }
.t-d8:not(.d3), .t-d8 .f { clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); border-radius: 8%; }
.t-d8 .badge { display: none; }
.t-verre { --face: linear-gradient(135deg, rgba(205, 232, 255, .95), rgba(120, 170, 240, .7)); }
.t-or { --face: linear-gradient(135deg, #ffe88f, #e1a018); }
.t-rubis { --face: linear-gradient(135deg, #ff8a95, #cf2643); }
.t-saphir { --face: linear-gradient(135deg, #95c4ff, #2c6ad8); }
.t-joker { --face: linear-gradient(135deg, #b77eff, #6939d4); }
.t-pipe:not(.d3), .t-pipe .f { outline: 3px dashed #d0475a; outline-offset: -7px; }
.t-rubis .pips i.on, .t-saphir .pips i.on, .t-joker .pips i.on { background: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }

/* ---------- Dés en 3D (piste de jeu) ---------- */
.die.d3 { background: none; box-shadow: none; perspective: 420px; }
.d3 .cube, .d3 .shadow { pointer-events: none; } /* le toucher arrive toujours au dé (Safari gère mal le 3D) */
.d3 .cube { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(calc(var(--s) / -2)); } /* face avant au niveau de l'écran */
.d3 .f {
  position: absolute; inset: 0; border-radius: 22%; background: var(--face, var(--die));
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .7), inset 0 0 0 1px rgba(0, 0, 0, .08);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.d3 .f-front { transform: translateZ(calc(var(--s) / 2)); }
.d3 .f-back { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.d3 .f-right { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.d3 .f-left { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.d3 .f-top { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.d3 .f-bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.d3 .shadow { position: absolute; left: 6%; right: 6%; bottom: -8px; height: 14px; border-radius: 50%; background: rgba(0, 0, 0, .5); filter: blur(4px); }
/* anneaux « gardé » / « marque » sur la face avant */
.die.d3.held, .die.d3.scoring, .die.d3.held.scoring { box-shadow: none; }
.d3.scoring .f-front { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .7), 0 0 0 3px var(--green); }
.d3.held .f-front { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .7), 0 0 0 3px var(--gold); }
.d3.held.scoring .f-front { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .7), 0 0 0 3px var(--gold), 0 0 0 6px var(--green); }
.d3.held .shadow { transform: scale(.8); opacity: .6; bottom: -18px; }
/* pendant le lancer, les combinaisons ne s'allument qu'une fois les dés posés */
.tiles .tile { transition: opacity .25s, filter .25s, transform .1s; }
.tiles.throwing .tile.avail { opacity: .4; filter: saturate(.4); }
.tile.used { opacity: .3; }
.t-used { position: absolute; top: -9px; right: -6px; font-family: var(--game); font-size: 12px; background: var(--ink2); color: var(--edge); border: 2px solid var(--edge); border-radius: 99px; padding: 0 6px; }

/* ---------- Piste de dés (feutrine + cadre en bois) ---------- */
.tray {
  position: relative; border-radius: 22px; padding: 22px 12px 10px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .06) 1px, transparent 0) 0 0 / 6px 6px,
    radial-gradient(ellipse at 50% 40%, var(--felt), var(--felt2));
  border: 6px solid var(--wood);
  box-shadow: inset 0 6px 16px rgba(0, 0, 0, .55), 0 0 0 3px var(--edge), 0 6px 0 3px var(--edge), inset 0 0 0 2px var(--wood2);
}
.tray-hint { text-align: center; color: rgba(255, 255, 255, .55); font-size: 12px; margin-top: 18px; min-height: 16px; }

/* ---------- Reliques ---------- */
.relics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.relic {
  position: relative; aspect-ratio: 1; max-height: 56px; width: 100%; border-radius: 14px;
  background: linear-gradient(var(--panel2), var(--panel)); font-size: 26px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.relic:not(.empty):nth-child(odd) { transform: rotate(-3deg); }
.relic:not(.empty):nth-child(even) { transform: rotate(3deg); }
.relic.empty { background: rgba(0, 0, 0, .18); border: 2px dashed var(--line); }
.relic.off { filter: grayscale(1); opacity: .35; }
.relic .cnt { position: absolute; bottom: -7px; right: -7px; font-family: var(--game); font-size: 13px; background: var(--mult); border: 2px solid var(--edge); border-radius: 99px; padding: 0 6px; }

/* ---------- Choix des manches ---------- */
.blinds { display: flex; flex-direction: column; gap: 12px; }
.blind-card { background: var(--panel); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.blind-card.current { border-color: var(--gold); box-shadow: 0 4px 0 #8a6510, 0 0 24px rgba(255, 201, 60, .2); }
.blind-card.done, .blind-card.next { opacity: .5; }
.blind-card.boss { background: linear-gradient(135deg, #5a1f45, var(--panel)); }
.blind-card .btn { margin-top: 6px; }
.bc-head { display: flex; align-items: center; gap: 12px; }
.bc-head b { font-family: var(--game); font-weight: 400; font-size: 21px; display: block; letter-spacing: .02em; }
.bc-head small { color: var(--ink2); display: block; }
.bc-row { display: flex; justify-content: space-between; color: var(--ink2); }
.bc-row b { font-family: var(--game); font-weight: 400; font-size: 19px; color: var(--ink); }
.bc-row b.gold { color: var(--gold); }
.bc-done { color: var(--green); font-family: var(--game); font-size: 18px; }
.section-title { color: var(--ink2); font-family: var(--game); font-size: 15px; text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; }
.section-title small { text-transform: none; letter-spacing: 0; font-family: system-ui, sans-serif; font-size: 12px; opacity: .8; }

/* jeton de mise (petite / grande / boss) */
.chip-token, .bc-icon {
  flex: none; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--game); font-size: 24px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  background: var(--chips); border: 3px solid var(--edge);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .85), inset 0 0 0 7px var(--chips), inset 0 0 0 9px rgba(255, 255, 255, .5), 0 3px 0 var(--edge);
}
.chip-token.s1, .bc-icon.s1 { background: #e98b1a; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .85), inset 0 0 0 7px #e98b1a, inset 0 0 0 9px rgba(255, 255, 255, .5), 0 3px 0 var(--edge); }
.chip-token.s2, .bc-icon.s2 { background: #b8285e; font-size: 22px; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .85), inset 0 0 0 7px #b8285e, inset 0 0 0 9px rgba(255, 255, 255, .5), 0 3px 0 var(--edge); }

/* ---------- Partie : tableau de bord ---------- */
.hud { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.hud.boss { background: linear-gradient(135deg, #5a1f45, var(--panel) 70%); }
.hud-top { display: flex; align-items: center; gap: 10px; }
.hud-mid { flex: 1; min-width: 0; }
.stage { font-family: var(--game); font-size: 19px; letter-spacing: .02em; line-height: 1.1; }
.target { color: var(--ink2); font-size: 13px; }
.target b { color: var(--ink); font-family: var(--game); font-weight: 400; font-size: 17px; }
.hud-score { text-align: right; line-height: 1; }
.hud-score small { display: block; color: var(--ink2); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.hud-score b { font-family: var(--game); font-weight: 400; font-size: 34px; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 var(--edge); }
.bar { position: relative; height: 16px; background: rgba(0, 0, 0, .35); border-radius: 99px; overflow: hidden; border: 2px solid var(--edge); }
.bar i, .bar .ghost { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.bar .ghost { background: rgba(255, 255, 255, .28); transition: width .25s ease-out; }
.bar i {
  display: block; background: linear-gradient(var(--green), #22a870); overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35);
}
/* reflet qui défile sur la barre */
.bar i::after {
  content: ''; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: shine 2.4s ease-in-out infinite;
}
@keyframes shine { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(320%); } }
.bar.full i { background: linear-gradient(#ffe27a, #e9a41c); }
.bar.full { border-color: #8a6510; box-shadow: 0 0 14px rgba(255, 201, 60, .6); animation: bar-pop .5s; }
@keyframes bar-pop { 30% { transform: scaleY(1.5); } }
.bar-goal { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-family: var(--game); font-size: 11px; color: rgba(255, 255, 255, .55); text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.calc-row { display: flex; align-items: center; gap: 8px; }
.counter { width: 62px; text-align: center; line-height: 1; background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 5px 0; }
.counter b { display: block; font-family: var(--game); font-weight: 400; font-size: 24px; }
.counter small { color: var(--ink2); font-size: 11px; }
.calc { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; font-family: var(--game); font-size: 28px; font-variant-numeric: tabular-nums; }
.calc .chips, .calc .mult { border-radius: 12px; padding: 1px 10px; min-width: 64px; text-align: center; border: 3px solid var(--edge); box-shadow: 0 3px 0 var(--edge), inset 0 3px 0 rgba(255, 255, 255, .25); text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.calc .chips { background: var(--chips); }
.calc .mult { background: var(--mult); }
.calc .x { color: var(--ink2); font-size: 22px; }
.calc.total .sum { color: var(--gold); font-size: 38px; -webkit-text-stroke: 2px var(--edge); paint-order: stroke fill; text-shadow: 0 3px 0 var(--edge); animation: pop .35s cubic-bezier(.3, 1.8, .5, 1); }
.boss-rule { background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 700; text-align: center; color: #ffb3cc; }

/* ---------- Combinaisons en tuiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(62px, 92px); gap: 10px 8px; flex: 1; align-content: center; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 62px; padding: 6px 4px; border-radius: 14px; background: var(--panel);
  opacity: .4; filter: saturate(.4); transition: transform .1s, opacity .15s;
}
.tile.avail { opacity: 1; filter: none; background: linear-gradient(var(--panel2), var(--panel)); }
.tile.avail:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.tile.sel { border-color: var(--gold); background: linear-gradient(#5b4290, #3a2c68); transform: translateY(-3px); box-shadow: 0 7px 0 #8a6510, 0 0 18px rgba(255, 201, 60, .35); }
.tile.banned { opacity: .25; }
.t-name { font-family: var(--game); font-size: 16px; letter-spacing: .02em; line-height: 1; text-align: center; }
.t-cm { display: flex; gap: 3px; font-family: var(--game); font-size: 13px; }
.t-cm i { font-style: normal; border-radius: 6px; padding: 0 6px; }
.t-cm .pc { background: var(--chips); }
.t-cm .pm { background: var(--mult); }
.t-lvl { position: absolute; top: -8px; left: -6px; font-family: var(--game); font-size: 12px; color: var(--edge); background: var(--gold); border: 2px solid var(--edge); border-radius: 99px; padding: 0 6px; }
.t-lvl::before { content: 'niv '; font-size: 10px; }
.t-pred { position: absolute; top: -9px; right: -6px; font-family: var(--game); font-size: 13px; background: var(--green); color: var(--edge); border: 2px solid var(--edge); border-radius: 99px; padding: 0 6px; }
.t-ban { position: absolute; top: -9px; right: -6px; font-size: 14px; }

.actions { display: flex; gap: 10px; }
.actions .btn { margin: 0; }
.actions .btn small { display: block; font-size: 13px; line-height: 1; margin-top: 1px; }
.actions .btn.blue small { display: inline; font-size: 18px; background: rgba(0, 0, 0, .25); border-radius: 99px; padding: 0 8px; margin-left: 4px; }

/* ---------- Animations de score ---------- */
.bump { animation: bump .25s; }
@keyframes bump { 0% { scale: 1; } 40% { scale: 1.2; rotate: -5deg; } 100% { scale: 1; } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.shake { animation: shake .45s; }
@keyframes shake {
  0%, 100% { transform: none; } 15% { transform: translate(-6px, 3px) rotate(-1deg); } 30% { transform: translate(6px, -3px) rotate(1deg); }
  45% { transform: translate(-4px, 2px); } 60% { transform: translate(4px, -2px); } 80% { transform: translate(-2px, 1px); }
}
.float {
  position: fixed; z-index: 40; transform: translate(-50%, -100%); pointer-events: none;
  font-family: var(--game); font-size: 19px; padding: 0 9px; border-radius: 9px; white-space: nowrap;
  border: 2px solid var(--edge); background: var(--panel2); animation: float .9s ease-out forwards;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
.float.fc { background: var(--chips); }
.float.fm { background: var(--mult); }
.float.fx { background: var(--x); }
.float.fg { background: var(--gold); color: #3a2600; text-shadow: none; }
@keyframes float { 0% { opacity: 0; margin-top: 6px; scale: .6; } 15% { opacity: 1; scale: 1.1; } 30% { scale: 1; } 100% { opacity: 0; margin-top: -30px; } }

/* ---------- Gains, fin de partie ---------- */
.panel.center { text-align: center; padding: 22px 18px; margin: auto 0; display: flex; flex-direction: column; gap: 12px; }
.panel.center h2 { font-size: 32px; color: var(--gold); -webkit-text-stroke: 2px var(--edge); paint-order: stroke fill; text-shadow: 0 4px 0 var(--edge); }
.big-emoji { font-size: 56px; animation: pop .4s cubic-bezier(.3, 1.8, .5, 1); }
.lines { display: flex; flex-direction: column; gap: 6px; text-align: left; margin: 6px 0; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(0, 0, 0, .25); border-radius: 12px; }
.line b { font-family: var(--game); font-weight: 400; font-size: 19px; }
.panel .btn + .btn { margin-top: 0; }

/* ---------- Boutique ---------- */
.shop-title { font-family: var(--game); font-weight: 400; font-size: 38px; color: var(--gold); -webkit-text-stroke: 2px var(--edge); paint-order: stroke fill; text-shadow: 0 4px 0 var(--edge); margin: 0; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: linear-gradient(var(--panel2), var(--panel)); border-radius: 16px; padding: 10px 12px;
}
.item:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.item.sold { justify-content: center; color: var(--ink2); opacity: .5; box-shadow: none; border: 2px dashed var(--line); background: transparent; font-family: var(--game); font-size: 17px; padding: 16px; }
.item-icon { font-size: 32px; flex: none; width: 52px; text-align: center; display: flex; justify-content: center; }
.item-text { flex: 1; min-width: 0; }
.item-text b { display: block; font-family: var(--game); font-weight: 400; font-size: 18px; letter-spacing: .02em; }
.item-text small { color: var(--ink2); display: block; font-size: 13px; }
.price { font-family: var(--game); font-size: 20px; color: var(--edge); background: var(--gold); border: 2px solid var(--edge); border-radius: 12px; padding: 2px 10px; flex: none; }
.price.poor { color: var(--ink2); background: rgba(0, 0, 0, .3); }
.sticky-bottom { position: sticky; bottom: 0; margin: 8px -14px 0; padding: 14px 14px calc(env(safe-area-inset-bottom) + 8px); background: linear-gradient(transparent, var(--bg) 35%); }
#app:has(.sticky-bottom) { padding-bottom: 0; }

/* ---------- Feuille du bas ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(8, 4, 18, .65); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet-card {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow: auto; background: var(--panel);
  border: 3px solid var(--edge); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(env(safe-area-inset-bottom) + 18px); animation: up .2s ease-out;
}
.sheet-card h3 { font-size: 26px; margin-bottom: 10px; color: var(--gold); }
.sheet-card p { margin: 0 0 12px; color: var(--ink); -webkit-user-select: text; user-select: text; }
.sheet-card .dice.small { margin-bottom: 14px; }
.sheet-card .warn { color: var(--mult); font-weight: 700; }
.info-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.info-head h3 { margin: 0; }
.info-icon { font-size: 40px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.ctable { width: 100%; border-collapse: collapse; margin: 6px 0 16px; }
.ctable td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ctable td b { font-family: var(--game); font-weight: 400; font-size: 17px; }
.ctable td small { color: var(--gold); font-weight: 800; }
.ctable .hint2 { display: block; color: var(--ink2); font-weight: 400; font-size: 12px; }
.ctable .cb { text-align: right; white-space: nowrap; font-family: var(--game); }
.ctable .cb i { font-style: normal; }
.ctable .c { color: var(--chips); }
.ctable .m { color: var(--mult); }

/* interrupteurs des options */
.toggle { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: rgba(0, 0, 0, .2); border: 0; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.toggle > span:first-child { flex: 1; }
.toggle b { display: block; font-family: var(--game); font-weight: 400; font-size: 18px; }
.toggle small { color: var(--ink2); font-size: 13px; }
.sw { flex: none; width: 52px; height: 30px; border-radius: 99px; background: rgba(255, 255, 255, .15); position: relative; border: 2px solid var(--edge); transition: background .15s; }
.sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw.on { background: var(--green); }
.sw.on::after { transform: translateX(22px); }

/* ---------- Message ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--edge); font-family: var(--game); font-size: 17px; padding: 8px 16px; border-radius: 14px;
  border: 3px solid var(--edge); width: max-content; max-width: calc(100vw - 32px); animation: up .2s;
}

/* ---------- Mise à jour ---------- */
.update {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; width: max-content; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--edge); border: 3px solid var(--edge); border-radius: 99px; font-size: 14px; font-weight: 700;
}
.update button { font-weight: 800; border: 0; border-radius: 99px; padding: 6px 12px; background: var(--mult); color: #fff; }

/* ---------- Bandeau d'installation (écran titre uniquement : en jeu il cacherait les dés) ---------- */
.install {
  position: fixed; left: 12px; right: 12px; z-index: 15; bottom: calc(env(safe-area-inset-bottom) + 12px);
  max-width: 496px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 10px 10px; border-radius: 16px; background: var(--panel2); border: 3px solid var(--edge);
  box-shadow: 0 4px 0 var(--edge);
}
body:not([data-screen="title"]) .install { display: none !important; }
.install img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install-text { flex: 1; min-width: 0; font-size: 13px; color: var(--ink2); line-height: 1.3; }
.install-text > b { display: block; font-size: 15px; color: var(--ink); }
.install-btn { border: 0; border-radius: 10px; padding: 8px 12px; background: var(--mult); font-weight: 800; flex: none; }
.install-close { background: none; border: 0; color: var(--ink2); font-size: 18px; padding: 6px; flex: none; }
body.has-install[data-screen="title"] #app { padding-bottom: 96px; }
.share-ico { width: 16px; height: 16px; vertical-align: -3px; color: var(--gold); }

/* ---------- Explications : pastilles points / multiplicateur ---------- */
.tk { display: inline-block; font-family: var(--game); font-weight: 400; font-size: .95em; line-height: 1.25; border-radius: 7px; padding: 0 6px; color: #fff; border: 2px solid var(--edge); text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.tk.tp { background: var(--chips); }
.tk.tm { background: var(--mult); }
.tk.tx { background: var(--x); }
.item-text .desc { display: block; color: var(--ink2); font-size: 13px; line-height: 1.45; }
.ex { display: block; margin-top: 4px; font-size: 12px; color: var(--ink2); opacity: .85; font-style: italic; }
.item-text .ex { font-size: 12px; }
.sheet-card .ex { font-size: 14px; }
.ex-box { background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 10px 12px; }
.kinds { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.kinds .tk { min-width: 42px; text-align: center; margin-right: 6px; }
.legend { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; width: 100%; background: rgba(0, 0, 0, .25); border: 2px solid var(--edge); border-radius: 14px; padding: 8px 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.legend .q, .calc-cap::after { font-family: var(--game); }
.legend .q { width: 22px; height: 22px; border-radius: 50%; background: var(--panel2); border: 2px solid var(--edge); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.calc-wrap { flex: 1; cursor: pointer; }
.calc-cap { display: flex; justify-content: center; gap: 30px; font-size: 10px; color: var(--ink2); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.calc-cap span { width: 92px; text-align: center; }
.calc-cap span:first-child { color: #8fb9ff; }
.calc-cap span:last-child { color: #ff9aa6; }
.item-text b.tk { display: inline-block; font-size: 13px; letter-spacing: 0; }
.item-text .ex { font-size: 11.5px; }
.small-print { font-size: 12px; margin: 4px 2px 14px !important; }

/* ---------- Reliques sur les tuiles ---------- */
.t-rel { position: absolute; bottom: -9px; right: -4px; font-size: 13px; line-height: 1; background: var(--edge); border-radius: 99px; padding: 3px 5px; letter-spacing: 1px; }

/* ---------- Tutoriel ---------- */
.tip {
  position: absolute; left: 14px; right: 14px; max-width: 492px; margin: 0 auto; z-index: 28;
  background: var(--ink); color: var(--edge); border: 3px solid var(--edge); border-radius: 16px;
  padding: 12px 14px 10px; box-shadow: 0 6px 0 var(--edge), 0 10px 30px rgba(0, 0, 0, .5);
  font-size: 15px; line-height: 1.4; animation: tip-in .25s cubic-bezier(.3, 1.6, .5, 1);
}
.tip::after { content: ''; position: absolute; left: calc(var(--ax, 50%) - 9px); width: 14px; height: 14px; background: var(--ink); border: 3px solid var(--edge); transform: rotate(45deg); }
.tip.above::after { bottom: -10px; border-top: 0; border-left: 0; }
.tip.below::after { top: -10px; border-bottom: 0; border-right: 0; }
.tip .tk { font-size: 13px; }
.tip-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 10px; }
.tip-actions button { background: none; border: 0; color: #6d6488; font-size: 12px; padding: 4px 0; text-decoration: underline; }
.tip-actions button.ok { margin-left: auto; text-decoration: none; font-family: var(--game); font-size: 17px; color: #fff; background: var(--mult); border: 2px solid var(--edge); border-radius: 10px; padding: 3px 14px; box-shadow: 0 3px 0 var(--edge); }
@keyframes tip-in { from { opacity: 0; transform: scale(.9); } }
.tuto-target { animation: tuto-pulse 1.4s ease-in-out infinite; border-radius: 18px; }
@keyframes tuto-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 201, 60, .0); } 50% { box-shadow: 0 0 0 6px rgba(255, 201, 60, .75); } }
.btn.tuto-target { animation: tuto-pulse-btn 1.4s ease-in-out infinite; }
@keyframes tuto-pulse-btn { 0%, 100% { box-shadow: 0 5px 0 var(--edge), 0 0 0 0 rgba(255, 201, 60, 0); } 50% { box-shadow: 0 5px 0 var(--edge), 0 0 0 6px rgba(255, 201, 60, .8); } }

/* ---------- Boutique : un étal de marchand ---------- */
.stall {
  position: relative; margin-top: 30px; padding: 46px 12px 0; border-radius: 0 0 18px 18px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 46px),
    linear-gradient(#5a3418, #3f230f);
  border: 3px solid var(--edge); border-top: 0; box-shadow: 0 5px 0 var(--edge), inset 0 0 30px rgba(0, 0, 0, .45);
}
/* auvent rayé à festons */
.awning {
  position: absolute; left: -10px; right: -10px; top: -30px; height: 46px; z-index: 2;
  background: repeating-linear-gradient(90deg, #e23a4b 0 30px, #f6efe0 30px 60px);
  border: 3px solid var(--edge); border-radius: 12px 12px 4px 4px; box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
}
.awning::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -15px; height: 15px;
  background: radial-gradient(circle at 15px 0, #e23a4b 13px, transparent 14px) 0 0 / 60px 15px repeat-x,
              radial-gradient(circle at 45px 0, #f6efe0 13px, transparent 14px) 0 0 / 60px 15px repeat-x;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3));
}
.sign {
  position: absolute; top: -48px; left: 50%; transform: translateX(-50%) rotate(-2deg); z-index: 3;
  font-family: var(--game); font-size: 26px; letter-spacing: .06em; color: var(--gold);
  background: linear-gradient(#8a5528, #6a3d1b); border: 3px solid var(--edge); border-radius: 10px; padding: 0 18px;
  box-shadow: 0 4px 0 var(--edge); text-shadow: 0 2px 0 var(--edge); white-space: nowrap;
}
.keeper { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.keeper-face { font-size: 34px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .4)); animation: idle 3s ease-in-out infinite; --r: 0deg; }
.keeper-say { position: relative; background: var(--ink); color: var(--edge); font-weight: 700; font-size: 13px; border: 2px solid var(--edge); border-radius: 12px; padding: 5px 10px; }
.keeper-say::before { content: ''; position: absolute; left: -7px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-right-color: var(--edge); border-left: 0; }

.shelf { position: relative; margin-bottom: 14px; }
.shelf-label { font-family: var(--game); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: #e9c79a; margin: 0 0 6px 2px; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.shelf-label small { font-family: system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 12px; opacity: .8; }
.shelf-row { display: flex; justify-content: center; gap: 10px; align-items: flex-end; padding: 0 4px; position: relative; z-index: 1; }
.shelf-row > * { width: calc((100% - 20px) / 3); flex: none; }
.plank {
  height: 14px; margin: -4px -6px 0; border-radius: 4px; position: relative;
  background: linear-gradient(#b07a43, #7c4f26); border: 3px solid var(--edge); box-shadow: 0 6px 0 rgba(0, 0, 0, .35);
}
/* les articles, posés debout sur l'étagère comme des cartes */
.ware {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px;
  min-height: 124px; padding: 10px 6px 24px; border-radius: 12px; text-align: center;
  background: linear-gradient(#f8f0de, #e8dcc0); color: var(--edge);
  border: 3px solid var(--edge); box-shadow: 0 4px 0 rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .5);
  transition: transform .12s;
}
.ware:nth-child(odd) { transform: rotate(-1.5deg); }
.ware:nth-child(even) { transform: rotate(1.5deg); }
.ware:active { transform: translateY(-4px) scale(1.04); }
.w-relic { background: linear-gradient(#f3e3ff, #d8bff2); }
.w-book { background: linear-gradient(#ffe2dc, #f0bdb2); }
.w-upg { background: linear-gradient(#dff5e8, #b6e2c8); }
.ware-icon { font-size: 34px; line-height: 1; height: 50px; display: flex; align-items: center; justify-content: center; }
.ware-icon .die.mini { --s: 44px; }
.ware-name { font-family: var(--game); font-size: 15px; line-height: 1.05; letter-spacing: .01em; hyphens: auto; overflow-wrap: anywhere; }
.ware-tag { font-family: var(--game); font-size: 11px; background: var(--gold); border: 2px solid var(--edge); border-radius: 99px; padding: 0 6px; }
/* étiquette de prix accrochée par une ficelle */
.price-tag {
  position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%) rotate(-4deg);
  font-family: var(--game); font-size: 17px; color: var(--edge); background: var(--gold);
  border: 2px solid var(--edge); border-radius: 6px 12px 12px 6px; padding: 0 9px 0 13px; box-shadow: 0 2px 0 var(--edge);
  white-space: nowrap; line-height: 1.3;
}
.price-tag::before { content: ''; position: absolute; left: 4px; top: 50%; margin-top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--edge); }
.price-tag.poor { background: #b9b0c9; }
.ware.sold { background: rgba(0, 0, 0, .25); border: 2px dashed rgba(255, 255, 255, .2); box-shadow: none; min-height: 118px; justify-content: center; transform: none; }
.ware.sold span { font-family: var(--game); color: rgba(255, 255, 255, .35); font-size: 15px; transform: rotate(-12deg); }
/* comptoir : sonnette pour renouveler, caisse */
.counter-top {
  display: flex; align-items: center; gap: 10px; margin: 4px -12px 0; padding: 12px;
  background: linear-gradient(#a8743e, #8a5a2b); border-top: 3px solid var(--edge); border-radius: 0 0 15px 15px;
}
.bell { flex: 1; font-family: var(--game); font-size: 17px; background: var(--panel2); color: var(--ink); border: 3px solid var(--edge); border-radius: 12px; padding: 7px 10px; box-shadow: 0 3px 0 var(--edge); }
.bell small { font-size: 14px; color: var(--gold); }
.bell:active { transform: translateY(3px); box-shadow: none; }
.till { font-family: var(--game); font-size: 22px; color: var(--gold); background: var(--edge); border-radius: 10px; padding: 3px 12px; text-shadow: 0 0 8px rgba(255, 201, 60, .5); }
.stall + .legend { margin-top: 6px; }
.tip b { font-weight: 800; }

/* ---------- Bilan d'une manche perdue ---------- */
.review { text-align: left; background: rgba(0, 0, 0, .25); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.review h3 { font-size: 20px; color: var(--gold); }
.review p { margin: 0; font-size: 14px; }
.moment { background: var(--panel2); border: 2px solid var(--edge); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.moment-head { font-family: var(--game); font-size: 15px; letter-spacing: .02em; }
.moment-line { display: grid; grid-template-columns: 44px 1fr; gap: 2px 8px; align-items: center; }
.moment-line .who { font-family: var(--game); font-size: 13px; color: var(--ink2); grid-row: span 2; }
.moment-line.better .who { color: var(--green); }
.moment-line .what { font-size: 13px; color: var(--ink2); }
.moment-line .what b { color: var(--ink); }
.moment-line.better .what b { color: var(--green); }
.rv-dice { gap: 5px !important; }
.rv-dice .die.mini { --s: 30px; }
.rv-dice .die .badge { display: none; }
.die.rv-kept { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16), 0 0 0 2px var(--gold); }
.die.rv-off { opacity: .45; }
.rv-stat, .rv-note { font-size: 12px !important; }

/* combinaison déjà jouée dans la manche : hachurée, barrée, tampon avec les points marqués */
.tiles .tile.used {
  opacity: 1; filter: none; box-shadow: none; border-style: dashed; border-color: rgba(255, 255, 255, .15);
  background: repeating-linear-gradient(135deg, rgba(0, 0, 0, .45) 0 7px, rgba(0, 0, 0, .25) 7px 14px);
}
.tile.used .t-cm { display: none; }
.tile.used .t-name { opacity: .7; text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--green); }
.tile.used { justify-content: flex-start; padding-top: 10px; }
.t-stamp {
  margin-top: 6px; transform: rotate(-6deg);
  font-family: var(--game); font-size: 17px; color: var(--green); white-space: nowrap;
  border: 3px solid var(--green); border-radius: 9px; padding: 0 8px; background: rgba(10, 30, 22, .85);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .4); box-shadow: 0 3px 0 rgba(0, 0, 0, .4);
}

/* ---------- Monnaie : un petit dé doré à la place de l'euro ---------- */
.gd {
  --pip: #6b4a00; --body: linear-gradient(135deg, #fff1a8, #f5c542 45%, #d18d0c);
  display: inline-block; width: .82em; height: .82em; vertical-align: -.1em; border-radius: 24%;
  background:
    radial-gradient(circle, var(--pip) 0 .07em, transparent .08em) 22% 22% / .3em .3em no-repeat,
    radial-gradient(circle, var(--pip) 0 .07em, transparent .08em) 78% 22% / .3em .3em no-repeat,
    radial-gradient(circle, var(--pip) 0 .07em, transparent .08em) 50% 50% / .3em .3em no-repeat,
    radial-gradient(circle, var(--pip) 0 .07em, transparent .08em) 22% 78% / .3em .3em no-repeat,
    radial-gradient(circle, var(--pip) 0 .07em, transparent .08em) 78% 78% / .3em .3em no-repeat,
    var(--body);
  box-shadow: inset 0 -.06em 0 rgba(0, 0, 0, .25), 0 0 0 .06em #6b4a00;
  transform: rotate(-8deg);
}
/* sur un fond doré, le petit dé passe en sombre à points dorés pour rester lisible */
.btn.gold .gd { --pip: #ffd866; --body: linear-gradient(135deg, #5a3d00, #2e1f00); box-shadow: 0 0 0 .06em #2e1f00; }
/* étiquette de prix en papier, accrochée par une ficelle */
.price-tag { background: linear-gradient(#fffaf0, #efe4cc); }
.price-tag.poor { background: #c9c2d6; color: #5c5470; }
.price-tag.poor .gd { filter: grayscale(.8) brightness(.9); }
.price-tag::after { content: ''; position: absolute; left: 6px; top: -9px; width: 2px; height: 11px; background: #8a6d4a; transform: rotate(-25deg); }

/* ---------- Achat d'un dé : choisir celui qu'il remplace ---------- */
.swap-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.swap-head h3 { margin-bottom: 4px; }
.swap-head p { margin: 0 !important; font-size: 14px; }
.die.mini.big { --s: 64px; flex: none; transform: rotate(-6deg); }
.swap-title { font-family: var(--game); font-size: 16px; letter-spacing: .02em; color: var(--ink2); margin-bottom: 8px; }
.swap-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.swap-slot {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px 6px;
  background: rgba(0, 0, 0, .25); border: 3px solid transparent; border-radius: 14px; transition: transform .1s;
}
.swap-slot .die.mini { --s: 44px; }
.swap-slot small { font-family: var(--game); font-size: 12px; color: var(--ink2); }
.swap-slot.on { border-color: var(--mult); background: rgba(255, 68, 88, .15); transform: translateY(-4px); }
.swap-slot.on small { color: var(--ink); }
.swap-preview {
  display: grid; grid-template-columns: auto auto auto; grid-template-rows: auto auto; justify-content: center; align-items: center;
  gap: 6px 12px; background: rgba(0, 0, 0, .25); border-radius: 14px; padding: 10px; margin-bottom: 14px;
}
.swap-preview .die.mini { --s: 40px; }
.swap-preview .die.out { opacity: .5; filter: grayscale(.6); }
.swap-arrow { font-family: var(--game); font-size: 24px; color: var(--gold); }
.swap-text { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--ink2); }
.swap-text b { color: var(--mult); }

/* ---------- Solde : toujours visible dans la boutique, mouvements bien visibles ---------- */
body[data-screen="shop"] .top {
  position: sticky; top: 0; z-index: 31;
  margin: calc(-8px - env(safe-area-inset-top)) -14px 0; padding: calc(env(safe-area-inset-top) + 8px) 14px 8px;
  background: linear-gradient(var(--bg) 75%, rgba(26, 18, 48, 0));
}
.money-hit { animation: money-hit .45s; }
@keyframes money-hit { 0%, 100% { transform: none; } 25% { transform: scale(1.15) rotate(-4deg); } 55% { transform: scale(.95) rotate(3deg); } }
.float.down { transform: translate(-50%, 0); font-size: 24px; padding: 2px 12px; animation: float-down 1.3s ease-out forwards; z-index: 45; }
@keyframes float-down { 0% { opacity: 0; margin-top: -10px; scale: .6; } 12% { opacity: 1; scale: 1.15; } 25% { scale: 1; } 70% { opacity: 1; } 100% { opacity: 0; margin-top: 34px; } }
.float.fspend { background: var(--mult); }
.float.fgain { background: var(--green); color: var(--edge); text-shadow: none; }

/* ---------- Pseudo et classement ---------- */
.pseudo-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.pseudo-form input {
  font: 600 18px system-ui, sans-serif; color: var(--edge); background: var(--ink); border: 3px solid var(--edge);
  border-radius: 14px; padding: 12px 14px; -webkit-user-select: text; user-select: text; outline: none;
}
.pseudo-form input:focus { box-shadow: 0 0 0 3px var(--gold); }
.player-chip { align-self: center; background: rgba(0, 0, 0, .25); border: 2px solid var(--line); border-radius: 99px; padding: 6px 14px; color: var(--ink2); font-size: 14px; }
.player-chip b { color: var(--ink); }
.toggle .edit { font-size: 18px; }
.lb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(0, 0, 0, .25); border-radius: 14px; padding: 4px; margin-bottom: 10px; }
.lb-tabs button { font-family: var(--game); font-size: 15px; background: none; border: 0; border-radius: 10px; padding: 8px; color: var(--ink2); }
.lb-tabs button.on { background: var(--panel2); color: var(--ink); box-shadow: 0 3px 0 var(--edge); }
.lb-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.lb-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 8px 10px; }
.lb-row.me { background: rgba(255, 201, 60, .14); box-shadow: inset 0 0 0 2px var(--gold); }
.lb-rank { font-family: var(--game); font-size: 20px; text-align: center; color: var(--ink2); }
.lb-name { font-family: var(--game); font-size: 17px; letter-spacing: .02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lb-name small, .lb-score small { display: block; font-family: system-ui, sans-serif; font-size: 12px; color: var(--ink2); letter-spacing: 0; }
.lb-score { text-align: right; font-family: var(--game); font-size: 18px; color: var(--gold); }
.rank-box { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; background: rgba(255, 201, 60, .12); border: 2px solid var(--gold); border-radius: 14px; padding: 10px; color: var(--ink); font-size: 14px; }
.rank-n { font-family: var(--game); font-size: 26px; color: var(--gold); }

/* ---------- Score qui grimpe ---------- */
#score { display: inline-block; transition: color .2s; }
#score.counting { color: var(--gold); transform: scale(1.12); text-shadow: 0 3px 0 var(--edge), 0 0 16px rgba(255, 201, 60, .55); transition: transform .15s; }
#score.landed { animation: landed .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes landed { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }
.sum.flying { position: fixed; z-index: 45; pointer-events: none; font-family: var(--game); font-size: 38px; color: var(--gold); -webkit-text-stroke: 2px var(--edge); paint-order: stroke fill; text-shadow: 0 3px 0 var(--edge); }
.gd.burst { position: fixed; z-index: 46; pointer-events: none; width: 1em; height: 1em; }
.hud { position: relative; }
.goal-stamp {
  position: absolute; left: 50%; top: 74%; z-index: 5; pointer-events: none;
  font-family: var(--game); font-size: 30px; color: var(--gold); white-space: nowrap;
  -webkit-text-stroke: 3px var(--edge); paint-order: stroke fill; text-shadow: 0 4px 0 var(--edge);
  animation: stamp 1.6s cubic-bezier(.3, 1.6, .5, 1) forwards;
}
@keyframes stamp {
  0% { transform: translate(-50%, -50%) scale(2.4) rotate(-14deg); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(.9) rotate(-8deg); opacity: 0; }
}
/* écran de gains : les lignes arrivent une à une */
.pop-in { animation: pop-in .4s cubic-bezier(.3, 1.6, .5, 1) backwards; }
@keyframes pop-in { from { transform: translateX(-30px) scale(.8); opacity: 0; } }
.hud:has(.goal-stamp) .calc-cap { opacity: 0; transition: opacity .2s; }
