/* Bla5t — thème radioactif. Aucune ressource externe (CSP : 'self'). */
:root {
  --bg: #080d08;
  --panel: rgba(13, 22, 13, 0.86);
  --panel2: rgba(22, 36, 22, 0.9);
  --line: rgba(120, 230, 60, 0.28);
  --txt: #e9f4e2;
  --dim: #9fb596;
  --acc: #6edc2d;
  --acc2: #c4ff6a;
  --danger: #ff5a4d;
  --warn: #ffb020;
  /* Taille des cartes : la plus grande qui tienne dans la hauteur (adversaires + piles + ma main empilés), bornée par la largeur.
     --ui-scale est la préférence du joueur (menu « Affichage »), --anim la vitesse des animations (plus grand = plus lent). */
  --ui-scale: 1;
  --anim: 1;
  --m: clamp(50px, min(9vw, calc((100dvh - 240px) / 6)), 230px);
  --cw-me: calc(var(--m) * var(--ui-scale));
  --cw-opp: calc(var(--m) * .7 * var(--ui-scale));
  --cw-pile: calc(var(--m) * .85 * var(--ui-scale));
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--txt);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(rgba(4, 9, 4, 0.74), rgba(4, 9, 4, 0.9)), var(--bg) url(/assets/backgrounds/wasteland.jpg) center / cover fixed;
}
#app { min-height: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.15; }
h1 { font: 900 clamp(2.4rem, 6vw, 3.6rem)/1 Impact, "Arial Black", system-ui, sans-serif; letter-spacing: .02em; color: var(--acc2); text-shadow: 0 0 18px rgba(110, 220, 45, .5); }
h2 { font-size: 1.15rem; color: var(--acc2); }
h3 { font-size: 1rem; } h4 { font-size: .9rem; color: var(--dim); margin: .8rem 0 .3rem; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--acc2); outline-offset: 2px; }

