/* ===== La Boîte de Jambon : décor clair et joyeux, disposé comme au UNO =====
   En haut à gauche la pioche ; au centre, sur une planche à charcuterie, la boîte et la défausse ;
   les autres joueurs autour ; en bas, ma main en grand. */

.hb {
  --hw: clamp(88px, min(28vw, 19dvh), 150px);   /* cartes en main */
  --tw: clamp(38px, min(11vw, 7dvh), 58px);      /* pioche */
  --dw: clamp(56px, min(19vw, 12dvh), 104px);    /* défausse (les pouvoirs y sont lisibles) */
  --sw: clamp(28px, min(8vw, 6.5dvh), 54px);     /* Déchiqueteuses devant les joueurs */
  --av: clamp(44px, 12vw, 60px);                 /* avatars autour de la planche */

  --ink: #3a1d17;          /* texte */
  --ink-2: #6b4a3f;        /* texte secondaire (≥ 7:1 sur crème) */
  --cream: #fffaf3;
  --gold: #f5b53f;
  --gold-deep: #c98a1e;
  --ham: #ef7f93;
  --ham-deep: #c94a64;
  --good: #2e9a5b;
  --good-deep: #1f7a45;
  --bad: #d9443f;
  --bad-deep: #b0302c;
  --wood-1: #f8dfb3;
  --wood-2: #ecc28a;
  --wood-edge: #cf9a5f;
  --sh: 120 50 30;         /* ombres chaudes */
  --glow-y: 50%;

  /* clip (et pas seulement hidden) : rien ne peut faire défiler l'écran de jeu, même une carte en vol hors cadre */
  position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; overflow: clip; color: var(--ink);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  background: radial-gradient(ellipse 85% 65% at 50% var(--glow-y), #fffaf2 0%, #ffead9 42%, #ffd3bf 78%, #fbb7a6 100%);
}
/* rayons de soleil autour de la planche */
.hb::before {
  content: ''; position: fixed; left: 50%; top: var(--glow-y); width: 300vmax; height: 300vmax; pointer-events: none;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgb(255 255 255 / .34) 0deg 7deg, transparent 7deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 42%); mask: radial-gradient(circle, #000 0, transparent 42%);
}
.hb .icon { width: 1.1em; height: 1.1em; flex: none; display: block; }
/* texte courant en Nunito ; noms, chiffres et titres en Fredoka */
.hb { font-family: var(--font-body); }
.hb h1, .hb h2, .hb-turn, .deck-label, .seat-name, .seat-role, .spot-label, .tin-count, .tin-goal, .zone-count,
.hint strong, .role-title, .fin-total, .mk-n, .target { font-family: var(--font); }
.hb .muted { color: var(--ink-2); }
.hb em { color: var(--ink-2); }

/* ---- cartes (3D : face / dos), dessins SVG ---- */
.pc3d { --w: 50px; position: relative; flex: none; width: var(--w); height: calc(var(--w) * 1.45); perspective: 800px; }
.pc3d .inner { position: absolute; inset: 0; transform-style: preserve-3d; }
.pc3d.down .inner { transform: rotateY(180deg); }
.pc3d .side { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pc3d .rear { transform: rotateY(180deg); }
.pc {
  position: relative; width: 100%; height: 100%; border-radius: calc(var(--w) * .1);
  box-shadow: 0 3px 7px rgb(var(--sh) / .3), 0 0 0 .5px rgb(var(--sh) / .2);
}
.pc svg { display: block; width: 100%; height: 100%; }
.art text, .tin-art text { font-family: var(--font); }

/* ---- en-tête : pioche (toujours en haut à gauche), à qui de jouer, menu ---- */
.hb-hud {
  position: relative; z-index: 6; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 4px;
}
.spot-deck { justify-self: start; display: flex; align-items: center; gap: 8px; }
.hb-deck { position: relative; width: var(--tw); height: calc(var(--tw) * 1.45); }
.hb-deck .pc3d { position: absolute; left: 0; top: 0; }
.hb-deck .pc3d:nth-child(1) { translate: 3px 5px; }
.hb-deck .pc3d:nth-child(2) { translate: 1.5px 2.5px; }
.deck-label {
  display: flex; flex-direction: column; line-height: 1.1; font-size: .7rem; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .06em;
}
.deck-count { font-size: 1.25rem; color: var(--ink); letter-spacing: 0; font-variant-numeric: tabular-nums; }

.hb-turn {
  justify-self: center; display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 48vw;
  padding: 4px 16px 6px; border-radius: 18px; background: #fff;
  box-shadow: 0 3px 0 rgb(var(--sh) / .16), 0 10px 20px -8px rgb(var(--sh) / .4);
  transition: background .25s, box-shadow .25s;
}
.turn-round {
  display: flex; align-items: center; gap: 4px; font-size: .66rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2);
}
.turn-round .icon { width: 12px; height: 12px; }
.turn-who {
  display: flex; align-items: center; gap: 6px; max-width: 100%; font-weight: 700; font-size: .98rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.turn-av {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .82rem;
  background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 3px rgb(var(--sh) / .4);
}
.hb-turn.mine {
  background: linear-gradient(#ffe48a, var(--gold));
  box-shadow: 0 3px 0 var(--gold-deep), 0 10px 22px -6px rgb(201 138 30 / .6);
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1);
}
.hb-turn.mine .turn-round { color: #5b3a0a; }
.hb-menu {
  justify-self: end; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; padding: 0;
  color: var(--ink); background: #fff; border: 0; border-radius: 14px;
  box-shadow: 0 3px 0 rgb(var(--sh) / .18), 0 8px 16px -6px rgb(var(--sh) / .4); transition: transform .1s, box-shadow .1s;
}
.hb-menu .icon { width: 22px; height: 22px; }
.hb-menu:active { transform: translateY(2px); box-shadow: 0 1px 0 rgb(var(--sh) / .18); }

/* ---- la scène ---- */
.hb-stage { position: relative; flex: 1; min-height: 0; max-width: 1100px; width: 100%; margin: 0 auto; container-type: size; }

/* ---- la planche à charcuterie : la boîte, et la défausse juste à côté ---- */
.hb-center {
  /* la boîte prend la place qu'il y a : jamais plus de la moitié de la hauteur de la scène */
  --tinw: min(26cqw, calc((50cqh - 84px) / .68), 260px);
  --dw: clamp(44px, calc(var(--tinw) * .42), 108px);
  position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); z-index: 2;
  display: flex; align-items: center; gap: clamp(14px, 3.4vw, 34px);
  padding: clamp(14px, 2.6vw, 24px) clamp(18px, 3.4vw, 34px) clamp(12px, 2.2vw, 20px); border-radius: 30px;
  background:
    radial-gradient(ellipse at 28% 18%, rgb(255 255 255 / .5), transparent 60%),
    repeating-linear-gradient(97deg, rgb(160 95 40 / .07) 0 2px, transparent 2px 13px),
    repeating-linear-gradient(92deg, rgb(160 95 40 / .045) 0 1px, transparent 1px 7px),
    linear-gradient(170deg, var(--wood-1), var(--wood-2));
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / .75), inset 0 -3px 0 rgb(150 90 40 / .22),
    0 7px 0 var(--wood-edge), 0 9px 0 #ad7a46, 0 26px 40px -10px rgb(var(--sh) / .5);
}
.hb-center::after { /* le trou pour accrocher la planche */
  content: ''; position: absolute; right: 14px; top: 11px; width: 11px; height: 11px; border-radius: 50%;
  background: rgb(120 70 30 / .22); box-shadow: inset 0 2px 3px rgb(80 40 10 / .45);
}
.hb.tall .hb-center { top: 72%; --tinw: min(46cqw, calc((52cqh - 84px) / .68), 240px); --dw: clamp(50px, calc(var(--tinw) * .5), 100px); }
.spot { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.spot-tin { width: max(110px, var(--tinw)); gap: 5px; }
.spot-label {
  display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: clamp(.68rem, 2.3vw, .8rem); font-weight: 700;
  color: var(--ink); letter-spacing: .02em;
}
.spot-label b {
  min-width: 22px; text-align: center; padding: 0 6px; border-radius: 10px; font-size: .92em; font-variant-numeric: tabular-nums;
  background: #fff; box-shadow: 0 1px 0 rgb(var(--sh) / .25);
}
.hb-tin { position: relative; width: 100%; }
.hb-tin svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 8px rgb(var(--sh) / .3)); }
.tin-count {
  position: absolute; left: 0; right: 0; bottom: 13%; width: fit-content; margin: 0 auto; white-space: nowrap;
  display: flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: clamp(.7rem, 2.4vw, .86rem); font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ink); background: #fff; box-shadow: 0 2px 0 rgb(var(--sh) / .3), 0 4px 10px rgb(var(--sh) / .25);
}
.tin-count .icon { width: 13px; height: 13px; color: var(--ham-deep); }

