/* ══════════════════════ WebNo — habillage ══════════════════════ */
:root {
  /* couleurs officielles du jeu */
  --red:    #ED1C24;  --red-d:    #9E0F16;
  --yellow: #FFDE17;  --yellow-d: #D6A200;
  --green:  #00A651;  --green-d:  #056B36;
  --blue:   #0072BC;  --blue-d:   #004A81;

  /* côté sombre du pack Flip : d'autres couleurs, plus profondes */
  --pink:   #E5127D;  --pink-d:   #8E0A4C;
  --teal:   #00A9A5;  --teal-d:   #046B69;
  --orange: #F58220;  --orange-d: #A5510A;
  --purple: #7B4FA8;  --purple-d: #4A2C6B;

  --ink:    #141118;
  --bg:     #08080D;
  --panel:  rgba(255,255,255,.055);
  --panel-2:rgba(255,255,255,.09);
  --line:   rgba(255,255,255,.12);
  --txt:    #F2F3F8;
  --muted:  #98A0B4;
  --gold:   #FFC93C;

  --felt-1: #17825F;
  --felt-2: #0C5540;
  --felt-3: #052E1F;

  --cw: clamp(74px, min(6.4vw, 15vh), 148px);
  --ch: calc(var(--cw) * 1.5);
  --display: 'Archivo Black', 'Arial Black', 'Helvetica Neue', sans-serif;
  --font: 'Outfit', 'Segoe UI', Roboto, -apple-system, sans-serif;
  --ease: cubic-bezier(.22,.9,.3,1.1);
}

