/* style-uno.css - the UNO TABLE (round 3). Full-screen poker-table: oval felt with up to 20 seats, my hand as a fan at the bottom. Cards are drawn in CSS only. Pairs with js/11t-bar-uno.js. */
:root {
  --uno-red: #E63946; --uno-yellow: #FFC93C; --uno-green: #2FB86A; --uno-blue: #2F7DE1; --uno-wild: #F2F2F4;
  --uno-gold: #FFB547; --uno-felt: #0F4A2E; --uno-felt2: #0A2F1E;
}
html.uno-open, html.uno-open body { overflow: hidden; overscroll-behavior: none; }
.uno-root { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; background: radial-gradient(120% 80% at 50% 40%, #16221C 0%, #0B0F0D 70%); color: #F2F2F4; font-family: inherit;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.uno-root .hidden { display: none !important; }
.uno-root button { font-family: inherit; }
.uno-root button:focus-visible { outline: 3px solid #7DF0A8; outline-offset: 2px; }

/* top bar + turn timer */
.uno-top { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px; flex: none; }
.uno-x { width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 28px; line-height: 1; background: rgba(255,255,255,.1); color: #fff; }
.uno-title { flex: 1; font-weight: 900; font-size: 22px; letter-spacing: .08em; color: var(--uno-gold); } .uno-title small { font-size: 12px; font-weight: 600; letter-spacing: 0; color: #9AA59F; margin-left: 6px; }
.uno-clock { min-width: 64px; text-align: right; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; padding-right: 6px; } .uno-clock.low { color: #FF6B60; }
.uno-bar { height: 4px; background: rgba(255,255,255,.08); flex: none; } .uno-bar i { display: block; height: 100%; width: 0; background: var(--uno-gold); transition: width .25s linear; }
.uno-clock.low ~ * {} #uno-bar-fill { transition: width .25s linear; }

/* the table */
.uno-stage { position: relative; flex: 1; min-height: 0; margin: 4px 6px 0; }
.uno-oval { position: absolute; left: 11%; right: 11%; top: 8%; bottom: 8%; border-radius: 50%; background: radial-gradient(closest-side, #17653F, var(--uno-felt) 70%, var(--uno-felt2));
  box-shadow: 0 0 0 5px #3b2a1a, 0 0 0 8px #5a4026, 0 14px 40px rgba(0,0,0,.6) inset, 0 10px 30px rgba(0,0,0,.5); transition: box-shadow .2s; }
.uno-stage.drop .uno-oval { box-shadow: 0 0 0 5px var(--uno-gold), 0 0 0 9px rgba(255,181,71,.35), 0 14px 40px rgba(0,0,0,.6) inset; }
.uno-oval::after { content: ""; position: absolute; inset: 7%; border-radius: 50%; border: 2px dashed rgba(255,255,255,.14); animation: unoSpin 26s linear infinite; }
.uno-oval.ccw::after { animation-direction: reverse; }
.uno-dir { position: absolute; left: 50%; top: 2%; transform: translateX(-50%); font-size: 22px; color: rgba(255,255,255,.35); }
@keyframes unoSpin { to { transform: rotate(360deg); } }
.uno-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: 62%; }
.uno-piles { display: flex; align-items: center; gap: 16px; }
.uno-pile { position: relative; padding: 0; background: none; border: 0; border-radius: 10px; min-width: 44px; min-height: 44px; }
.uno-pile small { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); background: #000a; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 800; color: #fff; }
.uno-pile .uno-card { --w: 56px; box-shadow: 3px 3px 0 #0006, 6px 6px 0 #0004; }
.uno-discard { position: relative; padding: 5px; border-radius: 14px; background: radial-gradient(closest-side, transparent 60%, var(--cip) 62%, transparent 100%); }
.uno-discard::before { content: ""; position: absolute; inset: -3px; border-radius: 16px; border: 3px solid var(--cip); opacity: .9; box-shadow: 0 0 18px var(--cip); }
.uno-discard .uno-card { --w: 64px; position: relative; } .uno-discard .uno-card.top { animation: unoPop .3s ease-out; }
@keyframes unoPop { from { transform: scale(1.25) rotate(-8deg); } }
.uno-cip { position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--cip); border: 2px solid #fff; }
.uno-say { text-align: center; line-height: 1.25; min-height: 34px; display: flex; flex-direction: column; gap: 2px; max-width: 100%; }
.uno-say b { font-size: 15px; } .uno-say.me b { color: var(--uno-gold); font-size: 17px; } .uno-say span { font-size: 12px; color: #BFD0C6; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* seats */
.uno-seat { --bw: 17px; --st: 5px; position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 4px; border-radius: 12px; background: rgba(10,14,12,.78); border: 2px solid transparent; color: #fff; min-width: 44px; min-height: 44px; width: 64px; }
.uno-seat.sm { width: 54px; padding: 2px; } .uno-seat.xs { width: 44px; padding: 1px; border-radius: 10px; }
.us-av .avatar { width: 30px; height: 30px; font-size: 13px; } .uno-seat.xs .us-av .avatar { width: 24px; height: 24px; font-size: 11px; }
.us-name { font-size: 10px; line-height: 1.1; font-weight: 700; max-width: 100%; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.uno-seat.xs .us-name { font-size: 8px; -webkit-line-clamp: 1; } .uno-seat.sm .us-name { font-size: 9px; }
.us-cards { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 22px; }
.us-fan { position: relative; display: flex; justify-content: center; width: 30px; height: 22px; } .us-fan .uno-card { --w: 15px; position: absolute; bottom: 0; transform: rotate(var(--r)); transform-origin: 50% 120%; left: calc(50% - 7px + var(--i) * 2px); border-width: 1px; }
.us-fan .uno-card .uc-mid { display: none; }
.us-n { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 14px; text-align: center; } .uno-seat.xs .us-n { font-size: 12px; }
.us-uno { position: absolute; top: -9px; right: -8px; background: #E63946; color: #fff; font-size: 9px; font-weight: 900; font-style: normal; padding: 2px 5px; border-radius: 8px; border: 1px solid #fff; transform: rotate(8deg); animation: unoBeat 1s ease-in-out infinite; }
@keyframes unoBeat { 50% { transform: rotate(8deg) scale(1.15); } }
.uno-seat.turn { border-color: #34C759; background: rgba(20,60,34,.92); box-shadow: 0 0 0 3px rgba(52,199,89,.35), 0 0 16px rgba(52,199,89,.7); animation: unoTurn 1.3s ease-in-out infinite; z-index: 2; }
@keyframes unoTurn { 50% { box-shadow: 0 0 0 6px rgba(52,199,89,.2), 0 0 22px rgba(52,199,89,.9); } }
.uno-seat.off { opacity: .5; } .uno-seat.off .us-av { filter: grayscale(1); } .uno-seat.out { opacity: .7; }
.uno-seat.exposed { border-color: #FF6B60; animation: unoCatch .7s ease-in-out infinite; z-index: 3; } @keyframes unoCatch { 50% { box-shadow: 0 0 0 5px rgba(255,107,96,.45); } }

/* me bar: chip, buttons */
.uno-me { flex: none; padding: 4px 8px 0; display: flex; flex-direction: column; gap: 6px; }
.um-row { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.um-chip { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 22px; background: rgba(255,255,255,.08); border: 2px solid transparent; max-width: 55%; position: relative; }
.um-chip .avatar { width: 28px; height: 28px; font-size: 12px; } .um-chip b { overflow-wrap: anywhere; font-size: 14px; line-height: 1.1; max-height: 2.2em; overflow: hidden; } .um-chip i { font-style: normal; font-weight: 900; background: #fff2; border-radius: 10px; padding: 0 8px; }
.um-chip.turn { border-color: #34C759; box-shadow: 0 0 14px rgba(52,199,89,.7); } .um-chip .us-uno { top: -8px; right: -4px; }
.um-say { flex: 1; font-size: 13px; color: var(--uno-gold); font-weight: 700; text-align: right; line-height: 1.2; }
.um-btns { display: grid; grid-template-columns: 1fr 1fr 1.25fr 1fr; gap: 6px; }
.um-btns button { min-height: 48px; padding: 4px 6px; font-size: 15px; font-weight: 800; border-radius: 12px; overflow-wrap: anywhere; line-height: 1.1; }
.um-btns button:disabled { opacity: .35; }
.um-btns .uno-b { background: #E63946; color: #fff; font-size: 20px; letter-spacing: .04em; box-shadow: 0 0 0 2px #fff4 inset; } .um-btns .uno-b:not(:disabled) { animation: unoBeat2 1.2s ease-in-out infinite; }
@keyframes unoBeat2 { 50% { box-shadow: 0 0 0 3px #fff6 inset, 0 0 16px #E63946; } }
.uno-slow { min-height: 44px; border-radius: 12px; background: #3A2A10; color: #FFD39A; border: 2px solid var(--uno-gold); font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }

/* my hand: a fan of big cards */
.uno-hand { flex: none; height: 200px; position: relative; padding-bottom: 6px; touch-action: none; }
.uno-fan { position: absolute; inset: 0 0 6px 0; touch-action: none; }
.uno-fan.marking::after { content: ""; position: absolute; left: var(--mark); top: 6px; bottom: 0; width: 4px; border-radius: 2px; background: var(--uno-gold); transform: translateX(-2px); z-index: 99; }
.uno-card { --w: 64px; --cc: var(--uno-red); --cg: #C62836; position: relative; isolation: isolate; width: var(--w); height: calc(var(--w) * 1.5); flex: none; border-radius: calc(var(--w) * .14); background: var(--cc);
  border: calc(var(--w) * .05) solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.55); color: #fff; font-weight: 900; overflow: hidden; cursor: pointer; }
.uno-card[data-c=yellow] { --cc: var(--uno-yellow); --cg: #9A6A00; color: #3a2a00; } .uno-card[data-c=green] { --cc: var(--uno-green); --cg: #17803F; } .uno-card[data-c=blue] { --cc: var(--uno-blue); --cg: #1F5FBF; }
.uno-card[data-c=wild] { --cc: #1A1A1F; --cg: #fff; }
.uc-mid { position: absolute; inset: 20% 8%; display: grid; place-items: center; z-index: 1; color: var(--cg); font-size: calc(var(--w) * .42); line-height: 1; font-weight: 900; font-style: normal; }
.uc-mid::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #fff; border-radius: 50%; transform: rotate(-24deg) scaleY(1.12); }
.uno-card[data-c=wild] .uc-mid::before { background: conic-gradient(var(--uno-red) 0 25%, var(--uno-blue) 0 50%, var(--uno-green) 0 75%, var(--uno-yellow) 0); }
.uno-card[data-c=wild] .uc-mid { color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.uc-tl, .uc-br { position: absolute; z-index: 2; font-style: normal; font-size: calc(var(--w) * .22); line-height: 1; font-weight: 900; text-shadow: 0 1px 1px #0005; } .uc-tl { left: 7%; top: 5%; } .uc-br { right: 7%; bottom: 5%; transform: rotate(180deg); }
.uc-let { position: absolute; z-index: 2; left: 8%; bottom: 5%; font-style: normal; font-size: calc(var(--w) * .16); font-weight: 900; opacity: .85; }
.uno-card.back { --cc: #17171c; } .uno-card.back .uc-mid { color: var(--uno-gold); inset: 30% 4%; font-size: calc(var(--w) * .26); transform: rotate(-12deg); } .uno-card.back .uc-mid::before { background: var(--uno-red); transform: rotate(-24deg) scaleY(1.1); } .uno-card.back .uc-mid { color: #fff; }
.uno-card.hand { position: absolute; left: 0; bottom: 16px; transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--a, 0deg)); transform-origin: 50% 130%; transition: transform .18s ease, filter .18s ease; touch-action: none; }
.uno-card.hand.ok { transform: translate(var(--x), calc(var(--y) - 18px)) rotate(var(--a)); box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(255,255,255,.55), 0 4px 10px rgba(0,0,0,.6); }
.uno-card.hand.no { filter: brightness(.55) saturate(.8); }
.uno-card.hand.drag { transition: none; z-index: 200 !important; filter: none; box-shadow: 0 10px 24px rgba(0,0,0,.7); }
.uno-card.ghost { transition: none; }

/* colour picker + end screen + toast */
.uno-picker, .uno-end { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.7); padding: 16px; }
.up-card, .ue-card { width: min(100%, 340px); background: #1C1C1E; border-radius: 20px; padding: 18px; text-align: center; border: 2px solid #3A3A3C; display: flex; flex-direction: column; gap: 12px; max-height: 88vh; overflow-y: auto; }
.up-card h3, .ue-card h2 { margin: 0; font-size: 20px; color: #fff; overflow-wrap: anywhere; } .ue-card p { margin: 0; color: #BBB; }
.up-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .up-c { min-height: 76px; border-radius: 16px; font-size: 16px; font-weight: 900; color: #fff; background: var(--cc); border: 3px solid #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.up-c span { font-size: 22px; } .up-c[data-c=red] { --cc: var(--uno-red); } .up-c[data-c=yellow] { --cc: var(--uno-yellow); color: #2b2000; } .up-c[data-c=green] { --cc: var(--uno-green); } .up-c[data-c=blue] { --cc: var(--uno-blue); }
.uno-picker .secondary, .uno-end button { min-height: 48px; border-radius: 12px; background: #2C2C2E; color: #fff; font-weight: 700; }
.ue-card.win { border-color: #34C759; background: #0F3320; } .ue-card.lose { border-color: var(--uno-gold); } .ue-big { font-size: 56px; line-height: 1; }
.ue-rank { margin: 0; padding: 0 0 0 1.4em; text-align: left; display: flex; flex-direction: column; gap: 4px; } .ue-rank li { overflow-wrap: anywhere; } .ue-rank li.w { color: #34C759; font-weight: 800; }
.uno-toast { position: absolute; left: 50%; top: 62px; transform: translate(-50%, -10px); max-width: 88%; background: #3A1512; color: #FFD6D2; border: 2px solid #FF6B60; border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; overflow-wrap: anywhere; }
.uno-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-height: 700px) { .uno-hand { height: 168px; } .uno-discard .uno-card { --w: 54px; } .uno-pile .uno-card { --w: 48px; } .uno-top { height: 42px; } }
@media (min-width: 700px) { .uno-root { max-width: 520px; margin: 0 auto; border-left: 1px solid #222; border-right: 1px solid #222; } }
@media (prefers-reduced-motion: reduce) { .uno-root *, .uno-root *::before, .uno-root *::after { animation: none !important; transition: none !important; } }

.uno-root .uno-prize { display: block; width: 100%; margin: 10px 0 6px; min-height: 52px; font-size: 17px; font-weight: 800; background: #FF9F0A; color: #1b1100; border: 0; border-radius: 12px; }

/* the other players hold REAL card backs - one per card (Kuma 2026-11-04) */
.uno-seat { width: auto; min-width: 64px; } .uno-seat.sm { --bw: 13px; --st: 4px; min-width: 54px; } .uno-seat.xs { --bw: 10px; --st: 3px; min-width: 44px; }
.uno-seat .us-fan { width: calc(var(--bw) + (var(--n) - 1) * var(--st) + 4px); height: calc(var(--bw) * 1.45); }
.uno-seat .us-fan .uno-card { --w: var(--bw); left: calc(2px + var(--i) * var(--st)); width: var(--bw); height: calc(var(--bw) * 1.45); border-width: 1px; border-radius: 3px; background: #111116; overflow: visible; }
.uno-seat .us-fan .uno-card.back::after { content: ""; position: absolute; inset: 24% 14%; background: #E63946; border-radius: 50%; transform: rotate(-24deg); }
.uno-seat.xs .us-fan { display: flex; }
.uno-root.auto-uno #uno-b-uno, .uno-root.auto-uno #uno-b-catch { display: none !important; }
