/* ===== Uno — la table du jeu vidéo : fond rouge orangé lumineux (lueur jaune au centre, ellipse rouge, éclats),
   joueurs en arc avec ruban turquoise et avatar carré, ma plaque dorée, le logo ovale UNO comme bouton.
   Cartes aux quatre couleurs du jeu (rouge, jaune, vert, bleu). Tout est préfixé « un- ». ===== */

.un, .rb {
  --un-red: #ff5555;
  --un-yellow: #ffaa00;
  --un-green: #55aa55;
  --un-blue: #5555ff;
  --un-gold: #ffd400;
  --un-gold-d: #a88700;
  --un-ink: #171717;
  --un-deep: #5a0606;
  --un-card: #7a0d0a;
  --un-text: #fff;
  --un-text-2: #ffd9c4;
  --un-line: rgb(255 255 255 / .28);
  --un-teal: #2a9cc0;
  --un-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --un-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.un {
  --hw: clamp(56px, min(25vw, 15.5dvh), 124px); /* ma main */
  --dw: clamp(60px, min(18vw, 14.5dvh), 124px);  /* le talon */
  --mw: clamp(13px, min(3.3vw, 4.3dvh), 44px);   /* les cartes des autres */
  --fw: clamp(32px, min(9vw, 7dvh), 64px);       /* les avatars */
  --un-bgimg:
    radial-gradient(ellipse 34% 30% at 50% 50%, #fff3a6 0, #ffc21a 28%, rgb(255 150 20 / 0) 72%),
    radial-gradient(ellipse 85% 75% at 50% 50%, #ff8a1a 0, #f5480f 38%, #c8170b 66%, #7a0505 100%);

  position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  overflow: hidden; overflow: clip; color: var(--un-text); font-family: var(--un-body); font-weight: 600; line-height: 1.3;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  background: var(--un-bgimg); background-color: #b3140c;
}
.un [hidden] { display: none !important; }
:where(.un) :is(h1, h2, h3, p, ol, ul) { margin: 0; padding: 0; }
.un .icon { width: 1.15em; height: 1.15em; flex: none; display: block; }
.un :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.un button { font-family: inherit; }
.un.in-mode .un-table, .un.in-mode .un-dock { visibility: hidden; }

/* ---- le décor ---- */
.un-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.un-bg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.un-bg::before {
  content: ''; position: absolute; inset: -30%;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgb(255 248 200 / .16) 0 4deg, transparent 4deg 13deg);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0, rgb(0 0 0 / .5) 22%, transparent 45%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0, rgb(0 0 0 / .5) 22%, transparent 45%);
  animation: un-spin 140s linear infinite;
}

/* ---- haut de l'écran ---- */
.un-hud { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(7px + env(safe-area-inset-top)) 12px 4px; }
.un-hud-r { display: flex; align-items: center; gap: 6px; flex: none; }
.un-pill { display: flex; align-items: center; gap: 8px; min-width: 0; height: 38px; padding: 0 14px; border-radius: 999px; background: rgb(70 0 0 / .55); border: 2px solid rgb(255 255 255 / .6); font: 800 .95rem/1 var(--un-body); white-space: nowrap; backdrop-filter: blur(3px); }
.un-pill .un-dot-s { width: 10px; height: 10px; border-radius: 50%; background: var(--un-text-2); flex: none; }
.un-pill.mine { background: var(--un-gold); border-color: #fff; color: #2b2000; box-shadow: 0 0 18px 2px rgb(255 230 120 / .7); }
.un-pill.mine .un-dot-s { background: #2b2000; animation: un-blink 1.1s ease-in-out infinite; }
.un-pill-t { overflow: hidden; text-overflow: ellipsis; }
.un-chip, .un-round-btn { height: 38px; border-radius: 999px; border: 2px solid rgb(255 255 255 / .6); background: rgb(70 0 0 / .55); color: var(--un-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0; font: 800 .85rem var(--un-body); }
.un-chip { padding: 0 11px; }
.un-round-btn { width: 38px; font: 800 1.15rem var(--un-display); }
.un-chip:hover, .un-round-btn:hover { background: rgb(40 0 0 / .8); }
.un-round-btn b { font-weight: 800; }
.un-chip .icon { width: 1.05em; height: 1.05em; }

/* ---- les cartes ---- */
.un-card { position: relative; display: block; width: var(--w, 60px); aspect-ratio: 137 / 205; padding: 0; border: 0; background: none; border-radius: calc(var(--w, 60px) * .11); flex: none; font: inherit; color: inherit; line-height: 0; }
.un-card :is(.un-svg, .un-img) { display: block; width: 100%; height: 100%; filter: drop-shadow(0 calc(var(--w, 60px) * .03) calc(var(--w, 60px) * .05) rgb(0 0 0 / .45)); }
.un-card.gone { border: 2px dashed var(--un-line); }
/* Les faces : la planche des vraies cartes (14 × 4), la position est donnée par carte. */
.un-card .un-img { border-radius: inherit; background: url('/img/uno/cards.webp') 0 0 / 1400% 400% no-repeat; }
button.un-card { cursor: pointer; }
.un-dot { display: inline-block; width: .85em; height: .85em; border-radius: 50%; border: 2px solid #fff; vertical-align: -1px; }
.c-R { --cc: #ff5555; } .c-J { --cc: #ffaa00; } .c-V { --cc: #55aa55; } .c-B { --cc: #5555ff; }
.un-dot.c-R, .un-dot.c-J, .un-dot.c-V, .un-dot.c-B { background: var(--cc); }

/* ---- les plaques des joueurs : ruban du nom, avatar carré, nombre de cartes ---- */
.un-plate { position: relative; display: grid; justify-items: start; gap: 3px; }
.un-ribbon { display: block; max-width: calc(var(--fw) * 2.9); padding: 2px 22px 2px 8px; transform: skewX(-10deg); background: linear-gradient(90deg, #105a76 0, var(--un-teal) 55%, rgb(42 156 192 / 0) 100%); border-top: 2px solid rgb(255 255 255 / .55); font: 600 clamp(.72rem, 1.5vw, 1.05rem)/1.25 var(--un-display); color: #fff; text-shadow: 0 1px 0 rgb(0 0 0 / .45); white-space: nowrap; }
.un-ribbon > span { display: block; transform: skewX(10deg); overflow: hidden; text-overflow: ellipsis; }
.un-plate.me .un-ribbon { background: linear-gradient(90deg, #8e4c00 0, #eea200 55%, rgb(238 162 0 / 0) 100%); }
.un-plate-row { display: flex; align-items: flex-end; gap: 7px; }
.un-face { position: relative; width: var(--fw); aspect-ratio: 1; display: grid; place-items: center; flex: none; border-radius: calc(var(--fw) * .16); background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--c, #888) 45%, #fff) 0, var(--c, #888) 75%); border: 3px solid #fff; box-shadow: 0 4px 10px rgb(0 0 0 / .35); font-size: calc(var(--fw) * .56); line-height: 1; transition: box-shadow .25s; }
.un-face .cam-bubble { position: absolute; inset: 0; border-radius: inherit; }
.un-face.v-talk { box-shadow: 0 0 0 3px #6fdc8c, 0 0 16px 2px rgb(111 220 140 / .6); }
.un-face.sm { --fw: 26px; border-width: 2px; border-radius: 6px; box-shadow: none; }
.un-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: calc(var(--fw) * .5); height: calc(var(--fw) * .58); margin: 0 4px 2px 0; padding: 0 5px; border-radius: 6px; background: #fff; color: var(--un-ink); border: 2px solid var(--un-ink); box-shadow: 3px -3px 0 -1px #fff, 3px -3px 0 1px var(--un-ink); font: 700 calc(var(--fw) * .42)/1 var(--un-display); }
.un-badge i { display: none; }
.un-badge.one { background: #e5282c; color: #fff; animation: un-pulse .9s ease-in-out infinite; }
.un-plate-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.un-team, .un-total { padding: 1px 7px; border-radius: 6px; font: 800 .66rem/1.5 var(--un-body); white-space: nowrap; }
.un-team { background: rgb(0 0 0 / .35); color: #fff; }
.un-total { background: #fff; color: var(--un-ink); }
.un-plate.active .un-face { box-shadow: 0 0 0 3px var(--un-gold), 0 0 24px 8px rgb(255 228 110 / .9); animation: un-bob 1.4s ease-in-out infinite; }
.un-plate.miss .un-face { box-shadow: 0 0 0 3px #fff, 0 0 0 7px #e5282c; }
.un-plate.out { filter: grayscale(.85); opacity: .6; }

/* ---- la table ---- */
.un-table { position: relative; z-index: 1; min-height: 0; }
.un-seats { position: absolute; inset: 0; pointer-events: none; }
.un-seat { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; pointer-events: auto; z-index: 2; }
.un-fan {
  --fd: calc(var(--mw) * 1.25 + var(--fw) * .62);
  position: absolute; left: 50%; top: 50%; z-index: -1; display: flex; padding-left: calc(var(--mw) * .64);
  transform: translate(-50%, -50%) translate(calc(var(--fx) * var(--fd)), calc(var(--fy) * var(--fd))) rotate(var(--rot));
  -webkit-box-reflect: below 2px linear-gradient(transparent 40%, rgb(255 255 255 / .32));
}
.un-mini { display: block; width: var(--mw); aspect-ratio: 137 / 205; margin-left: calc(var(--mw) * -.64); transform: rotate(calc((var(--k) - (var(--n) - 1) / 2) * 2.5deg)); transform-origin: 50% 140%; }
.un-mini svg { display: block; width: 100%; height: 100%; filter: drop-shadow(1px 1px 1px rgb(0 0 0 / .45)); }
.un-catch { padding: 5px 10px; border-radius: 999px; border: 2px solid #fff; background: #e5282c; color: #fff; font: 800 .78rem var(--un-body); cursor: pointer; animation: un-pulse 0.9s ease-in-out infinite; white-space: nowrap; }

/* ---- le centre : pioche inclinée, tas du talon, flèches du sens ---- */
.un-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; display: grid; justify-items: center; gap: 8px; width: max-content; max-width: 96%; pointer-events: none; }
.un-center > * { pointer-events: auto; }
@media (orientation: portrait) { .un-center { top: 56%; } }
.un-piles { display: flex; align-items: center; gap: calc(var(--dw) * .3); }
.un-deck { position: relative; display: grid; justify-items: center; gap: 10px; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
button.un-deck { cursor: pointer; }
.un-deck-3d { display: block; transform: perspective(600px) rotateX(30deg) rotateZ(-24deg); }
.un-deck-3d .un-card {
  --w: calc(var(--dw) * .8); --t: calc(var(--l, 4) * 1.3px);
  box-shadow: 0 calc(var(--t) * .5) 0 #fff, 0 var(--t) 0 #d6d6d6, 0 calc(var(--t) + 6px) 12px rgb(0 0 0 / .4);
}
.un-deck.hot .un-deck-3d .un-card {
  box-shadow: 0 calc(var(--t) * .5) 0 #fff, 0 var(--t) 0 #d6d6d6, 0 0 0 3px #fff, 0 0 26px 8px rgb(255 236 130 / .95);
  animation: un-glow 1.3s ease-in-out infinite;
}
.un-deck.empty .un-deck-3d { opacity: .5; }
.un-deck-n b { display: inline-block; padding: 2px 10px; border-radius: 999px; background: rgb(70 0 0 / .55); border: 1.5px solid rgb(255 255 255 / .5); font: 800 .78rem/1.3 var(--un-body); white-space: nowrap; }
.un-deck.hot .un-deck-n b { background: var(--un-gold); color: #2b2000; border-color: #fff; }
.un-disc { position: relative; display: grid; place-items: center; width: calc(var(--dw) * 1.95); aspect-ratio: 1; }
.un-ring { position: absolute; inset: -4%; pointer-events: none; }
.un-ring.ccw { transform: scaleX(-1); }
.un-ring svg { display: block; width: 100%; height: 100%; overflow: visible; animation: un-spin 16s linear infinite; filter: drop-shadow(0 0 5px var(--cur)) drop-shadow(0 0 2px rgb(255 255 255 / .9)); }
.un-ring .a { fill: none; stroke: color-mix(in srgb, var(--cur) 75%, #fff); stroke-width: 6.5; stroke-linecap: round; opacity: .92; }
.un-ring .h { fill: color-mix(in srgb, var(--cur) 75%, #fff); opacity: .92; }
.un-pile { position: relative; display: block; width: var(--dw); aspect-ratio: 137 / 205; }
.un-dcard { position: absolute; inset: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); }
.un-dcard .un-card { --w: var(--dw); }
.un-dcard:not(.top) .un-card :is(.un-svg, .un-img) { filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35)) brightness(.94); }
.un-dcard.top .un-card :is(.un-svg, .un-img) { filter: drop-shadow(0 8px 12px rgb(0 0 0 / .45)); }
.un-dcard.pop .un-card { animation: un-pop .4s cubic-bezier(.2, .9, .3, 1.25); }
.un-colchip { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: #fff; color: var(--un-ink); border: 2.5px solid var(--cc); font: 800 .74rem/1.4 var(--un-body); white-space: nowrap; z-index: 3; box-shadow: 0 0 14px 2px var(--cc); }
.un-banner { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 6px; border-radius: 999px; background: #fff; color: #9b120b; border: 2.5px solid var(--un-ink); font: 800 .82rem/1.2 var(--un-body); box-shadow: 0 4px 0 rgb(0 0 0 / .3); white-space: nowrap; }
.un-banner b { display: grid; place-items: center; min-width: 36px; height: 28px; padding: 0 6px; border-radius: 999px; background: #e5282c; color: #fff; font: 700 1.05rem var(--un-display); }
.un-ticker { max-width: min(92vw, 560px); padding: 3px 12px; border-radius: 999px; background: rgb(70 0 0 / .5); font-size: .76rem; font-weight: 700; text-align: center; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: un-in .35s ease-out; }

/* ---- le choix après le second toucher : la couleur, ou le joueur du 7 ---- */
.un-pick { position: absolute; inset: 0; z-index: 8; display: none; place-items: center; background: rgb(60 0 0 / .45); backdrop-filter: blur(2px); }
.un-pick.open { display: grid; animation: un-fade .15s ease both; }
.un-pick-card { display: grid; justify-items: center; gap: 14px; padding: 16px 20px; border-radius: 24px; background: radial-gradient(ellipse 120% 80% at 50% 0%, #c8270f, #6a0807 70%); border: 3px solid #fff; box-shadow: 0 20px 50px rgb(0 0 0 / .5); animation: un-rise .22s cubic-bezier(.2, .8, .2, 1) both; max-width: calc(100vw - 24px); }
.un-pick-t { font: 700 1.25rem/1.1 var(--un-display); text-align: center; }
.un-wheel { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(60vw, 30dvh, 220px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 6px solid #fff; box-shadow: 0 0 0 3px var(--un-ink), 0 12px 26px rgb(0 0 0 / .45); transform: rotate(-14deg); }
.un-wheel.big { width: min(70vw, 34dvh, 260px); }
.un-wq { border: 0; padding: 0; background: var(--cc); color: #fff; cursor: pointer; display: grid; place-items: center; font: 700 clamp(.85rem, 3.4vw, 1.05rem) var(--un-display); text-shadow: 0 2px 0 rgb(0 0 0 / .35); transition: filter .12s; }
.un-wq span { transform: rotate(14deg); }
.un-wq:hover { filter: brightness(1.15); }
.un-wq:active { filter: brightness(.88); }
.un-wq:focus-visible { outline: 4px solid #fff; outline-offset: -10px; }
.un-wheel-hub { position: absolute; left: 50%; top: 50%; width: 24%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: var(--un-ink); border: 4px solid #fff; pointer-events: none; }
.un-pick-who { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; width: min(80vw, 440px); }
.un-who-b { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 14px; border: 2px solid rgb(255 255 255 / .6); background: rgb(0 0 0 / .25); color: #fff; cursor: pointer; font: inherit; }
.un-who-b .un-face { grid-row: span 2; }
.un-who-b b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.un-who-b small { font-size: .72rem; color: var(--un-text-2); font-weight: 700; }
.un-who-b:hover { background: rgb(255 255 255 / .14); }

/* ---- mon côté : ma plaque à gauche, la main en éventail, le logo UNO à droite ---- */
.un-dock {
  position: relative; z-index: 3; display: grid; align-items: end; column-gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "mine . uno" "hand hand hand";
  padding: 0 10px calc(6px + env(safe-area-inset-bottom));
}
.un-mine { grid-area: mine; padding-bottom: 2px; }
/* L'aide et les boutons flottent au bas de la table, juste au-dessus de la main. */
.un-acts { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); display: grid; justify-items: center; gap: 6px; text-align: center; pointer-events: none; }
.un-acts > * { pointer-events: auto; }
.un-unobtn { grid-area: uno; }
.un-hand { grid-area: hand; }
@media (min-width: 900px) and (min-height: 560px) {
  .un-dock { grid-template-columns: minmax(150px, 1fr) minmax(0, 3.2fr) minmax(150px, 1fr); grid-template-areas: "mine hand uno"; }
  .un-mine { align-self: end; padding-bottom: 18px; }
  .un-unobtn { align-self: end; justify-self: end; margin-bottom: 8px; }
}
.un-ask { max-width: 560px; padding: 5px 12px; border-radius: 12px; background: rgb(70 0 0 / .5); border: 1.5px solid rgb(255 255 255 / .3); font: 700 .82rem/1.25 var(--un-body); text-shadow: 0 1px 0 rgb(0 0 0 / .3); }
.un-acts.ask .un-ask { border-color: var(--un-gold); background: rgb(90 20 0 / .62); }
.un-acts-b { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.un-act { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 2.5px solid #fff; background: #fff; color: #b3140c; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font: 800 .9rem var(--un-body); box-shadow: 0 3px 0 rgb(0 0 0 / .3); white-space: nowrap; }
.un-act.primary { background: var(--un-gold); color: #2b2000; border-color: #fff6c4; }
.un-act.ghost { background: rgb(60 0 0 / .45); color: #fff; border-color: rgb(255 255 255 / .6); }
.un-act:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgb(0 0 0 / .3); }
.un-act:disabled { opacity: .55; cursor: default; }

.un-hand { display: flex; align-items: flex-end; justify-content: safe center; overflow-x: auto; overflow-y: hidden; padding: calc(var(--hw) * .45) 16px calc(var(--hw) * .1); min-height: calc(var(--hw) * 2.05 + 4px); scrollbar-width: none; }
.un-hand::-webkit-scrollbar { display: none; }
.un-hand .un-card { --w: var(--hw); transform: translateY(var(--dy, 0px)) rotate(var(--a, 0deg)); transform-origin: 50% 100%; transition: transform .16s ease, filter .16s; }
.un-hand .un-card + .un-card { margin-left: max(calc(var(--hw) * -.74), min(calc(var(--hw) * -.3), calc((100% - var(--hw)) / (var(--n) - 1) - var(--hw)))); }
.un-hand .un-card.dim { filter: brightness(.6) saturate(.8); }
.un-hand .un-card.can { transform: translateY(calc(var(--dy, 0px) - 8px)) rotate(var(--a, 0deg)); }
.un-hand .un-card.can:hover { transform: translateY(calc(var(--dy, 0px) - 16px)) rotate(var(--a, 0deg)); z-index: 2; }
.un-hand .un-card.sel { transform: translateY(calc(var(--dy, 0px) - var(--hw) * .4)) rotate(calc(var(--a, 0deg) * .3)) scale(1.07); z-index: 5; }
.un-hand .un-card.sel :is(.un-svg, .un-img), .un-hand .un-card.jump :is(.un-svg, .un-img) { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 12px var(--un-gold)) drop-shadow(0 10px 14px rgb(0 0 0 / .4)); }
.un-hand .un-card.bluff::after, .un-hand .un-card.jump::after { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); padding: 1px 7px; border-radius: 999px; font: 800 .6rem/1.4 var(--un-body); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.un-hand .un-card.bluff::after { content: 'bluff'; background: #fff; color: var(--un-ink); }
.un-hand .un-card.jump::after { content: 'identique'; background: var(--un-gold); color: #2b2000; }

/* Le logo UNO : à toucher pour annoncer (deux cartes en main) ou pour un contre-UNO. */
.un-unobtn { position: relative; width: clamp(74px, 13vw, 176px); padding: 0 0 8px; border: 0; background: none; cursor: pointer; display: grid; justify-items: center; transition: transform .15s, opacity .2s, filter .2s; }
.un-unobtn img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .45)); transition: transform .15s; }
.un-unobtn:disabled { cursor: default; opacity: .78; filter: saturate(.75) brightness(.9); }
.un-unobtn.ready img { animation: un-beat 1s ease-in-out infinite; filter: drop-shadow(0 0 10px #fff3a0) drop-shadow(0 6px 10px rgb(0 0 0 / .45)); }
.un-unobtn.on img { transform: scale(1.08) rotate(-4deg); filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 22px #fff3a0); }
.un-unobtn.catch img { animation: un-beat .6s ease-in-out infinite; filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 22px #ff6a6a); }
.un-unobtn:not(:disabled):active img { transform: scale(.94); }
.un-unobtn-t { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); padding: 2px 9px; border-radius: 999px; background: #fff; color: #c2191e; border: 2px solid var(--un-ink); font: 800 .7rem/1.3 var(--un-body); white-space: nowrap; box-shadow: 0 2px 0 rgb(0 0 0 / .3); }
.un-unobtn-t:empty { display: none; }
.un-unobtn.on .un-unobtn-t { background: var(--un-gold); color: #2b2000; }
.un-unobtn.catch .un-unobtn-t { background: #e5282c; color: #fff; }

/* ---- effets ---- */
.un-fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.un-float { position: absolute; transform: translate(-50%, -60%); padding: 4px 14px; border-radius: 999px; background: #fff; color: var(--un-ink); font: 700 1.15rem var(--un-display); white-space: nowrap; border: 2.5px solid var(--un-ink); box-shadow: 0 4px 0 rgb(0 0 0 / .4); animation: un-float 1.8s ease-out both; }
.un-float.bad { background: var(--un-gold); }
.un-float.draw { background: #fff; color: #c2191e; font-size: 1.6rem; }
.un-flash { position: absolute; display: grid; justify-items: center; gap: 4px; transform: translate(-50%, -50%); animation: un-flash 1.7s cubic-bezier(.2, .9, .3, 1.2) both; }
.un-flash-logo { width: min(58vw, 320px); filter: drop-shadow(0 10px 20px rgb(0 0 0 / .5)) drop-shadow(0 0 30px #fff3a0); }
.un-flash b { margin-top: -6px; padding: 2px 14px; border-radius: 999px; background: #fff; color: #c2191e; border: 2.5px solid var(--un-ink); font: 700 1.3rem var(--un-display); }
@keyframes un-flash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-24deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.14) rotate(4deg); } 30% { transform: translate(-50%, -50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); } }
@keyframes un-float { from { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 18% { opacity: 1; transform: translate(-50%, -80%) scale(1.1); } 75% { opacity: 1; transform: translate(-50%, -100%) scale(1); } to { opacity: 0; transform: translate(-50%, -170%) scale(1); } }
@keyframes un-blink { 50% { opacity: .35; } }
@keyframes un-pulse { 50% { transform: scale(1.06); } }
@keyframes un-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07) rotate(-2deg); } }
@keyframes un-bob { 50% { transform: translateY(-3px); } }
@keyframes un-spin { to { transform: rotate(360deg); } }
@keyframes un-glow { 50% { box-shadow: 0 calc(var(--t) * .5) 0 #fff, 0 var(--t) 0 #d6d6d6, 0 0 0 3px #fff, 0 0 34px 12px rgb(255 236 130 / 1); } }
@keyframes un-pop { from { transform: scale(1.35) rotate(-10deg); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes un-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes un-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes un-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .un *, .un *::before, .un::before { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .un-bg::before { animation: none; }
}

/* ---- fenêtres : scores, menu, journal ---- */
.un-sheet-wrap { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-end; justify-content: center; background: rgb(40 0 0 / .6); backdrop-filter: blur(3px); }
.un-sheet-wrap.open { display: flex; animation: un-fade .2s ease both; }
.un-sheet { width: 100%; max-width: 640px; max-height: 88dvh; overflow: auto; display: grid; gap: 12px; align-content: start; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: radial-gradient(ellipse 120% 60% at 50% 0%, #a8170c, var(--un-card) 60%, var(--un-deep)); border: 3px solid #fff; border-bottom: 0; border-radius: 24px 24px 0 0; animation: un-rise .28s cubic-bezier(.2, .8, .2, 1) both; }
@media (min-width: 700px) { .un-sheet-wrap { align-items: center; } .un-sheet { border-radius: 24px; border-bottom: 3px solid #fff; } }
.un-sheet h2 { font: 700 1.5rem/1.1 var(--un-display); }
.un-sheet h2 em { font: 700 .85rem var(--un-body); font-style: normal; color: var(--un-text-2); }
.un-sheet-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; width: 100%; }
.un-sheet-btns .un-btn { flex: 1 1 140px; }
.un-muted { color: var(--un-text-2); font-size: .88rem; font-weight: 700; }
.un-muted.small { font-size: .78rem; }
.un-variants { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.un-variants li, .un-chips span { padding: 3px 10px; border-radius: 999px; background: rgb(255 255 255 / .14); border: 1.5px solid rgb(255 255 255 / .5); font-size: .78rem; font-weight: 800; }
.un-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.un-journal { list-style: none; display: grid; gap: 4px; max-height: 46dvh; overflow: auto; font-size: .85rem; }
.un-journal li { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--un-line); }
.un-jt { flex: none; width: 2.2em; color: var(--un-gold); font-weight: 800; }
.un-tablewrap { overflow: auto; border-radius: 12px; border: 1.5px solid var(--un-line); }
.un-table-s { width: 100%; border-collapse: collapse; font-size: .9rem; }
.un-table-s th, .un-table-s td { padding: 7px 10px; text-align: center; border-bottom: 1px solid var(--un-line); white-space: nowrap; }
.un-table-s th[scope="row"] { text-align: left; font-weight: 800; }
.un-table-s th small { color: var(--un-text-2); }
.un-table-s thead th { background: rgb(0 0 0 / .25); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--un-text-2); }
.un-table-s tr.me { background: rgb(255 212 0 / .16); }
.un-table-s tr.out { opacity: .55; }
.un-table-s td.tot, .un-table-s th.tot { background: rgb(255 255 255 / .1); }
.un-table-s td.tot b { font: 800 1.05rem var(--un-body); }

.un-btn { flex: 1 1 150px; min-height: 46px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border-radius: 999px; border: 2.5px solid transparent; font: 800 .98rem/1.15 var(--un-body); text-align: center; touch-action: manipulation; transition: transform .12s, filter .12s; }
.un-btn:active:not(:disabled) { transform: translateY(2px); }
.un-btn:disabled { opacity: .5; cursor: default; }
.un-btn.primary { background: linear-gradient(#ffe14a, #ffb800); color: #6a1200; border-color: #fff; box-shadow: 0 4px 0 #b06d00; }
.un-btn.ghost { background: rgb(60 0 0 / .35); color: var(--un-text); border-color: rgb(255 255 255 / .55); }
.un-btn:hover:not(:disabled) { filter: brightness(1.06); }

/* ---- plein écran : qui distribue, couleur de départ, mise en doute, décompte ---- */
.un-overlay { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 14px; overflow: auto; background: rgb(60 0 0 / .55); backdrop-filter: blur(5px); }
.un-overlay.open { display: flex; }
.un-overlay.open.anim { animation: un-fade .3s ease both; }
.un-over-card { width: min(100%, 460px); margin: auto; display: grid; gap: 12px; justify-items: center; text-align: center; padding: 18px 16px 16px; border-radius: 26px; background: radial-gradient(ellipse 120% 70% at 50% 0%, #e2420f, #9b100a 55%, var(--un-deep)); border: 3px solid #fff; box-shadow: 0 24px 60px -10px rgb(0 0 0 / .7); }
.un-overlay.anim .un-over-card { animation: un-rise .35s cubic-bezier(.2, .8, .2, 1) both; }
.un-over-card.wide { width: min(100%, 640px); }
.un-over-card > * { min-width: 0; max-width: 100%; }
.un-over-card h1 { font: 700 1.9rem/1.05 var(--un-display); text-shadow: 0 3px 0 rgb(90 0 0 / .5); }
.un-over-logo { width: clamp(110px, 34vw, 170px); margin: -4px 0 -6px; filter: drop-shadow(0 6px 12px rgb(0 0 0 / .4)); }
.un-over-c .un-card { transform: rotate(-6deg); }
.un-overlay.win .un-over-card h1 { color: var(--un-gold); }
.un-who { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.un-who li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px; background: rgb(0 0 0 / .25); font-weight: 800; font-size: .85rem; }
.un-verdict { font: 700 1.15rem var(--un-display); color: var(--un-gold); }
.un-draws { list-style: none; display: grid; gap: 6px; width: 100%; }
.un-draws li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: rgb(0 0 0 / .22); text-align: left; }
.un-draws li.win { background: rgb(255 212 0 / .25); box-shadow: inset 0 0 0 2px var(--un-gold); }
.un-draw-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.un-first { padding: 2px 8px; border-radius: 999px; background: var(--un-gold); color: #2b2000; font-size: .7rem; font-weight: 800; }
.un-revhand { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

.un-ranks { list-style: none; display: grid; gap: 8px; width: 100%; max-height: 52dvh; overflow: auto; text-align: left; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .4) transparent; }
.un-ranks li { padding: 8px 10px; border-radius: 14px; background: rgb(0 0 0 / .22); display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.un-ranks li.me { box-shadow: inset 0 0 0 2px rgb(255 255 255 / .5); }
.un-ranks li.champ { background: rgb(255 212 0 / .25); box-shadow: inset 0 0 0 2px var(--un-gold); }
.un-ranks li.out { opacity: .6; }
.un-rank-h { display: flex; align-items: center; gap: 8px; }
.un-pos { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--un-ink); font-weight: 800; flex: none; }
.un-pos .icon { width: 1em; height: 1em; }
.un-rank-n { flex: 1; min-width: 0; display: grid; line-height: 1.15; }
.un-rank-n b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.un-rank-n small { color: var(--un-text-2); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.un-rank-pts, .un-rank-tot { display: grid; justify-items: center; line-height: 1; }
.un-rank-pts small, .un-rank-tot small { font-size: .55rem; text-transform: uppercase; letter-spacing: .08em; color: var(--un-text-2); }
.un-rank-pts b { font: 800 1.15rem var(--un-body); color: var(--un-gold); }
.un-rank-tot { padding: 3px 10px; border-radius: 10px; background: #fff; color: var(--un-ink); }
.un-rank-tot small { color: #7a5a55; }
.un-rank-tot b { font: 800 1.1rem var(--un-body); }
.un-rank-hands { display: grid; gap: 6px; }
.un-rank-hand small { display: block; margin-bottom: 3px; color: var(--un-text-2); font-weight: 800; font-size: .72rem; }
.un-minis { display: flex; flex-wrap: wrap; gap: 3px; }
.un-minis .un-card { --w: 28px; }
.un-minis .un-card :is(.un-svg, .un-img) { filter: none; }

/* ---- l'écran des règles de la table (l'hôte, avant le lancement) ---- */
.un-overlay.mode { align-items: stretch; padding: 0; background: var(--un-bgimg); background-color: #b3140c; backdrop-filter: none; }
.un-modecard { width: min(100%, 880px); margin: 0 auto; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.un-overlay.anim .un-modecard { animation: un-rise .3s ease both; }
.un-mode-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 8px; }
.un-mode-logo { width: clamp(84px, 20vw, 150px); filter: drop-shadow(0 6px 12px rgb(0 0 0 / .4)); transform: rotate(-4deg); }
.un-mode-ht h1 { font: 700 clamp(1.35rem, 5vw, 2.3rem)/1.05 var(--un-display); text-shadow: 0 3px 0 rgb(120 0 0 / .55); }
.un-mode-ht p { margin-top: 4px; font-size: .86rem; font-weight: 700; color: #fff0e2; text-shadow: 0 1px 0 rgb(0 0 0 / .25); }
.un-reset { align-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 2px solid rgb(255 255 255 / .65); background: rgb(70 0 0 / .45); color: #fff; font: 800 .8rem var(--un-body); cursor: pointer; white-space: nowrap; }
.un-reset:disabled { opacity: .4; cursor: default; }
.un-mode-scroll { overflow: auto; display: grid; gap: 20px; align-content: start; padding: 8px 14px 20px; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .45) transparent; }
.un-msec { display: grid; gap: 10px; }
.un-msec-h { display: grid; gap: 4px; justify-items: start; }
.un-msec-h p { font-size: .82rem; font-weight: 700; color: #fff0e2; }
.un-ribbon.big { max-width: none; padding: 4px 34px 4px 12px; font-size: 1.15rem; }

.un-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.un-tile { position: relative; display: grid; justify-items: center; align-content: start; gap: 5px; padding: 12px 8px 11px; border-radius: 18px; border: 2.5px solid rgb(255 255 255 / .4); background: rgb(90 0 0 / .42); color: #fff; text-align: center; cursor: pointer; font: inherit; transition: transform .15s, background .15s, box-shadow .15s; }
.un-tile:hover:not(:disabled):not(.on) { background: rgb(90 0 0 / .6); }
.un-tile-i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .16); }
.un-tile-i .icon { width: 25px; height: 25px; }
.un-tile-n { font: 700 1rem/1.1 var(--un-display); }
.un-tile-s { font-size: .72rem; font-weight: 700; line-height: 1.2; color: var(--un-text-2); }
.un-tile.on { background: #fff; color: #9b120b; border-color: var(--un-gold); box-shadow: 0 0 0 3px rgb(255 212 0 / .55), 0 8px 18px rgb(0 0 0 / .3); transform: translateY(-2px); }
.un-tile.on .un-tile-i { background: #e5282c; color: #fff; }
.un-tile.on .un-tile-s { color: #7a3a30; }
.un-tile:disabled { opacity: .45; cursor: not-allowed; }
.un-tick { position: absolute; top: -9px; right: -7px; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: var(--un-gold); color: #2b2000; border: 2.5px solid #fff; box-shadow: 0 2px 4px rgb(0 0 0 / .3); }
.un-tick .icon { width: 15px; height: 15px; }
.un-explain { padding: 8px 12px; border-radius: 12px; background: rgb(60 0 0 / .45); border-left: 4px solid var(--un-gold); font-size: .84rem; font-weight: 700; line-height: 1.35; }

.un-target { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.un-target-l { font: 600 .95rem var(--un-display); }
.un-chips-r { display: flex; gap: 8px; }
.un-tok { width: 60px; height: 60px; border-radius: 50%; border: 3px dashed rgb(255 255 255 / .65); background: rgb(90 0 0 / .45); color: #fff; display: grid; place-content: center; justify-items: center; cursor: pointer; font: 700 1.02rem/1 var(--un-display); box-shadow: inset 0 0 0 4px rgb(90 0 0 / .45); transition: transform .15s; }
.un-tok small { margin-top: 2px; font: 800 .52rem var(--un-body); text-transform: uppercase; letter-spacing: .05em; color: var(--un-text-2); }
.un-tok.on { background: var(--un-gold); color: #4a1a00; border-color: #fff; box-shadow: inset 0 0 0 4px #ffb800, 0 0 0 3px #e5282c, 0 6px 12px rgb(0 0 0 / .3); transform: scale(1.08); }
.un-tok.on small { color: #6b4e00; }

.un-tp { display: grid; gap: 6px; }
.un-tp-team { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: rgb(60 0 0 / .42); }
.un-tp-team small { min-width: 70px; font: 800 .66rem var(--un-body); text-transform: uppercase; letter-spacing: .06em; color: var(--un-gold); }
.un-tp-p { display: inline-flex; align-items: center; gap: 5px; font-size: .85rem; font-weight: 800; }
.un-tp-team i, .un-tp-team em { font-style: normal; font-weight: 800; color: var(--un-text-2); }
.un-tp-note { font-size: .75rem; font-weight: 700; color: var(--un-text-2); }

.un-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 9px; }
.un-rule { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px 10px 8px; border-radius: 18px; border: 2.5px solid rgb(255 255 255 / .35); background: rgb(90 0 0 / .42); color: #fff; text-align: left; cursor: pointer; font: inherit; transition: background .15s, box-shadow .15s; }
button.un-rule:hover:not(.on) { background: rgb(90 0 0 / .6); }
.un-rule.wide { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); cursor: default; }
.un-rule.on { background: #fff; color: #7a0d08; border-color: var(--un-gold); box-shadow: 0 0 0 3px rgb(255 212 0 / .5); }
.un-rule-b { display: grid; gap: 5px; min-width: 0; }
.un-rule-h { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.un-rule-h b { font: 700 1rem/1.15 var(--un-display); }
.un-rule small { font-size: .76rem; font-weight: 700; line-height: 1.3; color: var(--un-text-2); }
.un-rule.on small { color: #6b3a32; }
.un-art { position: relative; display: flex; align-items: center; justify-content: center; width: 68px; height: 58px; flex: none; }
.un-art-c { display: block; margin: 0 -9px; transform: rotate(var(--r)); transform-origin: 50% 90%; }
.un-art .un-card { --w: 30px; }
.un-art.ban::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); border: 4px solid #e5282c; border-radius: 50%; background: linear-gradient(45deg, transparent calc(50% - 2px), #e5282c calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)); box-shadow: 0 0 0 2px #fff; }
.un-switch { position: relative; width: 48px; height: 28px; flex: none; border-radius: 999px; background: rgb(0 0 0 / .35); border: 2px solid rgb(255 255 255 / .65); transition: background .2s; }
.un-switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.un-switch.on { background: #2fa35a; border-color: #2fa35a; }
.un-switch.on i { transform: translateX(20px); }
.un-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.un-segb { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 2px solid rgb(255 255 255 / .55); background: transparent; color: inherit; font: 800 .82rem var(--un-body); cursor: pointer; }
.un-rule.on .un-segb { border-color: #e7c9c4; }
.un-segb.on, .un-rule.on .un-segb.on { background: #e5282c; color: #fff; border-color: #e5282c; }
.un-from { padding: 1px 8px; border-radius: 999px; font: 800 .6rem/1.5 var(--un-body); text-transform: uppercase; letter-spacing: .06em; }
.un-from.livret { background: var(--un-teal); color: #fff; }
.un-from.maison { background: var(--un-gold); color: #2b2000; }

.un-mode-f { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(rgb(80 0 0 / 0), rgb(80 0 0 / .7) 35%); }
.un-sum { display: flex; flex-wrap: wrap; gap: 5px; }
.un-sum span { padding: 3px 10px; border-radius: 999px; background: rgb(255 255 255 / .16); border: 1.5px solid rgb(255 255 255 / .45); font-size: .74rem; font-weight: 800; }
.un-go { min-height: 56px; padding: 0 30px; border-radius: 999px; border: 3px solid #fff; background: linear-gradient(#ffe14a, #ffb800); color: #6a1200; font: 700 1.25rem var(--un-display); box-shadow: 0 5px 0 #b06d00, 0 10px 22px rgb(0 0 0 / .35); text-shadow: 0 1px 0 rgb(255 255 255 / .5); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.un-go:hover:not(:disabled) { filter: brightness(1.05); }
.un-go:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #b06d00, 0 4px 10px rgb(0 0 0 / .3); }
.un-go:disabled { opacity: .6; cursor: default; }
@media (max-width: 560px) {
  .un-mode-f { grid-template-columns: 1fr; }
  .un-go { width: 100%; }
  .un-tile { padding: 10px 5px 9px; }
  .un-tile-i { width: 38px; height: 38px; }
  .un-tile-n { font-size: .9rem; }
  .un-tok { width: 52px; height: 52px; font-size: .92rem; }
}

@media (max-width: 480px) {
  .un-hud { padding-inline: 8px; }
  .un-hud-r { gap: 4px; }
  .un-chip, .un-round-btn { width: 34px; height: 34px; padding: 0; }
  .un-chip .un-round { display: none; }
  .un-pill { height: 34px; padding: 0 10px; gap: 6px; font-size: .86rem; }
}

@media (min-width: 900px) {
  .un-over-card.wide .un-ranks { grid-template-columns: 1fr 1fr; max-height: 56dvh; }
}
