.bl-wrap { display: flex; flex-direction: column; gap: .9rem; align-items: center; }
.bl-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.scorebox { display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.scorebox > div { display: flex; flex-direction: column; align-items: center; min-width: 70px; padding: .25rem .6rem; border-radius: 12px; }
.scorebox > div.mine { background: rgb(var(--primary-rgb) / .14); }
.scorebox span { font-size: .75rem; font-weight: 800; color: var(--text-mute); }
.scorebox b { font-size: 1.6rem; font-weight: 900; line-height: 1.1; color: var(--text); }
.scorebox > div.mine b { color: var(--primary-ink); }
.scorebox i { font-style: normal; color: var(--text-mute); font-weight: 800; }
.taken { display: flex; align-items: center; gap: .4rem; font-weight: 800; color: var(--text-dim); }
.taken span { font-size: .8rem; color: var(--text-mute); }

/* the table */
.bl-table { width: 100%; max-width: 780px; padding: 16px; border-radius: 44px; background: linear-gradient(160deg, #7a4f2c 0%, #4a2d17 45%, #2f1c0e 100%);
  box-shadow: 0 34px 70px -30px rgb(0 0 0 / .85), inset 0 2px 0 rgb(255 255 255 / .18), inset 0 -3px 0 rgb(0 0 0 / .35), 0 0 0 1px rgb(212 175 55 / .25); position: relative; }
.bl-table::before { content: ''; position: absolute; inset: 6px; border-radius: 38px; border: 1.5px solid rgb(212 175 55 / .35); pointer-events: none; }
.felt { position: relative; aspect-ratio: 1.25; border-radius: 30px; overflow: hidden; direction: ltr;
  background: radial-gradient(circle at 50% 46%, rgb(255 255 255 / .1), transparent 55%), repeating-radial-gradient(circle at 30% 30%, rgb(0 0 0 / .035) 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 45%, #22865d 0%, #166443 55%, #0d4029 100%);
  box-shadow: inset 0 0 0 3px rgb(212 175 55 / .4), inset 0 0 80px rgb(0 0 0 / .5); transition: background .6s; }
.felt-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 900 clamp(2rem, 7vw, 4.2rem)/1 var(--font-en); letter-spacing: .3em; color: rgb(255 255 255 / .05); pointer-events: none; }
.felt::before { content: ''; position: absolute; inset: 18px; border-radius: 20px; border: 1.5px dashed rgb(212 175 55 / .25); pointer-events: none; }
.felt::after { content: ''; position: absolute; left: 50%; top: 50%; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(45deg); border: 2px solid rgb(212 175 55 / .16); border-radius: 18px; pointer-events: none; }
.bl-table.hokum .felt { background: radial-gradient(circle at 50% 46%, rgb(255 255 255 / .1), transparent 55%), repeating-radial-gradient(circle at 30% 30%, rgb(0 0 0 / .035) 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 45%, #2c7c96 0%, #1d5a70 55%, #113a4a 100%); }

.seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: .35rem; z-index: 2; direction: rtl; }
.seat.pos-bottom { bottom: 12px; left: 50%; transform: translateX(-50%); }
.seat.pos-top { top: 10px; left: 50%; transform: translateX(-50%); flex-direction: column-reverse; }
.seat.pos-left { left: 12px; top: 50%; transform: translateY(-50%); }
.seat.pos-right { right: 12px; top: 50%; transform: translateY(-50%); }
.plate { display: flex; align-items: center; gap: .4rem; padding: .3rem .7rem .3rem .35rem; border-radius: 99px; background: rgb(0 0 0 / .45); color: #fff; font-weight: 800; font-size: .88rem; border: 2px solid transparent; white-space: nowrap; transition: border-color .3s, box-shadow .3s; }
.plate .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #d4af37; color: #2a1f00; font-weight: 900; flex: none; }
.seat.t1 .plate .av { background: #e5e7eb; color: #1f2937; }
.plate .av svg { width: 16px; height: 16px; }
.plate .bd { font-style: normal; font-size: .68rem; padding: .1rem .45rem; border-radius: 99px; background: rgb(255 255 255 / .16); }
.plate .bd.buy { background: #d4af37; color: #2a1f00; }
.seat.is-turn .plate { border-color: #fde68a; box-shadow: 0 0 0 4px rgb(253 230 138 / .25), 0 0 24px rgb(253 230 138 / .45); }
.bubble { padding: .25rem .8rem; border-radius: 12px; background: #fff; color: #1f2937; font-weight: 900; font-size: .9rem; animation: pop .35s var(--ease); box-shadow: 0 6px 14px -6px rgb(0 0 0 / .5); }
.bubble.sun { background: #fde68a; } .bubble.hokum { background: #bfdbfe; } .bubble.pass { opacity: .85; }
.projs { display: flex; gap: .25rem; }
.projs span { font-size: .72rem; font-weight: 900; padding: .15rem .5rem; border-radius: 99px; background: rgb(0 0 0 / .4); color: #fff; }
.projs span.win { background: #d4af37; color: #2a1f00; }
.fan { display: flex; --cw: 30px; direction: ltr; }
.fan .pc { box-shadow: 0 2px 4px rgb(0 0 0 / .4); }
.fan .pc + .pc { margin-left: -20px; }
.seat.pos-left .fan, .seat.pos-right .fan { --cw: 26px; }

.centre { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 1; }
.up { display: flex; flex-direction: column; align-items: center; gap: .4rem; color: #fff; font-weight: 800; font-size: .85rem; animation: pop .4s var(--ease); }
.up .pc { --cw: 88px; transform: rotate(-4deg); box-shadow: 0 0 0 3px #fde68a, 0 16px 30px -10px rgb(0 0 0 / .7); }
.trick { position: relative; width: 240px; height: 200px; --cw: 70px; }
.trick .pc { position: absolute; left: 50%; top: 50%; animation: throwin .35s var(--ease); transition: box-shadow .3s; }
.trick .pc.at-bottom { transform: translate(-50%, -15%) rotate(3deg); }
.trick .pc.at-top { transform: translate(-50%, -85%) rotate(-4deg); }
.trick .pc.at-left { transform: translate(-115%, -50%) rotate(-8deg); }
.trick .pc.at-right { transform: translate(15%, -50%) rotate(7deg); }
.trick .pc.is-win { box-shadow: 0 0 0 3px #fde68a, 0 0 26px rgb(253 230 138 / .8); z-index: 2; }
@keyframes throwin { from { opacity: 0; } }
.trick .pc.in-bottom { animation: inB .42s cubic-bezier(.2, .9, .3, 1); } .trick .pc.in-top { animation: inT .42s cubic-bezier(.2, .9, .3, 1); }
.trick .pc.in-left { animation: inL .42s cubic-bezier(.2, .9, .3, 1); } .trick .pc.in-right { animation: inR .42s cubic-bezier(.2, .9, .3, 1); }
@keyframes inB { from { transform: translate(-50%, 160%) rotate(20deg) scale(1.15); opacity: .4; } }
@keyframes inT { from { transform: translate(-50%, -240%) rotate(-20deg) scale(.8); opacity: .4; } }
@keyframes inL { from { transform: translate(-260%, -50%) rotate(-30deg) scale(.8); opacity: .4; } }
@keyframes inR { from { transform: translate(160%, -50%) rotate(30deg) scale(.8); opacity: .4; } }
.trick.collect .pc { transition: transform .5s cubic-bezier(.5, 0, .8, .4), opacity .5s; opacity: 0; }
.trick.collect.to-bottom .pc { transform: translate(-50%, 220%) scale(.6) !important; } .trick.collect.to-top .pc { transform: translate(-50%, -300%) scale(.6) !important; }
.trick.collect.to-left .pc { transform: translate(-320%, -50%) scale(.6) !important; } .trick.collect.to-right .pc { transform: translate(220%, -50%) scale(.6) !important; }
.centre-msg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 1; }
.msg.soft { background: rgb(0 0 0 / .3); font-size: .9rem; animation: pop .4s var(--ease); }
.tbar { position: absolute; left: 14px; right: 14px; bottom: -6px; height: 4px; border-radius: 4px; background: rgb(0 0 0 / .45); overflow: hidden; }
.tbar > i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #fde68a, #d4af37); transition: width .25s linear; }
.plate { position: relative; }
.projs span.lose { opacity: .55; text-decoration: line-through; }
.declare { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: center; padding: .55rem .8rem; border-radius: 16px; background: rgb(var(--primary-rgb) / .12); border: 1px dashed rgb(var(--primary-rgb) / .6); font-weight: 800; font-size: .88rem; animation: pop .35s var(--ease); }
.dbtn { padding: .35rem .9rem; border-radius: 99px; font-weight: 900; background: var(--surface-2); border: 2px solid var(--line); color: var(--text); }
.dbtn.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.hand .pc.proj { box-shadow: 0 0 0 3px #fde68a, 0 10px 18px -8px rgb(0 0 0 / .6); }
.hand.dealing .pc { animation: dealIn .5s cubic-bezier(.2, .9, .3, 1.1) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes dealIn { from { opacity: 0; transform: translateY(-160px) rotate(-12deg) scale(.6); } }
.up .pc { animation: flipUp .6s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes flipUp { from { transform: rotateY(90deg) rotate(-4deg); } }
.sheet-btn { margin-inline-start: auto; }
.sheet { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: rgb(0 0 0 / .55); padding: 1rem; animation: pop .25s var(--ease); }
.sheet-paper { width: min(560px, 100%); max-height: 85vh; overflow: auto; border-radius: 18px; padding: 1rem 1.1rem 1.2rem; color: #1f2937;
  background: repeating-linear-gradient(180deg, #fffdf6 0 31px, #e7e2d2 31px 32px), #fffdf6; box-shadow: 0 30px 60px -20px rgb(0 0 0 / .7); border-inline-start: 6px solid #c8102e; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; }
.sheet-h h3 { margin: 0; font-size: 1.4rem; color: #7c2d12; }
.sheet-x { width: 32px; height: 32px; border-radius: 10px; background: rgb(0 0 0 / .06); color: #1f2937; font-weight: 900; }
.sheet table { width: 100%; border-collapse: collapse; margin-top: .6rem; font-size: .92rem; }
.sheet th, .sheet td { padding: .45rem .4rem; text-align: center; border-bottom: 1px solid #d6d0bd; }
.sheet thead th { font-size: .78rem; color: #6b5e45; }
.sheet td.sub { color: #7c2d12; font-weight: 900; }
.sheet tfoot th { font-size: 1rem; color: #7c2d12; border-top: 2px solid #7c2d12; }
.sheet .mute { color: #8a7f68; }
.msg { color: #fff; font-weight: 800; background: rgb(0 0 0 / .4); padding: .6rem 1rem; border-radius: 14px; }
.result { position: absolute; inset: 14% 12%; z-index: 5; border-radius: 22px; background: rgb(10 14 12 / .9); border: 1px solid rgb(212 175 55 / .45); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 1rem; direction: rtl; animation: pop .4s var(--ease); }
.result h3 { margin: 0; font-size: 1.4rem; color: #fde68a; }
.result p { margin: 0; }
.result table { border-collapse: collapse; font-size: .9rem; }
.result th, .result td { padding: .35rem .6rem; text-align: center; border-bottom: 1px solid rgb(255 255 255 / .1); }
.result thead th { font-size: .75rem; color: #c8c8c8; }
.result tr.mine th { color: #fde68a; }
.result td.tot { font-weight: 900; font-size: 1.1rem; color: #fde68a; }

.bids { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; animation: pop .35s var(--ease); }
.bbtn { min-width: 92px; height: 50px; padding: 0 1.1rem; border-radius: 14px; font-weight: 900; font-size: 1.05rem; border: 2px solid transparent; box-shadow: 0 8px 20px -10px rgb(0 0 0 / .6); transition: transform .2s; }
.bbtn:hover { transform: translateY(-2px); }
.bbtn.sun { background: linear-gradient(180deg, #fde68a, #d4af37); color: #2a1f00; }
.bbtn.hokum { background: linear-gradient(180deg, #e2e8f0, #cbd5e1); color: #111827; }
.bbtn.hokum.red { color: #c8102e; }
.bbtn.pass { background: var(--surface-2); color: var(--text); border-color: var(--line); }

.hand { display: flex; justify-content: center; --cw: 84px; padding: 10px 0 4px; max-width: 100%; direction: ltr; }
.hand .pc + .pc { margin-left: -26px; }
.hand .pc { transition: transform .2s var(--ease), filter .2s, box-shadow .2s; }
.hand .pc.ok { cursor: pointer; }
.hand .pc.ok:hover { transform: translateY(-16px); z-index: 2; box-shadow: 0 0 0 3px var(--primary), 0 16px 26px -10px rgb(0 0 0 / .6); }
.hand.my-turn .pc.ok { transform: translateY(-6px); }
.hand.my-turn .pc.ok:hover { transform: translateY(-18px); }
.hand .pc.no { filter: brightness(.6) saturate(.6); }

.sc-mini { display: flex; gap: .6rem; }
.sc-mini > div { flex: 1; text-align: center; padding: .5rem; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); }
.sc-mini span { display: block; font-size: .8rem; color: var(--text-mute); font-weight: 800; }
.sc-mini b { font-size: 1.5rem; font-weight: 900; color: var(--primary-ink); }
.bl-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; max-height: 260px; overflow-y: auto; font-size: .85rem; }
.bl-hist li { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.bl-hist em { font-style: normal; margin-inline-start: auto; font-weight: 800; }
.tag-l, .tag-k { font-style: normal; font-size: .7rem; font-weight: 900; padding: .05rem .4rem; border-radius: 99px; }
.tag-l { background: rgb(239 68 68 / .15); color: var(--danger); } .tag-k { background: rgb(212 175 55 / .2); color: var(--primary-ink); }

@media (max-width: 640px) {
  .felt { aspect-ratio: .95; }
  .hand { --cw: 60px; } .hand .pc + .pc { margin-left: -24px; }
  .trick { width: 170px; height: 160px; --cw: 48px; }
  .seat.pos-left { left: 6px; } .seat.pos-right { right: 6px; }
  .seat.pos-left .plate b, .seat.pos-right .plate b { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
  .up .pc { --cw: 66px; }
  .plate { font-size: .74rem; padding: .2rem .5rem .2rem .25rem; } .plate .av { width: 22px; height: 22px; }
  .fan { --cw: 22px; } .fan .pc + .pc { margin-left: -16px; }
  .seat.pos-left .fan, .seat.pos-right .fan { display: none; }
  .felt { aspect-ratio: .82; }
  .seat.pos-left .plate, .seat.pos-right .plate { flex-direction: column; gap: .15rem; padding: .35rem .3rem; border-radius: 16px; max-width: 72px; text-align: center; }
  .seat.pos-left .plate b, .seat.pos-right .plate b { max-width: 62px; font-size: .7rem; }
  .seat.pos-left .plate .bd, .seat.pos-right .plate .bd { font-size: .6rem; padding: .05rem .3rem; }
  .trick { width: 150px; height: 150px; --cw: 46px; }
  .bbtn { min-width: 70px; height: 44px; font-size: .95rem; }
  .result { inset: 6% 4%; } .result table { font-size: .78rem; }
}

/* doubling */
.bbtn.dbl { background: linear-gradient(160deg, #b91c1c, #7f1d1d); color: #fff; border-color: #fca5a5; }
.bbtn.dbl.closed { background: linear-gradient(160deg, #1f2937, #0b1220); border-color: #fca5a5; }
.bbtn.dbl.gahwa { background: linear-gradient(160deg, #92400e, #451a03); border-color: #fde68a; color: #fde68a; }
.plate .bd.dbl { background: #b91c1c; color: #fff; }
.dblbox { padding: .35rem .8rem; border-radius: 12px; font-weight: 900; background: #b91c1c; color: #fff; animation: pop .35s var(--ease); }
.dblbox.lv4 { background: #92400e; color: #fde68a; }
.dbl-msg { align-self: center; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: .25rem; background: rgb(127 29 29 / .75); }
.dbl-msg b { font-size: 1.4rem; color: #fde68a; }
.tag-d { font-style: normal; font-size: .7rem; font-weight: 900; padding: .05rem .4rem; border-radius: 99px; background: rgb(185 28 28 / .18); color: #dc2626; }

/* tricks sheet (الأكلات / النشرة السابقة) */
.sheet-btns { display: flex; gap: .4rem; margin-inline-start: auto; }
.sheet-btns .sheet-btn { margin: 0; }
.sheet-paper.wide { width: min(640px, 100%); }
.sheet-paper h4 { margin: 1rem 0 .4rem; color: #7c2d12; font-size: 1rem; }
.tricks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.tricks li { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; border-radius: 12px; background: rgb(0 0 0 / .04); border-inline-start: 4px solid #9ca3af; }
.tricks li.ours { border-color: #16a34a; } .tricks li.theirs { border-color: #dc2626; }
.tricks .tn { width: 1.6em; text-align: center; font-weight: 900; color: #6b5e45; }
.tricks .tc { display: flex; gap: .25rem; --cw: 38px; direction: ltr; }
.tricks .tc .pc { box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
.tricks .tc .pc.tw { box-shadow: 0 0 0 2px #d4af37, 0 2px 6px rgb(0 0 0 / .3); transform: translateY(-2px); }
.tricks .tw-name { margin-inline-start: auto; font-weight: 800; font-size: .85rem; display: flex; flex-direction: column; align-items: flex-end; }
.tricks .tw-name small { color: #6b5e45; font-weight: 700; }
.sheet .rtab { margin: .3rem 0 .6rem; }
.result [data-sheet] { margin-top: .6rem; }
@media (max-width: 640px) { .tricks .tc { --cw: 30px; } .sheet-btns .btn { padding-inline: .6rem; } }
