/* =========================================================
   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; }

/* ---------- Fond aurora ---------- */
.aurora { position: fixed; inset: 0; overflow: hidden; z-index: -1; background: radial-gradient(120% 80% at 50% 0%, #1b1b2b 0%, var(--ink) 60%); }
.blob { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(90px); opacity: .5; animation: drift 26s var(--ease) infinite alternate; }
.b1 { background: var(--red);    top: -18vmax; left: -22vmax; }
.b2 { background: var(--blue);   top: 8vmax; right: -30vmax; animation-delay: -6s; }
.b3 { background: var(--green);  bottom: -28vmax; left: -18vmax; animation-delay: -12s; opacity: .32; }
.b4 { background: var(--yellow); bottom: -32vmax; right: -22vmax; animation-delay: -18s; opacity: .26; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

/* ---------- Verre ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border: 1px solid var(--stroke);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 20px 50px rgba(0,0,0,.35);
}
.panel { border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h3 { margin: 0; font-size: 1.05rem; }
.pill { font-size: .78rem; padding: 4px 10px; border-radius: 99px; background: var(--glass-strong); color: var(--text-2); }

.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 ---------- */
.home, .lobby { margin: auto; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; padding: 24px 0 32px; }
.hero { position: relative; height: 150px; margin-bottom: -6px; }
.hero-card {
  position: absolute; left: 50%; top: 18px; width: 74px; height: 110px; margin-left: -37px; border-radius: 14px;
  transform: translateX(var(--x)) rotate(var(--r)); transform-origin: 50% 130%;
  border: 3px solid #fff; box-shadow: 0 14px 30px rgba(0,0,0,.45);
  animation: heroIn .9s var(--spring) both;
}
.hero-card:nth-child(2) { animation-delay: .06s; } .hero-card:nth-child(3) { animation-delay: .12s; } .hero-card:nth-child(4) { animation-delay: .18s; }
@keyframes heroIn { from { transform: translateX(0) rotate(0) translateY(30px); opacity: 0; } }
.wordmark {
  margin: 0; text-align: center; font-size: 3.6rem; font-weight: 800; letter-spacing: -.04em;
  background: linear-gradient(180deg, #fff 30%, rgba(255,255,255,.55)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { text-align: center; color: var(--text-2); margin: -10px 0 8px; font-size: 1.02rem; }
.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 .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); }
.hero-card.c-red, .hero-card.c-yellow, .hero-card.c-green, .hero-card.c-blue, .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; }
.fly.small { --card-w: 46px; --card-h: 68px; }

/* ---------- 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%); } }
.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: 2px; 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; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