/* ---------- formulaires & boutons ---------- */
button, input, select {
  font: inherit; color: var(--txt); background: #142014; border: 1px solid var(--line);
  border-radius: 8px; padding: .55rem .9rem; min-height: 44px;
}
input[type="checkbox"] { min-height: 0; width: 20px; height: 20px; accent-color: var(--acc); padding: 0; }
input[type="text"], select { width: 100%; }
button { cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s; }
button:hover:not(:disabled) { background: #1d301d; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: linear-gradient(#5fc925, #3f9712); border-color: #8bf04a; color: #04140a; font-weight: 700; }
button.primary:hover:not(:disabled) { background: linear-gradient(#74e035, #4bac19); }
button.danger { background: linear-gradient(#e0382c, #a31f16); border-color: #ff8d84; color: #fff; font-weight: 800; }
button.big { padding: .8rem 1.3rem; font-size: 1.05rem; }
label { display: block; font-size: .9rem; color: var(--dim); margin: .6rem 0 .25rem; }
.check { display: flex; align-items: center; gap: .6rem; color: var(--txt); margin: .4rem 0; }
.help { color: var(--dim); font-size: .85rem; margin: .3rem 0; }
.help.bad { color: var(--warn); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; backdrop-filter: blur(6px); box-shadow: 0 6px 28px rgba(0,0,0,.4); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; background: #26361f; color: var(--dim); border: 1px solid var(--line); }
.badge.host { background: #3a2f08; color: #ffd75a; border-color: #8d7420; }
.badge.ready { background: #1b4a14; color: var(--acc2); }
.badge.wait { color: var(--warn); }
.badge.blast { background: #5a1510; color: #ff9a90; border-color: var(--danger); animation: pulse 1.2s infinite; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #555; flex: none; }
.dot.on { background: var(--acc); box-shadow: 0 0 8px var(--acc); } .dot.off { background: var(--danger); }
.conn.ok { color: var(--acc); } .conn.ko { color: var(--warn); }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 100; left: 50%; bottom: 84px; transform: translateX(-50%); display: grid; gap: .5rem; width: min(92vw, 460px); pointer-events: none; }
.toast { background: #12200f; border: 1px solid var(--line); border-radius: 10px; padding: .65rem .9rem; box-shadow: 0 6px 20px rgba(0,0,0,.5); animation: rise .25s ease-out; }
.toast.error { border-color: var(--danger); background: #2a0f0c; }
.toast.out { opacity: 0; transition: opacity .35s; }

/* ---------- lobby ---------- */
.lobby { max-width: 980px; margin: 0 auto; padding: 1.2rem 1rem 3rem; display: grid; gap: 1rem; }
.hero { display: flex; gap: 1.2rem; align-items: center; padding: .5rem 0; }
.logo { width: clamp(90px, 22vw, 168px); height: auto; filter: drop-shadow(0 0 14px rgba(110, 220, 45, .55)); }
.tag { color: var(--dim); margin: .2rem 0; }
.create .big { margin-top: 1rem; width: 100%; }
.games { display: grid; gap: .6rem; }
.game { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; }
.game h3 { margin: 0; } .meta { margin: .15rem 0 0; color: var(--dim); font-size: .85rem; }
.state { font-size: .8rem; padding: .2rem .6rem; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.state.lobby, .state.countdown { color: var(--acc2); } .state.playing { color: var(--warn); } .state.finished { color: var(--dim); }
.game-actions { display: flex; gap: .4rem; }
.empty { color: var(--dim); text-align: center; padding: 1.2rem 0; margin: 0; }

/* ---------- salle ---------- */
.room { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 3rem; position: relative; }
.room-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.room-head h2 { font-size: 1.6rem; margin: 0; }
.room-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 1rem; align-items: start; }
.members { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .4rem; }
.member { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; background: var(--panel2); border-radius: 8px; border: 1px solid transparent; }
.member.me { border-color: var(--line); } .who { flex: 1; overflow-wrap: anywhere; }
.rename { display: flex; gap: .4rem; margin: .5rem 0; } .rename input { flex: 1; }
.room-actions { display: grid; gap: .3rem; }
.room-actions .big { width: 100%; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
fieldset.exts { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 .5rem; padding: .3rem .8rem .5rem; } legend { color: var(--dim); font-size: .85rem; padding: 0 .3rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: .4rem; }
.thumb { position: relative; padding: 0; width: 58px; min-height: 0; border-radius: 6px; overflow: hidden; background: #000; }
.thumb img { display: block; width: 100%; aspect-ratio: 5 / 7; object-fit: cover; }
.thumb.off img { filter: grayscale(1) brightness(.35); } .thumb.off::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; color: var(--danger); }
.thumb b { position: absolute; right: 2px; bottom: 2px; font-size: .7rem; background: rgba(0,0,0,.75); padding: 0 .3rem; border-radius: 4px; }
.countdown { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; text-align: center; background: rgba(3, 8, 3, .88); }
.countdown[hidden] { display: none; }
.countdown .num { font: 900 clamp(7rem, 30vw, 14rem)/1 Impact, "Arial Black", sans-serif; color: var(--acc2); text-shadow: 0 0 40px var(--acc); animation: pop 1s infinite; }

/* ---------- plateau ---------- */
.board { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; position: relative; }
.topbar { grid-row: 1; } .blast-flag { grid-row: 2; } .table { grid-row: 3; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .4rem .8rem; background: rgba(5, 10, 5, .85); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tt { color: var(--acc2); } .ti { color: var(--dim); font-size: .9rem; }
.top-actions { display: flex; gap: .4rem; flex-wrap: wrap; } .top-actions button { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.blast-flag { text-align: center; font-weight: 800; background: linear-gradient(90deg, #5a1510, #a31f16, #5a1510); padding: .3rem; letter-spacing: .03em; }
.blast-flag[hidden] { display: none; }
.table {
  min-height: 0; padding: .4rem .6rem; overflow: auto; display: grid; gap: .3rem 1rem;
  /* En haut : messages des actions (1/3 gauche), adversaire du haut (1/3 centre), commandes de jeu (1/3 droite). */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "feed top cmds" "left center right" "me me me";
  align-items: center; justify-items: center;
}
.region { display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap; }
.region.tl { grid-area: tl; } .region.top { grid-area: top; } .region.tr { grid-area: tr; }
.region.left { grid-area: left; } .region.right { grid-area: right; } .region.me { grid-area: me; }
.seat { position: relative; display: grid; justify-items: center; gap: .25rem; padding: .3rem .5rem .4rem; border-radius: 14px; border: 2px solid transparent; transition: box-shadow .3s, border-color .3s, background .3s; }
.plate { display: flex; align-items: center; gap: .4rem; font-size: .85rem; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: .15rem .7rem; max-width: 100%; }
.pname { font-weight: 700; max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .seat.mine .pname { max-width: 16ch; }
.pscore { color: var(--acc2); font-variant-numeric: tabular-nums; } .ptags { display: inline-flex; gap: .2rem; }
.seat.active-action-glow { border-color: var(--acc2); background: rgba(110, 220, 45, .08); box-shadow: 0 0 0 2px rgba(110, 220, 45, .5), 0 0 28px 6px rgba(110, 220, 45, .45); animation: glow 1.6s ease-in-out infinite; }
.seat.blaster { border-color: var(--danger); background: rgba(255, 70, 50, .07); }
.timer { width: 100%; height: 5px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; } .timer[hidden] { display: none; }
.tbar { display: block; height: 100%; background: var(--acc); transform-origin: left; } .timer.low .tbar { background: var(--danger); }
.hand { display: grid; grid-template-columns: repeat(var(--cols, 2), var(--cw)); gap: 5px; --cw: var(--cw-opp); }
.seat.mine .hand { --cw: var(--cw-me); gap: 8px; }
/* --cols est posé par le script d'après `cols` du serveur ; chaque carte est placée par sa case (grid-column / grid-row inline) : un trou reste un trou. */
.card.gone { opacity: 0; pointer-events: none; }

/* cartes : retournement 3D */
.card { position: relative; width: var(--cw); aspect-ratio: 5 / 7; padding: 0; min-height: 0; border: 0; border-radius: 8%; background: transparent; perspective: 700px; cursor: default; }
.card:hover:not(:disabled), .drawn-card:hover { background: transparent; }
.inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform calc(.7s * var(--anim)) cubic-bezier(.3, .7, .2, 1); border-radius: 8%; }
.card.up .inner, .drawn-card.up .inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 8%; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.6); background: #101810; }
.front { transform: rotateY(180deg); }
.card.clickable, .pile.clickable, .drawn-card.clickable { cursor: pointer; }
.card.clickable:hover { transform: translateY(-4px) scale(1.04); z-index: 4; }
.card.locked::after { content: "🔒"; position: absolute; right: 3%; bottom: 3%; font-size: clamp(.7rem, 1.4vw, 1.1rem); filter: drop-shadow(0 0 3px #000); }
.card.peeked .inner { transform: rotateY(180deg) scale(.97); outline: 2px dashed var(--warn); outline-offset: -2px; }
.card.peeked::before {
  content: "👁"; position: absolute; left: 50%; top: 0; z-index: 6; transform: translate(-50%, -58%);
  font-size: clamp(.8rem, calc(var(--cw) * .17), 1.5rem); line-height: 1; padding: .14em .42em; border-radius: 99px;
  background: rgba(6, 12, 6, .95); border: 1px solid var(--warn); box-shadow: 0 2px 8px #000; pointer-events: none;
}
/* Une carte regardée, visée ou touchée par un autre joueur : halo rouge (au lieu de l'œil). */
.card.looked, .fx-acted, .acted-glow { box-shadow: 0 0 0 3px var(--danger), 0 0 20px 7px rgba(255, 70, 50, .85); border-radius: 8%; z-index: 3; }
.card.looked { animation: glow 1.1s ease-in-out infinite; }
.acted-glow::after { content: ""; position: absolute; left: 0; bottom: -7px; height: 4px; width: calc(100% * var(--p, 1)); background: var(--danger); border-radius: 2px; }
.card.flipped-glow.acted-glow, .card.flipped-glow.fx-acted { box-shadow: 0 0 0 2px var(--acc2), 0 0 16px 5px rgba(110, 220, 45, .8); }
/* Une carte en vol vers cette place n'y est pas encore. */
.pending { visibility: hidden; }
.flipped-glow { box-shadow: 0 0 0 2px var(--acc2), 0 0 16px 5px rgba(110, 220, 45, .8); border-radius: 8%; animation: glow 1.3s ease-in-out infinite; }
.picked-glow { box-shadow: 0 0 0 3px #4ab8ff, 0 0 18px 6px rgba(74, 184, 255, .85); border-radius: 8%; }
.target-glow { box-shadow: 0 0 0 3px var(--warn), 0 0 18px 6px rgba(255, 176, 32, .85); border-radius: 8%; }
.helmut-glow { box-shadow: 0 0 0 3px var(--danger), 0 0 22px 8px rgba(255, 70, 50, .9); border-radius: 8%; animation: glow .5s infinite; }
.helmut-glow::after { content: ""; position: absolute; left: 0; bottom: -7px; height: 4px; width: calc(100% * var(--p, 1)); background: var(--danger); border-radius: 2px; }
.fx-pulse { animation: pop calc(.7s * var(--anim)); }
.fx-swap { animation: swap calc(1.8s * var(--anim)); }
.fx-flip { animation: swap calc(1.4s * var(--anim)); }
.fx-look { animation: pulse calc(1.2s * var(--anim)); }
.fx-shake { animation: shake calc(.6s * var(--anim)); }
.fx-land { animation: land calc(1.6s * var(--anim)); border-radius: 8%; }

/* centre de table */
.center { grid-area: center; display: flex; align-items: center; justify-content: center; gap: clamp(.5rem, 2vw, 1.5rem); }
.pile { position: relative; width: var(--cw-pile); aspect-ratio: 5 / 7; padding: 0; min-height: 0; border: 0; background: transparent; border-radius: 8%; }
.pile img { width: 100%; height: 100%; object-fit: cover; border-radius: 8%; box-shadow: 0 0 0 1px #000, 2px 2px 0 #1a261a, 4px 4px 0 #101810, 0 6px 14px rgba(0,0,0,.7); }
.pile.draw img { filter: brightness(.9); }
.count { position: absolute; right: -6px; bottom: -8px; background: #0a120a; border: 1px solid var(--line); border-radius: 99px; font-size: .75rem; padding: 0 .45rem; }
.lock { position: absolute; left: 3px; top: 3px; font-style: normal; } .lock[hidden] { display: none; }
/* Carte(s) piochée(s) : posées à côté du joueur qui joue (à droite de sa main ; à gauche pour les places de droite). */
.drawn { display: flex; gap: .4rem; position: absolute; top: 50%; left: calc(100% + .4rem); transform: translateY(-50%); z-index: 6; }
.drawn[hidden] { display: none; }
.region.right .drawn, .region.tr .drawn { left: auto; right: calc(100% + .4rem); }
.seat.mine .drawn { left: calc(100% + .8rem); }
.drawn-card { position: relative; width: var(--cw-pile); aspect-ratio: 5 / 7; padding: 0; min-height: 0; border: 0; background: transparent; perspective: 700px; border-radius: 8%; }
.peek-face { position: absolute; inset: 0; z-index: 2; animation: peekIn calc(.6s * var(--anim)) ease-out; transform-origin: center; }
.peek-face[hidden] { display: none; }
.peek-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 8%; outline: 3px dashed var(--warn); outline-offset: 2px; box-shadow: 0 0 18px rgba(255, 176, 32, .6); }
.peek-face small { position: absolute; left: 50%; top: -1.4em; transform: translateX(-50%); white-space: nowrap; font-size: .72rem; color: var(--warn); font-weight: 700; }
@keyframes peekIn { from { transform: perspective(600px) rotateY(90deg); } }
/* Fenêtre d'Helmut, chez le propriétaire : chrono vert sous la carte */
.react-timer::after { content: ""; position: absolute; left: 0; bottom: -7px; height: 4px; width: calc(100% * var(--p, 1)); background: var(--acc2); border-radius: 2px; box-shadow: 0 0 6px var(--acc2); }

/* barre d'actions */
.dock { grid-area: cmds; align-self: start; justify-self: stretch; display: flex; flex-direction: column; gap: .5rem; padding: .6rem .8rem; background: rgba(5, 12, 5, .9); border: 1px solid var(--acc); border-radius: 12px; box-shadow: 0 0 18px rgba(110, 220, 45, .25); }
.hint { margin: 0; font-weight: 700; font-size: 1.05rem; color: var(--acc2); } .hint:empty { display: none; }
.bar { display: flex; gap: .5rem; flex-wrap: wrap; } .bar:empty { display: none; }
.bar button { flex: 1 1 110px; }
.afk-bar { padding: .45rem .7rem; border-radius: 8px; background: #5a1510; border: 1px solid var(--danger); color: #ffd7d2; font-weight: 800; animation: pulse 1s infinite; }
.afk-bar[hidden] { display: none; }
/* Messages des actions (en haut à gauche) */
.feed { grid-area: feed; align-self: start; justify-self: stretch; margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; pointer-events: none; }
.feed-item { padding: .4rem .7rem; border-radius: 9px; background: rgba(5, 12, 5, .82); border-left: 4px solid var(--line); font-weight: 600; font-size: .92rem; color: var(--dim); transition: opacity .4s; }
.feed-item:first-child { font-size: 1.05rem; color: var(--txt); background: rgba(10, 24, 10, .92); }
.feed-item:nth-child(3) { opacity: .7; } .feed-item:nth-child(4) { opacity: .45; }
.feed-item.mine { border-left-color: var(--acc2); } .feed-item.other { border-left-color: var(--warn); } .feed-item.round { border-left-color: #4ab8ff; color: #bfe6ff; } .feed-item.blast { border-left-color: var(--danger); color: #ffb3aa; }
.feed-item.new { animation: feedIn .5s ease-out; box-shadow: 0 0 16px rgba(255, 176, 32, .35); }
@keyframes feedIn { from { opacity: 0; transform: translateX(-16px); } }

/* journal */
.log { position: absolute; right: 0; top: 52px; bottom: 70px; width: min(340px, 88vw); z-index: 20; background: var(--panel); border-left: 1px solid var(--line); padding: .6rem .8rem; overflow: auto; }
.log[hidden] { display: none; }
.log-list { margin: 0; padding: 0; list-style: none; font-size: .85rem; display: grid; gap: .25rem; } .log-list li { color: var(--dim); } .log-list li.sep { color: var(--acc2); font-weight: 700; margin-top: .5rem; }

/* fenêtres */
.overlay-root { position: absolute; inset: 0; z-index: 40; pointer-events: none; } .overlay-root > * { pointer-events: auto; }
.modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(3, 8, 3, .8); padding: 1rem; overflow: auto; }
.sheet { width: min(760px, 100%); max-height: 100%; overflow: auto; background: #0f1a0f; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.3rem; box-shadow: 0 10px 50px #000; }
.sheet h2 { font-size: 1.5rem; } .victory { color: var(--warn); text-shadow: 0 0 20px rgba(255, 176, 32, .5); }
.sheet-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.tablewrap { overflow: auto; }
.scores { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.scores th, .scores td { padding: .4rem .7rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.scores thead th { color: var(--acc2); position: sticky; top: 0; background: #0f1a0f; } .scores .rank { color: var(--dim); }
.scores tfoot td, .scores tfoot th { font-size: 1.2rem; font-weight: 800; border-top: 2px solid var(--line); } .scores .win { color: var(--warn); }
.scores td.blaster { background: rgba(255, 90, 77, .07); } .bl { color: var(--danger); font-weight: 800; }
.pic { display: inline-block; font-size: .78rem; font-weight: 800; padding: 0 .35rem; border-radius: 6px; } .pic.false { background: #5a1510; color: #ff9a90; } .pic.out { background: #4a3408; color: #ffcf6a; } .pic.combo { background: #173d0b; color: var(--acc2); }
.legend { color: var(--dim); font-size: .85rem; }
.scores .gone, .scores th small.gone { color: var(--dim); font-weight: 400; }
.discard-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .6rem; margin-top: .6rem; }
.discard-list figure { margin: 0; text-align: center; font-size: .72rem; color: var(--dim); } .discard-list img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 8px; }
.menu-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.menu { position: fixed; transform: translateY(-100%); pointer-events: auto; width: 262px; display: grid; gap: .35rem; padding: .5rem; background: #0f1a0f; border: 1px solid var(--acc); border-radius: 12px; box-shadow: 0 8px 30px #000; animation: rise .15s; }
.menu button { text-align: left; }
.zoom { position: fixed; z-index: 70; width: 260px; pointer-events: none; filter: drop-shadow(0 8px 24px #000); opacity: .8; } .zoom[hidden] { display: none; } .zoom img { width: 100%; border-radius: 12px; display: block; }
.fly3d { perspective: 900px; } .fly3d .inner { transition: none; }
.fly { position: fixed; z-index: 80; transform-origin: 0 0; will-change: transform; object-fit: cover; border-radius: 8px; pointer-events: none; box-shadow: 0 6px 20px #000; }
.banner { position: fixed; z-index: 90; left: 50%; top: 38%; transform: translate(-50%, -50%); font: 900 clamp(2.6rem, 12vw, 6rem)/1 Impact, "Arial Black", sans-serif; color: var(--acc2); text-shadow: 0 0 30px var(--acc), 0 4px 0 #000; pointer-events: none; animation: banner 1.8s ease-out forwards; white-space: nowrap; }
.banner.blast { color: #ff6a5a; text-shadow: 0 0 40px #ff2a1a, 0 4px 0 #000; } .banner.helmut { color: var(--warn); } .banner.turn { font-size: clamp(1.8rem, 7vw, 3.4rem); }
.loading { text-align: center; padding: 4rem 1rem; color: var(--dim); }

/* ---------- animations ---------- */
@keyframes glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes swap { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 4px var(--warn), 0 0 22px 8px rgba(255, 176, 32, .9); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes land { 0% { box-shadow: 0 0 0 0 rgba(196, 255, 106, 0); } 25% { box-shadow: 0 0 0 4px var(--acc2), 0 0 26px 10px rgba(110, 220, 45, .95); } 100% { box-shadow: 0 0 0 0 rgba(196, 255, 106, 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- petits écrans : la table devient une colonne ---------- */
@media (max-width: 860px) {
  .room-grid { grid-template-columns: 1fr; }
  .game { grid-template-columns: 1fr; } .game-actions button { flex: 1; }
  .table { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); grid-template-areas: none; grid-template-rows: none; align-content: start; gap: .5rem; padding-bottom: 1rem; }
  .region { display: contents; }
  .seat.opp { order: 1; } .center { grid-area: auto; order: 2; grid-column: 1 / -1; padding: .4rem 0; } .seat.mine { order: 3; grid-column: 1 / -1; justify-self: center; }
  :root { --cw-opp: calc(clamp(36px, 11vw, 60px) * var(--ui-scale)); --cw-me: calc(clamp(56px, 18vw, 96px) * var(--ui-scale)); --cw-pile: calc(clamp(52px, 15vw, 84px) * var(--ui-scale)); }
  .feed { grid-area: auto; order: 0; grid-column: 1 / -1; } .feed-item:nth-child(n+3) { display: none; }
  .dock { grid-area: auto; order: 99; grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 8; padding-bottom: calc(.6rem + env(safe-area-inset-bottom)); } .bar { width: 100%; } .bar button { flex: 1; }
  .log { top: 0; bottom: 0; }
  .drawn { position: static; transform: none; justify-content: center; }
}

/* ---------- réglages du son ---------- */
.audio-ctl { position: relative; }
.audio-btn { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.audio-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 250px; display: grid; gap: .5rem; padding: .8rem; background: #0f1a0f; border: 1px solid var(--acc); border-radius: 12px; box-shadow: 0 8px 30px #000; animation: rise .15s; }
.audio-panel[hidden] { display: none; }
.vol { display: grid; gap: .15rem; margin: 0; color: var(--txt); font-size: .85rem; }
.vol input[type="range"] { width: 100%; min-height: 28px; padding: 0; accent-color: var(--acc); }

/* ---------- outils : règles, signalement ---------- */
.hero-tools { margin-left: auto; align-self: flex-start; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.room-head .hero-tools { align-self: center; }
.tools { display: flex; gap: .4rem; }
.tool-btn { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }

/* ---------- fenêtres (aide, signalement) ---------- */
.dlg-bg { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 1rem; background: rgba(3, 8, 3, .84); overflow: auto; }
.dlg { width: min(560px, 100%); max-height: min(92vh, 900px); display: flex; flex-direction: column; background: #0f1a0f; border: 1px solid var(--acc); border-radius: 14px; box-shadow: 0 10px 50px #000; outline: none; animation: rise .15s; }
.dlg.wide { width: min(980px, 100%); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 1.25rem; }
.dlg-close { min-height: 36px; min-width: 36px; padding: 0; }
.dlg-body { overflow: auto; padding: 1rem 1.2rem 1.2rem; }
.rep textarea { width: 100%; font: inherit; color: var(--txt); background: #142014; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; resize: vertical; }
.rep details { margin: .6rem 0; } .rep summary { cursor: pointer; color: var(--acc2); }
.rep-preview { max-height: 180px; overflow: auto; font: .78rem/1.4 ui-monospace, Consolas, monospace; background: #080f08; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; white-space: pre-wrap; }

.help-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .8rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.help-tabs button { min-height: 36px; padding: .3rem .8rem; font-size: .9rem; } .help-tabs button.on { background: linear-gradient(#5fc925, #3f9712); border-color: #8bf04a; color: #04140a; font-weight: 700; }
.help-panel { line-height: 1.5; } .help-panel h3 { margin: 1rem 0 .3rem; color: var(--acc2); } .help-panel p, .help-panel ul { margin: .4rem 0; } .help-panel li { margin: .25rem 0; }
.help-note { padding: .55rem .8rem; background: rgba(255, 176, 32, .09); border-left: 3px solid var(--warn); border-radius: 4px; }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .7rem; }
.help-card { margin: 0; font-size: .78rem; } .help-card img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 8px; display: block; }
.help-card figcaption { display: grid; gap: .1rem; margin-top: .3rem; } .help-card figcaption span { color: var(--dim); }
.help-powers { list-style: none; padding: 0; display: grid; gap: .6rem; }
.help-powers li { display: grid; grid-template-columns: 64px 1fr; gap: .8rem; align-items: start; padding: .5rem; background: var(--panel2); border-radius: 10px; }
.help-powers img { width: 64px; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 6px; } .help-powers p { margin: .15rem 0 0; color: var(--txt); }
@media (max-width: 860px) { .hero-tools { margin-left: 0; width: 100%; justify-content: flex-start; } .help-powers li { grid-template-columns: 52px 1fr; } .help-powers img { width: 52px; } .dlg-bg { padding: .5rem; } }

/* ---------- sélection des héros / boss (salle) ---------- */
.picker { border: 1px solid var(--line, #444); border-radius: 8px; padding: .5rem .7rem; margin: .5rem 0; }
.seg { display: inline-flex; gap: .3rem; margin-bottom: .4rem; }
.seg button { min-height: 36px; padding: .3rem .8rem; }
.seg button.on { background: var(--accent, #e8a33d); color: #111; font-weight: 700; }
.thumb.pick { opacity: .6; } .thumb.pick.sel { opacity: 1; outline: 3px solid var(--accent, #e8a33d); }
.thumb.pick:disabled { opacity: .25; }
.thumb .tick { right: auto; left: 2px; bottom: auto; top: 2px; background: var(--accent, #e8a33d); color: #111; }
.host-panel { display: grid; gap: .6rem; min-width: min(92vw, 420px); }
.host-panel .hp-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: space-between; }
.host-btn { margin-right: .4rem; }

/* ---------- mains révélées en fin de manche ---------- */
.final-hands { margin: .8rem 0; }
.final-hands h3 { margin: 0 0 .4rem; font-size: 1rem; }
.fh-row { display: flex; align-items: center; gap: .6rem; margin: .3rem 0; flex-wrap: wrap; }
.fh-name { min-width: 6rem; font-weight: 700; }
.fh-cards { display: flex; gap: .3rem; flex-wrap: wrap; }
.fh-card { width: 54px; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 5px; }

.version { text-align: center; color: var(--mut, #9aa890); font-size: .8rem; margin: 1rem 0 .5rem; }

/* GamesCore : compte facultatif (accueil) et badge « vérifié » (salle) */
.gc-box { margin: .6rem 0 .2rem; padding: .6rem .8rem; border: 1px dashed var(--line); border-radius: 8px; }
.gc-who { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0; }
.gc-who span { flex: 1; overflow-wrap: anywhere; }
.gc-avatar { border-radius: 50%; object-fit: cover; }
.gc-login { display: inline-flex; align-items: center; min-height: 44px; padding: .55rem .9rem; border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--acc2); background: #142014; border: 1px solid var(--acc2); }
.gc-login:hover { background: #1d301d; }
button.link { background: none; border: none; color: var(--acc2); text-decoration: underline; padding: 0; min-height: 0; cursor: pointer; }
.badge.gc { color: var(--acc2); border-color: var(--acc2); max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-console { display: inline-block; margin-top: .3rem; color: var(--acc2); font-weight: 700; }

/* Réglages : jeu de base / extensions, galerie, héros et boss secrets */
.ext-row { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; }
.ext-row input[type="checkbox"] { flex: none; }
.ext-fixed { flex: none; width: 20px; text-align: center; color: var(--acc2); font-weight: 900; }
.ext-open { flex: 1; display: flex; align-items: center; gap: .7rem; text-align: left; padding: .4rem .6rem; }
.ext-open small { display: block; color: var(--dim); font-size: .8rem; }
.ext-row:not(.on) .ext-open { opacity: .6; }
.ext-imgs { display: flex; flex: none; } .ext-imgs img { width: 30px; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 3px; margin-left: -10px; box-shadow: 0 2px 6px #000; } .ext-imgs img:first-child { margin-left: 0; }
.seg { flex-wrap: wrap; }
.thumb.secret { display: block; } .thumb.secret b { inset: 0; right: 0; bottom: 0; display: grid; place-items: center; font-size: 1.4rem; background: rgba(0,0,0,.45); border-radius: 0; }
.gallery h3 { margin: 1rem 0 .5rem; color: var(--acc2); } .gallery h3:first-child { margin-top: 0; }
.gallery-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .7rem; }
.gcard { margin: 0; text-align: center; } .gcard img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 8px; display: block; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.gcard figcaption { font-size: .78rem; margin-top: .25rem; color: var(--dim); } .gcard figcaption b { color: var(--acc2); }
[data-zoom] { cursor: zoom-in; }
.card-zoom { width: 280px; z-index: 200; }
/* Plateau : joueur inactif (MJ) */
.idle-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; background: rgba(40, 24, 4, .95); border: 1px solid var(--warn); border-radius: 10px; padding: .25rem .6rem; }
.idle-bar button { min-height: 34px; padding: .25rem .7rem; }
.idle-bar[hidden] { display: none; }
