:root {
  --bg: #0b2a1f; --felt: #0f3d2b; --felt2: #14523a; --line: #245c45;
  --ink: #f3f1e8; --muted: #9bb5a8; --acc: #f2c14e; --red: #e5484d;
  --card: #fbfaf5; --cardink: #1b1b1b; --ok: #4cc38a; --wood: #5a3a1c;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 8px) 12px calc(env(safe-area-inset-bottom) + 10px); }
button { font: inherit; color: var(--ink); background: var(--felt2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--acc); color: #2a2100; border-color: var(--acc); font-weight: 700; }
button.warn { background: #7a2a2d; border-color: #a33a3e; }
button.ghost { background: transparent; }
button.small { min-height: 36px; padding: 6px 12px; border-radius: 10px; }
button.ic { min-height: 36px; min-width: 36px; padding: 4px 8px; border-radius: 18px; font-size: 16px; }
input[type=text] { width: 100%; font: inherit; color: var(--ink); background: #0a2219;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px; }
input:focus { outline: 2px solid var(--acc); }
.muted { color: var(--muted); }
.center { text-align: center; padding-top: 10vh; }
.logo { font-size: 44px; font-weight: 800; letter-spacing: 2px; color: var(--acc); }
h2 { font-size: 18px; margin: 18px 0 8px; }

header { display: flex; align-items: center; gap: 6px; padding: 2px 0 6px; }
.brand { font-weight: 800; letter-spacing: 1px; color: var(--acc); font-size: 20px; margin-right: 4px; }
.nick { margin-left: auto; padding: 4px 12px; min-height: 36px; border-radius: 18px; max-width: 46vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-left: 2px; }
.dot.on { background: var(--ok); } .dot.off { background: var(--red); }

.avatar { width: 44px; height: 44px; border-radius: 50%; background: #0a2219; border: 2px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 25px; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 19px; }
.avgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; }
.avgrid button { font-size: 24px; padding: 6px 0; min-height: 48px; }
.avgrid button.on { border-color: var(--acc); background: #1b5e44; box-shadow: 0 0 0 2px var(--acc) inset; }

.tabs { display: flex; gap: 8px; margin: 6px 0 10px; }
.tabs button { flex: 1; } .tabs button.on { background: var(--felt2); border-color: var(--acc); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; background: var(--felt); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { font-size: 13px; color: var(--muted); }
.row.invite { border-color: var(--acc); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.actions > * { flex: 1; }
.empty { text-align: center; padding: 22px 10px; color: var(--muted); }
.wins { font-size: 12px; color: var(--acc); font-weight: 700; }

/* ---------- stol ---------- */
.timerbox { margin: 0 0 4px; }
.timer { height: 7px; background: #0a2219; border-radius: 4px; overflow: hidden; }
.tfill { height: 100%; transform-origin: left; animation: shrink linear both; }
.tlabel { font-size: 13px; color: var(--muted); text-align: center; margin-top: 1px; }
@keyframes shrink {
  0% { transform: scaleX(1); background: var(--ok); }
  60% { background: var(--acc); }
  100% { transform: scaleX(0); background: var(--red); }
}
/* okragly stol: gracze siedza na elipsie (pozycje liczy app.js), na 5 osob stol jest bardziej owalny */
.ring { position: relative; width: 100%; aspect-ratio: 1 / 1.08; margin: 12px 0 4px; }
.ring.p4, .ring.p5 { aspect-ratio: 1 / 1.26; }
.ring.p3 { aspect-ratio: 1 / 0.98; }
.ring.p3 .mid { top: 49%; }
.ring.p4 .mid { top: 49%; }
.felt { position: absolute; inset: 9% 7%; border-radius: 50%; border: 9px solid var(--wood);
  background:
    radial-gradient(ellipse at 50% 18%, #ffe9a62a, transparent 55%),
    radial-gradient(ellipse at 50% 55%, var(--felt-hi, #1f7a53), var(--felt-lo, #0f3d2b) 74%);
  box-shadow: inset 0 0 46px #000c, inset 0 0 0 2px #0a2a1c, 0 10px 26px #000b, 0 0 0 2px #3a2410,
    0 0 0 4px #7a5530; }
.ring.p5 .felt { border-radius: 46% / 40%; inset: 7% 8%; }
.spot { position: absolute; transform: translate(-50%, -50%); z-index: 2; }
.spot.mine { transform: translate(-50%, -64%); }
.mid { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 50%; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
/* 2 osoby: przeciwnik naprzeciwko, wiec stol jest wyzszy */
.ring.p2 { aspect-ratio: 1 / 1.3; }
.ring.p2 .mid { width: 62%; top: 49%; }
.mid .lbl { font-size: 11px; color: var(--muted); }
.seat { width: 86px; text-align: center; padding: 2px; border-radius: 14px; }
.seat .avatar { box-shadow: 0 3px 8px #000a; }
.seat .sn { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px;
  text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.spot.mine .seat { width: auto; min-width: 120px; }
.spot.mine .sn { max-width: 110px; }
.seat .off { color: #ff9b9e; font-size: 11px; text-shadow: 0 1px 3px #000; }
.seat.turn .avatar { border-color: var(--acc); box-shadow: 0 0 14px #f2c14e99; animation: pulse 1.1s ease-in-out infinite alternate; }
.seat.dead { opacity: .4; filter: grayscale(.8); }
.seat.shake { animation: shake .7s both; animation-delay: var(--d, 0ms); }
.seat.out { animation: outfade .9s both; animation-delay: var(--d, 0ms); }
.fan { display: flex; justify-content: center; margin-top: 3px; min-height: 52px; }
.fan .fc + .fc { margin-left: -13px; }
.fan.c2 .fc + .fc { margin-left: 3px; }
.fan.c3 .fc + .fc { margin-left: -7px; }

.center { text-align: center; }
.bidpanel { text-align: center; margin: 2px 0 0; min-height: 54px; }
.bidpanel .who { font-size: 13px; color: #c9ddd2; }
.bidpanel .bidtext { font-size: 18px; font-weight: 800; color: var(--acc); margin: 0 0 4px; text-shadow: 0 2px 6px #000a; line-height: 1.2; }
.bidpanel.enter .bidtext, .banner.enter { animation: pop .5s both; }
.bidpanel .bidtext.long, .ring.p4 .bidpanel .bidtext.long, .ring.p5 .bidpanel .bidtext.long { font-size: 14px; line-height: 1.15; }
.chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; align-items: center; }
.chip { min-height: 36px; padding: 4px 12px; border-radius: 18px; background: #0a2219; font-weight: 700; }
.chip.static { display: inline-flex; align-items: center; border: 1px solid var(--line); min-height: 30px; padding: 2px 10px; }

/* ---------- karty ---------- */
.card { width: 52px; height: 74px; background: var(--card); color: var(--cardink); border-radius: 8px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px #0008; font-style: normal; line-height: 1.05; }
.card b { font-size: 24px; } .card i { font-size: 20px; font-style: normal; }
.card.red { color: var(--red); }
.fc { position: relative; flex: none; perspective: 500px; }
.fc.sm { width: 36px; height: 52px; } .fc.md { width: 52px; height: 74px; } .fc.lg { width: 56px; height: 80px; }
.fc .card { width: 100%; height: 100%; }
.fc.sm .card b { font-size: 17px; } .fc.sm .card i { font-size: 14px; }
.fc.lg .card b { font-size: 28px; } .fc.lg .card i { font-size: 22px; }
.fi { position: absolute; inset: 0; transform-style: preserve-3d; }
.fc .face, .fc .cb { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 7px; }
.fc .cb { transform: rotateY(180deg); box-shadow: 0 2px 6px #0008; border: 2px solid #f3f1e8;
  background: repeating-linear-gradient(45deg, var(--ba, #2b6f9e), var(--ba, #2b6f9e) 4px, var(--bb, #1f5a84) 4px, var(--bb, #1f5a84) 8px);
  border-color: var(--bedge, #f3f1e8); }
.fc.down .fi { transform: rotateY(180deg); }
.fc.flip .fi { animation: flip .6s ease both; animation-delay: var(--d, 0ms); }
.fc.deal { animation: dealfly .55s cubic-bezier(.2, .7, .3, 1) both; animation-delay: var(--d, 0ms); }
.fc.hl .face { animation: glow .9s ease-in-out infinite alternate both; animation-delay: var(--g, 0ms); }
.fc.dim .face { animation: dim .5s both; animation-delay: var(--g, 0ms); }
.hand { display: flex; gap: 6px; justify-content: center; margin: 0 0 3px; min-height: 74px; }
@keyframes flip { from { transform: rotateY(180deg); } to { transform: rotateY(0deg); } }
@keyframes dealin { from { opacity: 0; transform: translateY(-140px) scale(.4) rotate(-25deg); } to { opacity: 1; transform: none; } }
@keyframes glow {
  from { box-shadow: 0 0 0 0 #f2c14e00; transform: none; }
  to { box-shadow: 0 0 0 3px #f2c14e, 0 0 18px 5px #f2c14eaa; transform: translateY(-7px); }
}
@keyframes dim { to { opacity: .42; filter: grayscale(.6); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.1); } }
@keyframes pop { from { opacity: 0; transform: scale(.7); } 60% { transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100% { transform: none; } 15% { transform: translateX(-7px); } 30% { transform: translateX(7px); }
  45% { transform: translateX(-5px); } 60% { transform: translateX(5px); } 80% { transform: translateX(-2px); } }
@keyframes outfade { to { opacity: .35; filter: grayscale(1); } }
@keyframes appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.appear { animation: appear .5s ease-out both; animation-delay: var(--d, 0ms); }

/* ---------- ja / panel akcji ---------- */
.me { margin-top: 4px; }
.builder .chip { min-height: 30px; padding: 2px 10px; }
.mehead { display: flex; align-items: center; gap: 6px; justify-content: center; font-weight: 700; }
.verdict { text-align: center; margin: 6px 0; }
.verdict .big { font-size: 22px; font-weight: 800; margin: 6px 0; }
.banner { text-align: center; font-weight: 700; margin: 8px 0; }
.lost { color: #ff9b9e; } .won { color: var(--ok); }
.wait { text-align: center; padding: 14px; color: var(--muted); }
.builder .sel { margin: 4px 0; }
.builder .sel:empty { display: none; }
.builder .actions { margin: 6px 0; }
.builder button { min-height: 42px; }
.pv { text-align: center; font-weight: 600; font-size: 14px; min-height: 22px; margin: 2px 0 6px; }
.pv.err { color: #ff9b9e; } .pv.ok { color: var(--ok); font-size: 16px; }
.ranks { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 5px; margin: 6px 0; }
.rk { font-weight: 800; font-size: 18px; padding: 6px 0; min-height: 44px; background: var(--card); color: var(--cardink); border-color: #bdb8a2; }
/* panel akcji zawsze na wierzchu ekranu */
.dock { position: sticky; bottom: 0; z-index: 5; margin: 0 -12px; padding: 8px 12px calc(env(safe-area-inset-bottom) + 6px);
  background: linear-gradient(to top, var(--bg) 88%, transparent); }
/* 4-5 graczy: mniejsze karty i awatary */
.ring.p4 .seat, .ring.p5 .seat { width: 76px; }
.ring.p4 .avatar, .ring.p5 .avatar { width: 38px; height: 38px; font-size: 21px; }
.ring.p5 .fc.sm, .ring.p4 .fc.sm { width: 30px; height: 44px; }
.ring.p5 .fc.sm .card b, .ring.p4 .fc.sm .card b { font-size: 14px; }
.ring.p5 .fc.sm .card i, .ring.p4 .fc.sm .card i { font-size: 12px; }
.ring.p4 .fan, .ring.p5 .fan { min-height: 44px; }
.ring.p4 .fan .fc + .fc, .ring.p5 .fan .fc + .fc { margin-left: -14px; }
.ring.p4 .bidpanel .bidtext, .ring.p5 .bidpanel .bidtext { font-size: 16px; }
.ring .spot.mine .avatar { width: 34px; height: 34px; font-size: 19px; }

.modal { position: fixed; inset: 0; background: #000a; display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { width: 100%; max-width: 560px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); max-height: 92dvh; overflow: auto; }
.seg { display: flex; gap: 8px; margin: 10px 0 14px; } .seg button { flex: 1; } .seg button.on { border-color: var(--acc); background: var(--felt2); }
.err { color: #ff9b9e; }
.rules { text-align: left; }
.rules .rsec { margin: 12px 0; }
.rules h3 { font-size: 16px; color: var(--acc); margin: 0 0 4px; }
.rules p { margin: 4px 0; font-size: 15px; }
.rules ol { margin: 4px 0; padding-left: 22px; font-size: 15px; }
.rules .rex { background: #0a2219; border-left: 3px solid var(--acc); border-radius: 8px; padding: 6px 10px; margin: 6px 0; font-size: 14px; color: #dfe9e2; }

#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translate(-50%, 30px);
  background: #000d; color: #fff; padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none;
  transition: .25s; max-width: 90vw; text-align: center; z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.seg button { font-size: 14px; padding: 10px 6px; }
.modebox { background: rgba(0,0,0,.18); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.modebox .seg { margin: 6px 0 0; }
.rdy { color: #7be08a; font-weight: 700; font-size: 13px; }
.row.tap { cursor: pointer; } .row.tap:active { background: rgba(255,255,255,.08); }
.row.invite { border: 1px solid var(--acc); }

/* ---------- efekty: konfetti po wygranej, czerwony blysk po przegranej ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.confetti i { position: absolute; top: -16px; width: 8px; height: 14px; border-radius: 2px;
  animation: fall var(--t) cubic-bezier(.3,.6,.6,1) var(--d) both; }
@keyframes fall { from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--x), 105vh) rotate(var(--r)); opacity: .9; } }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 29; animation: flash 1.4s ease-out both; }
.flash.bad { background: radial-gradient(ellipse at center, transparent 35%, #e5484d99); }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
.verdict .big.won { animation: pop .6s both; animation-delay: var(--d, 0ms); text-shadow: 0 0 16px #4cc38a88; }
.drain { background: #3a2f0a; border: 1px solid var(--acc); border-radius: 12px; padding: 8px 12px; margin: 2px 0 8px; font-size: 14px; text-align: center; }

/* ---------- rozmowa glosowa ---------- */
.voicebar { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 12px 0 6px; flex-wrap: wrap; }
.voicebar .muted { font-size: 13px; }
.mic { font-size: 11px; margin-right: 2px; }
.speaking .avatar { border-color: var(--ok) !important; box-shadow: 0 0 0 3px #4cc38a, 0 0 16px #4cc38aaa !important; }
.row.speaking { border-color: var(--ok); }

/* ---------- chmurki nad awatarami ---------- */
.seat { position: relative; }
.bubble { position: absolute; top: -12px; left: calc(50% + 12px); z-index: 4; white-space: nowrap;
  background: #fbfaf5; color: #1b1b1b; font-weight: 800; font-size: 13px; letter-spacing: .5px;
  padding: 3px 9px; border-radius: 12px 12px 12px 3px; box-shadow: 0 3px 8px #000a; }
.spot.right .bubble { left: auto; right: calc(50% + 12px); border-radius: 12px 12px 3px 12px; }
.bubble.check { background: #e5484d; color: #fff; }
.bubble.highest, .bubble.agree { background: var(--acc); color: #2a2100; }
.bubble.enter { animation: pop .45s both; }
.mehead .bubble { position: static; margin-left: 4px; border-radius: 12px; }
.bidpanel .who .code { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 8px;
  background: #0a2219; color: var(--acc); font-weight: 800; letter-spacing: .5px; }

/* ---------- lobby: sekcje do zwijania ---------- */
.fold { margin: 8px 0 14px; }
.foldhead { width: 100%; display: flex; align-items: center; gap: 8px; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 2px; font-size: 18px; font-weight: 700; text-align: left; }
.foldhead .arrow { width: 18px; color: var(--acc); }
.foldhead .cnt { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); background: #0a2219;
  border-radius: 10px; padding: 1px 9px; }
.fold > div { margin-top: 8px; }

/* ---------- gra na jednym ekranie (bez przewijania) ---------- */
.topbar { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; }
.topbar .timerbox { flex: 1; margin: 0; }
.topbar .leave { flex: none; font-size: 13px; padding: 4px 10px; min-height: 32px; border-radius: 16px; }
/* stol skaluje sie do wysokosci ekranu: zostawia miejsce na naglowek, pasek, rozmowe i przyciski */
.ring { --inv: .926; width: min(100%, calc((100dvh - 352px) * var(--inv))); margin: 6px auto 2px; }
.ring.p2 { --inv: .769; } .ring.p3 { --inv: 1.02; } .ring.p4, .ring.p5 { --inv: .794; }
.voicebar { margin: 4px 0 2px; }
.voicebar button { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.pvrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; min-height: 30px; margin: 2px 0 4px; }
.pvrow .pv { min-height: 0; margin: 0; font-size: 13px; }
.pvrow .pv.ok { font-size: 15px; }
.builder .chip { min-height: 28px; padding: 1px 9px; }
.builder .ranks { margin: 4px 0; }
.builder .rk { min-height: 42px; padding: 4px 0; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 0; }
.btns button { min-height: 42px; padding: 6px 8px; }
.dock { padding-top: 4px; }
.wait { padding: 8px; }
.banner { margin: 4px 0; }
.bidpanel { min-height: 0; }
.mid .lbl { font-size: 10px; margin-top: -1px; }
.tcards { display: flex; gap: 6px; justify-content: center; }
.turnrow { display: flex; align-items: center; gap: 12px; margin-top: 6px; } .turnrow b { min-width: 52px; text-align: right; }
.turnrange { flex: 1; accent-color: var(--acc); height: 32px; }
.rankbox { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line, #2c4a3a); border-radius: 12px; }
.coderow { display: flex; gap: 8px; align-items: center; margin-top: 8px; } .coderow input { flex: 1; min-width: 0; }
.rcode { flex: 1; font-size: 20px; letter-spacing: 2px; font-weight: 700; color: var(--acc); }
.rpos { min-width: 30px; font-weight: 700; } .rpts { font-size: 18px; } .meRow { border-color: var(--acc); }
.rankline { margin: 6px 0; } .rankline .up { color: #7ee08a; font-weight: 700; } .rankline .down { color: #ff8a80; font-weight: 700; }
/* ---------- szybkie reakcje ---------- */
.react { position: absolute; top: -30px; left: 50%; z-index: 6; white-space: nowrap; pointer-events: none;
  background: #1d2a24; color: #fff; border: 1px solid var(--acc); font-weight: 700; font-size: 13px;
  padding: 3px 9px; border-radius: 12px; box-shadow: 0 3px 10px #000b;
  animation: reactfade 4s both; }
.react.emo { background: none; border: 0; box-shadow: none; font-size: 34px; padding: 0; top: -38px; }
@keyframes reactfade { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.6); } 8% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  14% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -10px); } }
.mehead { position: relative; cursor: pointer; }
.mehead .react { left: 18px; }
.modal.light { background: #0006; }
.reactsheet { padding: 12px; }
.reactgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.reactgrid button { padding: 8px 4px; font-size: 13px; }
.reactgrid.emo button { font-size: 26px; padding: 4px; }
.topbar .react-btn { flex: none; font-size: 18px; padding: 2px 8px; min-height: 32px; border-radius: 16px; }
/* ---------- motywy (data-* na <html>, wybierane w profilu) ---------- */
[data-felt=blue] { --felt-hi: #2c5fa0; --felt-lo: #12264a; }
[data-felt=red] { --felt-hi: #94303c; --felt-lo: #3d0f17; }
[data-felt=gray] { --felt-hi: #545b63; --felt-lo: #1c1f23; }
[data-felt=purple] { --felt-hi: #6a3f9a; --felt-lo: #261640; }
[data-felt=teal] { --felt-hi: #1d8a88; --felt-lo: #0b3a3a; }
[data-wood=light] { --wood: #b07a44; }
[data-wood=black] { --wood: #1a1a1a; }
[data-wood=gold] { --wood: #b8902f; }
[data-back=red] { --ba: #b8333b; --bb: #8c2229; }
[data-back=green] { --ba: #2f8050; --bb: #1d5a37; }
[data-back=black] { --ba: #2a2a2a; --bb: #121212; --bedge: #d4af37; }
[data-back=purple] { --ba: #7a4bb0; --bb: #573285; }
[data-pattern=check] .fc .cb { background:
  repeating-linear-gradient(45deg, transparent, transparent 4px, var(--bb, #1f5a84) 4px, var(--bb, #1f5a84) 6px),
  repeating-linear-gradient(-45deg, var(--ba, #2b6f9e), var(--ba, #2b6f9e) 4px, var(--bb, #1f5a84) 4px, var(--bb, #1f5a84) 6px); }
[data-pattern=dots] .fc .cb { background: radial-gradient(circle, var(--bb, #1f5a84) 1.6px, transparent 2px) 0 0 / 7px 7px, var(--ba, #2b6f9e); }
[data-pattern=plain] .fc .cb { background: linear-gradient(160deg, var(--ba, #2b6f9e), var(--bb, #1f5a84)); }
[data-face=cream] { --card: #f3e7c6; }
[data-face=four] .card.s0 { color: #1b1b1b; } [data-face=four] .card.s1 { color: #d3363d; }
[data-face=four] .card.s2 { color: #1f6fd1; } [data-face=four] .card.s3 { color: #1e8a43; }
[data-face=big] .card i { display: none; } [data-face=big] .card b { font-size: 140% !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chips button.on { border-color: var(--acc); background: var(--felt2); }
.themeprev { position: relative; height: 96px; margin-top: 8px; border-radius: 14px; overflow: hidden; }
.themeprev .felt.mini { inset: 0; border-width: 6px; border-radius: 48px; }
.themeprev .tp-cards { position: absolute; inset: 0; display: flex; gap: 6px; align-items: center; justify-content: center; }
/* ---------- kibice ---------- */
.tbtns { display: flex; gap: 6px; align-items: center; }
.watchers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; font-size: 14px; }
.wchip { display: inline-flex; align-items: center; gap: 2px; background: var(--felt); border: 1px solid var(--line); border-radius: 14px; padding: 2px 8px; }
button.xs { min-height: 24px; min-width: 24px; padding: 0 6px; margin-left: 2px; }
/* ---------- samouczek ---------- */
.row.tut { border-color: var(--acc); }
.coach { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); width: min(536px, calc(100% - 24px));
  top: calc(env(safe-area-inset-top) + 92px); background: #10281ff2; border: 1px solid var(--acc); border-radius: 14px;
  padding: 10px 12px; font-size: 15px; line-height: 1.4; box-shadow: 0 8px 28px #000c; animation: coachin .3s both; }
@keyframes coachin { from { opacity: 0; } to { opacity: 1; } }
.coachhead { color: var(--acc); margin-bottom: 4px; }
.coachpill { position: fixed; z-index: 30; left: 12px; top: calc(env(safe-area-inset-top) + 92px); border-color: var(--acc); }
.row.off { opacity: .6; }
.fbtn { position: relative; }
.fbtn .badge { position: absolute; top: -2px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 17px; }
button.danger { color: #ff8a80; border-color: #7a2a2d; }
/* ---------- zlapany na blefie ---------- */
.caught { position: absolute; z-index: 7; left: 50%; top: 38%; white-space: nowrap; pointer-events: none;
  background: #c62828; color: #fff; font-weight: 900; font-size: 13px; letter-spacing: .5px; text-transform: uppercase;
  padding: 4px 10px; border: 2px solid #fff; border-radius: 8px; box-shadow: 0 4px 14px #000c;
  transform: translate(-50%, -50%) rotate(-8deg); animation: stamp 3.2s both; }
.caught.mine { top: 0; }
@keyframes stamp { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(2.6); }
  10% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(.92); }
  16% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); } 82% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(1); } }
.matchscore { margin: 6px 0; font-size: 14px; color: var(--acc); font-weight: 700; }
.matchover { margin: 8px 0 2px; font-size: 20px; font-weight: 900; }
.matchover.won { color: var(--acc); } .matchover.lost { color: #ff8a80; }
/* ---------- start partii: 3-2-1 i losowanie ---------- */
.intro { position: absolute; inset: 0; z-index: 8; pointer-events: none; animation: introbg 5.5s both; animation-delay: var(--el); }
@keyframes introbg { 0%, 94% { background: radial-gradient(ellipse at center, #000a 0, #0006 45%, transparent 70%); } 100% { background: transparent; } }
.intro .cnt { position: absolute; left: 50%; top: 50%; font-size: 84px; font-weight: 900; color: var(--acc);
  text-shadow: 0 4px 18px #000; transform: translate(-50%, -50%); opacity: 0; animation: cnt 1s both; }
@keyframes cnt { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }
.intro .spinner { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0;
  animation: spinshow 2.5s both, spinrot 2.3s cubic-bezier(.12, .7, .18, 1) both;
  animation-delay: calc(3s + var(--el)), calc(3s + var(--el)); }
.intro .arrow { position: absolute; left: -10px; top: -9px; width: 92px; height: 18px;
  background: linear-gradient(90deg, #f2c14e00, var(--acc) 30%); clip-path: polygon(0 35%, 78% 35%, 78% 0, 100% 50%, 78% 100%, 78% 65%, 0 65%);
  filter: drop-shadow(0 2px 4px #000); }
@keyframes spinshow { 0% { opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes spinrot { from { transform: rotate(0deg); } to { transform: rotate(var(--rot)); } }
.intro .picked { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); white-space: nowrap; font-weight: 900; font-size: 18px;
  color: var(--acc); text-shadow: 0 2px 8px #000; opacity: 0; animation: picked .8s both; animation-delay: calc(4.6s + var(--el)); }
@keyframes picked { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 60% { opacity: 1; transform: translateX(-50%) scale(1.1); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
/* ---------- podium ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 10px 0 6px; }
.pstep { width: 92px; text-align: center; }
.pstep .pav .avatar { font-size: 30px; }
.pstep .pname { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstep .pblock { margin-top: 4px; border-radius: 8px 8px 0 0; background: var(--felt2); border: 1px solid var(--line); font-size: 24px; padding-top: 4px; }
.pstep.p1 .pblock { height: 64px; background: #8a6d1f; border-color: var(--acc); } .pstep.p2 .pblock { height: 46px; } .pstep.p3 .pblock { height: 32px; }
.pstep.me .pname { color: var(--acc); }
/* ---------- FINAL ---------- */
.ring.final .felt { animation: finalpulse 1.6s ease-in-out infinite; }
@keyframes finalpulse { 0%, 100% { box-shadow: inset 0 0 46px #000c, 0 10px 26px #000b, 0 0 0 2px #3a2410, 0 0 0 4px #7a5530; }
  50% { box-shadow: inset 0 0 46px #000c, 0 10px 26px #000b, 0 0 0 2px #3a2410, 0 0 0 4px #7a5530, 0 0 26px 6px #e5484d88; } }
.finalban, .outban { position: absolute; left: 50%; top: 30%; z-index: 9; pointer-events: none; white-space: nowrap;
  font-weight: 900; letter-spacing: 2px; text-shadow: 0 3px 14px #000; }
.finalban { font-size: 34px; color: #ffcf5a; animation: finalban 3.5s both; }
@keyframes finalban { 0% { opacity: 0; transform: translate(-50%, -50%) scale(3); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(.95); }
  18% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
/* ---------- odpadniecie ---------- */
.outban { top: 70%; font-size: 24px; color: #ff8a80; opacity: 0; animation: outban 3.2s both; }
@keyframes outban { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  20% { transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.scatter { display: inline-block; animation: scatter 1.1s cubic-bezier(.3, .1, .6, 1) both; animation-delay: var(--sd); }
@keyframes scatter { 0% { transform: none; opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(var(--rr)); opacity: 0; } }
/* ---------- rozdawanie od krupiera (ze srodka stolu do gracza) ---------- */
.ring { container-type: size; }
@keyframes dealfly { 0% { opacity: 0; transform: translate(calc(var(--fx, 0) * 1cqw), calc(var(--fy, 0) * 1cqh)) rotate(-25deg) scale(.7); }
  15% { opacity: 1; } 100% { opacity: 1; transform: none; } }
/* ---------- ostatnie zycie ---------- */
.seat.lastlife .avatar { box-shadow: 0 0 0 2px #e5484d, 0 0 12px #e5484d99; }
/* ---------- TWOJ RUCH ---------- */
.yourturn { position: absolute; left: 50%; top: 66%; z-index: 9; pointer-events: none; white-space: nowrap;
  font-size: 30px; font-weight: 900; letter-spacing: 3px; color: var(--acc); text-shadow: 0 3px 14px #000;
  animation: yourturn 1.6s both; }
@keyframes yourturn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1); } }
.ring.myturn .spot.mine .mehead .avatar { border-color: var(--acc); box-shadow: 0 0 16px #f2c14ecc; animation: pulse 1.1s ease-in-out infinite alternate; }
.ring.myturn .spot.mine .hand { filter: drop-shadow(0 0 8px #f2c14e88); }
/* ---------- co nowego ---------- */
.news { display: flex; flex-direction: column; gap: 8px; }
.newsrow { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.35; }
.newsrow .nic { font-size: 20px; width: 26px; flex: none; text-align: center; }