/* défausse : en vrac, les pouvoirs face visible dessus */
.hb-discard { position: relative; width: var(--dw); height: calc(var(--dw) * 1.45); }
.hb-discard .pc3d { --w: var(--dw) !important; position: absolute; left: 0; top: 0; cursor: pointer; transition: translate .15s; }
.hb-discard .pc3d:last-child:hover { translate: 0 -4px; }
.hb-discard .pc3d:nth-child(1) { rotate: -9deg; translate: -2px 2px; }
.hb-discard .pc3d:nth-child(2) { rotate: 7deg; translate: 2px 0; }
.hb-discard .pc3d:nth-child(3) { rotate: -3deg; }
.hb-discard .pc3d:nth-child(4) { rotate: 5deg; translate: 1px -1px; }
.hb-discard .pc3d:nth-child(5) { rotate: -1deg; }
.hb-discard.empty { border: 2.5px dashed rgb(58 29 23 / .25); border-radius: 10px; background: rgb(255 255 255 / .25); }

/* objectif : une tranche par point à atteindre */
.hb-goal { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tin-goal { font-size: clamp(.7rem, 2.3vw, .82rem); font-weight: 600; color: var(--ink); }
.tin-slices { display: flex; flex-direction: column-reverse; gap: 3px; }
.tin-row { display: flex; gap: 3px; justify-content: center; }
.sl {
  width: clamp(10px, 2.6vw, 14px); height: clamp(10px, 2.6vw, 14px); border-radius: 50%;
  background: rgb(255 255 255 / .35); border: 1.5px dashed rgb(58 29 23 / .3);
}
.sl.on {
  border: 2px solid #fff; background: radial-gradient(circle at 40% 35%, #ffc2ca, #ef8a9a 55%, #d8657a);
  box-shadow: 0 0 0 1px var(--ink), 0 2px 4px rgb(var(--sh) / .4);
}

/* annonce des effets, juste au-dessus de la planche */
.hb-ticker {
  position: absolute; left: 50%; bottom: calc(100% + 16px); z-index: 7; width: max-content; max-width: min(88vw, 520px);
  transform: translate(-50%, 8px); text-align: center; font-size: .9rem; font-weight: 600; line-height: 1.3;
  padding: .5rem 1rem; border-radius: 16px; color: var(--ink); background: #fff;
  box-shadow: 0 3px 0 rgb(var(--sh) / .18), 0 14px 26px -8px rgb(var(--sh) / .5);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.hb-ticker::after {
  content: ''; position: absolute; left: 50%; top: 100%; width: 14px; height: 14px; background: #fff;
  transform: translate(-50%, -8px) rotate(45deg); border-radius: 0 0 4px 0;
}
.hb-ticker.show { opacity: 1; transform: translate(-50%, 0); }
.hb.tall .hb-ticker { max-width: 72vw; }

/* « À toi de jouer ! » : un ruban doré qui surgit au milieu de la planche, quand mon tour arrive */
.hb-banner {
  position: absolute; left: 50%; top: 50%; z-index: 8; pointer-events: none; white-space: nowrap;
  display: flex; align-items: center; gap: .5rem; padding: .55rem 1.3rem .6rem 1.05rem; border-radius: 999px;
  font-family: var(--font); font-size: clamp(1.25rem, 5.6vw, 1.9rem); font-weight: 700; color: var(--ink);
  background: linear-gradient(#ffe68f, var(--gold)); border: 3px solid #fff;
  box-shadow: 0 5px 0 var(--gold-deep), 0 18px 36px -10px rgb(var(--sh) / .65);
  opacity: 0; transform: translate(-50%, -50%) scale(.5);
}
.hb-banner .icon { width: .9em; height: .9em; fill: currentColor; }
.hb-banner.show { animation: banner 1.6s cubic-bezier(.2, 1.3, .4, 1) forwards; }
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(.96); }
}

/* ---- les autres joueurs ---- */
.hb-seats { position: absolute; inset: 0; pointer-events: none; }
.seat { position: absolute; transform: translate(-50%, -50%); width: 98px; text-align: center; z-index: 3; transition: opacity .3s; }
.seat.off { opacity: .5; }
.seat-top { position: relative; display: inline-block; margin-top: 12px; }
.seat-avatar {
  position: relative; z-index: 1; width: var(--av); height: var(--av); border-radius: 50%; display: grid; place-items: center;
  font-size: calc(var(--av) * .5); background: var(--c);
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 70%);
  border: 4px solid #fff; box-shadow: 0 4px 0 rgb(var(--sh) / .22), 0 10px 18px -4px rgb(var(--sh) / .45);
  transition: transform .3s cubic-bezier(.2, 1.5, .4, 1);
}
/* celui qui joue : un anneau doré tourne autour de lui (on l'attend) */
.seat-ring {
  position: absolute; inset: -7px; z-index: 0; border-radius: 50%; opacity: 0; transition: opacity .25s;
  background: conic-gradient(var(--gold), #fff3c4, var(--ham), var(--gold) 70%, #fff3c4, var(--gold));
}
.seat.turn { z-index: 4; }
.seat.turn .seat-ring { opacity: 1; animation: spin 2.2s linear infinite; }
.seat.turn .seat-avatar { transform: scale(1.08); }
.seat.turn .seat-name { background: linear-gradient(#ffe48a, var(--gold)); box-shadow: 0 2px 0 var(--gold-deep); }
@keyframes spin { to { rotate: 360deg; } }
.seat-badge {
  position: absolute; right: -8px; bottom: -3px; z-index: 2; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 5px;
  display: none; place-items: center; font-size: .74rem; font-weight: 700; color: #fff; border: 2.5px solid #fff;
  box-shadow: 0 2px 4px rgb(var(--sh) / .4);
}
.seat-badge.done { display: grid; background: var(--good); animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.seat-badge.dead { display: grid; background: #4a3a36; font-size: .8rem; }
@keyframes pop { from { transform: scale(0); } }
.seat-name {
  display: block; width: fit-content; max-width: 98px; margin: 7px auto 0; padding: 1px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); background: #fff; box-shadow: 0 2px 0 rgb(var(--sh) / .18), 0 4px 10px -4px rgb(var(--sh) / .4);
}
.seat-role:empty { display: none; }
.seat-role {
  display: inline-block; margin-top: 3px; padding: 0 7px; border-radius: 999px; color: #fff;
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; line-height: 1.6;
}
.seat-role.good { background: var(--good); }
.seat-role.bad { background: var(--bad); }
/* ses cartes en main, de dos, en éventail derrière l'avatar */
.seat-cards { position: absolute; left: 50%; top: -12px; width: 0; height: 0; z-index: 0; }
.mini-back {
  position: absolute; left: -11px; top: 0; width: 22px; height: 32px; --w: 22px;
  transform-origin: 50% 150%; transform: rotate(calc(var(--i) * 14deg));
}
.mini-back .pc { box-shadow: 0 2px 4px rgb(var(--sh) / .35); border-radius: 3px; }
.seat.dead { opacity: .7; }
.seat.dead .seat-avatar { filter: grayscale(1); box-shadow: none; }
.seat.dead .seat-name { text-decoration: line-through; color: var(--ink-2); }
.seat.dead .seat-cards { display: none; }
.seat-fx {
  position: absolute; left: 50%; top: -6px; z-index: 5; white-space: nowrap; font-weight: 700; font-size: 1rem;
  color: var(--bad-deep); text-shadow: 0 0 6px #fff, 0 0 2px #fff; transform: translateX(-50%); animation: fxUp 2.8s ease-out forwards;
}
@keyframes fxUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.5); }
  15% { opacity: 1; transform: translate(-50%, -6px) scale(1.2); }
  80% { opacity: 1; transform: translate(-50%, -24px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1); }
}

/* ---- Déchiqueteuses : posées devant le joueur visé, une carte par Déchiqueteuse ---- */
.hb-zones { position: absolute; inset: 0; pointer-events: none; z-index: 1; } /* sous la planche : son annonce passe devant */
.zone { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.zone-probe { position: absolute; width: var(--sw); height: 0; visibility: hidden; }
.zone-cards { display: flex; align-items: center; justify-content: center; transform: rotate(var(--r, 0deg)); }
.zone-cards .pc3d + .pc3d { margin-left: calc(var(--sw) * -.6); }
.zone-cards .pc3d:nth-child(1) { rotate: -9deg; }
.zone-cards .pc3d:nth-child(2) { rotate: 2deg; translate: 0 -3px; }
.zone-cards .pc3d:nth-child(3) { rotate: 12deg; }
.zone-cards .pc3d:nth-child(n+4) { rotate: 20deg; }
.zone-count {
  font-size: .7rem; font-weight: 700; white-space: nowrap; padding: 0 8px; border-radius: 999px;
  color: #fff; background: #8f2433; border: 2px solid #fff; box-shadow: 0 2px 4px rgb(var(--sh) / .4);
}
.zone-count:empty { display: none; }
.zone.danger .zone-count { animation: danger 1s ease-in-out infinite; }
@keyframes danger { 50% { background: var(--bad); } }

.mini {
  display: inline-block; min-width: 1.7rem; text-align: center; border-radius: 6px; padding: .02rem .3rem; margin: 0 .08rem;
  font-weight: 700; font-size: .85rem; color: #fff; border: 1.5px solid #fff;
}
.mini.plus { background: var(--good); }
.mini.zero { background: #d8961c; }
.mini.minus { background: var(--bad); }
.mini.sp { background: none; border: 0; padding: 0; min-width: 0; vertical-align: middle; }
.mini.sp svg { display: block; width: 24px; height: auto; filter: drop-shadow(0 1px 2px rgb(var(--sh) / .35)); }

/* ---- en bas : moi, ce qui se passe, ma main ---- */
.hb-dock {
  position: relative; z-index: 6; padding: 0 10px calc(4px + env(safe-area-inset-bottom));
  background: linear-gradient(rgb(255 250 243 / 0), rgb(255 247 238 / .75) 40%);
}
.hb-me-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 0; min-height: 52px; }
.hb-me { display: flex; min-width: 0; }
.me-seat {
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; display: flex; align-items: center; gap: 10px;
  max-width: 100%; min-height: 48px; padding: 4px 14px 4px 4px; border: 0; border-radius: 999px; background: #fff;
  box-shadow: 0 3px 0 rgb(var(--sh) / .16), 0 10px 20px -8px rgb(var(--sh) / .4); transition: background .25s, box-shadow .25s, transform .1s;
}
.me-seat:active { transform: translateY(2px); }
.me-seat:focus-visible, .hcard:focus-visible, .hb-menu:focus-visible { outline: 3px solid var(--ham-deep); outline-offset: 3px; }
.me-seat .seat-top { margin: 0; }
.me-seat .seat-avatar { --av: 40px; border-width: 3px; box-shadow: 0 2px 0 rgb(var(--sh) / .2); }
.me-id { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.me-seat .seat-name { margin: 0; padding: 0; background: none; box-shadow: none; max-width: 140px; font-size: .92rem; }
.me-seat .seat-role { margin: 1px 0 0; }
.me-seat.turn { background: linear-gradient(#fff3c4, #ffe08a); box-shadow: 0 3px 0 var(--gold-deep), 0 10px 20px -8px rgb(201 138 30 / .6); }
.me-seat.dead .seat-avatar { filter: grayscale(1); }
.zone.mine { position: static; transform: none; flex-direction: row; gap: 6px; --sw: 24px; }
.zone.mine .zone-cards { transform: none; }
.zone.mine:not(:has(.pc3d)) { display: none; }

.hb-action { min-height: 40px; display: flex; justify-content: center; align-items: center; padding: 2px 8px; }
.hint { margin: 0; text-align: center; color: var(--ink-2); font-size: .92rem; font-weight: 500; line-height: 1.3; }
.hint.my-turn { display: flex; flex-direction: column; gap: 1px; color: var(--ink); animation: myTurn .45s cubic-bezier(.2, 1.5, .4, 1); }
.hint.my-turn strong { font-size: 1.05rem; }
.hint-sub { font-size: .74rem; color: var(--ink-2); font-weight: 500; }
@keyframes myTurn { from { transform: scale(.75); opacity: 0; } }

.hb-hand {
  display: flex; justify-content: center; align-items: flex-end; padding: 8px 0 14px;
  min-height: calc(var(--hw) * 1.45 + 30px);
}
.hcard {
  margin: 0 calc(var(--hw) * var(--ov, -.04)); cursor: pointer; transform-origin: 50% 140%; outline: none;
  transition: translate .22s cubic-bezier(.3, 1.4, .5, 1), filter .25s, scale .1s;
}
.hcard .pc { box-shadow: 0 12px 22px -8px rgb(var(--sh) / .6), 0 2px 0 rgb(var(--sh) / .18); transition: box-shadow .25s; }
/* à moi de jouer : les cartes se soulèvent, cerclées d'or */
.hb-hand.ready .hcard .pc { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--gold), 0 16px 26px -8px rgb(var(--sh) / .6); }
.hb-hand.ready .hcard:hover, .hb-hand.ready .hcard:focus-visible { translate: 0 -22px; }
.hb-hand.ready .hcard:active { scale: .96; }
/* pas à moi : la main est baissée et pâlie, on ne peut pas jouer */
.hb-hand.locked .hcard { translate: 0 14px; filter: saturate(.55) brightness(.96); pointer-events: none; }
.hb-dock.after .hb-hand { opacity: .6; }
.over-actions { display: flex; gap: .6rem; align-items: center; justify-content: center; }

/* ---- boutons du jeu (pâte à modeler) ---- */
.hb .btn {
  color: var(--ink); background: #fff; border: 2px solid #f3dccb; border-radius: 16px; font-weight: 600;
  box-shadow: 0 4px 0 #ecc8b2; transition: transform .1s, box-shadow .1s, background .15s;
}
.hb .btn:hover:not(:disabled) { background: #fff8f2; }
.hb .btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #ecc8b2; }
.hb .btn:focus-visible { outline: 3px solid var(--ham-deep); outline-offset: 2px; }
.hb .btn.gold, .hb .btn.gold:hover:not(:disabled), .hb .reveal-btn, .hb .reveal-btn:hover:not(:disabled) {
  color: var(--ink); background: linear-gradient(#ffe48a, var(--gold)); border-color: #fff0bf;
  box-shadow: 0 4px 0 var(--gold-deep), 0 10px 18px -8px rgb(var(--sh) / .5);
}
.hb .btn.gold:active:not(:disabled), .hb .reveal-btn:active:not(:disabled) { box-shadow: 0 1px 0 var(--gold-deep); }
.hb .btn.ghost { background: transparent; border-color: rgb(58 29 23 / .18); box-shadow: none; }
.hb .btn.ghost:hover:not(:disabled) { background: rgb(255 255 255 / .6); }
.hb .btn.ghost:active:not(:disabled) { transform: scale(.98); box-shadow: none; }
.reveal-btn {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: .4rem 1rem; border-radius: 999px;
  font-size: .9rem; font-weight: 700; white-space: nowrap; gap: 6px;
}
.reveal-btn .icon { margin-right: 2px; }
@media (max-width: 440px) { .rv-more { display: none; } }
.hb-reveal { flex: none; }

/* ---- couches ---- */
.hb-flight { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.hb-flight .pc3d { will-change: transform; }
.hb-sheets { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.hb-sheets.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(58 29 23 / .42); backdrop-filter: blur(3px); animation: fade .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 86%; overflow: auto;
  color: var(--ink); background: linear-gradient(#fffaf3, #fff0e2); border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .7rem;
  box-shadow: 0 -12px 40px rgb(var(--sh) / .35); animation: slideUp .32s cubic-bezier(.2, .9, .3, 1);
}
.sheet h2, .sheet h3, .sheet p { margin: 0; }
.sheet h2 { color: var(--ink); font-size: 1.25rem; }
.sheet h3 { font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: rgb(58 29 23 / .18); margin: 0 auto 4px; flex: none; }
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.role-card { text-align: center; padding: .9rem .7rem; border-radius: 22px; border: 3px solid; }
.role-card.good { border-color: #8fd6ad; background: #e8f7ee; }
.role-card.bad { border-color: #f4a69b; background: #fdeae6; }
.role-emblem { width: 96px; margin: 0 auto .3rem; filter: drop-shadow(0 6px 10px rgb(var(--sh) / .35)); animation: popIn .6s cubic-bezier(.2, 1.4, .4, 1); }
.role-emblem svg { display: block; width: 100%; }
.role-kicker { color: var(--ink-2); font-size: .88rem; }
.role-title { font-size: 2.3rem; font-weight: 700; margin: .1rem 0; }
.role-card.good .role-title { color: var(--good-deep); }
.role-card.bad .role-title { color: var(--bad-deep); }
.role-mates { margin-top: .5rem !important; color: var(--ink); }
.who { display: inline-block; color: var(--ink); background: rgb(58 29 23 / .07); border-radius: 999px; padding: .1rem .6rem; margin: .15rem; font-size: .9rem; }

.sp-detail { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.sp-card { margin: .3rem 0 .4rem; animation: cardIn .5s cubic-bezier(.2, 1.3, .4, 1); }
.sp-card .pc { box-shadow: 0 16px 30px -6px rgb(var(--sh) / .55); }
@keyframes cardIn { from { transform: translateY(30px) rotate(-8deg) scale(.7); opacity: 0; } }
.sp-tin { width: 150px; margin: .2rem 0 .3rem; filter: drop-shadow(0 8px 10px rgb(var(--sh) / .3)); animation: cardIn .5s cubic-bezier(.2, 1.3, .4, 1); }
.sp-tin svg { display: block; width: 100%; height: auto; }
.targets { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; }
.target {
  font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; display: flex; align-items: center; gap: .5rem;
  min-height: 48px; padding: .35rem .9rem .35rem .4rem; background: #fff; border: 2px solid #f3dccb; border-radius: 999px;
  box-shadow: 0 3px 0 #ecc8b2; transition: transform .1s, box-shadow .1s, background .15s;
}
.target:hover { background: #fff6dc; border-color: var(--gold); }
.target:active { transform: translateY(2px); box-shadow: 0 1px 0 #ecc8b2; }
.target em { color: var(--bad-deep); }
.target .lp-avatar { border-color: #fff; }

.peek-row { display: flex; justify-content: center; gap: 12px; padding: 10px 0; }
/* Renouvellement des stocks : toutes les cartes étalées, on touche celles qu'on garde. */
.sheet-market { --mkw: min(92px, calc((100vw - 80px) / 5)); }
.mk-step { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .95rem; }
.mk-num {
  flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--ink); font-family: var(--font); box-shadow: 0 2px 0 var(--gold-deep);
}
.mk-count {
  margin-left: auto; font-family: var(--font); font-weight: 700; padding: .1rem .6rem; border-radius: 999px;
  background: rgb(58 29 23 / .08); color: var(--ink-2); transition: background .2s, color .2s;
}
.mk-count.ok { background: #d8f2e2; color: var(--good-deep); }
.mk-pool { display: flex; justify-content: center; gap: 8px; padding: 14px 0 6px; }
.mk-card {
  position: relative; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 12px;
  transition: translate .18s cubic-bezier(.3, 1.4, .5, 1), opacity .2s, filter .2s; touch-action: manipulation;
}
.mk-card .pc3d { border-radius: 12px; transition: box-shadow .18s; }
.mk-card.on { translate: 0 -12px; }
.mk-card.on .pc3d { box-shadow: 0 0 0 3px var(--gold), 0 10px 18px -4px rgb(201 138 30 / .55); }
.mk-card.off { opacity: .55; filter: saturate(.5); translate: 0 6px; }
.mk-card:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 3px; }
.mk-check {
  position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--good-deep); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgb(var(--sh) / .35);
  scale: 0; transition: scale .2s cubic-bezier(.3, 1.6, .5, 1);
}
.mk-check svg { width: 15px; height: 15px; }
.mk-card.on .mk-check { scale: 1; }
.mk-back {
  display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: .7rem; min-height: 64px; justify-content: center;
  border-radius: 18px; background: rgb(58 29 23 / .05); border: 2px dashed rgb(58 29 23 / .14); text-align: center;
}
.mk-deck { display: flex; gap: 14px; justify-content: center; }
.mk-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: cardIn .35s cubic-bezier(.2, 1.3, .4, 1); }
.mk-pos { font-size: .78rem; font-weight: 700; color: var(--ink-2); max-width: 9rem; }
.mk-slot:first-child .mk-pos { color: var(--gold-deep); }
@media (prefers-reduced-motion: reduce) { .mk-card, .mk-check, .mk-slot { transition: none; animation: none; } }
.journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.journal li {
  display: flex; align-items: baseline; gap: .6rem; background: #fff; border-radius: 12px; padding: .45rem .7rem;
  box-shadow: 0 1px 0 rgb(var(--sh) / .12);
}
.jr-round {
  flex: none; font-family: var(--font); font-size: .72rem; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  padding: 0 .45rem; border-radius: 999px; background: #fff3e8;
}
.menu-actions { display: flex; gap: .6rem; justify-content: space-between; }

.recap-wrap { overflow-x: auto; background: #fff; border-radius: 16px; }
.recap { border-collapse: collapse; width: 100%; font-size: .9rem; }
.recap th { color: var(--ink-2); font-weight: 600; }
.recap th, .recap td { padding: .4rem .5rem; text-align: center; white-space: nowrap; border-bottom: 1px solid rgb(58 29 23 / .07); }
.recap th:first-child, .recap td:first-child { text-align: left; }
.tag { font-size: .68rem; color: #fff; border-radius: 999px; padding: .05rem .45rem; margin-left: .4rem; }
.tag.good { background: var(--good); }
.tag.bad { background: var(--bad); }

/* ---- fin de partie ---- */
.hb-overlay {
  position: absolute; inset: 0; z-index: 40; display: none; place-items: center; padding: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgb(255 246 236 / .85), rgb(255 205 186 / .95)); backdrop-filter: blur(4px);
}
.hb-overlay.open { display: grid; animation: fade .4s; }
.over-card {
  position: relative; z-index: 2; text-align: center; max-width: 440px; width: 100%; padding: 24px 20px;
  color: var(--ink); background: #fff; border-radius: 28px;
  box-shadow: 0 6px 0 #f0cdb6, 0 28px 60px -12px rgb(var(--sh) / .55); animation: popIn .6s cubic-bezier(.2, 1.3, .4, 1);
}
.hb-overlay.win .over-card { box-shadow: 0 0 0 4px var(--gold), 0 6px 0 4px var(--gold-deep), 0 28px 60px -12px rgb(var(--sh) / .55); }
.over-card h1 { font-size: 1.7rem; margin: .2rem 0 .4rem; color: var(--ham-deep); }
.over-card p { margin: .2rem 0; }
.over-emblem { width: 96px; margin: 0 auto .2rem; filter: drop-shadow(0 8px 12px rgb(var(--sh) / .35)); }
.over-emblem svg { display: block; width: 100%; }
.over-sub { font-weight: 700; color: var(--gold-deep); }
.over-roles { margin: .8rem 0; }
.who.bad { box-shadow: inset 0 0 0 2px var(--bad); }
.who.good { box-shadow: inset 0 0 0 2px var(--good); }
.over-btns { display: flex; gap: .6rem; justify-content: center; margin-top: .6rem; }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.confetti i {
  position: absolute; top: -20px; width: 9px; height: 15px; border-radius: 2px; opacity: .95;
  animation: fall 3.4s linear infinite;
}
@keyframes fall { to { transform: translate(var(--dx), 110dvh) rotate(720deg); } }

/* ---- révélation finale : toutes les cartes de la boîte se retournent ---- */
.hb-final {
  position: absolute; inset: 0; z-index: 35; display: none; place-items: center; padding: 14px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgb(255 248 238 / .96), rgb(255 214 196 / .98));
}
.hb-final.open { display: grid; animation: fade .3s; }
.fin-card { width: 100%; max-width: 560px; text-align: center; display: flex; flex-direction: column; gap: .7rem; align-items: center; }
.fin-card h2 { font-size: 1.6rem; margin: 0; color: var(--ham-deep); }
.fin-card p { margin: 0; }
.fin-grid { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-height: 50dvh; overflow: hidden; padding: 4px; }
.fin-sum { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: .3rem; }
.fin-total { font-size: 3.4rem; font-weight: 700; line-height: 1; min-width: 3.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.fin-total.ok { color: var(--good-deep); }
.fin-total.neg { color: var(--bad-deep); }
.fin-goal { flex-basis: 100%; font-weight: 600; color: var(--ink-2); }
.fin-goal.ok { color: var(--good-deep); font-size: 1.15rem; }
.fin-goal.ko { color: var(--bad-deep); font-size: 1.15rem; }

/* ---- téléphone en portrait : la planche plus bas, les joueurs en arc au-dessus ---- */
.hb.tall .hb-center { gap: clamp(12px, 4vw, 22px); }

/* ---- écran large (PC, téléphone couché) : comme au UNO, ma place à gauche de ma main, l'aide à droite ---- */
.hb:not(.tall) { --hw: clamp(64px, min(13vw, 18dvh), 150px); }
.hb:not(.tall) .hb-dock {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; column-gap: 12px;
  background: linear-gradient(rgb(255 250 243 / 0), rgb(255 247 238 / .7) 55%);
}
.hb:not(.tall) .hb-me-row {
  grid-column: 1; grid-row: 1; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 10px;
  padding-bottom: 18px;
}
.hb:not(.tall) .hb-hand { grid-column: 2; grid-row: 1; padding-bottom: 12px; }
.hb:not(.tall) .hb-action { grid-column: 3; grid-row: 1; align-self: end; padding-bottom: 26px; }
.hb:not(.tall) .rv-more { display: inline; }

/* ---- téléphone couché : tout se resserre ---- */
@media (orientation: landscape) and (max-height: 520px) {
  .hb { --tw: clamp(28px, 9dvh, 44px); --av: clamp(34px, 10dvh, 46px); }
  .hb:not(.tall) { --hw: clamp(52px, 22dvh, 96px); }
  .hb-hud { padding-top: calc(4px + env(safe-area-inset-top)); }
  .hb-turn { padding: 2px 12px 3px; }
  .hb:not(.tall) .hb-me-row { padding-bottom: 8px; }
  .hb:not(.tall) .hb-action { padding-bottom: 10px; }
  .hb-hand { padding: 4px 0 8px; min-height: calc(var(--hw) * 1.45 + 14px); }
  .hint-sub { display: none; }
  .seat { width: 84px; }
  .seat-name { font-size: .72rem; }
}

/* ---- grands écrans ---- */
@media (min-width: 900px) {
  .seat { width: 128px; }
  .seat-name { font-size: .9rem; max-width: 128px; }
  .hb-turn { max-width: 40vw; padding: 5px 22px 7px; }
  .turn-who { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .seat.turn .seat-ring, .seat-badge, .hint.my-turn, .zone.danger .zone-count, .confetti i, .sp-card, .sp-tin, .role-emblem,
  .hb-turn.mine, .hb-banner.show { animation: none !important; }
  .hcard { transition: none; }
}

/* ---- appel vocal / vidéo (voice.js) ---- */
.hb-side { justify-self: end; position: relative; }
.hb-side .voice-bar { position: absolute; right: 2px; top: calc(100% + 8px); flex-direction: column; gap: 6px; }
.hb-side .vb { width: 40px; padding: 0; border-radius: 12px; }
/* sa caméra, au-dessus de son personnage (à côté quand il est tout en haut de l'écran) */
.seat-top .cam-bubble {
  --cw: clamp(58px, 10cqw, 92px);
  position: absolute; z-index: 3; left: 50%; bottom: calc(100% + 16px); width: var(--cw); aspect-ratio: 4 / 3; translate: -50% 0;
  border-radius: 14px; border: 3px solid #fff; box-shadow: 0 4px 0 rgb(var(--sh) / .2), 0 10px 18px -6px rgb(var(--sh) / .5);
  animation: pop .35s cubic-bezier(.2, 1.5, .4, 1);
}
.seat.cam-side .cam-bubble { bottom: auto; top: 50%; left: calc(100% + 8px); translate: 0 -50%; }
.seat.cam-side.cam-left .cam-bubble { left: auto; right: calc(100% + 8px); }
.seat.turn .cam-bubble { border-color: var(--gold); }
.cam-bubble.talk, .seat.turn .cam-bubble.talk { border-color: #2fbf71; box-shadow: 0 0 0 3px #2fbf71, 0 10px 18px -6px rgb(var(--sh) / .5); }
.seat.dead .cam-bubble { filter: grayscale(1); }
/* ma caméra, au-dessus de ma place en bas */
.me-seat .seat-top .cam-bubble { --cw: clamp(64px, 18vw, 96px); left: 0; translate: 0 0; bottom: calc(100% + 10px); }
/* qui parle : un halo vert autour de l'avatar ; micro coupé : un petit badge */
.v-talk .seat-avatar { box-shadow: 0 0 0 4px #2fbf71, 0 0 18px 2px rgb(47 191 113 / .55); }
.seat-mic {
  position: absolute; left: -7px; bottom: -3px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center;
  color: #fff; background: #8a7a74; border: 2.5px solid #fff; box-shadow: 0 2px 4px rgb(var(--sh) / .4);
}
.seat-mic .icon { width: 12px; height: 12px; stroke-width: 3; }
.v-mute .seat-mic { display: grid; }

/* ---- écran de test : choisir les cartes de sa main ---- */
.hb-test {
  flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 12px; cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 800; color: #3d2a6b; background: #ece6ff; border: 2px dashed #9b87d8; border-radius: 999px;
  touch-action: manipulation;
}
.hb-test .icon { width: 18px; height: 18px; }
.hb-test:active { transform: translateY(2px); }
.sheet-testhand { --thw: min(84px, calc((100vw - 64px) / 4)); }
.sheet-testhand h2 { display: flex; align-items: center; gap: .45rem; }
.sheet-testhand h2 .icon { width: 22px; height: 22px; color: #6d55b8; }
.th-slots { display: flex; justify-content: center; gap: 12px; padding: 8px 0 4px; }
.th-slot, .th-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; cursor: pointer;
  font: inherit; color: var(--ink-2); background: none; border: 0; touch-action: manipulation;
}
.th-slot .pc, .th-card .pc { width: var(--thw); height: calc(var(--thw) * 1.45); border-radius: calc(var(--thw) * .1); --w: var(--thw); transition: box-shadow .18s, translate .18s; }
.th-slot span { font-size: .78rem; font-weight: 800; }
.th-slot.on .pc { translate: 0 -8px; box-shadow: 0 0 0 3px #7a5fd0, 0 10px 18px -4px rgb(90 60 180 / .5); }
.th-slot.on span { color: #5b43a8; }
.th-label { margin-top: .4rem; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); text-align: center; }
.th-pool { --thw: min(64px, calc((100vw - 72px) / 4)); display: grid; grid-template-columns: repeat(4, auto); justify-content: center; gap: 10px; padding: 6px 0; }
.th-card:active .pc { translate: 0 2px; }
.th-slot:focus-visible, .th-card:focus-visible, .hb-test:focus-visible { outline: 3px solid #7a5fd0; outline-offset: 3px; border-radius: 10px; }
/* téléphone : le bouton de test se réduit à son icône (la place va à mon nom et au bouton « Révéler ») */
@media (max-width: 480px) { .hb-test { width: 40px; padding: 0; justify-content: center; } .hb-test span { display: none; } }
