/* UNO : table de jeu, cartes, main, effets. Tout se dimensionne à partir de --cw (largeur de la carte) : un seul dessin pour la main, la défausse et les animations. */
.uno { --cw: clamp(58px, 8.4vw, 104px); background: radial-gradient(1200px 700px at 50% 30%, #1b1640 0%, #0c0a1f 70%); }
.uno .gamebar { background: rgba(0, 0, 0, 0.25); border-bottom: 1px solid var(--line); }
.turnlabel { color: var(--muted); font-weight: 600; }
.turnlabel.mine { color: var(--good); }

/* carte */
.ucard { --c: #444; position: relative; flex: none; width: var(--cw); aspect-ratio: 2 / 3; border-radius: 9% / 6%; background: #f7f7f9; user-select: none; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); color: #fff; }
.ucard::before { content: ""; position: absolute; inset: 5.5%; border-radius: 7% / 5%; background: var(--c); }
.ucard.c0 { --c: #e74c3c; } .ucard.c1 { --c: #f1c40f; } .ucard.c2 { --c: #2ecc71; } .ucard.c3 { --c: #3498db; }
.ucard.wild::before { background: conic-gradient(from 45deg, #e74c3c 0 25%, #f1c40f 0 50%, #2ecc71 0 75%, #3498db 0); }
.ucard .oval { position: absolute; inset: 14% 11%; display: grid; place-items: center; }
.ucard .oval::before { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.94); border-radius: 50%; transform: rotate(-24deg) scaleX(0.74); }
.ucard .oval b { position: relative; font-size: calc(var(--cw) * 0.52); line-height: 1; color: var(--c); font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); display: grid; place-items: center; }
.ucard.wild .oval b { color: #222; }
.ucard .sym { width: 1em; height: 1em; display: block; }
.ucard .oval b .sym { width: 0.95em; height: 0.95em; }
.ucard .corner { position: absolute; font-size: calc(var(--cw) * 0.17); font-weight: 800; line-height: 1; display: grid; place-items: center; z-index: 1; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.ucard .corner.tl { left: 11%; top: 8%; }
.ucard .corner.br { right: 11%; bottom: 8%; transform: rotate(180deg); }
.ucard .corner .sym { width: 1.05em; height: 1.05em; }
.ucard.back::before { background: #15151f; }
.ucard.back .oval::before { background: #e74c3c; }
.ucard.back .oval b { color: #f1c40f; font-size: calc(var(--cw) * 0.3); letter-spacing: 0.02em; }

/* main */
.dock { flex: none; padding: 6px 8px 14px; background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; min-height: 46px; margin-bottom: 6px; }
.callout { font-weight: 700; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); }
.hand { --overlap: 0px; display: flex; justify-content: center; align-items: flex-end; padding: 26px 12px 2px; min-height: calc(var(--cw) * 1.5 + 34px); }
.hand .ucard { margin-left: calc(-1 * var(--overlap)); transition: transform 0.16s, filter 0.2s, box-shadow 0.2s; }
.hand .ucard:first-child { margin-left: 0; }
.hand .ucard.playable { cursor: pointer; transform: translateY(-12px); box-shadow: 0 0 0 3px #fff, 0 0 26px var(--glow, #fff), 0 10px 18px rgba(0, 0, 0, 0.5); }
.hand .ucard.playable:hover, .hand .ucard.playable:focus-visible { transform: translateY(-34px) scale(1.08); z-index: 5; }
.hand .ucard.dim { filter: brightness(0.5) saturate(0.7); }
.colorbtn { width: 54px; height: 54px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); transition: transform 0.15s; }
.colorbtn:hover { transform: scale(1.14); }
.unobtn.armed { background: linear-gradient(135deg, #e0364a, #ff8a5c); border-color: transparent; }
.pulse { animation: pulse 1s infinite; }

/* table */
.stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; --glow: #7c5cff; }
.felt { position: absolute; inset: 6% 3% 4%; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, rgba(40, 140, 100, 0.55), rgba(8, 70, 60, 0.55) 55%, rgba(6, 30, 40, 0.65)); border: 4px solid color-mix(in srgb, var(--glow) 60%, #000); box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.6), 0 0 80px color-mix(in srgb, var(--glow) 40%, transparent); transition: border-color 0.5s, box-shadow 0.5s; }
.seats { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.seat { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; display: grid; justify-items: center; gap: 3px; width: 112px; transition: opacity 0.3s; }
.seat .avatar { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.seat .sname { font-weight: 700; font-size: 0.82rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 6px #000; }
.seat .mini { display: flex; height: 40px; }
.seat .mini .ucard { --cw: 28px; margin-left: -14px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.seat .mini .ucard.first { margin-left: 0; }
.seat .count { position: absolute; top: -4px; right: 12px; min-width: 24px; padding: 1px 7px; text-align: center; border-radius: 99px; background: #0d1030; border: 1px solid var(--line); font-weight: 800; font-size: 0.85rem; }
.seat.active .avatar { box-shadow: 0 0 0 4px var(--glow), 0 0 28px var(--glow); animation: glowpulse 1.4s ease-in-out infinite; }
@keyframes glowpulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--glow) 55%, transparent), 0 0 40px var(--glow); } }
.seat.out { opacity: 0.35; filter: grayscale(1); }
.seat .alert { position: absolute; top: -22px; padding: 2px 10px; border-radius: 99px; background: #ff5d6c; font-weight: 900; font-size: 0.8rem; animation: pulse 1s infinite; }
.seat .alert.ok { background: #f1c40f; color: #3a2a00; }
.seats.compact { position: relative; inset: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; padding: 8px 8px 0; }
.seats.compact .seat { position: relative; transform: none; width: 84px; }
.seats.compact .seat .mini { display: none; }
.seats.compact .seat .count { right: 6px; }

.center-table { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 44px); z-index: 1; pointer-events: none; }
.stage:has(.seats.compact) .center-table { position: relative; flex: 1; }
.center-table > * { pointer-events: auto; }
.dir { position: absolute; width: min(44vw, 380px); aspect-ratio: 1; color: rgba(255, 255, 255, 0.16); animation: spin 14s linear infinite; pointer-events: none !important; }
.dir.rev { animation-direction: reverse; }
.drawpile { position: relative; width: var(--cw); aspect-ratio: 2 / 3; }
.drawpile .ucard { position: absolute; left: 0; top: 0; }
.drawpile .d2 { transform: translate(-3px, -3px); } .drawpile .d3 { transform: translate(-6px, -6px); }
.drawpile .dcount { position: absolute; bottom: -26px; left: 0; right: 0; text-align: center; font-weight: 800; color: var(--muted); font-size: 0.9rem; }
.drawpile.can { cursor: pointer; animation: bob 1.1s ease-in-out infinite; filter: drop-shadow(0 0 14px var(--glow)); }
@keyframes bob { 50% { transform: translateY(-8px); } }
.orbwrap { position: relative; display: grid; place-items: center; }
.discard { position: relative; width: var(--cw); aspect-ratio: 2 / 3; }
.discard .ucard { position: absolute; left: 0; top: 0; }
.discard .under { transform: translateX(var(--x)) rotate(var(--r)); opacity: 0.9; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6); }
.discard .top { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 12px 28px rgba(0, 0, 0, 0.6); }
.orb { position: absolute; right: -18px; top: -10px; width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 3px solid #fff; z-index: 3; }
.flying { position: fixed; z-index: 200; pointer-events: none; margin: 0 !important; }

/* effets */
.fx { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 20; }
.bigfx { grid-area: 1 / 1; font-size: clamp(60px, 14vw, 150px); font-weight: 900; color: #fff; text-shadow: 0 0 40px var(--c), 0 6px 20px rgba(0, 0, 0, 0.6); -webkit-text-stroke: 3px var(--c); display: grid; place-items: center; }
.bigfx .sym { width: 1em; height: 1em; }

/* victoire */
.overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(5, 4, 15, 0.72); backdrop-filter: blur(5px); }
.victory { padding: 26px 30px; display: grid; gap: 14px; justify-items: center; min-width: min(92vw, 420px); background: rgba(24, 20, 56, 0.92); }
.victory .crown { font-size: 3.6rem; animation: bob 1.4s ease-in-out infinite; }
.victory h2 { margin: 0; font-size: 1.9rem; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.rank li.win { background: linear-gradient(90deg, rgba(241, 196, 15, 0.28), rgba(241, 196, 15, 0.06)); border: 1px solid rgba(241, 196, 15, 0.6); }
.rank .pos { width: 22px; text-align: center; font-weight: 900; color: var(--muted); }

@media (max-width: 720px) {
  .uno { --cw: clamp(54px, 17vw, 84px); }
  .discard .under { display: none; }
  .uno .gamebar .btn:nth-of-type(2) { display: none; }
}
