/* =========================================================
   UNO en famille : design Apple-like + verre dépoli
   ========================================================= */
:root {
  --red: #ff3b30;    --red-2: #c4161c;
  --yellow: #ffcc00; --yellow-2: #e09a00;
  --green: #34c759;  --green-2: #1a8f3a;
  --blue: #0a84ff;   --blue-2: #0050c8;
  --ink: #0b0b12;
  --text: #f5f5f7;
  --text-2: rgba(235, 235, 245, .62);
  --text-3: rgba(235, 235, 245, .38);
  --glass: rgba(255, 255, 255, .07);
  --glass-strong: rgba(255, 255, 255, .12);
  --stroke: rgba(255, 255, 255, .14);
  --card-w: 70px;
  --card-h: 104px;
  --radius: 22px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); overscroll-behavior: none; overflow-x: hidden; }
body { -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-2); font-size: .9rem; }
.center { text-align: center; }
.ico { width: 20px; height: 20px; fill: currentColor; flex: none; }


.screen { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 10px) 14px calc(env(safe-area-inset-bottom) + 0px); animation: screenIn .5s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px) scale(.99); } }

/* ---------- Boutons ---------- */
.btn {
  border: 0; border-radius: 16px; padding: 15px 20px; font-size: 1rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  color: var(--text); transition: transform .25s var(--spring), opacity .2s, background .2s;
}
.btn:active { transform: scale(.96); }
.btn.block { width: 100%; }
.btn.primary { background: #fff; color: #000; box-shadow: 0 8px 24px rgba(255,255,255,.15); }
.btn.secondary { background: var(--glass-strong); border: 1px solid var(--stroke); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.btn.ghost { background: transparent; color: var(--text-2); font-weight: 500; }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.uno {
  min-width: 132px; font-weight: 800; letter-spacing: .08em; font-size: 1.05rem; color: #fff;
  background: linear-gradient(180deg, #ff5a4f, var(--red-2));
  box-shadow: 0 10px 30px rgba(255,59,48,.45), 0 1px 0 rgba(255,255,255,.35) inset;
  position: relative; overflow: hidden;
}
.btn.uno::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%); background-size: 250% 100%; animation: shine 2.2s linear infinite; }
.btn.uno.armed { background: linear-gradient(180deg, #fff, #e9e9ee); color: var(--red-2); box-shadow: 0 0 0 2px rgba(255,59,48,.6); }
.btn.uno.armed::after { display: none; }
.icon-btn { background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; border-radius: 12px; display: flex; }
.icon-btn:active { background: var(--glass-strong); }

input {
  width: 100%; font-size: 1.05rem; padding: 15px 16px; border-radius: 14px;
  border: 1px solid var(--stroke); background: rgba(0,0,0,.25); color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s; font-family: inherit;
}
input::placeholder { color: var(--text-3); }
input:focus { border-color: rgba(255,255,255,.5); box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.field span { display: block; margin-bottom: 8px; color: var(--text-2); font-size: .85rem; font-weight: 500; }

/* ---------- Accueil ---------- */
.sep { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: .8rem; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--stroke); }
.join-row { display: flex; gap: 10px; }
.join-row input { text-transform: uppercase; letter-spacing: .5em; text-align: center; font-weight: 700; padding-left: 22px; }

/* ---------- Salon ---------- */
.eyebrow { text-align: center; color: var(--text-2); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; margin: 0; font-weight: 600; }
.code-tiles { display: flex; justify-content: center; gap: 10px; }
.code-tiles span {
  width: 62px; height: 76px; border-radius: 16px; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800;
  background: var(--glass-strong); border: 1px solid var(--stroke); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: tileIn .6s var(--spring) both;
}
.code-tiles span:nth-child(2) { animation-delay: .05s; } .code-tiles span:nth-child(3) { animation-delay: .1s; } .code-tiles span:nth-child(4) { animation-delay: .15s; }
@keyframes tileIn { from { transform: translateY(16px) scale(.8); opacity: 0; } }
#btn-share { align-self: center; }
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.player-list li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; animation: rowIn .45s var(--ease) both; }
.player-list li + li { border-top: 1px solid rgba(255,255,255,.06); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-10px); } }
.player-list .name { flex: 1; font-weight: 500; }
.player-list .you { color: var(--text-3); font-weight: 400; }
.tag { font-size: .7rem; padding: 3px 9px; border-radius: 99px; background: rgba(255,204,0,.16); color: var(--yellow); font-weight: 600; }
.tag.off { background: rgba(255,255,255,.08); color: var(--text-3); }
.kick { background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 6px; border-radius: 10px; display: flex; }
.dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Avatars ---------- */
.avatar {
  --size: 40px; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: calc(var(--size) * .38); color: #fff;
  background: var(--av, linear-gradient(135deg, #8e8e93, #48484a));
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 4px 12px rgba(0,0,0,.3);
  text-shadow: 0 1px 2px rgba(0,0,0,.25); position: relative;
}

/* ---------- Table ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 6px 6px 16px; border-radius: 18px; }
.room-tag { color: var(--text-2); font-size: .85rem; display: flex; align-items: center; gap: 8px; }
.room-tag b { color: var(--text); font-weight: 600; }
.room-tag b#game-code { letter-spacing: .12em; }
.sep-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.top-actions { display: flex; gap: 2px; }

.opponents { display: flex; gap: 10px; overflow-x: auto; padding: 14px 2px 10px; scrollbar-width: none; justify-content: safe center; }
.opponents::-webkit-scrollbar { display: none; }
.seat { flex: none; width: 86px; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; transition: opacity .3s; }
.seat.off { opacity: .45; }
.seat.waiting { opacity: .6; }
.seat.waiting .avatar { filter: grayscale(.5); box-shadow: 0 0 0 2px rgba(255,255,255,.25), 0 4px 12px rgba(0,0,0,.3); }
.spectator .hand-hint { position: static; padding: 50px 20px; font-size: .9rem; color: var(--text-2); }
.seat .avatar { --size: 52px; transition: transform .4s var(--spring); }
.seat.turn .avatar { transform: scale(1.08); }
.seat.turn .avatar::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; padding: 2.5px;
  background: conic-gradient(var(--red), var(--yellow), var(--green), var(--blue), var(--red));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 2.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.seat .count {
  position: absolute; top: 34px; right: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: #fff; color: #000; font-size: .8rem; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.35); transition: transform .3s var(--spring);
}
.seat .count.one { background: var(--red); color: #fff; animation: pulse .9s infinite alternate; }
.seat .seat-name { font-size: .8rem; font-weight: 600; max-width: 78px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .seat-pts { font-size: .7rem; color: var(--text-3); margin-top: -4px; white-space: nowrap; }
.seat .catch {
  white-space: nowrap; font-size: .68rem; padding: 5px 9px; border-radius: 10px; border: 0; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #ff5a4f, var(--red-2)); box-shadow: 0 6px 16px rgba(255,59,48,.5); animation: pulse .7s infinite alternate;
}
.seat .kick-mini { font-size: .68rem; padding: 4px 8px; border-radius: 9px; border: 1px solid var(--stroke); background: var(--glass); color: var(--text-2); }
@keyframes pulse { to { transform: scale(1.08); } }
.shake { animation: shake .5s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px) rotate(-3deg); } 40%, 80% { transform: translateX(6px) rotate(3deg); } }

.table {
  position: relative; flex: 1; min-height: 210px; max-height: 300px; border-radius: 32px; margin: 4px 0 0;
  display: flex; align-items: center; justify-content: center; gap: 34px; overflow: visible;
}
.table::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(60% 70% at 50% 50%, var(--glow, rgba(255,255,255,.08)), transparent 70%); opacity: .55; transition: background .6s; pointer-events: none; }
.table[data-color="red"] { --glow: var(--red); } .table[data-color="yellow"] { --glow: var(--yellow); }
.table[data-color="green"] { --glow: var(--green); } .table[data-color="blue"] { --glow: var(--blue); }
.direction { position: absolute; width: 230px; height: 230px; left: 50%; top: 50%; margin: -115px 0 0 -115px; color: rgba(255,255,255,.16); fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; animation: spin 18s linear infinite; pointer-events: none; }
.direction.ccw { animation-direction: reverse; transform: scaleX(-1); }
.direction.flip { animation: flipDir .8s var(--spring); }
@keyframes flipDir { 50% { transform: scale(1.25); color: rgba(255,255,255,.6); } }

.pile-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 1; }
.pile-label { font-size: .75rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; min-height: 16px; }
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 10px currentColor; }
.color-dot.c-red { background: var(--red); color: var(--red); } .color-dot.c-yellow { background: var(--yellow); color: var(--yellow); }
.color-dot.c-green { background: var(--green); color: var(--green); } .color-dot.c-blue { background: var(--blue); color: var(--blue); }

.discard-stack { position: relative; width: 92px; height: 136px; }
.discard-stack #discard { position: absolute; inset: 0; }
.discard-stack #discard .card { --card-w: 92px; --card-h: 136px; }
.ghost-card { position: absolute; inset: 0; border-radius: 16px; background: linear-gradient(155deg, #fafafa, #d8d8de); box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.ghost-card.g1 { transform: rotate(-8deg) translate(-5px, 3px); filter: brightness(.6); }
.ghost-card.g2 { transform: rotate(6deg) translate(4px, 1px); filter: brightness(.8); }
#discard .card .val { font-size: 2.6rem; }
#discard .card .val .ico { width: 42px; height: 42px; }
#discard .card.land { animation: land .55s var(--spring); }
@keyframes land { from { transform: scale(1.25) rotate(-8deg); } }

/* Pioche : paquet en épaisseur + carte posée de travers */
.deck-stack { --card-w: 80px; --card-h: 118px; --thick: 10px; position: relative; width: var(--card-w); height: var(--card-h); margin-bottom: var(--thick); }
.deck-edges { position: absolute; inset: 0; }
.deck-edge {
  position: absolute; inset: 0; border-radius: calc(var(--card-w) * .17);
  background: linear-gradient(180deg, #f4f4f6, #c9c9d0);
  border-bottom: 1px solid rgba(0,0,0,.35);
  box-shadow: 0 1px 0 rgba(0,0,0,.18);
}
.deck-edges .deck-edge:first-child { box-shadow: 0 10px 22px rgba(0,0,0,.55), 0 2px 4px rgba(0,0,0,.35); }
.deck-loose { position: absolute; left: 0; top: 0; transform: translate(-7px, 3px) rotate(-9deg); filter: brightness(.82); }
.deck-loose, #deck { --card-w: 80px; --card-h: 118px; }
#deck { position: absolute; left: 0; top: 0; cursor: pointer; transform: translate(3px, -1px) rotate(3deg); transition: transform .3s var(--spring); }
#deck:active { transform: translate(3px, -1px) rotate(3deg) scale(.96); }
.deck-stack.empty #deck, .deck-stack.empty .deck-loose { opacity: .25; }
#deck.can-draw { animation: bob 1.6s ease-in-out infinite; box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 32px rgba(255,255,255,.35), 0 14px 30px rgba(0,0,0,.5); }
@keyframes bob { 0%, 100% { transform: translate(3px, -1px) rotate(3deg); } 50% { transform: translate(3px, -7px) rotate(3deg); } }

.fx-layer { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; z-index: 5; }
.fx-badge {
  grid-area: 1 / 1; font-size: 3.4rem; font-weight: 900; color: #fff; letter-spacing: -.03em;
  text-shadow: 0 6px 30px rgba(0,0,0,.6); animation: fxPop 1.1s var(--ease) forwards; display: flex; align-items: center; gap: 8px;
}
.fx-badge .ico { width: 64px; height: 64px; filter: drop-shadow(0 6px 20px rgba(0,0,0,.5)); }
.fx-badge.big { font-size: 4.6rem; color: #fff; text-shadow: 0 0 2px #fff, 0 0 24px rgba(255,59,48,.95), 0 0 60px rgba(255,59,48,.7), 0 10px 30px rgba(0,0,0,.6); }
@keyframes fxPop { 0% { transform: scale(.3); opacity: 0; } 25% { transform: scale(1.12); opacity: 1; } 45% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: scale(1.05) translateY(-20px); opacity: 0; } }

.status { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0 6px; }
.turn-pill { margin: 0; font-weight: 700; font-size: .95rem; padding: 7px 16px; border-radius: 99px; background: var(--glass); border: 1px solid var(--stroke); min-height: 34px; transition: all .3s var(--ease); }
.turn-pill.mine { background: #fff; color: #000; border-color: #fff; box-shadow: 0 8px 24px rgba(255,255,255,.2); }
.event { margin: 0; min-height: 1.2em; font-size: .85rem; color: var(--text-2); text-align: center; }
.event.fresh { animation: fadeUp .4s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
.actions { display: flex; justify-content: center; gap: 10px; min-height: 8px; }
.actions .btn { padding: 12px 22px; animation: popIn .4s var(--spring); }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } }

/* ---------- Main en éventail ---------- */
.hand-wrap { position: relative; margin: 0 -14px; padding-bottom: calc(env(safe-area-inset-bottom) + 6px); }
.hand { position: relative; height: 176px; }
.hand.scrolls { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.hand.scrolls::-webkit-scrollbar { display: none; }
.hand.scrolls { height: 270px; }
.hand.scrolls .card { bottom: 48px; }
.hand.turning .card { transition: none; }
.hand.scrolls::after { content: ''; position: absolute; left: 0; top: 0; width: var(--content-w); height: 1px; }
.hand .card { position: absolute; left: 50%; bottom: 16px; transform-origin: 50% 120%; transition: transform .45s var(--spring), filter .3s, opacity .3s; cursor: pointer; }
.hand.my-turn .card:not(.playable) { filter: brightness(.55) saturate(.6); }
.hand .card.selected { z-index: 50 !important; }
.hand-hint { position: absolute; left: 0; right: 0; top: -4px; margin: 0; padding: 0 20px; text-align: center; font-size: .72rem; color: var(--text-3); }

/* ---------- Cartes ---------- */
.card {
  width: var(--card-w); height: var(--card-h); border-radius: calc(var(--card-w) * .17);
  position: relative; display: flex; align-items: center; justify-content: center; flex: none;
  color: #fff; font-weight: 800; padding: 0; border: 0; user-select: none; overflow: hidden;
  background: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 22px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.3);
}
.card .face { position: absolute; inset: calc(var(--card-w) * .06); border-radius: calc(var(--card-w) * .12); background: var(--face); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card .face::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 70% at 20% 0%, rgba(255,255,255,.45), transparent 55%); pointer-events: none; }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 45%, rgba(255,255,255,.1) 52%, transparent 62%);
  background-size: 260% 100%; background-position: 130% 0; mix-blend-mode: soft-light; opacity: .9;
}
.hand.my-turn .card.playable::after, #discard .card.land::after { animation: shine 2.6s ease-in-out infinite; }
@keyframes shine { 0% { background-position: 130% 0; } 60%, 100% { background-position: -130% 0; } }
.card .oval {
  width: 84%; height: 64%; position: relative; border-radius: 50%; transform: rotate(-28deg);
  background: linear-gradient(160deg, #fff, #f1f1f4); box-shadow: 0 2px 6px rgba(0,0,0,.25) inset;
  display: flex; align-items: center; justify-content: center;
}
.card .val { transform: rotate(28deg); font-size: calc(var(--card-w) * .4); letter-spacing: -.04em; color: var(--c2); display: flex; text-shadow: 1px 1px 0 rgba(0,0,0,.12); }
.card .val .ico { width: calc(var(--card-w) * .44); height: calc(var(--card-w) * .44); }
.card .corner { position: absolute; z-index: 1; font-size: calc(var(--card-w) * .17); line-height: 1; display: flex; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.card .corner .ico { width: calc(var(--card-w) * .2); height: calc(var(--card-w) * .2); }
.card .tl { top: calc(var(--card-w) * .11); left: calc(var(--card-w) * .12); }
.card .br { bottom: calc(var(--card-w) * .11); right: calc(var(--card-w) * .12); transform: rotate(180deg); }

.c-red    { --face: linear-gradient(155deg, #ff6b61, var(--red) 45%, var(--red-2)); --c2: var(--red-2); }
.c-yellow { --face: linear-gradient(155deg, #ffe066, var(--yellow) 45%, var(--yellow-2)); --c2: #c78400; }
.c-green  { --face: linear-gradient(155deg, #6ee58c, var(--green) 45%, var(--green-2)); --c2: var(--green-2); }
.c-blue   { --face: linear-gradient(155deg, #5aaeff, var(--blue) 45%, var(--blue-2)); --c2: var(--blue-2); }
.c-wild   { --face: linear-gradient(155deg, #3a3a40, #121214 55%, #000); --c2: #fff; }
.c-wild .oval { background: conic-gradient(from 0deg, var(--red) 0 25%, var(--blue) 0 50%, var(--yellow) 0 75%, var(--green) 0); }
.c-wild .val { color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.swatch { background: var(--face); }

.card.back .face, .card.back { --face: linear-gradient(155deg, #2c2c32, #0e0e10 60%); }
.card.back .oval { background: linear-gradient(160deg, #ff5a4f, var(--red-2)); }
.card.back .mini-logo { transform: rotate(28deg); color: var(--yellow); font-style: italic; font-weight: 900; font-size: calc(var(--card-w) * .24); letter-spacing: -.03em; text-shadow: 1px 1px 0 #000; }
.card.back { background: #fff; }

/* Cartes en vol */
.fly { position: fixed; z-index: 100; pointer-events: none; margin: 0; will-change: transform; }

/* ---------- Modales (feuille iOS) ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; z-index: 60; animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 460px; border-radius: 30px 30px 0 0; padding: 10px 20px calc(env(safe-area-inset-bottom) + 22px); display: flex; flex-direction: column; gap: 14px; text-align: center; animation: sheetUp .5s var(--spring); background: rgba(30,30,36,.72); }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetPop { from { transform: scale(.92); opacity: 0; } }
/* Grand écran : fenêtre centrée aux 4 coins arrondis (le mobile garde la feuille en bas) */
@media (min-width: 700px) {
  .modal { align-items: center; }
  .sheet { border-radius: 30px; padding: 22px 24px 26px; animation: sheetPop .4s var(--spring); }
  .grabber { display: none; }
}
.grabber { width: 38px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); align-self: center; margin-bottom: 4px; }
.sheet h2, .sheet h3 { margin: 0; letter-spacing: -.02em; }
.sheet h2 { font-size: 1.6rem; }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.swatch { height: 92px; border-radius: 20px; border: 0; cursor: pointer; position: relative; overflow: hidden; color: #fff; font-weight: 700; font-size: 1rem; display: flex; align-items: flex-end; padding: 12px 14px; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 10px 24px rgba(0,0,0,.35); transition: transform .3s var(--spring); }
.swatch::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 70% at 20% 0%, rgba(255,255,255,.45), transparent 55%); }
.swatch span { position: relative; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.swatch:active { transform: scale(.94); }
.winner-avatar { align-self: center; margin-top: 6px; }
.winner-avatar .avatar { --size: 84px; animation: tileIn .7s var(--spring); }
.winner-avatar .avatar::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; background: conic-gradient(var(--red), var(--yellow), var(--green), var(--blue), var(--red)); z-index: -1; filter: blur(10px); animation: spin 3s linear infinite; }
.scores { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.scores li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); animation: rowIn .45s var(--ease) both; }
.scores li.win { background: rgba(255,204,0,.12); }
.scores .rank { width: 18px; color: var(--text-3); font-weight: 700; font-size: .85rem; }
.scores .avatar { --size: 32px; }
.scores .nm { flex: 1; font-weight: 600; }
.scores .cards { color: var(--text-3); font-size: .8rem; }
.scores .pts { font-weight: 800; min-width: 44px; text-align: right; }

/* ---------- Confettis ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 1px; animation: fall var(--d) cubic-bezier(.25,.6,.4,1) forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); opacity: .9; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%); z-index: 90; padding: 11px 18px; border-radius: 16px; font-size: .9rem; font-weight: 500; max-width: 90vw; text-align: center; background: rgba(40,40,46,.82); border: 1px solid var(--stroke); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toastIn .45s var(--spring); }
@keyframes toastIn { from { transform: translate(-50%, -30px); opacity: 0; } }

@media (min-width: 700px) {
  :root { --card-w: 84px; --card-h: 124px; }
  .screen { max-width: 820px; margin: 0 auto; width: 100%; }
  .hand { height: 210px; }
  .hand.scrolls { height: 340px; }
  .hand.scrolls .card { bottom: 98px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@font-face { font-family: "Anton"; src: url(fonts/anton-latin.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
:root { --display: "Anton", Impact, "Arial Narrow", "Arial Black", sans-serif; }

/* =========================================================
   Accueil : papier crème, typo grasse, aplats (sans verre)
   ========================================================= */
html:has(body.home-light), body.home-light { background: #f4f0e6; color: #111; }
html:has(body.home-light), body.home-light { height: auto; min-height: 100%; overflow-y: auto; }
#screen-home, #screen-rules { --paper: #f4f0e6; --line: #111; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding: calc(env(safe-area-inset-top) + 14px) 20px calc(env(safe-area-inset-bottom) + 14px); animation: none; }
.home { margin: 0 auto; width: 100%; max-width: 1080px; min-height: calc(100dvh - 28px); display: flex; flex-direction: column; gap: 0; }
.home-top { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; border-bottom: 2px solid var(--line); }
.logo { display: flex; align-items: baseline; gap: 10px; }
.logo-uno { font-size: 2.6rem; font-weight: 400; font-style: italic; letter-spacing: -.05em; line-height: 1; font-family: var(--display); }
.logo-sub { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: #111; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }
.top-actions { display: flex; gap: 18px; align-items: baseline; }
.home-main { flex: 1; display: flex; flex-direction: column; gap: 22px; padding: 22px 0; }
.slogan { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(3.4rem, 15vw, 6.4rem); line-height: .96; letter-spacing: 0; text-transform: none; }
.slogan .dot { color: var(--red-2); }
.lead { margin: 10px 0 0; font-size: 1.05rem; }
.mk-hand { position: relative; height: 170px; margin: 18px auto 0; width: 270px; }
.mk-card { position: absolute; top: 16px; width: 92px; height: 138px; border-radius: 12px; border: 3px solid #111; background: var(--bg); transform: rotate(var(--r)); font-weight: 400; font-family: var(--display); color: #fff; }
.mk-card.c-green { --bg: #17a34a; left: 0; } .mk-card.c-blue { --bg: #1565d8; left: 50px; }
.mk-card.c-red { --bg: #e3141a; left: 100px; top: 4px; z-index: 2; } .mk-card.c-yellow { --bg: #fcc800; left: 164px; color: #111; }
.mk-card .oval { position: absolute; inset: 20px 8px; border-radius: 50%; background: #f4f0e6; transform: rotate(-24deg); display: grid; place-items: center; }
.mk-card .oval span { transform: rotate(24deg); font-style: normal; font-size: 2.6rem; color: #111; line-height: 1; }
.mk-card b { position: absolute; font-size: .95rem; line-height: 1; }
.mk-card .tl { top: 7px; left: 8px; } .mk-card .br { bottom: 7px; right: 8px; transform: rotate(180deg); }
.home-form { display: flex; flex-direction: column; gap: 14px; }
.form-title { margin: 0; font-weight: 400; padding-bottom: 10px; border-bottom: 2px solid var(--line); font-family: var(--display); font-size: 1.6rem; letter-spacing: .01em; text-transform: uppercase; }
#screen-home .field span { color: #111; font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
#screen-home input { background: #fff; color: #111; border: 2px solid #111; border-radius: 6px; font-size: 1.1rem; }
#screen-home input::placeholder { color: rgba(0,0,0,.4); }
#screen-home input:focus { border-color: #111; }
#screen-home .btn { border-radius: 6px; font-weight: 800; font-size: 1.1rem; padding: 16px 20px; backdrop-filter: none; -webkit-backdrop-filter: none; }
#screen-home .btn.primary { background: #e3141a; color: #fff; border: 2px solid #111; }
#screen-home .btn.secondary { background: #111; color: #fff; border: 2px solid #111; }
#screen-home .btn:active { transform: scale(.98); }
#screen-home .sep { color: #111; font-weight: 600; } #screen-home .sep::before, #screen-home .sep::after { background: #111; height: 2px; }
#screen-home .join-row input { letter-spacing: .3em; font-weight: 800; padding-left: 16px; text-align: left; }
#screen-home .join-row input::placeholder { letter-spacing: .3em; }
.home-form .field { margin: 0; } .home-form .field + .join-row { margin-top: -8px; }
.fine { margin: 0; font-size: .92rem; color: rgba(0,0,0,.65); }
.home-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 12px; border-top: 2px solid var(--line); font-size: .92rem; }
.chips { display: flex; gap: 6px; flex: none; } .chips i { width: 22px; height: 22px; display: block; }
.chips .c-red { background: #e3141a; } .chips .c-yellow { background: #fcc800; } .chips .c-green { background: #17a34a; } .chips .c-blue { background: #1565d8; }
@media (min-width: 800px) {
  .home-top { padding-top: 6px; } .logo-uno { font-size: 3rem; }
  .home-main { flex-direction: row; align-items: center; gap: 56px; padding: 16px 0; }
  .home-pitch { flex: 1.5; } .home-form { flex: 1; max-width: 440px; }
  .slogan { font-size: clamp(3.6rem, 6.6vw, 6rem); }
  .mk-hand { margin: 22px 0 0; transform: scale(1.15); transform-origin: 0 0; height: 190px; }
}

/* =========================================================
   Salon d'attente : même papier que l'accueil
   ========================================================= */
#screen-lobby { --line: #111; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding: calc(env(safe-area-inset-top) + 14px) 20px calc(env(safe-area-inset-bottom) + 14px); animation: none; }
#screen-lobby .slogan { font-size: clamp(3.2rem, 14vw, 5.4rem); }
#screen-lobby .eyebrow { text-align: center; color: #111; font-weight: 800; letter-spacing: .1em; margin-top: 18px; font-size: .8rem; }
#screen-lobby .code-tiles { margin: 10px 0 14px; }
#screen-lobby .code-tiles span { width: 62px; height: 72px; border-radius: 6px; background: #fff; color: #111; border: 2px solid #111; font-family: var(--display); font-weight: 400; font-size: 2.6rem; backdrop-filter: none; -webkit-backdrop-filter: none; }
#screen-lobby .btn { border-radius: 6px; font-weight: 800; font-size: 1.1rem; padding: 16px 20px; backdrop-filter: none; -webkit-backdrop-filter: none; }
#screen-lobby .btn.secondary { background: #111; color: #fff; border: 2px solid #111; }
#screen-lobby .btn.primary { background: #e3141a; color: #fff; border: 2px solid #111; }
#screen-lobby .btn:disabled { opacity: 1; background: #cfcabd; color: rgba(0,0,0,.55); border-color: #cfcabd; box-shadow: none; }
#screen-lobby .btn:active { transform: scale(.98); }
.center-link { display: block; margin: 12px auto 0; font-weight: 500; }
.players-head { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 2px solid var(--line); }
.players-head .form-title { border: 0; font-size: 2rem; text-transform: none; padding-bottom: 8px; }
.players-head .count { font-weight: 800; font-size: 1.1rem; padding-bottom: 12px; }
#screen-lobby .player-list { gap: 0; }
#screen-lobby .player-list li { padding: 12px 4px; border-top: 0; }
#screen-lobby .player-list li + li { border-top: 1px solid rgba(0,0,0,.22); }
#screen-lobby .player-list .name { font-weight: 800; font-size: 1.3rem; font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
#screen-lobby .player-list .you { color: rgba(0,0,0,.6); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: .95rem; letter-spacing: 0; }
#screen-lobby .avatar { --size: 44px; background: #e3141a; box-shadow: none; text-shadow: none; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 800; }
#screen-lobby .tag { background: none; color: #111; border: 2px solid #111; font-weight: 800; padding: 4px 12px; font-size: .85rem; }
#screen-lobby .tag.off { color: rgba(0,0,0,.55); border-color: rgba(0,0,0,.4); }
#screen-lobby .kick { color: #111; }
#screen-lobby .player-list li.free .name { color: rgba(0,0,0,.55); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.05rem; font-weight: 400; }
.slot { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed rgba(0,0,0,.55); flex: none; }
#screen-lobby .dots i { background: #111; }
.mk-two { width: 190px; height: 170px; }
.mk-two .c-red { left: 0; top: 14px; } .mk-two .c-blue { left: 70px; top: 6px; }
.mk-two .c-blue { z-index: 1; }
@media (min-width: 800px) {
  #screen-lobby .home-pitch { flex: 1.2; max-width: 520px; }
  #screen-lobby .home-main { align-items: flex-start; padding-top: 30px; }
  #screen-lobby .slogan { font-size: clamp(3.6rem, 6.6vw, 6rem); }
  #screen-lobby .eyebrow { text-align: left; } #screen-lobby .code-tiles { justify-content: flex-start; }
  #screen-lobby .mk-two { margin-top: 18px; transform: scale(1); }
}

/* =========================================================
   Page des règles
   ========================================================= */
#screen-rules { --line: #111; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding: calc(env(safe-area-inset-top) + 14px) 20px calc(env(safe-area-inset-bottom) + 14px); animation: none; }
.rules-body { flex: 1; display: flex; flex-direction: column; gap: 22px; padding: 22px 0 26px; max-width: 760px; width: 100%; margin: 0 auto; }
.rules-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rules-steps > li { counter-increment: step; border-top: 2px solid #111; padding: 16px 0 18px 54px; position: relative; }
.rules-steps > li::before { content: counter(step); position: absolute; left: 0; top: 12px; font-family: var(--display); font-size: 2.4rem; line-height: 1; color: #e3141a; width: 40px; }
.rules-steps h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 1.7rem; letter-spacing: .01em; text-transform: uppercase; }
.rules-steps p { margin: 0 0 8px; line-height: 1.45; font-size: 1.02rem; }
.specials { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.specials li { display: flex; align-items: center; gap: 14px; line-height: 1.35; }
.rc { flex: none; width: 46px; height: 62px; border: 2px solid #111; border-radius: 7px; display: grid; place-items: center; font-family: var(--display); font-size: 1.5rem; color: #fff; background: var(--bg, #111); }
.rc.c-blue { --bg: #1565d8; } .rc.c-red { --bg: #e3141a; } .rc.c-green { --bg: #17a34a; }
.rc.c-wild { background: conic-gradient(#e3141a 0 25%, #fcc800 0 50%, #17a34a 0 75%, #1565d8 0); text-shadow: 0 0 3px #111, 0 0 3px #111; }
.points { width: 100%; border-collapse: collapse; margin-top: 8px; }
.points td { padding: 9px 0; border-top: 1px solid rgba(0,0,0,.25); font-size: 1rem; }
.points td:last-child { text-align: right; font-weight: 800; }
#screen-rules .btn { border-radius: 6px; font-weight: 800; font-size: 1.1rem; padding: 16px 20px; }
#screen-rules .btn.primary { background: #e3141a; color: #fff; border: 2px solid #111; }
#screen-rules .btn:active { transform: scale(.98); }
@media (min-width: 800px) {
  .rules-body { padding-top: 34px; }
  .rules-steps > li { padding-left: 70px; } .rules-steps > li::before { font-size: 3rem; top: 8px; }
}

/* =========================================================
   Table de jeu et fenêtres : papier crème, aplats, filets noirs
   ========================================================= */
body.home-light { --ink-paper: #f4f0e6; --text: #111; --text-2: rgba(17,17,17,.7); --text-3: rgba(17,17,17,.5); --stroke: #111; letter-spacing: 0; }
.topbar { padding: 4px 0 12px; border-radius: 0; border-bottom: 2px solid #111; background: none; box-shadow: none; }
.room-tag { color: #111; font-size: .9rem; }
.room-tag b { font-weight: 800; } .room-tag b#game-code { font-family: var(--display); font-weight: 400; font-size: 1.3rem; letter-spacing: .1em; }
.sep-dot { background: #111; }
.icon-btn { color: #111; border-radius: 6px; } .icon-btn:active { background: rgba(0,0,0,.1); }

/* Adversaires */
.seat .avatar { background: #e3141a; box-shadow: none; text-shadow: none; font-weight: 800; }
.seat .avatar.x, .seat.waiting .avatar { filter: none; opacity: .65; }
.seat.turn .avatar { transform: scale(1.06); box-shadow: 0 0 0 3px #f4f0e6, 0 0 0 6px #111; }
.seat.turn .avatar::before { display: none; }
.seat .count { background: #111; color: #fff; border: 2px solid #f4f0e6; box-shadow: none; }
.seat .count.one { background: #e3141a; }
.seat .seat-name { font-weight: 800; } .seat .seat-pts { color: var(--text-3); }
.seat .catch { background: #e3141a; border: 2px solid #111; border-radius: 6px; }
.seat .kick-mini { border: 2px solid #111; border-radius: 6px; background: none; color: #111; }

/* Table */
.table { background: #fbf8f0; border: 3px solid var(--accent, #111); border-radius: 10px; transition: border-color .4s; }
.table::before { display: none; }
.table[data-color="red"] { --accent: #e3141a; } .table[data-color="yellow"] { --accent: #fcc800; }
.table[data-color="green"] { --accent: #17a34a; } .table[data-color="blue"] { --accent: #1565d8; }
.direction { color: rgba(0,0,0,.14); }
.direction.flip { color: rgba(0,0,0,.5); }
@keyframes flipDir { 50% { transform: scale(1.25); color: rgba(0,0,0,.55); } }
.pile-label { color: #111; font-weight: 700; font-size: .8rem; }
.color-dot { box-shadow: none; border: 2px solid #111; width: 14px; height: 14px; border-radius: 3px; }
.color-dot.c-red { background: #e3141a; } .color-dot.c-yellow { background: #fcc800; } .color-dot.c-green { background: #17a34a; } .color-dot.c-blue { background: #1565d8; }
.ghost-card { background: #fff; border: 2px solid #111; box-shadow: none; filter: none !important; }
.deck-edge { background: #fff; border: 2px solid #111; border-top: 0; box-shadow: none; }
.deck-edges .deck-edge:first-child { box-shadow: none; }
#deck.can-draw { box-shadow: 0 0 0 3px #e3141a; }
.fx-badge { color: #f4f0e6; background: #111; border-radius: 8px; padding: 6px 18px; text-shadow: none; font-family: var(--display); font-weight: 400; }
.fx-badge .ico { filter: none; }
.fx-badge.big { color: #fcc800; text-shadow: none; font-size: 4.2rem; padding: 4px 22px 8px; line-height: 1.1; }

/* Statut et boutons */
.turn-pill { background: #fbf8f0; border: 2px solid #111; border-radius: 6px; font-weight: 800; }
.turn-pill.mine { background: #e3141a; color: #fff; border-color: #111; }
.event { color: var(--text-2); }
#screen-game .btn, .sheet .btn { border-radius: 6px; font-weight: 800; backdrop-filter: none; -webkit-backdrop-filter: none; }
#screen-game .btn.secondary, .sheet .btn.secondary { background: #111; color: #fff; border: 2px solid #111; }
.sheet .btn.primary { background: #e3141a; color: #fff; border: 2px solid #111; }
.sheet .btn.ghost { color: #111; text-decoration: underline; text-underline-offset: 4px; }
.btn.uno { background: #e3141a; color: #fff; border: 2px solid #111; font-family: var(--display); font-weight: 400; letter-spacing: .06em; font-size: 1.3rem; }
.btn.uno::after { display: none; }
.btn.uno.armed { background: #fff; color: #e3141a; }
.hand-hint { color: var(--text-2); font-weight: 600; }
.hand.my-turn .card:not(.playable) { filter: saturate(.4); opacity: .55; }

/* Cartes : aplats, contour noir */
.card { background: #f4f0e6; border: 2px solid #111; overflow: hidden; }
.card .face { inset: calc(var(--card-w) * .05); border-radius: calc(var(--card-w) * .1); background: var(--face); }
.card .face::before, .card::after { display: none; }
.card .oval { background: #f4f0e6; box-shadow: none; border: 0; }
.card .val { color: #111; text-shadow: none; font-family: var(--display); font-weight: 400; letter-spacing: 0; }
.card .corner { text-shadow: none; font-family: var(--display); font-weight: 400; }
.c-red { --face: #e3141a; } .c-yellow { --face: #fcc800; } .c-green { --face: #17a34a; } .c-blue { --face: #1565d8; }
.c-yellow .corner { color: #111; }
.c-wild { --face: #111; }
.c-wild .oval { background: conic-gradient(from 0deg, #e3141a 0 25%, #1565d8 0 50%, #fcc800 0 75%, #17a34a 0); }
.c-wild .val { color: #fff; text-shadow: 0 0 3px #111, 0 0 3px #111; }
.card.back, .card.back .face { --face: #111; background: #f4f0e6; }
.card.back .face { background: #111; }
.card.back .oval { background: #e3141a; }
.card.back .mini-logo { color: #fcc800; text-shadow: none; font-family: var(--display); font-weight: 400; font-style: normal; letter-spacing: .02em; }
.hand .card.selected { box-shadow: 0 0 0 2px #e3141a; }

/* Fenêtres (fin de manche, couleur) */
.modal { background: rgba(17,17,17,.45); backdrop-filter: none; -webkit-backdrop-filter: none; }
.sheet { background: #f4f0e6; color: #111; border: 2px solid #111; border-bottom: 0; border-radius: 12px 12px 0 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.sheet h2, .sheet h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; text-transform: uppercase; }
.sheet h2 { font-size: 2.2rem; }
.grabber { background: #111; }
.muted { color: var(--text-2); }
.swatch { border: 2px solid #111; border-radius: 6px; background: var(--face); }
.swatch::before { display: none; }
.swatch span { text-shadow: none; font-weight: 800; }
.c-yellow.swatch span { color: #111; }
.winner-avatar .avatar { background: #e3141a; box-shadow: none; text-shadow: none; }
.winner-avatar .avatar::after { display: none; }
.scores li { background: none; border-top: 1px solid rgba(0,0,0,.25); border-radius: 0; }
.scores li.win { background: #fcc800; border-top-color: #111; }
.scores .avatar { background: #e3141a; box-shadow: none; text-shadow: none; }
.scores .rank, .scores .cards { color: var(--text-2); }
.scores .nm { font-weight: 800; } .scores .pts { font-family: var(--display); font-size: 1.4rem; font-weight: 400; }
.toast { background: #111; color: #fff; border: 0; border-radius: 6px; backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (min-width: 700px) { .sheet { border: 2px solid #111; border-radius: 12px; } }

/* Aucune ombre portée : tout est à plat (les anneaux de sélection restent) */
body.home-light .card, body.home-light .btn, body.home-light .toast, body.home-light .swatch,
body.home-light .seat .catch, body.home-light .turn-pill, body.home-light .mk-card, body.home-light .rc,
body.home-light .code-tiles span, body.home-light input, body.home-light .sheet { box-shadow: none; }

/* Manche interrompue : pas de gagnant ni de scores, seulement « Manche suivante » */
#round-over.interrupted .winner-avatar, #round-over.interrupted .scores { display: none; }

/* Écrans courts (iPhone avec barres Safari ~650 px) : l'essentiel tient sans défiler */
@media (max-width: 799px) {
  .slogan { font-size: clamp(2.4rem, 11vw, 3.4rem); line-height: 1; }
  #screen-lobby .slogan { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .home-main { gap: 14px; padding: 14px 0; }
  .form-title { font-size: 1.3rem; padding-bottom: 6px; }
  .home-form { gap: 10px; }
  .lead { margin-top: 6px; }
  #screen-lobby .eyebrow { margin-top: 10px; }
}
@media (max-width: 799px) and (max-height: 780px) {
  .mk-hand { display: none; }
  .home-foot { font-size: .8rem; }
}
@media (max-width: 799px) and (max-height: 720px) {
  #screen-lobby .lead, #screen-lobby .fine, #screen-lobby .player-list li.free, #screen-lobby .home-foot { display: none; }
  #screen-lobby .code-tiles span { height: 58px; font-size: 2.2rem; }
  #screen-lobby .code-tiles { margin: 8px 0 10px; }
  #screen-lobby .btn { padding: 13px 20px; }
  #screen-lobby .players-head .form-title { font-size: 1.6rem; }
  #screen-lobby .player-list li { padding: 8px 4px; }
}
@media (max-width: 799px) { #screen-lobby .mk-hand { display: none; } }

/* Table de jeu : tient toujours dans l'écran visible (le bouton « Passer » ne pousse plus la main hors champ) */
#screen-game { height: 100dvh; min-height: 0; }
#screen-game .table { min-height: 160px; max-height: 300px; flex: 1 1 160px; }
#screen-game .actions { min-height: 56px; align-items: center; }
#screen-game .status { padding-top: 10px; }
#screen-game .hand-wrap { margin-top: auto; flex: none; }
.hand.scrolls { height: 252px; }

.top-links { display: flex; gap: 18px; align-items: baseline; }
.rules-btn { font-family: var(--display); font-size: 1.25rem; width: 36px; height: 36px; align-items: center; justify-content: center; border: 2px solid #111; border-radius: 50%; margin: 2px 6px 2px 0; padding: 0; }

.sheet .btn.primary:disabled { opacity: 1; background: #cfcabd; color: rgba(0,0,0,.55); border-color: #cfcabd; }
/* La main (et ses z-index internes) reste sous les fenêtres */
.hand { isolation: isolate; }

/* Zoom autorisé (pincer pour agrandir), mais pas de zoom au double-toucher : on touche deux fois une carte pour la jouer */
html, body, button, input { touch-action: manipulation; }