@property --ring { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: #08080D;
  color: var(--txt);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button, input { font-family: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ══════════════════════ décor animé ══════════════════════ */
.ambience {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  contain: strict;
}
.halo {
  position: absolute; width: 58vmax; height: 58vmax; border-radius: 50%;
  filter: blur(56px); opacity: .34;
  will-change: transform; contain: strict;
}
.h-red    { background: radial-gradient(circle, var(--red) 0%, transparent 66%);    top: -20%; left: -14%;  animation: floatA 34s ease-in-out infinite alternate; }
.h-blue   { background: radial-gradient(circle, var(--blue) 0%, transparent 66%);   top: -10%; right: -18%; animation: floatB 41s ease-in-out infinite alternate; }
.h-green  { background: radial-gradient(circle, var(--green) 0%, transparent 66%);  bottom: -26%; left: 6%;  animation: floatC 47s ease-in-out infinite alternate; opacity: .24; }
.h-yellow { background: radial-gradient(circle, var(--yellow) 0%, transparent 66%); bottom: -30%; right: -6%;animation: floatD 38s ease-in-out infinite alternate; opacity: .18; }
@keyframes floatA { to { transform: translate3d(14vw, 10vh, 0) scale(1.18); } }
@keyframes floatB { to { transform: translate3d(-12vw, 14vh, 0) scale(1.1); } }
@keyframes floatC { to { transform: translate3d(16vw, -12vh, 0) scale(1.22); } }
@keyframes floatD { to { transform: translate3d(-16vw, -8vh, 0) scale(1.14); } }

/* grandes cartes dérivant au loin */
.drifters { position: absolute; inset: 0; }
.drift {
  position: absolute; display: block; width: 130px; height: 195px; border-radius: 16px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--tint, #fff) 26%, transparent), rgba(255,255,255,.015));
  border: 2px solid color-mix(in srgb, var(--tint, #fff) 18%, transparent);
  box-shadow: inset 0 0 40px rgba(0,0,0,.25);
  opacity: .5;
  animation: rise linear infinite;
  will-change: transform;
}
.drift::after {
  content: ''; position: absolute; inset: 22% 14%; border-radius: 50%;
  background: color-mix(in srgb, var(--tint, #fff) 14%, transparent); transform: rotate(-20deg);
}
@keyframes rise {
  from { transform: translateY(112vh) rotate(var(--r0)); }
  to   { transform: translateY(-40vh) rotate(var(--r1)); }
}
.d1 { --tint: var(--red); left: 4%;  --r0: -18deg; --r1: 22deg;  animation-duration: 58s; animation-delay: -4s;  scale: .8; }
.d2 { --tint: var(--blue); left: 21%; --r0: 24deg;  --r1: -14deg; animation-duration: 72s; animation-delay: -30s; opacity: .32; }
.d3 { --tint: var(--green); left: 38%; --r0: -8deg;  --r1: 30deg;  animation-duration: 64s; animation-delay: -50s; scale: 1.3; opacity: .26; }
.d4 { --tint: var(--yellow); left: 54%; --r0: 12deg;  --r1: -26deg; animation-duration: 80s; animation-delay: -12s; opacity: .34; }
.d5 { --tint: var(--blue); left: 70%; --r0: -28deg; --r1: 10deg;  animation-duration: 55s; animation-delay: -40s; scale: .72; }
.d6 { --tint: var(--red); left: 86%; --r0: 16deg;  --r1: -20deg; animation-duration: 68s; animation-delay: -22s; opacity: .3; }
.d7 { --tint: var(--yellow); left: 12%; --r0: 6deg;   --r1: -32deg; animation-duration: 88s; animation-delay: -62s; scale: 1.15; opacity: .22; }
.d8 { --tint: var(--green); left: 63%; --r0: -22deg; --r1: 18deg;  animation-duration: 76s; animation-delay: -70s; scale: .9;  opacity: .28; }

.grain {
  position: absolute; inset: 0; opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 44%, transparent 30%, rgba(3,3,6,.55) 78%, rgba(3,3,6,.92) 100%);
}

/* ══════════════════════ écrans ══════════════════════ */
.screen { position: fixed; inset: 0; z-index: 1; display: none; }
.screen.active { display: block; }

/* ══════════════════════ console de son ══════════════════════ */
.sound-dock { position: fixed; top: 14px; right: 14px; z-index: 70; display: grid; justify-items: end; gap: 8px; }
.sound-btn {
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  background: rgba(12,14,22,.8); border: 1px solid var(--line); color: var(--txt);
  display: grid; place-items: center; backdrop-filter: blur(10px);
  transition: background .18s, transform .12s, color .18s;
}
.sound-btn:hover { background: rgba(30,34,48,.9); transform: translateY(-1px); }
.sound-btn svg { width: 21px; height: 21px; fill: currentColor; }
.sound-btn .ico-off { display: none; }
body.muted .sound-btn { color: var(--muted); }
body.muted .sound-btn .ico-off { display: block; }
body.muted .sound-btn .ico-on { display: none; }
.sound-panel {
  background: rgba(12,14,22,.94); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; display: grid; gap: 12px; width: 208px;
  box-shadow: 0 20px 44px rgba(0,0,0,.6); backdrop-filter: blur(12px);
  animation: popIn .18s var(--ease);
}
.vol { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.vol input[type=range] { -webkit-appearance: none; appearance: none; height: 5px; border-radius: 4px; background: rgba(255,255,255,.16); }
.vol input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.vol input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: var(--gold); cursor: pointer; }

/* ══════════════════════ boutons ══════════════════════ */
.btn {
  --lip: rgba(0,0,0,.45);
  position: relative; border: none; cursor: pointer;
  background: var(--panel-2); color: var(--txt);
  padding: 12px 22px; border-radius: 13px;
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 4px 0 var(--lip), 0 10px 20px rgba(0,0,0,.35);
  transition: transform .1s ease, box-shadow .1s ease, filter .18s ease, background .18s;
}
.btn:hover:not(:disabled) { filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--lip), 0 4px 10px rgba(0,0,0,.35); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: 0 4px 0 var(--lip); }
.btn-block { width: 100%; }
.btn-big { padding: 16px 30px; font-size: 17px; font-weight: 700; }
.btn-tiny { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; box-shadow: 0 3px 0 var(--lip), 0 5px 12px rgba(0,0,0,.3); }
.btn-tiny:active:not(:disabled) { transform: translateY(3px); }
.btn-red    { background: linear-gradient(170deg, #FF4A45, var(--red)); --lip: var(--red-d); color: #fff; }
.btn-yellow { background: linear-gradient(170deg, #FFE95C, var(--yellow)); --lip: var(--yellow-d); color: #2E2400; }
.btn-green  { background: linear-gradient(170deg, #22C46B, var(--green)); --lip: var(--green-d); color: #fff; }
.btn-blue   { background: linear-gradient(170deg, #2E90DE, var(--blue)); --lip: var(--blue-d); color: #fff; }
.btn-ghost  { background: rgba(255,255,255,.07); --lip: rgba(0,0,0,.5); border: 1px solid var(--line); }
.btn.danger { background: rgba(237,28,36,.14); color: #FF938E; border: 1px solid rgba(237,28,36,.4); }
.btn.warn   { background: rgba(255,222,23,.14); color: #FFE988; border: 1px solid rgba(255,222,23,.4); }

/* ══════════════════════ accueil ══════════════════════ */
#screen-home { overflow-y: auto; }
.home-stage {
  position: relative; min-height: 100%;
  display: grid; align-content: center; justify-items: center;
  padding: 40px 20px 48px; gap: 6px;
}
.hero { position: relative; display: grid; justify-items: center; padding-top: 118px; }
.hero-fan { position: absolute; top: 0; left: 50%; width: 0; height: 0; z-index: -1; }
.fan-card {
  position: absolute; width: 96px; height: 144px; border-radius: 12px;
  border: 4px solid #fff; box-shadow: 0 20px 40px rgba(0,0,0,.5);
  transform-origin: 50% 150%;
  animation: fanIn .8s var(--ease) backwards;
}
.f1 { background: linear-gradient(160deg, #FF4A45, var(--red));    transform: translate(-50%) rotate(-21deg) translateY(-6px); animation-delay: .05s; }
.f2 { background: linear-gradient(160deg, #FFE95C, var(--yellow)); transform: translate(-50%) rotate(-7deg)  translateY(-14px); animation-delay: .12s; }
.f3 { background: linear-gradient(160deg, #22C46B, var(--green));  transform: translate(-50%) rotate(7deg)   translateY(-14px); animation-delay: .19s; }
.f4 { background: linear-gradient(160deg, #2E90DE, var(--blue));   transform: translate(-50%) rotate(21deg)  translateY(-6px); animation-delay: .26s; }
@keyframes fanIn { from { opacity: 0; transform: translate(-50%) rotate(0) translateY(40px) scale(.7); } }

.wordmark { width: min(400px, 78vw); filter: drop-shadow(0 18px 30px rgba(0,0,0,.6)); animation: dropIn .7s var(--ease) .3s backwards; }
.wordmark svg { width: 100%; height: auto; display: block; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-28px) scale(.9); } }
.tagline { color: #C3C9D8; font-size: 15px; margin: 6px 0 24px; text-align: center; animation: dropIn .7s var(--ease) .42s backwards; }

.home-card {
  width: min(410px, 92vw);
  background: rgba(11,12,19,.86); border: 1px solid var(--line);
  border-radius: 22px; padding: 24px 24px 22px;
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.07);
  animation: dropIn .7s var(--ease) .5s backwards;
}
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .1em; }
.field input, .code-input {
  width: 100%; padding: 14px 16px; font-size: 16px; font-weight: 500;
  background: rgba(255,255,255,.06); color: var(--txt);
  border: 1.5px solid var(--line); border-radius: 12px; outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input::placeholder, .code-input::placeholder { color: #5D6478; }
.field input:focus, .code-input:focus { border-color: var(--gold); background: rgba(255,255,255,.09); box-shadow: 0 0 0 3px rgba(255,201,60,.16); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 10px; }
.code-input { flex: 1; text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 700; font-size: 19px; font-family: var(--display); }
.error { color: #FF938E; font-size: 13.5px; margin-top: 14px; line-height: 1.45; }

.home-facts {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 26px; max-width: 560px;
  animation: dropIn .7s var(--ease) .62s backwards;
}
.home-facts li {
  font-size: 12px; color: var(--muted);
  background: rgba(255,255,255,.045); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 99px;
}
.home-facts b { color: var(--txt); font-weight: 600; }

/* ══════════════════════ salon ══════════════════════ */
/* Le salon tient toujours à l'écran : ce sont les colonnes qui défilent,
   chacune de leur côté. Ainsi le pied reste dégagé et ne recouvre jamais
   les commandes d'un panneau. */
#screen-lobby { overflow: hidden; }
.lobby-wrap { max-width: 1020px; margin: 0 auto; padding: 22px 20px 14px; height: 100%; display: flex; flex-direction: column; }
.lobby-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; padding-right: 64px; }
.lobby-head h2 { font-family: var(--display); font-size: 30px; font-style: italic; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; max-width: 44ch; }
.code-box {
  background: linear-gradient(165deg, rgba(237,28,36,.16), rgba(255,255,255,.04));
  border: 1px solid rgba(237,28,36,.32);
  border-radius: 16px; padding: 12px 20px; text-align: center;
}
.code-label { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.code-value {
  font-family: var(--display); font-size: 32px; font-style: italic;
  letter-spacing: .16em; color: #fff; margin: 5px 0 9px;
  text-shadow: 0 3px 0 rgba(0,0,0,.5);
}

.lobby-grid {
  /* « stretch » est indispensable : sans lui les panneaux prennent leur
     hauteur naturelle et débordent de la grille au lieu de défiler. */
  display: grid; gap: 18px; flex: 1; min-height: 0; align-items: stretch;
  grid-template-columns: 1fr 1.1fr;
  grid-template-areas: "code reglages" "joueurs reglages";
  grid-template-rows: auto minmax(0, 1fr);
}
.join-panel { grid-area: code; }
.players-panel { grid-area: joueurs; }
#settings-panel { grid-area: reglages; }
#code-panel { display: none; }
@media (max-width: 860px) {
  .lobby-grid { grid-template-columns: 1fr; grid-template-areas: "code" "joueurs" "reglages"; grid-template-rows: none; }
}

/* le bloc code, désormais dans un panneau, s'y étale */
.join-panel .code-box { display: grid; justify-items: center; padding: 14px 18px 16px; }
/* Le bloc code ouvre la colonne : compact, pour que la liste des joueurs et
   ses commandes tiennent sous lui sans passer derrière le pied. */
.join-panel { padding: 14px 18px 16px; }
.join-panel h3 { margin-bottom: 8px; }
.join-panel .code-box { padding: 10px 16px 12px; }
.join-panel .qr { width: min(128px, 100%); height: auto; aspect-ratio: 1; }
.join-panel .code-value { font-size: 26px; margin: 1px 0 6px; letter-spacing: .12em; }
.join-panel .qr-hint { font-size: 10.5px; margin: 6px 0 8px; }
.join-panel .code-label { font-size: 9.5px; }
.players-panel { padding: 16px 18px 18px; }
.players-panel h3 { margin-bottom: 10px; }
/* le pied colle en bas et flotte sur le contenu : la grille lui réserve
   sa hauteur, sinon il rogne le dernier élément de chaque colonne */
.lobby-grid { gap: 14px; min-height: 0; }
/* chaque panneau défile dans sa propre boîte */
.players-panel, #settings-panel, #code-panel {
  min-height: 0; max-height: 100%; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
.players-panel::-webkit-scrollbar, #settings-panel::-webkit-scrollbar,
#code-panel::-webkit-scrollbar { width: 5px; }
.players-panel::-webkit-scrollbar-thumb, #settings-panel::-webkit-scrollbar-thumb,
#code-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }
.panel {
  background: rgba(11,12,19,.72); border: 1px solid var(--line);
  border-radius: 20px; padding: 20px 22px; backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
}
.panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 16px; display: flex; justify-content: space-between; font-weight: 600; }
.count { color: var(--gold); }

.players { list-style: none; display: grid; gap: 9px; margin-bottom: 14px; }
.players li {
  display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,.045); border: 1px solid var(--line);
  border-radius: 13px; padding: 10px 12px; font-size: 15px;
  animation: slideIn .3s var(--ease) backwards;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } }
.players li.empty { opacity: .38; border-style: dashed; }
.avatar {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff;
  font-family: var(--display); font-size: 15px; font-style: italic;
  border: 2px solid rgba(255,255,255,.55); box-shadow: 0 4px 10px rgba(0,0,0,.4);
}
.pname { flex: 1; font-weight: 600; }
.tag { font-size: 10.5px; font-weight: 600; padding: 4px 9px; border-radius: 7px; background: rgba(255,255,255,.09); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tag.host  { background: rgba(255,201,60,.18);  color: var(--gold); }
.tag.bot   { background: rgba(0,114,188,.28);   color: #8CC4F5; }
.tag.teamA { background: rgba(0,166,81,.24);    color: #6EE39B; }
.tag.teamB { background: rgba(237,28,36,.24);   color: #FF9D98; }
.kick { background: none; border: none; color: #6B7385; cursor: pointer; font-size: 16px; line-height: 1; padding: 3px 5px; border-radius: 6px; transition: color .16s, background .16s; }
.kick:hover { color: #FF938E; background: rgba(237,28,36,.12); }
.kick.move:hover { color: var(--gold); background: rgba(255,201,60,.12); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

.settings { display: grid; gap: 18px; }
.set-group { display: grid; gap: 9px; }
.set-title { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.seg { display: flex; gap: 5px; background: rgba(0,0,0,.34); padding: 5px; border-radius: 13px; border: 1px solid rgba(255,255,255,.05); }
.seg button {
  flex: 1; padding: 10px 8px; font-size: 13.5px; font-weight: 600;
  background: transparent; border: none; border-radius: 9px; color: var(--muted); cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}
.seg button:hover { color: var(--txt); }
.seg button.on { background: linear-gradient(170deg, #FFE95C, var(--yellow)); color: #2E2400; box-shadow: 0 3px 10px rgba(255,222,23,.25); }
.seg.small button { padding: 8px 6px; font-size: 12.5px; }

.switch { display: flex; align-items: flex-start; gap: 13px; cursor: pointer; padding: 2px 0; }
.switch input { display: none; }
.track { flex: none; width: 44px; height: 25px; border-radius: 99px; background: rgba(255,255,255,.14); position: relative; transition: background .2s; margin-top: 2px; box-shadow: inset 0 2px 5px rgba(0,0,0,.4); }
.track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 2px 5px rgba(0,0,0,.4); }
.switch input:checked + .track { background: linear-gradient(170deg, #22C46B, var(--green)); }
.switch input:checked + .track::after { transform: translateX(19px); }
.sw-text b { display: block; font-size: 14.5px; font-weight: 600; }
.sw-text em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.settings.locked { opacity: .7; pointer-events: none; }

.lobby-foot {
  flex: none; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 14px 0 0; padding: 0; flex-wrap: wrap;
}
.status { color: var(--muted); font-size: 13px; flex: 1; text-align: center; min-width: 180px; }

/* ══════════════════════ HUD ══════════════════════ */
.hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; padding: 14px 16px;
  padding-right: 68px; pointer-events: none; gap: 10px;
}
.hud-group { display: flex; gap: 8px; align-items: center; pointer-events: auto; flex-wrap: wrap; }
.chip {
  background: rgba(10,12,20,.74); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 12px; font-size: 12.5px; font-weight: 500; color: #AEB6C7;
}

/* ══════════════════════ table ══════════════════════ */
.scene::before {
  content: ''; position: absolute; left: 50%; top: 42%;
  width: min(1500px, 148vw); height: min(900px, 120vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse 44% 42% at 50% 44%, rgba(52,214,150,.17), rgba(20,90,70,.10) 46%, transparent 72%);
  pointer-events: none; opacity: .9;
  animation: breathe 11s ease-in-out infinite alternate;
  will-change: opacity;
}
@keyframes breathe { to { opacity: .58; } }
.scene {
  /* la main recouvre le bas du feutre, comme des cartes tenues devant la table */
  position: absolute; inset: 56px 0 calc(var(--ch) * 0.6 + 74px) 0;
  perspective: 1500px; perspective-origin: 50% 38%;
  display: grid; place-items: center;
}
.table3d {
  --play-color: rgba(255,255,255,.2);
  position: relative;
  /* le plateau prend la hauteur que la scène lui laisse ; la largeur en découle,
     ce qui garde la même ellipse du téléphone au très grand écran */
  height: min(760px, 100%);
  aspect-ratio: 3.05;
  max-width: 86vw;
  transform: rotateX(25deg); transform-style: preserve-3d;
}
.rail {
  position: absolute; inset: -20px; border-radius: 50% / 42%;
  background: linear-gradient(165deg, #33363F 0%, #191B22 42%, #0A0B0F 100%);
  box-shadow: 0 46px 80px -18px rgba(0,0,0,.8), inset 0 2px 3px rgba(255,255,255,.09);
  transform: translateZ(-14px);
}
.rail::after {
  content: ''; position: absolute; inset: 16px; border-radius: 50% / 42%;
  box-shadow: inset 0 0 0 2.5px var(--play-color), 0 0 16px 0 var(--play-color);
  opacity: .5; transition: box-shadow .5s ease;
}
.felt {
  position: absolute; inset: 0; border-radius: 50% / 42%; overflow: hidden;
  background:
    radial-gradient(58% 62% at 50% 26%, var(--felt-1), var(--felt-2) 56%, var(--felt-3) 100%);
  box-shadow: inset 0 0 110px rgba(0,0,0,.55), inset 0 4px 12px rgba(255,255,255,.06);
  transform: translateZ(-6px);
}
.felt::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23f)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .12;
}
.felt::after {
  content: ''; position: absolute; inset: 22px; border-radius: 50% / 42%;
  border: 2px dashed rgba(255,255,255,.075);
}
.felt-mark {
  position: absolute; left: 50%; top: 74%; width: 40%;
  transform: translate(-50%, -50%);
  opacity: .085; pointer-events: none;
}
.felt-mark svg { width: 100%; height: auto; display: block; }

/* flèches qui tournent autour des piles, dans le sens du jeu */
.dir-ring {
  --ring-r: calc(var(--cw) * 2.05);
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--ring-r) * 2); height: calc(var(--ring-r) * 2);
  margin: calc(var(--ring-r) * -1) 0 0 calc(var(--ring-r) * -1);
  pointer-events: none; transform: translateZ(5px);
}
.dir-ring.ccw { transform: translateZ(5px) scaleX(-1); }
.orbit { position: absolute; inset: 0; animation: orbit 9s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.orbit i {
  position: absolute; left: 50%; top: 50%;
  width: 30px; height: 27px; margin: -13px 0 0 -15px;
  background: rgba(255,255,255,.85);
  clip-path: polygon(0 6%, 100% 50%, 0 94%, 32% 50%);
  /* rotate(--a) oriente déjà le repère local : l'axe X local suit la tangente,
     donc la flèche (qui pointe vers la droite) indique le sens de rotation. */
  transform: rotate(var(--a)) translateY(calc(var(--ring-r) * -1));
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.8));
}

/* piles centrales */
.center {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) translateZ(18px);
  display: flex; gap: 30px; align-items: center; transform-style: preserve-3d;
}
.pile { position: relative; width: var(--cw); height: var(--ch); transform-style: preserve-3d; }
#deck-pile { cursor: pointer; transition: transform .18s var(--ease); }
#deck-pile .card { position: absolute; inset: 0; }
#deck-pile .deck-2 { transform: translate(-3px, -3px) rotate(-2deg); }
#deck-pile .deck-3 { transform: translate(-6px, -6px) rotate(-4deg); }
#deck-pile:hover { transform: translateZ(14px) scale(1.03); }
#deck-pile.can-draw { animation: deckCall 1.9s ease-in-out infinite; }
#deck-pile.can-draw > .card:last-of-type { box-shadow: 0 0 0 3px var(--gold), 0 16px 30px rgba(0,0,0,.55); }
@keyframes deckCall { 50% { scale: 1.03; } }
.pile-count {
  position: absolute; bottom: -24px; left: 0; right: 0; text-align: center;
  font-size: 11px; color: rgba(255,255,255,.5); font-weight: 500;
}
.discard .card { position: absolute; inset: 0; }
.discard::before {
  content: ''; position: absolute; inset: -34%; border-radius: 50%;
  background: radial-gradient(circle, var(--play-color), transparent 66%);
  opacity: .4; transition: background .45s ease; pointer-events: none;
}

/* ══════════════════════ cartes ══════════════════════ */
.card {
  width: var(--cw); height: var(--ch); border-radius: 13px;
  background: #fff; padding: 6px; position: relative; overflow: hidden;
  box-shadow: 0 12px 24px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.08);
  display: grid; place-items: center; transform-style: preserve-3d;
}
.card .inner {
  position: absolute; inset: 6px; border-radius: 8px;
  display: grid; place-items: center; overflow: hidden;
}
.card.red    .inner { background: radial-gradient(120% 90% at 30% 10%, #FF5B52, var(--red) 55%, var(--red-d)); }
.card.yellow .inner { background: radial-gradient(120% 90% at 30% 10%, #FFEE7A, var(--yellow) 55%, var(--yellow-d)); }
.card.green  .inner { background: radial-gradient(120% 90% at 30% 10%, #2ED47B, var(--green) 55%, var(--green-d)); }
.card.blue   .inner { background: radial-gradient(120% 90% at 30% 10%, #3D9BE8, var(--blue) 55%, var(--blue-d)); }
.card.wild   .inner { background: #17171D; }
.card.wild   .inner::before {
  content: ''; position: absolute; inset: 0;
  background: conic-gradient(from 45deg, var(--red) 0 25%, var(--blue) 0 50%, var(--green) 0 75%, var(--yellow) 0);
}
.card .oval {
  position: relative; z-index: 1;
  width: 78%; height: 86%; border-radius: 50% / 44%;
  background: #fff; transform: rotate(-26deg);
  display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.22);
}
.card .glyph {
  transform: rotate(26deg);
  font-family: var(--display); font-style: italic;
  font-size: calc(var(--cw) * .48); line-height: 1;
  letter-spacing: -.02em;
}
.card .glyph.sm { font-size: calc(var(--cw) * .34); }
.card .glyph svg { width: calc(var(--cw) * .40); height: calc(var(--cw) * .40); display: block; }
.card.red    .glyph { color: var(--red); }
.card.yellow .glyph { color: var(--yellow-d); }
.card.green  .glyph { color: var(--green); }
.card.blue   .glyph { color: var(--blue); }
.card.wild   .glyph { color: #17171D; }
.card .glyph.wheel {
  width: calc(var(--cw) * .46); height: calc(var(--cw) * .46); border-radius: 50%;
  background: conic-gradient(from 45deg, var(--red) 0 25%, var(--blue) 0 50%, var(--green) 0 75%, var(--yellow) 0);
  border: 3px solid #fff; box-shadow: 0 2px 7px rgba(0,0,0,.35);
}
.card .corner {
  position: absolute; z-index: 2;
  font-family: var(--display); font-style: italic; font-size: calc(var(--cw) * .15);
  color: #fff; text-shadow: 0 2px 3px rgba(0,0,0,.45); line-height: 1;
}
.card .corner svg { width: calc(var(--cw) * .15); height: calc(var(--cw) * .15); display: block; }
.card .corner.tl { top: 11px; left: 12px; }
.card .corner.br { bottom: 11px; right: 12px; transform: rotate(180deg); }
.card::after {   /* vernis */
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 13px;
  background: linear-gradient(118deg, rgba(255,255,255,.30) 0 26%, rgba(255,255,255,.05) 38%, transparent 56%);
}
/* dos de carte, façon paquet officiel */
.card.back { background: #fff; }
.card.back::before {
  content: ''; position: absolute; inset: 6px; border-radius: 8px;
  background: radial-gradient(120% 90% at 30% 12%, #26262E, #101016 60%, #08080B);
}
.card.back::after {
  content: 'WebNo'; position: absolute; z-index: 1;
  left: 50%; top: 50%; width: 84%; height: 44%;
  transform: translate(-50%, -50%) rotate(-22deg);
  border-radius: 50%; background: linear-gradient(170deg, #FF4A45, var(--red));
  border: 2.5px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.5);
  display: grid; place-items: center;
  font-family: var(--display); font-style: italic; color: #fff;
  font-size: calc(var(--cw) * .17); letter-spacing: .01em;
}
.card .chosen-dot {
  position: absolute; z-index: 3; top: 9px; right: 10px; width: 17px; height: 17px;
  border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.55);
}
.dot-red { background: var(--red); } .dot-yellow { background: var(--yellow); }
.dot-green { background: var(--green); } .dot-blue { background: var(--blue); }

@keyframes cardIn {
  from { transform: translate3d(-150px, -120px, 160px) rotate(-50deg) scale(1.2); opacity: 0; }
  to   { transform: translate3d(0,0,0) rotate(var(--rot, 0deg)) scale(1); opacity: 1; }
}
.discard .card.newest { animation: cardIn .38s var(--ease); }

/* ══════════════════════ places des joueurs ══════════════════════
   Chaque adversaire tient sa main devant lui : un éventail de dos, ou de
   faces s'il est de votre équipe.                                        */
.seats { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.seat {
  position: absolute; pointer-events: auto;
  transform: translate(-50%, -50%) translateZ(34px);
  transition: transform .3s var(--ease);
}

.player-box {
  position: relative;
  display: grid; justify-items: center; gap: 5px;
  padding: 8px 12px 9px; border-radius: 16px; min-width: 128px;
  background: linear-gradient(168deg, rgba(31,34,46,.94), rgba(9,10,15,.94));
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 16px 30px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
  transition: box-shadow .3s, border-color .3s, transform .3s var(--ease);
}
.player-box.active {
  border-color: rgba(255,201,60,.75);
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(0,0,0,.6), 0 0 32px rgba(255,201,60,.32);
}
.player-box.active::before {
  content: ''; position: absolute; inset: -2px; border-radius: 18px;
  padding: 2px; pointer-events: none; z-index: 2; --ring: 0deg;
  background: conic-gradient(from var(--ring),
    rgba(255,201,60,.12) 0 56%, var(--gold) 76%, #FFF6D2 83%, var(--gold) 90%, rgba(255,201,60,.12) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: ringSpin 2.8s linear infinite;
}
@keyframes ringSpin { to { --ring: 360deg; } }
.player-box.ally { background: linear-gradient(168deg, rgba(14,54,32,.95), rgba(7,20,13,.95)); border-color: rgba(0,166,81,.35); }
.player-box.offline { opacity: .72; }

.pb-head { display: flex; align-items: center; gap: 8px; width: 100%; }
.pb-avatar {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff;
  font-family: var(--display); font-style: italic; font-size: 12px;
  border: 2px solid rgba(255,255,255,.6); box-shadow: 0 3px 8px rgba(0,0,0,.45);
}
.pb-name { flex: 1; font-size: 13.5px; font-weight: 650; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-count {
  flex: none; min-width: 22px; text-align: center;
  font-family: var(--display); font-style: italic; font-size: 12px;
  background: rgba(255,255,255,.1); border-radius: 6px; padding: 2px 6px;
}
.player-box.active .pb-count { background: rgba(255,201,60,.22); color: var(--gold); }
.pb-meta {
  font-size: 10.5px; color: var(--muted); font-weight: 500;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px;
}
.pb-meta .pm + .pm::before { content: '·'; margin-right: 5px; opacity: .6; }
.pb-meta .dc-badge { color: #FF938E; }

/* l'éventail tenu par le joueur */
.hand-fan { position: relative; width: 100%; height: 44px; }
.fc {
  position: absolute; left: 50%; bottom: 0;
  width: 26px; height: 39px; border-radius: 4px;
  margin-left: -13px;
  transform-origin: 50% 135%;
  transform: translateX(var(--x, 0)) rotate(var(--a, 0deg));
  background: linear-gradient(150deg, #2A2A33, #0C0C11);
  border: 1.5px solid rgba(255,255,255,.34);
  box-shadow: 0 3px 8px rgba(0,0,0,.55);
  overflow: hidden;
  transition: transform .3s var(--ease);
}
.fc::after {
  content: ''; position: absolute; inset: 30% 16%; border-radius: 50%;
  background: var(--red); opacity: .9;
}
/* faces visibles : les cartes d'un coéquipier */
.fc.face { border-color: rgba(255,255,255,.9); display: grid; place-items: center; }
.fc.face::after { content: none; }
.fc.face.red    { background: linear-gradient(155deg, #FF5B52, var(--red)); }
.fc.face.yellow { background: linear-gradient(155deg, #FFEE7A, var(--yellow)); }
.fc.face.green  { background: linear-gradient(155deg, #2ED47B, var(--green)); }
.fc.face.blue   { background: linear-gradient(155deg, #3D9BE8, var(--blue)); }
.fc.face.wild   { background: conic-gradient(from 45deg, var(--red) 0 25%, var(--blue) 0 50%, var(--green) 0 75%, var(--yellow) 0); }
.fc.face b {
  font-family: var(--display); font-style: italic; font-size: 13px; line-height: 1;
  color: #fff; text-shadow: 0 1.5px 2px rgba(0,0,0,.55);
}
.fc.face.yellow b { color: #4A3800; text-shadow: 0 1px 1px rgba(255,255,255,.4); }
.fc.face b svg { width: 13px; height: 13px; display: block; }
.fc.face b .cw {
  display: block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #fff;
  background: conic-gradient(from 45deg, var(--red) 0 25%, var(--blue) 0 50%, var(--green) 0 75%, var(--yellow) 0);
}

.uno-badge {
  position: absolute; top: -11px; right: -10px; z-index: 4;
  background: linear-gradient(170deg, #FF4A45, var(--red)); color: #fff;
  font-family: var(--display); font-style: italic; font-size: 11px;
  padding: 4px 10px; border-radius: 99px; border: 2px solid #fff;
  box-shadow: 0 5px 14px rgba(237,28,36,.5);
  animation: pulse 1s ease-in-out infinite;
}
.uno-badge.callable { cursor: pointer; background: linear-gradient(170deg, #FFE95C, var(--yellow)); color: #33280A; }
.uno-badge.callable:hover { scale: 1.12; }
@keyframes pulse { 50% { scale: 1.12; } }

/* tables nombreuses : on resserre les plaques */
.seats[data-n="6"] .player-box,
.seats[data-n="7"] .player-box { min-width: 112px; padding: 7px 10px 8px; }
.seats[data-n="8"] .player-box { min-width: 100px; padding: 6px 9px 7px; gap: 4px; }
.seats[data-n="8"] .pb-name { font-size: 12px; max-width: 78px; }
.seats[data-n="8"] .pb-avatar { width: 24px; height: 24px; font-size: 11px; }
.seats[data-n="8"] .hand-fan { height: 34px; }
.seats[data-n="8"] .fc { width: 20px; height: 30px; margin-left: -10px; }
.seats[data-n="7"] .hand-fan, .seats[data-n="6"] .hand-fan { height: 38px; }
.seats[data-n="7"] .fc, .seats[data-n="6"] .fc { width: 23px; height: 34px; margin-left: -11.5px; }

.pending-badge {
  position: absolute; left: 50%; top: 50%; z-index: 5;
  transform: translate(-50%, calc(-50% - 104px)) translateZ(46px);
  background: linear-gradient(170deg, #FF4A45, var(--red));
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 10px 20px; border-radius: 99px; border: 2.5px solid #fff;
  box-shadow: 0 12px 30px rgba(237,28,36,.5);
  animation: pulse 1.1s ease-in-out infinite; white-space: nowrap;
}

/* ══════════════════════ ma zone ══════════════════════ */
.myzone {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 14px; z-index: 20;
  background: linear-gradient(to top, rgba(4,5,9,.96) 30%, rgba(4,5,9,.6) 68%, transparent);
}
.me-bar { display: flex; gap: 9px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.me-name { font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,.85); }
.me-score, .me-team { color: var(--muted); font-size: 12px; background: var(--panel); padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); }
.turn-flag {
  background: linear-gradient(170deg, #FFE95C, var(--yellow)); color: #2E2400;
  padding: 4px 13px; border-radius: 8px; font-weight: 700; font-size: 12px;
  box-shadow: 0 4px 12px rgba(255,222,23,.3);
  animation: pulse 1.5s ease-in-out infinite;
}
.hand {
  position: relative; flex: none; width: 100%;
  height: calc(var(--ch) + 30px);
  display: flex; justify-content: center; align-items: flex-end;
  perspective: 1100px;
}
.hand .card {
  position: absolute; bottom: 0;
  transform-origin: 50% 168%;
  transform: translateX(var(--x)) rotate(var(--a));
  transition: transform .24s var(--ease), filter .2s, opacity .2s;
  cursor: default;
}
.hand .card.playable { cursor: pointer; }
.hand .card.playable::before {
  content: ''; position: absolute; inset: -3px; z-index: 3; border-radius: 16px;
  border: 3px solid var(--gold); box-shadow: 0 0 20px rgba(255,201,60,.55);
  pointer-events: none;
}
.hand .card.jump::before { border-color: #6FE3FF; box-shadow: 0 0 20px rgba(111,227,255,.55); }
.hand .card.playable:hover,
.hand .card.selected { transform: translateX(var(--x)) rotate(var(--a)) translateY(-38px) scale(1.08); z-index: 9 !important; }
.hand .card.selected::after { box-shadow: inset 0 0 0 3px rgba(255,255,255,.95); }
.hand .card.selected.dim { filter: none; opacity: 1; }
.hand .card.dim {
  filter: brightness(.66); opacity: .88;
  transform: translateX(var(--x)) rotate(var(--a)) translateY(7px) scale(.97);
}
.hand .card.dealt { animation: dealIn .4s var(--ease) backwards; }
@keyframes dealIn { from { transform: translateX(0) translateY(-300px) rotate(24deg) scale(.55); opacity: 0; } }

/* main trop fournie ou écran étroit : on fait défiler au doigt */
.hand.scroll {
  display: flex; align-items: flex-end; justify-content: flex-start;
  gap: 8px; padding: 14px 16px 8px;
  overflow-x: auto; overflow-y: hidden;
  perspective: none; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.3) transparent;
}
.hand.scroll::-webkit-scrollbar { height: 7px; }
.hand.scroll::-webkit-scrollbar-track { background: transparent; }
.hand.scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 4px; }
.hand.scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.45); }
.hand.scroll .card {
  position: relative; bottom: auto; flex: 0 0 auto;
  transform: none; transform-origin: 50% 50%;
  scroll-snap-align: center;
}
.hand.scroll .card.dim { transform: translateY(8px) scale(.96); }
.hand.scroll .card.playable:hover,
.hand.scroll .card.selected { transform: translateY(-12px) scale(1.05); }
/* repère visuel : la main déborde et se fait défiler */
.hand.scroll::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 8px; width: 46px;
  background: linear-gradient(to left, rgba(4,5,9,.92), transparent);
  pointer-events: none;
}

.actions { display: flex; gap: 10px; margin-top: 16px; position: relative; z-index: 12; }
.btn.action { min-width: 112px; }
.btn.action.uno {
  background: linear-gradient(170deg, #FF4A45, var(--red)); --lip: var(--red-d); color: #fff;
  font-family: var(--display); font-style: italic; letter-spacing: .04em;
}
.btn.action.uno:not(:disabled) { animation: unoCall 1.1s ease-in-out infinite; }
@keyframes unoCall { 50% { scale: 1.05; } }
.btn.action.uno.armed { background: linear-gradient(170deg, #FFE95C, var(--yellow)); --lip: var(--yellow-d); color: #2E2400; box-shadow: 0 4px 0 var(--lip), 0 0 26px rgba(255,222,23,.5); }

/* ══════════════════════ journal, toasts, confettis ══════════════════════ */
.toasts { position: absolute; left: 50%; top: 80px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 40; pointer-events: none; justify-items: center; }
.toast {
  background: rgba(10,12,20,.94); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 20px; font-size: 14px; font-weight: 500;
  box-shadow: 0 14px 34px rgba(0,0,0,.55);
  animation: toastIn .28s var(--ease), toastOut .3s ease-in 2.6s forwards;
}
.toast.big { font-family: var(--display); font-style: italic; font-size: 17px; letter-spacing: .01em; }
.toast.warn { border-color: rgba(255,222,23,.45); color: #FFE988; }
.toast.bad  { border-color: rgba(237,28,36,.45); color: #FF938E; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 15px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  from { transform: translateY(-30px) rotate(0); opacity: 1; }
  to   { transform: translateY(105vh) rotate(760deg); opacity: .9; }
}

/* ══════════════════════ overlays ══════════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3,4,8,.88);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn .2s ease-out;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  position: relative;
  background: linear-gradient(168deg, #1B1E29, #0C0E15);
  border: 1px solid var(--line); border-radius: 24px;
  padding: 30px 32px; text-align: center; max-width: 94vw;
  box-shadow: 0 36px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.07);
  animation: popIn .26s var(--ease);
}
.modal::before {
  content: ''; position: absolute; left: 26px; right: 26px; top: 0; height: 4px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--red) 0 25%, var(--yellow) 0 50%, var(--green) 0 75%, var(--blue) 0);
}
.modal.wide { min-width: min(540px, 92vw); }
@keyframes popIn { from { transform: scale(.9) translateY(10px); opacity: 0; } }
.modal h3 { font-family: var(--display); font-style: italic; font-size: 23px; margin-bottom: 20px; }
.color-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.col {
  width: 100px; height: 100px; border-radius: 20px; border: 4px solid rgba(255,255,255,.9);
  cursor: pointer; transition: transform .15s var(--ease), box-shadow .18s; position: relative;
}
.col::after { content: ''; position: absolute; inset: 0; border-radius: 16px; background: linear-gradient(120deg, rgba(255,255,255,.32) 0 30%, transparent 52%); }
.col:hover { transform: scale(1.09) rotate(-3deg); }
.col.red    { background: linear-gradient(160deg, #FF5B52, var(--red));    box-shadow: 0 12px 30px rgba(237,28,36,.45); }
.col.yellow { background: linear-gradient(160deg, #FFEE7A, var(--yellow)); box-shadow: 0 12px 30px rgba(255,222,23,.4); }
.col.green  { background: linear-gradient(160deg, #2ED47B, var(--green));  box-shadow: 0 12px 30px rgba(0,166,81,.4); }
.col.blue   { background: linear-gradient(160deg, #3D9BE8, var(--blue));   box-shadow: 0 12px 30px rgba(0,114,188,.45); }

.target-picker { display: grid; gap: 10px; margin-bottom: 16px; }
.target-picker button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--txt);
  font-size: 15px; font-weight: 500; transition: background .16s, transform .14s;
}
.target-picker button:hover { background: rgba(255,255,255,.1); transform: translateX(4px); }
.target-picker .tp-count { margin-left: auto; color: var(--muted); font-size: 13px; }

.scoreboard { width: 100%; border-collapse: collapse; margin: 4px 0 18px; font-size: 14px; }
.scoreboard th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); font-weight: 600; }
.scoreboard td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.055); text-align: left; }
.scoreboard tr.win td { color: var(--gold); font-weight: 700; }
.scoreboard td:last-child, .scoreboard th:last-child { text-align: right; }
.modal-note { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; align-items: center; }
.waiting { color: var(--muted); font-size: 13px; }
.trophy { font-size: 56px; margin-bottom: 4px; animation: pop 1.5s ease-in-out infinite; }
@keyframes pop { 50% { translate: 0 -9px; scale: 1.07; } }
.winner-line { font-family: var(--display); font-style: italic; font-size: 18px; color: var(--gold); margin-bottom: 18px; }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.14); border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}

/* rôles */
body.is-guest .host-only { display: none !important; }
body.is-host .non-host { display: none !important; }

/* ══════════════════════ adaptations ══════════════════════ */

/* ─── écrans intermédiaires ─── */
@media (max-width: 900px) {
  .seat-left  { left: 1%; transform: translate(0, -50%) translateZ(36px) scale(.88); }
  .seat-right { right: 1%; transform: translate(0, -50%) translateZ(36px) scale(.88); }
}

/* ─── interface téléphone ───────────────────────────────────────────
   Le grand ovale en perspective ne tient pas en portrait : le plateau
   devient une table verticale arrondie, les adversaires passent en
   bandeau, et tout ce qui se touche grossit.                        */
@media (max-width: 600px) {
  .scene { inset: 48px 0 calc(var(--ch) + 132px) 0; padding: 0 8px; }
  .table3d {
    height: 100%; width: 100%; max-width: none; aspect-ratio: auto;
    transform: rotateX(9deg);
  }
  .rail { inset: -7px; border-radius: 26px; }
  .rail::after { inset: 7px; border-radius: 21px; }
  .felt { border-radius: 22px; }
  .felt::after { inset: 10px; border-radius: 16px; }
  .felt-mark { top: 80%; width: 58%; opacity: .07; }
  .dir-ring { --ring-r: calc(var(--cw) * 2.3); }
  .orbit i { width: 20px; height: 18px; margin: -9px 0 0 -10px; }

  /* adversaires en bandeau sur toute la largeur */
  .seat-left  { left: 6px;  top: 6px; transform: translateZ(14px); transform-origin: top left; }
  .seat-top   { left: 50%;  top: 6px; transform: translate(-50%, 0) translateZ(14px); }
  .seat-right { right: 6px; top: 6px; transform: translateZ(14px); transform-origin: top right; }
  .player-box { min-width: 0; padding: 6px 9px 7px; gap: 4px; border-radius: 13px; }
  .player-box.active { transform: translateZ(10px) scale(1.02); }
  .pb-head { gap: 6px; }
  .pb-avatar { width: 22px; height: 22px; font-size: 10px; border-radius: 7px; }
  .pb-name { font-size: 11px; max-width: 60px; }
  .pb-meta { font-size: 9.5px; }
  .mini-hand { height: 21px; }
  .mini-hand .mini { width: 14px; height: 20px; margin-left: -9px; border-radius: 3px; }
  .mini-hand.revealed { display: none; }        /* les cartes passent dans le bandeau */
  .ally-strip { display: flex; }
  .ally-cards .mini.face { width: 22px; height: 32px; }
  .mini.face b { font-size: 11px; }
  .mini.face b svg, .mini.face b .cw { width: 11px; height: 11px; }
  .player-box { max-width: 112px; }
  .pb-meta .pm-score, .pb-meta .pm-side, .pb-meta .pm-bot { display: none; }
  .pb-meta { white-space: nowrap; }
  .uno-badge {
    top: -10px; right: auto; left: 50%; translate: -50% 0;
    font-size: 9.5px; padding: 3px 8px;
  }

  /* la pioche et la défausse restent bien lisibles au centre */
  .center { --cw: clamp(84px, 23vw, 104px); --ch: calc(var(--cw) * 1.5); gap: 16px; }
  .pile-count { bottom: -19px; font-size: 10px; }
  .pending-badge {
    transform: translate(-50%, calc(-50% - 96px)) translateZ(30px);
    font-size: 13px; padding: 8px 15px;
  }

  /* zone du joueur : cibles tactiles confortables */
  .myzone { padding-bottom: 10px; }
  .me-bar { font-size: 12px; gap: 6px; }
  .me-score, .me-team { font-size: 11px; padding: 3px 8px; }
  .me-team { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .actions { width: 100%; padding: 0 10px; gap: 8px; margin-top: 12px; }
  .btn.action { flex: 1; min-width: 0; padding: 14px 6px; font-size: 14px; border-radius: 14px; }
  .hand.scroll { padding: 0 12px 8px; gap: 7px; }

  /* bandeau et panneaux */
  .hud { padding: 10px 12px; padding-right: 56px; flex-wrap: nowrap; }
  .hud-group { flex-wrap: nowrap; }
  #hud-mode, #btn-help { display: none; }
  .chip { padding: 6px 9px; font-size: 11.5px; white-space: nowrap; }
  .btn-tiny { padding: 7px 11px; font-size: 12px; }
  .toasts { top: 56px; width: 92vw; }
  .toast { font-size: 13px; padding: 9px 14px; }
  .sound-dock { top: 10px; right: 10px; }
  .sound-btn { width: 38px; height: 38px; }

  /* accueil et salon */
  .home-facts { display: none; }
  .hero { padding-top: 96px; }
  .wordmark { width: min(320px, 74vw); }
  .fan-card { width: 78px; height: 117px; }
  .lobby-wrap { padding: 18px 14px 30px; }
  .lobby-head { padding-right: 52px; }
  .lobby-head h2 { font-size: 24px; }
  .code-value { font-size: 26px; }
  .panel { padding: 16px; border-radius: 16px; }
  .lobby-foot { margin: 18px -14px -30px; padding: 14px; }
  .lobby-foot .btn-big { flex: 1; }
  .status { order: 3; width: 100%; }

  /* fenêtres modales */
  .modal { padding: 22px 18px; border-radius: 20px; }
  .modal.wide { min-width: 0; width: 100%; }
  .modal h3 { font-size: 19px; }
  .col { width: 100%; height: 78px; border-radius: 16px; }
  .color-picker { gap: 10px; }
  .scoreboard { font-size: 13px; }
  .scoreboard th, .scoreboard td { padding: 8px 6px; }
  .keylist { display: none; }
}

/* ─── téléphone en paysage : la hauteur est la ressource rare ─── */
@media (max-height: 480px) and (orientation: landscape) {
  :root { --cw: clamp(46px, 12.5vh, 84px); }
  .hud { padding: 8px 12px; padding-right: 54px; }
  .scene { inset: 40px 0 calc(var(--ch) * 0.55 + 60px) 0; }
  .myzone { padding-bottom: 6px; }
  .me-bar { margin-bottom: 2px; font-size: 11px; gap: 6px; }
  .me-score, .me-team { font-size: 10.5px; padding: 2px 7px; }
  .actions { margin-top: 6px; }
  .btn.action { padding: 8px 12px; font-size: 12.5px; min-width: 86px; }
  .felt-mark, .pile-count { display: none; }
  .dir-ring { --ring-r: calc(var(--cw) * 1.9); }
  .orbit i { width: 17px; height: 16px; margin: -8px 0 0 -8px; }
  .player-box { min-width: 0; max-width: 132px; padding: 5px 8px 6px; gap: 3px; }
  .pb-avatar { width: 20px; height: 20px; font-size: 9px; border-radius: 6px; }
  .pb-name { font-size: 10.5px; max-width: 66px; }
  .pb-meta { font-size: 9px; white-space: nowrap; }
  .pb-meta .pm-score, .pb-meta .pm-side, .pb-meta .pm-bot { display: none; }
  .mini-hand { height: 18px; }
  .mini-hand .mini { width: 12px; height: 17px; margin-left: -8px; }
  /* en paysage la largeur ne manque pas : les cartes du coéquipier
     restent sur sa plaque, le bandeau devient inutile */
  .mini-hand.revealed { display: flex; max-width: 124px; gap: 2px; }
  .mini-hand.revealed .mini.face { width: 17px; height: 25px; border-radius: 3px; }
  .mini.face b { font-size: 9px; }
  .mini.face b svg, .mini.face b .cw { width: 9px; height: 9px; }
  .ally-strip { display: none; }
  .uno-badge {
    top: -9px; right: auto; left: 50%; translate: -50% 0;
    font-size: 8.5px; padding: 2px 7px; border-width: 1.5px;
  }
  .chip { padding: 5px 8px; font-size: 11px; }
  #hud-mode, #btn-help { display: none; }
}

/* ─── écrans peu hauts en général ─── */
@media (max-height: 680px) and (orientation: landscape) {
  .actions { margin-top: 8px; }
  .me-bar { margin-bottom: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .halo, .drift, .dir-ring .arrow, .player-box.active::before, .trophy,
  .uno-badge, .pending-badge, .turn-flag, .btn.action.uno, #deck-pile.can-draw { animation: none !important; }
  .confetti { display: none; }
  * { transition-duration: .05s !important; }
}

/* petite roue quadricolore dans les coins des jokers */
.card .corner .cw {
  display: block; width: calc(var(--cw) * .15); height: calc(var(--cw) * .15);
  border-radius: 50%; border: 1.5px solid #fff;
  background: conic-gradient(from 45deg, var(--red) 0 25%, var(--blue) 0 50%, var(--green) 0 75%, var(--yellow) 0);
}

/* réglages du salon */
.set-note { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: -2px; }
.players.compact li { padding: 7px 10px; font-size: 13.5px; gap: 8px; }
.players.compact .avatar { width: 26px; height: 26px; font-size: 12px; border-radius: 8px; }
.players.compact { max-height: 44vh; overflow-y: auto; scrollbar-width: thin; }
.players li.summary { justify-content: flex-start; }

/* ══════════════════════ QR code d'invitation ══════════════════════ */
.qr {
  display: block; width: 168px; height: 168px; margin: 5px auto 6px; padding: 0;
  border: 4px solid #fff; border-radius: 10px; background: #fff; cursor: zoom-in;
  box-shadow: 0 8px 22px rgba(0,0,0,.5); overflow: hidden;
  transition: transform .16s var(--ease);
}
.qr:hover { transform: scale(1.04); }
.qr svg { display: block; width: 100% !important; height: 100% !important; }
.qr:empty { display: none; }
.qr-hint { font-size: 10.5px; color: var(--muted); margin-bottom: 9px; }
.qr:empty + .qr-hint { display: none; }
.qr-big {
  width: min(58vh, 78vw); height: min(58vh, 78vw); margin: 0 auto 16px;
  border: 10px solid #fff; border-radius: 14px; background: #fff;
}
.qr-big svg { display: block; width: 100% !important; height: 100% !important; }
#qr-big-code { font-family: var(--display); font-style: italic; letter-spacing: .2em; font-size: 30px; }

.scan-btn { margin-top: 12px; display: none; align-items: center; justify-content: center; gap: 9px; }
.scan-btn svg { width: 19px; height: 19px; }
body.can-scan .scan-btn { display: flex; }
.scan-frame {
  position: relative; width: min(320px, 72vw); aspect-ratio: 1; margin: 0 auto 14px;
  border-radius: 18px; overflow: hidden; background: #05070c; border: 1px solid var(--line);
}
.scan-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-reticle {
  position: absolute; inset: 16%; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255,201,60,.85), 0 0 0 100vmax rgba(3,4,8,.45);
}



/* ══════════════════════ pack Flip : le côté sombre ══════════════════════ */
.card.pink   .inner { background: radial-gradient(120% 90% at 30% 10%, #FF5AA8, var(--pink) 55%, var(--pink-d)); }
.card.teal   .inner { background: radial-gradient(120% 90% at 30% 10%, #3FD8D4, var(--teal) 55%, var(--teal-d)); }
.card.orange .inner { background: radial-gradient(120% 90% at 30% 10%, #FFB05C, var(--orange) 55%, var(--orange-d)); }
.card.purple .inner { background: radial-gradient(120% 90% at 30% 10%, #A87BD4, var(--purple) 55%, var(--purple-d)); }
.card.pink   .glyph { color: var(--pink); }
.card.teal   .glyph { color: var(--teal-d); }
.card.orange .glyph { color: var(--orange-d); }
.card.purple .glyph { color: var(--purple); }

.fc.face.pink   { background: linear-gradient(155deg, #FF5AA8, var(--pink)); }
.fc.face.teal   { background: linear-gradient(155deg, #3FD8D4, var(--teal)); }
.fc.face.orange { background: linear-gradient(155deg, #FFB05C, var(--orange)); }
.fc.face.purple { background: linear-gradient(155deg, #A87BD4, var(--purple)); }
.fc.face.teal b, .fc.face.orange b { color: #12261F; text-shadow: 0 1px 1px rgba(255,255,255,.35); }
/* faces vues à travers le carton d'un adversaire : légèrement en retrait */
.fc.verso { opacity: .88; filter: saturate(.86) brightness(.94); }

.col.pink   { background: linear-gradient(160deg, #FF5AA8, var(--pink));   box-shadow: 0 12px 30px rgba(229,18,125,.45); }
.col.teal   { background: linear-gradient(160deg, #3FD8D4, var(--teal));   box-shadow: 0 12px 30px rgba(0,169,165,.45); }
.col.orange { background: linear-gradient(160deg, #FFB05C, var(--orange)); box-shadow: 0 12px 30px rgba(245,130,32,.45); }
.col.purple { background: linear-gradient(160deg, #A87BD4, var(--purple)); box-shadow: 0 12px 30px rgba(123,79,168,.45); }

.dot-pink { background: var(--pink); } .dot-teal { background: var(--teal); }
.dot-orange { background: var(--orange); } .dot-purple { background: var(--purple); }

/* joker pioche-couleur : la roue marquée d'un plus */
.glyph.wheel { position: relative; }
.wheel-plus {
  position: absolute; right: -6px; bottom: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #17171D; color: #fff; border: 2px solid #fff;
  display: grid; place-items: center; font-style: normal;
  font-family: var(--display); font-size: 14px; line-height: 1;
}

/* la table bascule elle aussi du côté sombre */
body.dark-side {
  --felt-1: #3A2A66; --felt-2: #241844; --felt-3: #120B24;
}
body.dark-side .rail {
  background: linear-gradient(165deg, #2A2440 0%, #171327 42%, #0A0812 100%);
}
body.dark-side .scene::before {
  background: radial-gradient(ellipse 44% 42% at 50% 44%, rgba(150,90,230,.18), rgba(70,40,120,.10) 46%, transparent 72%);
}
body.dark-side .card.back::after { background: linear-gradient(170deg, #A87BD4, var(--purple)); }
body.dark-side .fc::after { background: var(--purple); }
body.dark-side .felt-mark { opacity: .06; }

/* l'annonce du retournement */
.flip-flash {
  position: absolute; inset: 0; z-index: 55; pointer-events: none;
  display: grid; place-items: center;
}
.flip-flash b {
  font-family: var(--display); font-style: italic; font-size: clamp(30px, 5vw, 58px);
  color: #fff; text-shadow: 0 6px 0 rgba(0,0,0,.45);
  animation: flipShout 1.5s var(--ease) forwards;
}
@keyframes flipShout {
  0% { opacity: 0; scale: .6; rotate: -12deg; }
  22% { opacity: 1; scale: 1.08; rotate: 3deg; }
  32% { scale: 1; rotate: 0deg; }
  75% { opacity: 1; }
  100% { opacity: 0; scale: 1.15; }
}
/* toutes les cartes se retournent d'un coup */
body.flipping .hand .card, body.flipping .discard .card, body.flipping .fc {
  animation: flipTurn .55s var(--ease);
}
@keyframes flipTurn {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

/* ══════════════════════ pack Flip : le côté sombre ══════════════════════ */
.card.pink   .inner { background: radial-gradient(120% 90% at 30% 10%, #FF5AA8, var(--pink) 55%, var(--pink-d)); }
.card.teal   .inner { background: radial-gradient(120% 90% at 30% 10%, #3FD8D4, var(--teal) 55%, var(--teal-d)); }
.card.orange .inner { background: radial-gradient(120% 90% at 30% 10%, #FFB05C, var(--orange) 55%, var(--orange-d)); }
.card.purple .inner { background: radial-gradient(120% 90% at 30% 10%, #A87BD4, var(--purple) 55%, var(--purple-d)); }
.card.pink   .glyph { color: var(--pink); }
.card.teal   .glyph { color: var(--teal-d); }
.card.orange .glyph { color: var(--orange-d); }
.card.purple .glyph { color: var(--purple); }

.fc.face.pink   { background: linear-gradient(155deg, #FF5AA8, var(--pink)); }
.fc.face.teal   { background: linear-gradient(155deg, #3FD8D4, var(--teal)); }
.fc.face.orange { background: linear-gradient(155deg, #FFB05C, var(--orange)); }
.fc.face.purple { background: linear-gradient(155deg, #A87BD4, var(--purple)); }
.fc.face.teal b, .fc.face.orange b { color: #12261F; text-shadow: 0 1px 1px rgba(255,255,255,.35); }
/* faces vues à travers le carton d'un adversaire : légèrement en retrait */
.fc.verso { opacity: .88; filter: saturate(.86) brightness(.94); }

.col.pink   { background: linear-gradient(160deg, #FF5AA8, var(--pink));   box-shadow: 0 12px 30px rgba(229,18,125,.45); }
.col.teal   { background: linear-gradient(160deg, #3FD8D4, var(--teal));   box-shadow: 0 12px 30px rgba(0,169,165,.45); }
.col.orange { background: linear-gradient(160deg, #FFB05C, var(--orange)); box-shadow: 0 12px 30px rgba(245,130,32,.45); }
.col.purple { background: linear-gradient(160deg, #A87BD4, var(--purple)); box-shadow: 0 12px 30px rgba(123,79,168,.45); }

.dot-pink { background: var(--pink); } .dot-teal { background: var(--teal); }
.dot-orange { background: var(--orange); } .dot-purple { background: var(--purple); }

/* joker pioche-couleur : la roue marquée d'un plus */
.glyph.wheel { position: relative; }
.wheel-plus {
  position: absolute; right: -6px; bottom: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #17171D; color: #fff; border: 2px solid #fff;
  display: grid; place-items: center; font-style: normal;
  font-family: var(--display); font-size: 14px; line-height: 1;
}

/* la table bascule elle aussi du côté sombre */
body.dark-side {
  --felt-1: #3A2A66; --felt-2: #241844; --felt-3: #120B24;
}
body.dark-side .rail {
  background: linear-gradient(165deg, #2A2440 0%, #171327 42%, #0A0812 100%);
}
body.dark-side .scene::before {
  background: radial-gradient(ellipse 44% 42% at 50% 44%, rgba(150,90,230,.18), rgba(70,40,120,.10) 46%, transparent 72%);
}
body.dark-side .card.back::after { background: linear-gradient(170deg, #A87BD4, var(--purple)); }
body.dark-side .fc::after { background: var(--purple); }
body.dark-side .felt-mark { opacity: .06; }

/* l'annonce du retournement */
.flip-flash {
  position: absolute; inset: 0; z-index: 55; pointer-events: none;
  display: grid; place-items: center;
}
.flip-flash b {
  font-family: var(--display); font-style: italic; font-size: clamp(30px, 5vw, 58px);
  color: #fff; text-shadow: 0 6px 0 rgba(0,0,0,.45);
  animation: flipShout 1.5s var(--ease) forwards;
}
@keyframes flipShout {
  0% { opacity: 0; scale: .6; rotate: -12deg; }
  22% { opacity: 1; scale: 1.08; rotate: 3deg; }
  32% { scale: 1; rotate: 0deg; }
  75% { opacity: 1; }
  100% { opacity: 0; scale: 1.15; }
}
/* toutes les cartes se retournent d'un coup */
body.flipping .hand .card, body.flipping .discard .card, body.flipping .fc {
  animation: flipTurn .55s var(--ease);
}
@keyframes flipTurn {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

/* ══════════════════════ catalogue des cartes (salon) ══════════════════════ */
.lobby-wrap { max-width: 1340px; }

@media (max-width: 1180px) { .lobby-grid { grid-template-columns: 1fr 1.15fr; } }
@media (max-width: 860px)  { .lobby-grid { grid-template-columns: 1fr; } }


.cl-side {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
  color: var(--muted); padding: 6px 2px 2px; border-bottom: 1px solid var(--line);
}
.cl-side.dark { color: #C39BEC; }
.cl-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 13px; padding: 9px 12px;
}
.cl-card { --cw: 46px; --ch: 69px; flex: none; }
.cl-card .card { width: var(--cw); height: var(--ch); border-radius: 8px; padding: 3px; box-shadow: 0 5px 12px rgba(0,0,0,.45); }
.cl-card .card .inner { inset: 3px; border-radius: 5px; }
.cl-card .card .corner { display: none; }
.cl-card .card::after { border-radius: 8px; }
.cl-text { min-width: 0; }
.cl-text b { display: block; font-size: 13.5px; font-weight: 650; }
.cl-text em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }

/* ══════════════════════ No Mercy et Extreme ══════════════════════ */
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 40%; }

/* badge collé au symbole : « sens +4 » */
.card .glyph { position: relative; }
.glyph-badge {
  position: absolute; right: -16%; bottom: -12%;
  font-family: var(--display); font-style: normal;
  font-size: calc(var(--cw) * .18); line-height: 1;
  background: #17171D; color: #fff; border: 2px solid #fff; border-radius: 7px;
  padding: 2px 5px; -webkit-text-stroke: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,.4);
}

/* joueur éliminé */
.player-box.out { opacity: .55; filter: grayscale(.7); }
.player-box.out .pb-name { text-decoration: line-through; }
.pb-meta .pm-out { color: #FF938E; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* le bouton du lanceur */
.btn.action.launcher {
  background: linear-gradient(170deg, #FFB05C, #E06A00); --lip: #8A3F00; color: #2B1400;
}
.btn.action.launcher:not(:disabled) { animation: none; }

/* ══════════════════════ un habillage par paquet ══════════════════════
   Chaque paquet doit se reconnaître d'un coup d'œil, sans lire la moindre
   valeur : la bordure, la forme du cartouche et le dos changent.        */

/* ─── Flip : le coin corné montre la couleur du verso ─── */
.fold {
  position: absolute; top: 0; right: 0; z-index: 3;
  width: 30%; height: 30%; pointer-events: none;
  background: linear-gradient(225deg, var(--fold) 0 52%, transparent 52%);
  border-top-right-radius: 13px;
  box-shadow: inset -1px 1px 0 rgba(255,255,255,.55);
}
.fold::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(225deg, transparent 0 52%, rgba(0,0,0,.35) 52% 56%, transparent 56%);
}
.pack-flip .card .oval{ border-radius: 46% / 40%; }
.pack-flip .card{ background: linear-gradient(150deg, #fff, #E8ECF5); }

/* ─── No Mercy : bordure noire, cartouche anguleux, rayures ─── */
.pack-nomercy .card {
  background: linear-gradient(150deg, #1C1C24, #08080C);
  box-shadow: 0 12px 24px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.14);
}
.pack-nomercy .card .inner{ border-radius: 5px; }
.pack-nomercy .card .inner::after {
  content: ''; position: absolute; inset: 0; opacity: .35;
  background: repeating-linear-gradient(-52deg, rgba(0,0,0,.5) 0 3px, transparent 3px 11px);
}
.pack-nomercy .card .oval {
  border-radius: 3px; transform: rotate(-24deg) skewX(-9deg);
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  box-shadow: 0 3px 10px rgba(0,0,0,.5);
}
.pack-nomercy .card .glyph{ transform: rotate(24deg) skewX(9deg); }
.pack-nomercy .card .corner{ color: #fff; font-style: italic; }
.pack-nomercy .card::after {
  background: linear-gradient(118deg, rgba(255,255,255,.18) 0 24%, transparent 44%);
}
.pack-nomercy .card.back::before{ background: radial-gradient(120% 90% at 30% 12%, #2A0B0F, #12050A 60%, #06020B); }
.pack-nomercy .card.back::after {
  background: linear-gradient(170deg, #FF3B30, #8E0009);
  border-color: #2A2A32; border-radius: 4px;
  clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%);
  transform: translate(-50%, -50%) rotate(-14deg);
}
.pack-nomercy .fc::after{ background: #FF3B30; border-radius: 2px; transform: skewX(-10deg); }

/* ─── Extreme : cadre métal, éclat électrique ─── */
.pack-extreme .card {
  background: linear-gradient(150deg, #F4F7FC 0 38%, #B9C2D2 52%, #EDF1F8 66%, #9AA6BA);
  box-shadow: 0 12px 24px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.6);
}
.pack-extreme .card .inner{ border-radius: 7px; }
.pack-extreme .card .inner::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 190%; height: 190%;
  translate: -50% -50%; opacity: .5; pointer-events: none;
  mix-blend-mode: soft-light;
  background: conic-gradient(from 8deg,
    #fff 0 7deg, transparent 7deg 30deg, #fff 30deg 37deg, transparent 37deg 60deg,
    #fff 60deg 67deg, transparent 67deg 90deg, #fff 90deg 97deg, transparent 97deg 120deg,
    #fff 120deg 127deg, transparent 127deg 150deg, #fff 150deg 157deg, transparent 157deg 180deg,
    #fff 180deg 187deg, transparent 187deg 210deg, #fff 210deg 217deg, transparent 217deg 240deg,
    #fff 240deg 247deg, transparent 247deg 270deg, #fff 270deg 277deg, transparent 277deg 300deg,
    #fff 300deg 307deg, transparent 307deg 330deg, #fff 330deg 337deg, transparent 337deg 360deg);
}
.pack-extreme .card .oval {
  border-radius: 22%; transform: rotate(-14deg);
  box-shadow: 0 3px 10px rgba(0,0,0,.28), inset 0 0 0 2px rgba(0,0,0,.06);
}
.pack-extreme .card .glyph{ transform: rotate(14deg); }
.pack-extreme .card.back::before{ background: radial-gradient(120% 90% at 30% 12%, #2C3444, #141A26 60%, #080B12); }
.pack-extreme .card.back::after {
  background: linear-gradient(170deg, #7FD8FF, #0A72C4);
  border-radius: 26%; transform: translate(-50%, -50%) rotate(-14deg);
  color: #04223A;
}
.pack-extreme .fc::after{ background: #29A3E8; border-radius: 30%; }

/* le catalogue montre lui aussi la bonne allure */
.cl-card .card .fold { border-top-right-radius: 8px; }

/* le dos du pack Flip annonce ses deux faces */
.pack-flip .card.back::after {
  background: linear-gradient(118deg, var(--red) 0 48%, #17171D 48% 52%, var(--purple) 52%);
}
.pack-flip .card.back::before {
  background: radial-gradient(120% 90% at 30% 12%, #241C34, #12101C 60%, #08060E);
}
body.dark-side .pack-flip .card.back::after,
.pack-flip.dark-side .card.back::after {
  background: linear-gradient(118deg, var(--purple) 0 48%, #17171D 48% 52%, var(--red) 52%);
}
.pack-flip .fc::after {
  background: linear-gradient(118deg, var(--red) 0 50%, var(--purple) 50%);
}

/* ══════════════════════ choix du paquet ══════════════════════ */
.pack-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; cursor: pointer;
  padding: 10px 14px; border-radius: 15px; text-align: left;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--txt);
  transition: background .18s, border-color .18s, transform .12s;
}
.pack-btn:hover { background: rgba(255,255,255,.09); border-color: rgba(255,201,60,.4); }
.pack-btn:active { transform: translateY(1px); }
.pk-txt { flex: 1; min-width: 0; }
.pk-txt b { display: block; font-size: 15px; font-weight: 650; }
.pk-txt em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.pk-go {
  flex: none; font-size: 11.5px; font-weight: 600; color: var(--gold);
  background: rgba(255,201,60,.14); padding: 5px 11px; border-radius: 8px;
}

/* l'éventail d'aperçu : quatre cartes en bouquet */
.pk-fan { position: relative; display: block; }
.pk-fan .card {
  position: absolute; left: 50%; top: 50%;
  width: var(--cw); height: var(--ch);
  transform-origin: 50% 118%;
  transform: translate(-50%, -50%) rotate(calc(var(--i) * 11deg)) translateX(calc(var(--i) * 22%));
  box-shadow: 0 6px 14px rgba(0,0,0,.5);
}
.pk-fan .card .corner { display: none; }
.pk-mini .pk-fan { --cw: 34px; --ch: 51px; width: 76px; height: 56px; flex: none; }
.pk-mini { flex: none; }

.packs-modal { width: min(672px, 94vw); min-width: 0; }
.packs-modal:has(.three) { width: min(986px, 94vw); }
.pack-grid {
  display: grid; grid-template-columns: repeat(2, var(--tuile, 306px));
  justify-content: center; gap: 16px; margin: 4px 0 18px;
  max-height: 66vh; overflow-y: auto; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent;
}
.pack-grid::-webkit-scrollbar { width: 6px; }
.pack-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 3px; }
@media (max-width: 620px) { .pack-grid { grid-template-columns: 1fr; --tuile: 100%; } }
.pack-tile {
  display: grid; gap: 10px; padding: 16px 14px 14px; cursor: pointer;
  height: 262px; grid-template-rows: auto 1fr; align-content: start;
  background: rgba(255,255,255,.045); border: 1.5px solid var(--line);
  border-radius: 18px; color: var(--txt); text-align: center;
  transition: background .18s, border-color .18s, transform .16s var(--ease);
}
.pack-tile:hover { background: rgba(255,255,255,.09); transform: translateY(-3px); }
.pack-tile.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,201,60,.28); }
.pt-vis {
  position: relative; height: 142px; border-radius: 13px;
  background: radial-gradient(60% 70% at 50% 40%, var(--felt-1), var(--felt-3));
  box-shadow: inset 0 0 26px rgba(0,0,0,.45);
  display: grid; place-items: center; overflow: hidden;
}
.pt-vis .pk-fan { --cw: 52px; --ch: 78px; width: 100%; height: 100%; }
.pt-txt b { display: block; font-family: var(--display); font-style: italic; font-size: 17px; }
.pt-txt em {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4;
}

/* chaque vignette montre déjà l'allure de son paquet */
.pack-tile[data-choice="nomercy"] .pt-vis { background: radial-gradient(60% 70% at 50% 40%, #2A1015, #0A0407); }
.pack-tile[data-choice="extreme"] .pt-vis { background: radial-gradient(60% 70% at 50% 40%, #16304A, #060C14); }
.pack-tile[data-choice="flip"] .pt-vis { background: radial-gradient(60% 70% at 50% 40%, #2B2050, #0C0818); }

/* ══════════════════════ aperçu d'un mode de jeu ══════════════════════
   Une vraie petite table vue de trois quarts : feutre, piles au centre et
   les mains des joueurs tout autour, colorées par camp.                 */
.md-vis {
  position: relative; display: block; width: 100%; height: 100%;
  perspective: 340px;
}
.md-felt {
  position: absolute; left: 50%; top: 50%;
  width: 62%; height: 56%;
  translate: -50% -50%; transform: rotateX(34deg);
  border-radius: 50% / 46%;
  background: radial-gradient(62% 68% at 50% 30%, var(--felt-1), var(--felt-2) 58%, var(--felt-3));
  border: 3px solid #2A2C34;
  box-shadow: 0 10px 18px -4px rgba(0,0,0,.75), inset 0 0 22px rgba(0,0,0,.55);
}
.md-felt::after {
  content: ''; position: absolute; inset: 14%; border-radius: 50% / 46%;
  border: 1px dashed rgba(255,255,255,.12);
}
/* les deux piles, posées au centre */
.md-deck, .md-discard {
  position: absolute; top: 50%; width: 8%; aspect-ratio: 2 / 3;
  translate: 0 -50%; border-radius: 2px;
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 2px 4px rgba(0,0,0,.6);
}
.md-deck { left: 40%; background: #14151C; }
.md-discard { right: 40%; background: linear-gradient(150deg, #FFEE7A, var(--yellow)); }

/* chaque joueur et sa main */
.md-seat {
  position: absolute; height: 14%;
  translate: -50% -50%; rotate: var(--tilt, 0deg);
  display: flex; justify-content: center; align-items: flex-end; gap: 1px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.6));
}
.md-seat b {
  display: block; width: 27%; height: 100%;
  border-radius: 1.5px;
  background: var(--camp, #C9D2E4);
  border: .5px solid rgba(255,255,255,.75);
}
.md-seat b:nth-child(1) { rotate: -9deg; transform-origin: 50% 120%; }
.md-seat b:nth-child(3) { rotate: 9deg;  transform-origin: 50% 120%; }
.md-seat b:nth-child(2) { height: 108%; }
.md-seat.a { --camp: #22C46B; }
.md-seat.b { --camp: #FF5B52; }
.md-seat.s0 { --camp: #FF5B52; }
.md-seat.s1 { --camp: #3D9BE8; }
.md-seat.s2 { --camp: #2ED47B; }
.md-seat.s3 { --camp: #FFDE17; }
/* au-delà de six joueurs les places se resserrent */
/* plus la table est peuplée, plus le plateau se resserre pour libérer
   la couronne où s'installent les mains */
.md-vis[data-seats="6"] .md-seat { height: 13%; }
.md-vis[data-seats="6"] .md-felt { width: 54%; height: 50%; }
.md-vis[data-seats="8"] .md-seat { height: 11.5%; }
.md-vis[data-seats="8"] .md-felt { width: 50%; height: 46%; }

.md-count {
  position: absolute; right: 6px; top: 6px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #C6CDDC; background: rgba(8,10,16,.82); border: 1px solid rgba(255,255,255,.1);
  padding: 3px 8px; border-radius: 99px;
}
.md-vis { transition: scale .3s var(--ease); }
.pack-tile:hover .md-vis { scale: 1.04; }

/* le même aperçu, en réduction, sur le bouton du salon */
.pk-mini .md-vis { width: 76px; height: 56px; perspective: 180px; }
.pk-mini .md-count { display: none; }
.pk-mini .md-felt { width: 70%; height: 60%; border-width: 2px; }
.pk-mini .md-seat { width: 24%; height: 17%; }
.pt-vis .md-vis { width: 100%; height: 100%; }
.mode-tile .pt-vis { background: radial-gradient(60% 70% at 50% 40%, #1B2233, #080B12); }

/* ══════════════════════ les règles, en grille ══════════════════════ */
.rules-modal { min-width: min(1060px, 96vw); }
.rules-modal h3 .count { color: var(--gold); font-family: var(--font); font-style: normal; font-size: 13px; margin-left: 8px; }
.rule-grid {
  display: grid; gap: 12px; margin: 6px 0 18px; text-align: left;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  grid-auto-rows: min-content; align-items: start;
  max-height: 62vh; overflow-y: auto; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent;
}
.rule-grid::-webkit-scrollbar { width: 6px; }
.rule-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 3px; }
.rl-side {
  grid-column: 1 / -1; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
  font-weight: 700; color: var(--muted); padding: 4px 2px 2px; border-bottom: 1px solid var(--line);
}
.rl-side.dark { color: #C39BEC; }
.rl-item {
  display: grid; gap: 9px; padding: 13px 13px 15px; height: 100%;
  align-content: start;
  background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 15px;
  justify-items: center; text-align: center;
}
.rl-card { --cw: 58px; --ch: 87px; }
.rl-card .card { width: var(--cw); height: var(--ch); border-radius: 9px; padding: 4px; box-shadow: 0 6px 14px rgba(0,0,0,.45); }
.rl-card .card .inner { inset: 4px; border-radius: 6px; }
.rl-card .card .corner { display: none; }
.rl-card .card::after { border-radius: 9px; }
.rl-text b { display: block; font-size: 14px; font-weight: 650; }
.rl-text em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.45; margin-top: 3px; }

/* le pied du salon accueille le bouton des règles */
.lobby-foot .btn-blue { flex: none; }

/* ══════════════════════ aperçus des réglages ══════════════════════ */
.pack-grid.three { grid-template-columns: repeat(3, var(--tuile, 306px)); }
@media (max-width: 860px) { .pack-grid.three { grid-template-columns: repeat(2, var(--tuile, 258px)); } }

/* objectif de points */
.wn-vis { display: grid; place-content: center; justify-items: center; gap: 3px; width: 100%; height: 100%; }
.wn-vis b {
  font-family: var(--display); font-style: italic; font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1; color: var(--gold); text-shadow: 0 3px 0 rgba(0,0,0,.45);
}
.wn-vis i { font-style: normal; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.wn-gauge {
  width: 62%; height: 6px; margin-top: 6px; border-radius: 99px;
  background: rgba(255,255,255,.12); overflow: hidden;
}
.wn-gauge span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--gold)); }
.pk-mini .wn-vis b { font-size: 20px; }
.pk-mini .wn-vis { width: 76px; height: 56px; }
.win-tile .pt-vis { background: radial-gradient(60% 70% at 50% 40%, #1E2A22, #080B0A); }

/* niveau des bots */
.bt-vis { display: grid; place-content: center; justify-items: center; gap: 8px; width: 100%; height: 100%; }
.bt-face {
  position: relative; width: 44px; height: 38px; border-radius: 11px;
  background: linear-gradient(165deg, #4E5A72, #2B3244);
  border: 2px solid rgba(255,255,255,.3); box-shadow: 0 4px 10px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.bt-face::before {
  content: ''; position: absolute; top: -8px; left: 50%; translate: -50% 0;
  width: 2px; height: 7px; background: rgba(255,255,255,.4);
}
.bt-face::after {
  content: ''; position: absolute; top: -12px; left: 50%; translate: -50% 0;
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}
.bt-face i { width: 7px; height: 7px; border-radius: 50%; background: #8FE3FF; box-shadow: 0 0 7px #8FE3FF; }
.bt-vis.n2 .bt-face i { background: var(--gold); box-shadow: 0 0 7px var(--gold); }
.bt-vis.n3 .bt-face i { background: #FF6B62; box-shadow: 0 0 8px #FF6B62; }
.bt-bars { display: flex; gap: 4px; align-items: flex-end; height: 16px; }
.bt-bars i { width: 7px; border-radius: 2px; background: rgba(255,255,255,.14); }
.bt-bars i:nth-child(1) { height: 45%; }
.bt-bars i:nth-child(2) { height: 72%; }
.bt-bars i:nth-child(3) { height: 100%; }
.bt-bars i.on { background: var(--green); }
.bt-vis.n2 .bt-bars i.on { background: var(--gold); }
.bt-vis.n3 .bt-bars i.on { background: var(--red); }
.pk-mini .bt-vis { width: 76px; height: 56px; gap: 5px; }
.pk-mini .bt-face { width: 32px; height: 27px; border-radius: 8px; gap: 6px; }
.pk-mini .bt-face i { width: 5px; height: 5px; }
.pk-mini .bt-bars { height: 11px; }
.pk-mini .bt-bars i { width: 5px; }
.bot-tile .pt-vis { background: radial-gradient(60% 70% at 50% 40%, #1B2233, #080B12); }

/* ══════════════════════ des boutons vivants ══════════════════════
   Le principe : presque rien au repos, tout se réveille au survol. Seuls
   les boutons qui appellent une action respirent en continu.           */

/* ─── un reflet balaie le bouton au survol ─── */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.4) 50%, transparent 70%);
  translate: -130% 0; opacity: 0;
}
.btn:hover:not(:disabled)::after { animation: sheen .75s ease-out; }
@keyframes sheen {
  from { translate: -130% 0; opacity: 0; }
  20%  { opacity: 1; }
  to   { translate: 130% 0; opacity: 0; }
}
.btn:hover:not(:disabled) { translate: 0 -2px; }
.btn:active:not(:disabled) { translate: 0 0; }

/* ─── le bouton principal appelle discrètement l'attention ───
   Le halo vit dans un calque à part dont on n'anime que l'opacité : animer
   l'ombre elle-même forcerait un repaint à chaque image.               */
.btn-green:not(:disabled), .btn-red:not(:disabled) { position: relative; }
.btn-green:not(:disabled)::before, .btn-red:not(:disabled)::before {
  content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: inherit;
  box-shadow: 0 0 22px 2px currentColor; opacity: 0; pointer-events: none;
  animation: callSoft 3.4s ease-in-out infinite;
}
@keyframes callSoft { 0%, 100% { opacity: 0; } 50% { opacity: .38; } }
.btn-green:hover:not(:disabled)::before, .btn-red:hover:not(:disabled)::before { animation-play-state: paused; }

/* ─── les boutons de réglage : l'aperçu s'anime au survol ─── */
.pack-btn { position: relative; overflow: hidden; }
.pack-btn::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 34%, rgba(255,255,255,.09) 50%, transparent 66%);
  translate: -130% 0;
}
.pack-btn:hover::after { animation: sheen 1s ease-out; }
.pack-btn:hover { translate: 0 -2px; }
.pk-go { transition: scale .18s var(--ease), background .18s; }
.pack-btn:hover .pk-go { scale: 1.06; background: rgba(255,201,60,.24); }

/* les cartes du paquet s'écartent comme une main qu'on ouvre */
.pk-fan .card { transition: transform .35s var(--ease); }
.pack-btn:hover .pk-fan .card,
.pack-tile:hover .pk-fan .card {
  transform: translate(-50%, -50%) rotate(calc(var(--i) * 15deg)) translateX(calc(var(--i) * 30%));
}
/* et la vignette entière prend un peu de relief */
.pack-tile .pt-vis > * { transition: scale .3s var(--ease); }
.pack-tile:hover .pt-vis > * { scale: 1.05; }

/* la table du mode pivote légèrement */
.md-felt { transition: transform .4s var(--ease); }
.pack-btn:hover .md-felt, .pack-tile:hover .md-felt { transform: rotateX(26deg); }
/* les mains se rapprochent du plateau, comme si on jouait */
.md-seat { transition: scale .35s var(--ease); }
.pack-btn:hover .md-seat, .pack-tile:hover .md-seat { scale: 1.08; }
/* la défausse clignote doucement : la partie est en cours */
.md-discard { animation: discardPulse 2.6s ease-in-out infinite; }
@keyframes discardPulse { 50% { opacity: .55; } }

/* la jauge de victoire se remplit au survol */
.wn-gauge span { transition: scale .5s var(--ease); transform-origin: left center; }
.pack-btn:hover .wn-gauge span, .pack-tile:hover .wn-gauge span { scale: 1.12 1; }
.wn-vis b { transition: scale .3s var(--ease); }
.pack-btn:hover .wn-vis b, .pack-tile:hover .wn-vis b { scale: 1.08; }

/* le robot cligne des yeux, et ses barres montent au survol */
.bt-face i { animation: blink 5s infinite; }
@keyframes blink { 0%, 92%, 100% { scale: 1 1; } 95% { scale: 1 .12; } }
.bt-face i:nth-child(2) { animation-delay: .12s; }
.bt-bars i { transition: scale .3s var(--ease); transform-origin: bottom; }
.pack-btn:hover .bt-bars i.on, .pack-tile:hover .bt-bars i.on { scale: 1 1.22; }
.bt-face { transition: rotate .35s var(--ease); }
.pack-btn:hover .bt-face, .pack-tile:hover .bt-face { rotate: -5deg; }

/* ─── les cartes du catalogue s'inclinent ─── */
.rl-card .card { transition: transform .3s var(--ease); }
.rl-item:hover .rl-card .card { transform: rotate(-6deg) scale(1.08); }

/* ─── petites touches ailleurs ─── */
.sound-btn svg { transition: scale .2s var(--ease); }
.sound-btn:hover svg { scale: 1.14; }
.kick { transition: scale .16s var(--ease); }
.kick:hover { scale: 1.2; }
.col { transition: transform .18s var(--ease), box-shadow .2s; }
.col:hover { transform: scale(1.1) rotate(-4deg); }
.col:active { transform: scale(.96); }
.target-picker button { transition: transform .16s var(--ease), background .16s; }

@media (prefers-reduced-motion: reduce) {
  .btn::after, .pack-btn::after { display: none; }
  .btn-green::before, .btn-red::before, .bt-face i, .md-discard { animation: none !important; }
}

/* ══════════════════════ galeries rangées par famille ══════════════════════ */
.choice-group {
  grid-column: 1 / -1; margin: 4px 2px -2px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 10px;
}
.choice-group::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.choice-group:first-child { margin-top: 0; }
/* le mode party se distingue de la famille « groupe » */
.mode-tile[data-choice="party"] .pt-vis {
  background: radial-gradient(60% 70% at 50% 40%, #2E1A3D, #0A0610);
}

/* ══════════════════════ mode party : deux écrans ══════════════════════
   L'hôte est la télévision, chaque téléphone est une manette. On emprunte
   le principe du GamePad : le plateau d'un côté, la main de l'autre.   */

/* ─── l'écran de l'hôte ─── */
body.is-screen .myzone,
body.is-screen .pad { display: none !important; }
body.is-screen .scene { inset: 64px 0 92px 0; }
body.is-screen .table3d { height: min(820px, 100%); max-width: 94vw; }
body.is-screen .center { --cw: clamp(120px, 12vw, 220px); --ch: calc(var(--cw) * 1.5); gap: clamp(24px, 3vw, 54px); }
body.is-screen .dir-ring { --ring-r: calc(var(--cw) * 2.3); }
body.is-screen .orbit i { width: 46px; height: 41px; margin: -20px 0 0 -23px; }
body.is-screen #deck-pile { cursor: default; }
body.is-screen #deck-pile.can-draw { animation: none; }

.party-hud {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 28;
  display: grid; place-items: center; padding: 14px 16px 20px;
  background: linear-gradient(to top, rgba(4,5,9,.94), transparent);
  pointer-events: none;
}
.ph-turn { text-align: center; }
.ph-turn b {
  display: block; font-family: var(--display); font-style: italic;
  font-size: clamp(22px, 2.6vw, 38px); color: var(--gold);
  text-shadow: 0 4px 0 rgba(0,0,0,.5);
}
.ph-turn em { display: block; font-style: normal; font-size: 13.5px; color: #C6CDDC; margin-top: 3px; }

/* ─── la manette du joueur ─── */
body.is-pad .scene,
body.is-pad .myzone,
body.is-pad .party-hud { display: none !important; }
body.is-pad .hud { padding: 6px 10px; padding-right: 56px; }
body.is-pad #hud-round, body.is-pad #hud-mode, body.is-pad #btn-help { display: none; }
body.is-pad .chip { padding: 5px 9px; font-size: 11px; }
body.is-pad .sound-dock { top: 5px; right: 8px; }
body.is-pad .sound-btn { width: 32px; height: 32px; border-radius: 9px; }
body.is-pad .sound-btn svg { width: 17px; height: 17px; }

.pad {
  /* la main occupe toute la hauteur qui reste : c'est elle qu'on regarde */
  --cw: clamp(58px, 26vh, 132px);
  --ch: calc(var(--cw) * 1.5);
  position: absolute; inset: 40px 0 0 0; z-index: 22;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 50% 0%, #16202E, #070A10 70%);
}
.pad-top {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.pad-me { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pad-me i {
  width: 30px; height: 30px; border-radius: 9px; flex: none; font-style: normal;
  display: grid; place-items: center; font-family: var(--display); font-size: 13px;
  border: 2px solid rgba(255,255,255,.55);
}
.pad-me b { font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad-stats { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pad-stats b { color: var(--txt); font-weight: 650; }
.pad-turn {
  margin-left: auto; flex: none; font-size: 12px; font-weight: 650;
  padding: 6px 12px; border-radius: 9px;
  background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--line);
}
.pad-turn.on {
  background: linear-gradient(170deg, #FFE95C, var(--yellow)); color: #2E2400;
  border-color: transparent; animation: pulse 1.5s ease-in-out infinite;
}
.pad-hand {
  position: relative; flex: 1; min-height: 0;
  display: flex; justify-content: center; align-items: center;
  perspective: 1100px; padding: 6px 0;
}
.pad-hand .card { width: var(--cw); height: var(--ch); }
.pad-hand .card {
  position: absolute; bottom: auto;
  transform-origin: 50% 168%;
  transform: translateX(var(--x)) rotate(var(--a));
  transition: transform .24s var(--ease), filter .2s, opacity .2s;
}
.pad-hand.scroll {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 8px; padding: 8px 14px; overflow-x: auto; overflow-y: hidden;
  perspective: none; scroll-snap-type: x proximity;
}
.pad-hand.scroll .card { position: relative; transform: none; flex: 0 0 auto; scroll-snap-align: center; }
.pad-actions {
  display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgba(6,9,14,.85);
}
.pad-actions .btn { flex: 1; min-width: 0; padding: 13px 8px; font-size: 14px; }
/* en paysage la place manque en hauteur : on resserre le haut et le bas */
@media (max-height: 460px) {
  .pad-top { padding: 5px 12px; }
  .pad-me i { width: 26px; height: 26px; font-size: 11px; }
  .pad-me b { font-size: 13px; }
  .pad-actions { padding: 7px 12px calc(7px + env(safe-area-inset-bottom)); gap: 7px; }
  .pad-actions .btn { padding: 11px 6px; font-size: 13px; }
}
.btn.action.party {
  background: linear-gradient(170deg, #B36BE0, #6C2E9C); --lip: #431C63; color: #fff;
}
.btn.action.party b { font-family: var(--display); font-style: italic; margin-left: 4px; }
body.is-pad .pad { animation: padIn .4s var(--ease); }
@keyframes padIn { from { opacity: 0; scale: .97; } }

/* ─── les cartes party ─── */
.pc {
  display: grid; justify-items: center; gap: 4px; position: relative;
  width: 84px; padding: 12px 8px 10px; border-radius: 13px;
  background: linear-gradient(165deg, var(--pt1), var(--pt2));
  border: 2px solid rgba(255,255,255,.75);
  box-shadow: 0 8px 18px rgba(0,0,0,.5);
}
.pc i { font-style: normal; font-size: 27px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.pc b { font-size: 10.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); text-align: center; }
.pc u {
  position: absolute; top: -8px; right: -8px; text-decoration: none;
  font-family: var(--display); font-style: italic; font-size: 11px;
  background: #17171D; color: #fff; border: 2px solid #fff; border-radius: 99px;
  padding: 2px 7px;
}
.t-orage     { --pt1: #7B8CA8; --pt2: #38445C; }
.t-rouge     { --pt1: #FF5B52; --pt2: #9E0F16; }
.t-bleu      { --pt1: #3D9BE8; --pt2: #004A81; }
.t-vert      { --pt1: #2ED47B; --pt2: #056B36; }
.t-violet    { --pt1: #A87BD4; --pt2: #4A2C6B; }
.t-jaune     { --pt1: #FFEE7A; --pt2: #C79A00; }
.t-rose      { --pt1: #FF6FB5; --pt2: #8E0A4C; }
.t-turquoise { --pt1: #3FD8D4; --pt2: #046B69; }
.t-jaune b { color: #33280A; text-shadow: none; }

.party-modal { min-width: min(760px, 94vw); }
.party-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin: 8px 0 18px; max-height: 60vh; overflow-y: auto; padding-right: 4px;
}
.party-tile {
  display: grid; gap: 9px; justify-items: center; padding: 14px 12px;
  background: rgba(255,255,255,.045); border: 1px solid var(--line);
  border-radius: 16px; color: var(--txt); cursor: pointer; text-align: center;
  transition: background .18s, transform .16s var(--ease), border-color .18s;
}
.party-tile:hover:not(:disabled) { background: rgba(255,255,255,.09); transform: translateY(-3px); border-color: rgba(255,255,255,.28); }
.party-tile:disabled { opacity: .45; cursor: not-allowed; }
.party-tile .pt-txt b { font-size: 14px; }
.party-tile .pt-txt em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.4; display: block; margin-top: 3px; }

/* choisir une carte à offrir */
.target-picker .gift { flex-direction: column; gap: 8px; --cw: 60px; --ch: 90px; }
.target-picker .gift .card { width: var(--cw); height: var(--ch); border-radius: 9px; padding: 4px; }
.target-picker .gift .card .inner { inset: 4px; border-radius: 6px; }
.target-picker .gift .card .corner { display: none; }
.target-picker .gift span { font-size: 12px; color: var(--muted); }
#target-picker:has(.gift) { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); display: grid; }

/* ══════════════════════ le salon en mode party ══════════════════════
   Les réglages passent dans une fenêtre : la place libérée revient au code
   et au QR, qu'il faut pouvoir scanner de loin et à plusieurs.        */
body:not(.lobby-party) .party-only { display: none !important; }
body.lobby-party .lobby-grid {
  grid-template-columns: 1fr 1.25fr; align-items: stretch;
  grid-template-areas: "joueurs code"; grid-template-rows: auto;
}
body.lobby-party .join-panel { display: none; }
body.lobby-party #code-panel { display: block; grid-area: code; }
body.lobby-party #settings-panel { display: none; }
body.lobby-party .code-box {
  position: static; display: grid; justify-items: center; align-content: center;
  padding: 22px 26px 26px; border-radius: 20px;
  background: linear-gradient(165deg, rgba(237,28,36,.14), rgba(255,255,255,.035));
  border: 1px solid rgba(237,28,36,.3);
}
body.lobby-party .lobby-head { display: block; padding-right: 0; margin-bottom: 18px; }
body.lobby-party .code-value { font-size: clamp(38px, 5vw, 68px); letter-spacing: .2em; margin: 8px 0 12px; }
body.lobby-party .qr { width: min(340px, 30vw); height: min(340px, 30vw); }
body.lobby-party .qr-hint { font-size: 13px; margin-bottom: 14px; }
body.lobby-party .players { max-height: 52vh; overflow-y: auto; }
.settings-modal { min-width: min(560px, 94vw); text-align: left; }
.settings-modal h3 { text-align: center; }
.settings-modal .settings { max-height: 64vh; overflow-y: auto; padding-right: 6px; }
.rl-side.party { color: #C39BEC; }
.rl-card .pc { width: 72px; padding: 10px 6px 8px; }
.rl-card .pc i { font-size: 23px; }

/* ══════════════════════ les dossiers de modes ══════════════════════ */
.fd-vis { position: relative; display: block; width: 100%; height: 100%; }
.fd-card {
  position: absolute; left: 50%; top: 50%;
  width: 74%; height: 74%;
  translate: calc(-50% + var(--i) * 16%) calc(-50% + var(--i) * 5%);
  rotate: calc(var(--i) * 6deg);
  border-radius: 12px; overflow: hidden;
  background: radial-gradient(60% 70% at 50% 40%, #1B2233, #080B12);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 18px rgba(0,0,0,.55);
  transition: translate .3s var(--ease), rotate .3s var(--ease);
}
.pack-tile:hover .fd-card { translate: calc(-50% + var(--i) * 21%) calc(-50% + var(--i) * 6%); }
.fd-vis u {
  position: absolute; right: 8px; bottom: 8px; text-decoration: none;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #C6CDDC; background: rgba(8,10,16,.85); border: 1px solid rgba(255,255,255,.1);
  padding: 3px 9px; border-radius: 99px;
}
.folder-tile .pt-vis { background: radial-gradient(60% 70% at 50% 40%, #141A26, #06080D); }
/* dans un dossier, le compte des modes suffit : celui des joueurs encombre */
.fd-card .md-count { display: none; }
.folder-tile .pt-txt b::after { content: ' ›'; color: var(--muted); font-style: normal; }
#mode-back { margin-right: auto; }
.packs-modal .modal-actions { justify-content: center; gap: 10px; }

/* ══════════════════════ le téléphone doit se tourner ══════════════════════ */
.rotate-gate {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 90% at 50% 0%, #16202E, #05070C 70%);
}
.rotate-gate[hidden] { display: none; }
.rg-inner { display: grid; justify-items: center; gap: 14px; text-align: center; max-width: 340px; }
.rg-phone {
  width: 74px; height: 122px; border-radius: 12px; position: relative;
  border: 3px solid rgba(255,255,255,.85); background: rgba(255,255,255,.06);
  animation: tourne 2.4s ease-in-out infinite;
}
.rg-phone i {
  position: absolute; left: 50%; bottom: 7px; translate: -50% 0;
  width: 26px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.6);
}
@keyframes tourne {
  0%, 30%   { rotate: 0deg; }
  55%, 100% { rotate: -90deg; }
}
.rg-inner b { font-family: var(--display); font-style: italic; font-size: 21px; }
.rg-inner em { font-style: normal; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ══════════════════════ la manette : moins de bruit ══════════════════════
   Les annonces vivent sur l'écran de l'hôte ; sur le téléphone elles
   masqueraient les cartes au moment de jouer.                          */
body.is-pad .toasts,
body.is-pad .flip-flash { display: none !important; }
@media (max-width: 900px) and (pointer: coarse) {
  .toasts { display: none !important; }
}

/* les cartes injouables s'effacent vraiment quand c'est à nous */
.hand .card.dim, .pad-hand .card.dim {
  filter: grayscale(.35) brightness(.8);
  opacity: .38;
  transform: translateX(var(--x)) rotate(var(--a)) translateY(10px) scale(.94);
}
.hand.scroll .card.dim, .pad-hand.scroll .card.dim {
  transform: translateY(10px) scale(.94);
}
.hand .card.dim:hover, .pad-hand .card.dim:hover { opacity: .6; }

/* ══════════════════════ le compte à rebours ══════════════════════
   Il n'apparaît que dans les cinq dernières secondes : un chrono qui
   tourne en permanence presse pour rien.                            */
.countdown {
  position: relative; display: grid; place-items: center;
  width: 84px; height: 84px; flex: none;
}
.countdown[hidden] { display: none; }
.countdown svg { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; }
.countdown circle { fill: none; stroke-width: 9; }
.cd-bg { stroke: rgba(255,255,255,.12); }
.cd-arc {
  stroke: var(--gold); stroke-linecap: round;
  stroke-dasharray: 276.5;
  stroke-dashoffset: calc(276.5 * (1 - var(--part, 1)));
  transition: stroke-dashoffset .1s linear;
}
.countdown b {
  position: relative; font-family: var(--display); font-style: italic;
  font-size: 34px; color: var(--gold); line-height: 1;
}
.countdown.urgent .cd-arc { stroke: var(--red); }
.countdown.urgent b { color: #FF6B62; }
.countdown.urgent { animation: pulse .5s ease-in-out infinite; }
.countdown.small { width: 40px; height: 40px; }
.countdown.small circle { stroke-width: 11; }
.countdown.small b { font-size: 17px; }

/* sur l'écran de l'hôte, il accompagne le nom du joueur */
.party-hud { grid-auto-flow: column; align-items: center; gap: 22px; }

/* ══════════════════════ le téléphone couché ══════════════════════
   En mode party le téléphone reste à l'horizontale : la hauteur devient
   la ressource rare, et tous les écrans doivent s'y plier.           */
@media (max-height: 480px) and (orientation: landscape) {
  /* ─── accueil ─── */
  .home-stage { padding: 12px 16px 16px; }
  .hero { padding-top: 0; }
  .hero-fan { display: none; }
  .wordmark { width: min(210px, 30vw); }
  .tagline { font-size: 12px; margin: 2px 0 10px; }
  .home-card { width: min(440px, 76vw); padding: 14px 16px 14px; border-radius: 16px; }
  .field { margin-bottom: 10px; }
  .field span { font-size: 10.5px; margin-bottom: 4px; }
  .field input, .code-input { padding: 9px 12px; font-size: 14px; }
  .or { margin: 10px 0; font-size: 10px; }
  .btn-big { padding: 11px 20px; font-size: 15px; }
  .scan-btn { margin-top: 8px; }
  .home-facts { display: none; }

  /* ─── salon ─── */
  .lobby-wrap { padding: 10px 14px 8px; }
  .lobby-head { margin-bottom: 10px; }
  .lobby-head h2 { font-size: 20px; }
  .sub { font-size: 11.5px; }
  /* couché, l'écran est trop bas pour un pied flottant : il reprend sa
     place dans le flux et toute la page défile d'un bloc */
  .lobby-grid { gap: 10px; align-items: start; }
  .panel { padding: 12px 14px; border-radius: 14px; }
  .lobby-foot { position: static; background: none; margin: 10px 0 0; padding: 0; }
  .panel h3 { font-size: 10.5px; margin-bottom: 9px; }
  .players { gap: 6px; max-height: none; }
  .players li { padding: 7px 10px; font-size: 13px; }
  .avatar { width: 26px; height: 26px; font-size: 12px; }
  .lobby-foot { margin: 10px -14px -8px; padding: 8px 14px 10px; }
  .lobby-foot .btn-big { padding: 10px 16px; font-size: 14px; }
  body.lobby-party .code-value { font-size: clamp(26px, 6vh, 40px); margin: 4px 0 8px; }
  body.lobby-party .qr { width: min(150px, 30vh); height: min(150px, 30vh); }
  body.lobby-party .qr-hint { font-size: 10.5px; margin-bottom: 8px; }
  body.lobby-party .code-box { padding: 12px 14px 14px; }

  /* ─── fenêtres ─── */
  .modal { padding: 14px 16px; border-radius: 16px; max-height: 92vh; overflow-y: auto; }
  .modal h3 { font-size: 16px; margin-bottom: 10px; }
  .modal.wide, .packs-modal, .rules-modal, .party-modal, .settings-modal { min-width: 0; width: 94vw; }
  .pack-grid, .rule-grid, .party-grid { max-height: 52vh; gap: 9px; }
  /* couché, la hauteur manque : la vignette se resserre, mais garde la même
     taille pour toutes */
  .pack-grid, .pack-grid.three { grid-template-columns: repeat(3, var(--tuile)); --tuile: 206px; }
  .pack-tile { height: 152px; padding: 10px 10px 9px; gap: 6px; }
  .pt-vis { height: 66px; }
  .pt-txt em { -webkit-line-clamp: 2; }
  .packs-modal, .packs-modal:has(.three) { width: auto; }
  .pt-txt b { font-size: 13px; }
  .pt-txt em { font-size: 10.5px; }
  .rule-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .rl-card { --cw: 40px; --ch: 60px; }
  .rl-text b { font-size: 12px; }
  .rl-text em { font-size: 10.5px; }
  .party-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .party-tile { padding: 9px 8px; }
  .pc { width: 62px; padding: 8px 6px 7px; }
  .pc i { font-size: 20px; }
  .pc b { font-size: 9px; }
  .color-picker { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .col { height: 56px; border-radius: 12px; }
  .target-picker { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); display: grid; }
  .target-picker button { padding: 8px 10px; font-size: 13px; }
  .scoreboard th, .scoreboard td { padding: 5px 6px; font-size: 12px; }
  .modal-note { font-size: 11.5px; margin-bottom: 10px; }
  .trophy { font-size: 34px; }
  .winner-line { font-size: 14px; margin-bottom: 10px; }
  .keylist { display: none; }

  /* ─── la porte du paysage n'a plus lieu d'être une fois couché ─── */
  .rg-inner { gap: 9px; }
  .rg-phone { width: 52px; height: 86px; }
  .rg-inner b { font-size: 17px; }
  .rg-inner em { font-size: 12px; }
}

/* ══════════════════════ « téléphones seulement » ══════════════════════ */
.phone-only {
  display: flex; align-items: flex-start; gap: 10px;
  margin: -4px 0 14px; padding: 10px 13px;
  background: rgba(255,201,60,.09); border: 1px solid rgba(255,201,60,.28);
  border-radius: 12px; font-size: 12.5px; line-height: 1.45; color: #D8DEEA;
}
.phone-only svg { width: 20px; height: 20px; flex: none; color: var(--gold); margin-top: 1px; }
.phone-only b { color: var(--gold); font-weight: 700; }
@media (max-height: 480px) and (orientation: landscape) {
  .phone-only { font-size: 11px; padding: 7px 10px; margin-bottom: 9px; gap: 7px; }
  .phone-only svg { width: 16px; height: 16px; }
}

/* ══════════════════════ No Mercy : éliminé ══════════════════════
   Les cartes restent visibles — on veut voir ce qu'on a raté — mais elles
   grisent et ne répondent plus. Un flot de cartes défile derrière.    */
.knocked {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 26;
  height: calc(var(--ch) + 116px);
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(to top, rgba(6,3,5,.96) 40%, rgba(6,3,5,.82));
  animation: knIn .4s var(--ease);
}
.knocked[hidden] { display: none; }
@keyframes knIn { from { opacity: 0; } }

.kn-stream {
  position: absolute; inset: 0; display: flex; align-items: center;
  opacity: .16; filter: grayscale(1) brightness(.9);
  animation: defile 26s linear infinite;
  width: max-content;
}
.kn-band { display: flex; gap: 18px; padding: 0 9px; }
.kn-stream .card {
  width: calc(var(--cw) * .84); height: calc(var(--ch) * .84);
  rotate: var(--r, 0deg); flex: none;
}
@keyframes defile { to { translate: -50% 0; } }

.kn-text { position: relative; text-align: center; display: grid; gap: 6px; }
.kn-text b {
  font-family: var(--display); font-style: italic;
  font-size: clamp(38px, 7vw, 76px); line-height: 1;
  color: var(--red); letter-spacing: .04em;
  text-shadow: 0 0 26px rgba(237,28,36,.5), 0 5px 0 rgba(0,0,0,.6);
  animation: knPulse 2.4s ease-in-out infinite;
}
@keyframes knPulse { 50% { scale: 1.03; } }
.kn-text em { font-style: normal; font-size: 15px; color: #E7C6C4; font-weight: 600; }
.kn-text span { font-size: 13px; color: var(--muted); }

/* les cartes du joueur sorti : visibles, mais éteintes et inertes */
body.is-out .hand .card, body.is-out .pad-hand .card {
  filter: grayscale(1) brightness(.5);
  opacity: .5; pointer-events: none; cursor: default;
}
body.is-out .hand .card::before, body.is-out .pad-hand .card::before { display: none; }
body.is-out .actions .btn, body.is-out .pad-actions .btn { pointer-events: none; opacity: .35; }
body.is-out .turn-flag, body.is-out .pad-turn { display: none; }

@media (prefers-reduced-motion: reduce) {
  .kn-stream, .kn-text b { animation: none !important; }
}

/* ══════════════════════ le plateau en volume ══════════════════════
   La toile prend toute la place laissée par les commandes. Le DOM ne garde
   que les menus, la barre du haut et les boutons d'action.            */
/* La toile est enveloppée : un canvas placé par ses quatre côtés garde son
   format d'origine, et « height » forcée écraserait le bas. L'enveloppe tient
   la place, la toile la remplit. */
/* La scène occupe tout l'écran, sans bandeau qui la coupe. Les commandes
   flottent au-dessus, sur un voile qui les détache du décor. */
.scene-wrap { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.scene-wrap > canvas {
  display: block; width: 100%; height: 100%;
  touch-action: none;                 /* le doigt vise, il ne fait pas défiler */
}

/* la manette montre la même scène, mais cadrée sur la main */
body.is-pad .pad-hand { display: none; }
/* La manette laisse passer les clics vers la scène en volume qu'elle
   recouvre — mais pas quand le plateau vit dans le document : il est alors
   son enfant, et hériterait de cette transparence. */
body.is-pad:not(.en-2d) .pad { background: none; pointer-events: none; }
body.is-pad:not(.en-2d) .pad-top,
body.is-pad:not(.en-2d) .pad-actions { pointer-events: auto; }
body.is-pad.en-2d .pad { background: none; }
.no3d {
  position: absolute; top: 42%; left: 50%; translate: -50% 0; z-index: 3;
  max-width: 30ch; text-align: center; color: var(--muted); font-size: 14px;
  line-height: 1.5; padding: 14px 18px; border-radius: 14px;
  background: rgba(10,12,18,.9); border: 1px solid var(--line);
}
.no3d[hidden] { display: none; }

/* les commandes flottent sur la scène, sans lui prendre de place */
.myzone {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 12;
  background: linear-gradient(to top, rgba(4,6,11,.88) 42%, rgba(4,6,11,0));
  padding: 26px 16px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.myzone > * { pointer-events: auto; }
.hud { z-index: 12; }
.pending-badge { z-index: 11; }

:root { --zone-h: 172px; }
.hand { display: none; }
.myzone .actions { margin-top: 0; }

/* ══════════════════════ le plateau sans volume ══════════════════════
   Pour les téléphones et la manette : les mêmes éléments, en éléments du
   document, où le doigt trouve ce qu'il vise du premier coup.        */
.plateau2d {
  /* les commandes flottent en bas : le plateau s'arrête juste au-dessus */
  position: absolute; inset: 46px 0 var(--zone-h, 172px) 0; z-index: 4;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 76% at 50% 34%, var(--felt-1), var(--felt-3) 72%, #06110C);
}
.plateau2d[hidden] { display: none; }
body.en-2d .scene-wrap { display: none; }

/* ─── les adversaires, en bandeau ─── */
.p2-sieges {
  display: flex; gap: 8px; padding: 8px 10px; overflow-x: auto;
  scrollbar-width: none; flex: none;
}
.p2-sieges::-webkit-scrollbar { display: none; }
.p2-siege {
  display: flex; align-items: center; gap: 7px; flex: none;
  padding: 6px 11px 6px 6px; border-radius: 12px;
  background: rgba(6,10,16,.62); border: 1.5px solid transparent;
}
.p2-siege.actif { border-color: var(--gold); background: rgba(40,34,8,.78); }
.p2-siege.sorti { opacity: .55; border-color: rgba(237,28,36,.5); }
.p2-av {
  width: 26px; height: 26px; border-radius: 8px; flex: none; font-style: normal;
  display: grid; place-items: center; font-family: var(--display); font-size: 13px;
  color: #fff; border: 1.5px solid rgba(255,255,255,.45);
}
.p2-av.a0 { background: var(--red); } .p2-av.a1 { background: var(--blue); }
.p2-av.a2 { background: var(--green); } .p2-av.a3 { background: var(--yellow); color: #2E2400; }
.p2-siege b { font-size: 13px; font-weight: 650; max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2-n {
  font-family: var(--display); font-style: italic; font-size: 15px; color: var(--gold);
  background: rgba(0,0,0,.4); border-radius: 7px; padding: 1px 7px;
}
.p2-siege u {
  text-decoration: none; font-size: 9.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #FF8078;
}
.p2-siege u.uno { color: var(--gold); }

/* ─── la pioche et la défausse ─── */
.p2-centre {
  position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  gap: clamp(20px, 7vw, 54px);
}
.p2-pioche {
  position: relative; cursor: pointer; background: none; border: 0; padding: 0;
  transition: transform .16s var(--ease);
}
.p2-pioche.active { animation: pulse 1.5s ease-in-out infinite; }
.p2-pioche:active { transform: scale(.95); }
.p2-pioche em {
  position: absolute; left: 50%; bottom: -20px; translate: -50% 0;
  font-style: normal; font-size: 11px; color: var(--muted);
}
.p2-defausse { position: relative; }
.p2-defausse::after {
  content: ''; position: absolute; inset: -12px; border-radius: 18px; z-index: -1;
  background: radial-gradient(closest-side, var(--teinte, transparent), transparent 72%);
  opacity: .55;
}

/* ─── la carte : le dessin vient de la même toile qu'en volume ─── */
.c2 {
  --cw: clamp(74px, 19vw, 116px);
  width: var(--cw); height: calc(var(--cw) * 1.5);
  flex: none; position: relative; cursor: pointer;
  background: center / 100% 100% no-repeat;
  border-radius: calc(var(--cw) * .10);
  filter: drop-shadow(0 5px 12px rgba(0,0,0,.55));
  transition: transform .18s var(--ease), filter .18s, opacity .18s;
}
.c2.posee { rotate: -4deg; }
.c2.eteinte { filter: grayscale(.45) brightness(.6) drop-shadow(0 3px 8px rgba(0,0,0,.5)); opacity: .62; }
.c2.jouable { filter: drop-shadow(0 6px 15px rgba(0,0,0,.6)) drop-shadow(0 0 3px rgba(255,255,255,.9)); }
.c2.choisie { transform: translateY(-16px) scale(1.04); }
.c2-choix {
  position: absolute; right: 6%; bottom: 6%; width: 26%; aspect-ratio: 1;
  border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.c2-choix.red { background: var(--red); } .c2-choix.yellow { background: var(--yellow); }
.c2-choix.green { background: var(--green); } .c2-choix.blue { background: var(--blue); }
.c2-choix.pink { background: #E82A7C; } .c2-choix.teal { background: #00A8A2; }
.c2-choix.orange { background: #F57C00; } .c2-choix.purple { background: var(--purple); }

/* ─── les flèches du sens de jeu ─── */
.p2-sens {
  position: absolute; inset: 0; pointer-events: none;
  display: block;
}
.p2-sens i {
  position: absolute; left: 50%; top: 50%;
  width: 15px; height: 15px; margin: -7px 0 0 -7px;
  background: rgba(255,255,255,.42);
  clip-path: polygon(0 0, 100% 50%, 0 100%, 22% 50%);
  transform:
    rotate(calc(var(--i) * 45deg))
    translateX(clamp(96px, 27vw, 168px))
    rotate(90deg);
  animation: sensPulse 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.32s);
}
.p2-sens.inverse i {
  transform:
    rotate(calc(var(--i) * -45deg))
    translateX(clamp(96px, 27vw, 168px))
    rotate(-90deg);
}
@keyframes sensPulse { 0%, 100% { opacity: .22; } 50% { opacity: .68; } }

/* ─── la main, défilante ─── */
.p2-main {
  flex: none; display: flex; gap: 6px; align-items: flex-end;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; scrollbar-width: none;
  background: linear-gradient(to top, rgba(4,6,11,.9), rgba(4,6,11,0));
}
.p2-main::-webkit-scrollbar { display: none; }
.p2-main .c2 { scroll-snap-align: center; }
.p2-main .c2:active { transform: translateY(-10px); }

/* en manette, seules les cartes comptent : la table s'efface */
/* dans la manette, le plateau prend simplement la place qui reste */
body.is-pad .plateau2d {
  position: relative; inset: auto; flex: 1; min-height: 0; background: radial-gradient(120% 90% at 50% 0%, #16202E, #070A10 70%); }
body.is-pad .p2-sieges, body.is-pad .p2-centre { display: none; }
body.is-pad .p2-main { flex: 1; align-items: center; }
body.is-pad .c2 { --cw: clamp(88px, 30vh, 168px); }
body.en-2d .myzone {
  background: linear-gradient(to top, rgba(4,6,11,.94) 60%, rgba(4,6,11,0));
  padding-top: 10px;
}
body.is-pad { --zone-h: 96px; }
