/* ===========================================================
   بلوت أونلاين (Baloot Online) — all styles for baloot-game.js
   Every class is prefixed bg- so nothing clashes with the
   baloot CALCULATOR (.blt) or any other module.

   STAGE 5: the game is a FULL-SCREEN TAKEOVER (.bg-stage) over
   the whole app — its own HUD, an edge-to-edge sadu rug, a big
   arched hand fan and a dark action bar. Cards are programmatic
   SVG faces/backs injected as background-images from the JS.
   =========================================================== */

/* ---------- section page (only the lobby entry lives here) ---------- */
.bg-head { display: flex; align-items: center; gap: 8px; }
.bg-beta {
  display: inline-block; background: var(--maroon); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  border-radius: 999px; padding: 2px 9px; vertical-align: middle;
}
.bg-wrap { display: flex; flex-direction: column; gap: 10px; }

.bg-toast {
  position: fixed; bottom: calc(var(--nav-h) + 18px); left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 24, 32, .92); color: #fff; font-size: 13px;
  padding: 9px 16px; border-radius: 999px; z-index: 1600; /* above the stage */
  box-shadow: 0 4px 18px rgba(0, 0, 0, .3);
  animation: bg-toast-in .2s ease;
}
@keyframes bg-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ===========================================================
   STAGE 5 — the full-screen game stage
   =========================================================== */
body.bg-lock { overflow: hidden; }           /* body scroll locked while open */

.bg-stage {
  position: fixed; inset: 0; z-index: 1500;  /* over header + bottom nav */
  background:
    radial-gradient(120% 55% at 50% 0, rgba(255, 255, 255, .18), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .03) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #dbc89c, #cdb684 55%, #bfa76e); /* Kamelna sand */
}
.bg-stagebody {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding-top: 8px;                                     /* fallback */
  padding-top: max(env(safe-area-inset-top), 8px);      /* iOS notch */
}
/* table-lobby variant: normal scrolling page inside the stage */
.bg-stage-lobby .bg-stagebody {
  display: block; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 14px 24px;                              /* fallback */
  padding: calc(max(env(safe-area-inset-top), 8px) + 6px) 14px
           calc(env(safe-area-inset-bottom) + 24px);
}
.bg-stage-lobby .bg-stagebody > * { margin: 0 0 10px; }
.bg-lobbybar { display: flex; justify-content: flex-start; }
.bg-stageload {
  text-align: center; color: #6b5a33; font-weight: 800;
  padding-top: 42vh; margin: 0;
}

/* ---------- lobby entry cards (section page + table lobby) ---------- */
.bg-codecard {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px; text-align: center;
}
.bg-code-label { font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
.bg-code {
  display: inline-block; background: none; border: 2px dashed var(--gold);
  border-radius: 12px; padding: 6px 18px; cursor: pointer;
  font-size: 28px; font-weight: 800; letter-spacing: 8px; color: var(--navy);
}
.bg-practice {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer;
}
.bg-practice input { width: 20px; height: 20px; accent-color: var(--gold); }
.bg-practice span { font-weight: 700; }
.bg-practice small { flex-basis: 100%; color: var(--ink-soft); }
.bg-lobby-actions { display: flex; gap: 10px; justify-content: center; }
.bg-danger { color: #b03030 !important; }

/* ENGINE: the prominent «لعب فردي» CTA — the solo mode the owner tests.
   A taller gold-edged green button so it clearly leads the lobby. */
.bg-solo-btn {
  font-size: 17px; font-weight: 800; min-height: 54px;
  box-shadow: 0 3px 12px rgba(30, 107, 71, .35),
              inset 0 0 0 2px rgba(201, 164, 83, .55);
}
.bg-solo-btn::before { content: '🎮 '; }

/* ---------- STAGE 6: the Kamelna HUD band ----------
   Small DARK TRANSLUCENT icon-over-label chips on both sides, the
   لنا/لهم numeric-pill unit (+ «جلسة CODE» beneath) in the center. */
.bg-hud {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px 6px;
}
.bg-hudbtn {
  border: none; cursor: pointer; font: inherit;
  display: inline-flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px;
  min-height: 44px; min-width: 46px; padding: 4px 6px; border-radius: 12px;
  background: linear-gradient(rgba(64, 69, 79, .92), rgba(26, 29, 35, .92));
  color: #f2ead6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 5px rgba(0, 0, 0, .25);
  transition: transform .1s ease;
}
.bg-hudbtn b { font-size: 15px; line-height: 1; font-weight: 400; }
.bg-hudbtn span { font-size: 9px; font-weight: 800; line-height: 1.1; }
.bg-hudbtn:active { transform: scale(.94); }
.bg-hudbtn.danger { color: #ffb4a6; }
/* the lobby bar reuses .bg-hudbtn with plain text — keep it usable there */
.bg-lobbybar .bg-hudbtn { min-width: 0; padding: 6px 14px; font-size: 12px; font-weight: 800; }
.bg-hudgrow { flex: 1; }
.bg-hudscore {
  border: none; cursor: pointer; font: inherit;
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 10px; border-radius: 13px;
  background: linear-gradient(rgba(64, 69, 79, .92), rgba(26, 29, 35, .92)); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 5px rgba(0, 0, 0, .25);
}
.bg-hudrow { display: inline-flex; align-items: center; gap: 9px; }
/* STAGE 6: لنا/لهم as numeric PILLS — tiny label + light oval number */
.bg-scorepill { display: inline-flex; align-items: center; gap: 4px; }
.bg-scorepill small { font-size: 10px; font-weight: 800; color: rgba(255, 255, 255, .85); }
.bg-scorepill b {
  font-size: 14px; line-height: 1.25; font-variant-numeric: tabular-nums;
  border-radius: 999px; padding: 1px 9px; min-width: 32px; text-align: center;
  color: #232830;
}
.bg-scorepill b.us { background: #ffe9b0; }
.bg-scorepill b.them { background: #ffcfc4; }
.bg-hudsess { font-size: 9px; font-weight: 700; color: rgba(255, 255, 255, .72); letter-spacing: 1.5px; }
/* STAGE 7 · P2-9: the 4-letter code always renders LTR inside RTL labels */
.bg-codeltr { direction: ltr; unicode-bidi: isolate; font-weight: 800; letter-spacing: 2px; }
.bg-code { direction: ltr; unicode-bidi: isolate; }

/* mode / دبل chips — STAGE 6: they ride the bottom plate row (.mini) */
.bg-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #efe9da; color: var(--ink); border: none; cursor: pointer;
  font-size: 12px; font-weight: 800; border-radius: 999px; padding: 5px 11px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.bg-chip.mini { font-size: 10px; padding: 3px 8px; flex: 0 0 auto; cursor: default; }
.bg-chip-sun { background: linear-gradient(#f3d98c, #e0b95a); color: #5c430e; }
.bg-chip-hokum { background: linear-gradient(#3f9c68, #1e6b47); color: #fff; }
.bg-chip-hokum.redsuit { text-shadow: 0 0 2px #fff; }
.bg-chip-ashkal { background: linear-gradient(#5b8fdf, #2b5aa8); color: #fff; }
.bg-chip-mult { background: linear-gradient(#d4574a, #8c2f27); color: #fff; }

/* ---------- the board: Kamelna composition (STAGE 6) ----------
   The RUG occupies only the MIDDLE BAND of the board — sand shows above
   (the top player's chip lives there) and below (the call area / my
   pills). Side chips straddle the rug's left/right edges.
   Rug pattern: BOLD horizontal bands — thick rust-maroon fields separated
   by big beige/teal interlocked triangle rows and thin weft stripes.
   Each triangle row = a pair of conic-gradient strips (down-pointing over
   up-pointing, offset half a tile). ::after draws the gold/beige frame. */
.bg-board { position: relative; flex: 1 1 auto; min-height: 300px; }
.bg-felt {
  position: absolute; inset: 88px 8px 36px;  /* sand above + below the rug */
  border-radius: 12px;                        /* slightly rounded corners */
  background:
    /* faint horizontal weave texture over everything */
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 4px),
    /* band 1 (upper) — big navy/teal triangles between beige stripes */
    linear-gradient(#d9c79a, #d9c79a) 0 6% / 100% 3px no-repeat,
    conic-gradient(from 120deg at 50% 0, #1A2744 0 120deg, transparent 120deg) 0 12% / 56px 26px repeat-x,
    conic-gradient(from -60deg at 50% 100%, #3e7a6e 0 120deg, transparent 120deg) 28px 12% / 56px 26px repeat-x,
    linear-gradient(#d9c79a, #d9c79a) 0 18% / 100% 3px no-repeat,
    /* band 2 (center, boldest) — beige/navy triangles between navy stripes */
    linear-gradient(#1A2744, #1A2744) 0 42% / 100% 4px no-repeat,
    conic-gradient(from 120deg at 50% 0, #d9c79a 0 120deg, transparent 120deg) 0 50% / 64px 30px repeat-x,
    conic-gradient(from -60deg at 50% 100%, #1A2744 0 120deg, transparent 120deg) 32px 50% / 64px 30px repeat-x,
    linear-gradient(#1A2744, #1A2744) 0 58% / 100% 4px no-repeat,
    /* band 3 (lower) — teal/navy triangles mirrored */
    linear-gradient(#d9c79a, #d9c79a) 0 82% / 100% 3px no-repeat,
    conic-gradient(from 120deg at 50% 0, #3e7a6e 0 120deg, transparent 120deg) 0 88% / 56px 26px repeat-x,
    conic-gradient(from -60deg at 50% 100%, #1A2744 0 120deg, transparent 120deg) 28px 88% / 56px 26px repeat-x,
    linear-gradient(#d9c79a, #d9c79a) 0 94% / 100% 3px no-repeat,
    /* rust-maroon wool base with tonal variation */
    linear-gradient(180deg, #722F37, #5E262D 45%, #6B2C33 70%, #521F26);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, .38),
    0 8px 22px rgba(0, 0, 0, .28);
}
/* the rug's frame: thin dark line · gold/beige band · dark line */
.bg-felt::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: 1;
  box-shadow:
    inset 0 0 0 2px #4a3220,
    inset 0 0 0 8px #c9a76b,
    inset 0 0 0 9px #8a6844,
    inset 0 0 0 11px rgba(58, 42, 26, .5);
}
/* table-lobby rug: back in normal flow */
.bg-felt-lobby { position: relative; inset: auto; height: clamp(260px, 38vh, 340px); border-radius: 14px; }
.bg-lobby-mid {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, .28); font-weight: 800; font-size: 20px;
  letter-spacing: .06em; pointer-events: none;
}

/* ---------- seats — STAGE 6: Kamelna player chips ----------
   Rounded-SQUARE avatar in a thin gold frame, card-back fan peeking from
   BEHIND/ABOVE it, dark gold-edged name plate (white name + small ★)
   UNDER it. Top chip sits on the sand above the rug; side chips straddle
   the rug's edges; the bottom "chip" is just the CALL AREA under the rug
   (my identity lives in the bottom plate row instead). */
.bg-seat {
  position: absolute; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; padding: 0; font: inherit;
}
.bg-seat-empty { cursor: pointer; }
.bg-pos-b { bottom: 2px; left: 50%; transform: translateX(-50%); }
.bg-pos-t { top: 2px; left: 50%; transform: translateX(-50%); }
.bg-pos-l { left: 2px; top: 50%; transform: translateY(-50%); }
.bg-pos-r { right: 2px; top: 50%; transform: translateY(-50%); }
/* in-game side chips straddle the rug's left/right edges */
.bg-board .bg-pos-l { left: -6px; }
.bg-board .bg-pos-r { right: -6px; }
/* the bottom seat = call area only: pills/bubbles/timer, no identity
   (my avatar+name live in the bottom plate row — Kamelna composition) */
.bg-board > .bg-pos-b .bg-avatar { display: none; }
.bg-board > .bg-pos-b .bg-avatar.bg-timer { display: flex; }
.bg-board > .bg-pos-b .bg-name,
.bg-board > .bg-pos-b .bg-tag { display: none; }
/* STAGE 8: the bottom capsule collapses to just the call area/timer —
   its dark plate + name column + suit strip are all suppressed. */
.bg-board > .bg-pos-b .bg-plate {
  background: none; border: none; box-shadow: none; padding: 0; gap: 0;
}
.bg-board > .bg-pos-b .bg-nameplate { display: none; }

/* ---------- STAGE 8: horizontal player CAPSULE ----------
   Kamelna's seat = a round avatar at one end + a dark gold-framed name
   plate (name + a tiny muted 4-suit strip) forming one rounded capsule. */
.bg-plate {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(rgba(18, 22, 32, .9), rgba(10, 13, 20, .92));
  border: 1.5px solid rgba(201, 164, 83, .75);
  border-radius: 999px; padding: 3px 10px 3px 3px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06);
}
/* the avatar becomes the CIRCLE at the capsule's leading end */
.bg-plate .bg-avatar { border-radius: 50%; }
.bg-nameplate {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-width: 0;
}
.bg-nameplate .bg-name {
  background: none; border: none; padding: 0; border-radius: 0;
  max-width: 96px;
}
/* tiny muted 4-suit strip under the name */
.bg-suits {
  display: flex; direction: ltr; gap: 3px; line-height: 1;
  font-size: 9px; opacity: .8;
}
.bg-suits .bl { color: #cfd6e4; }
.bg-suits .rd { color: #e58b7f; }

.bg-avatar {
  width: 52px; height: 52px; border-radius: 15px;   /* rounded square */
  background: linear-gradient(#24365c, #131d33); color: #f2ead6;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
  border: 2px solid #d8b25c;                        /* thin gold frame */
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
  transition: box-shadow .2s, border-color .2s;
  position: relative; z-index: 2; /* above the card-back fan */
}
.bg-avatar.empty {
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 24px;
  border-style: dashed; border-color: rgba(255, 255, 255, .5);
}
/* STAGE 6: the turn timer — avatar content REPLACED by a white circle
   with a big dark countdown number (Kamelna style, no ring overlay) */
.bg-avatar.bg-timer {
  border-radius: 50%; background: #fff; color: #232830;
  font-size: 22px; font-variant-numeric: tabular-nums;
}
.bg-seat-empty:hover .bg-avatar { background: rgba(255, 255, 255, .2); }
.bg-seat.turn .bg-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(194, 160, 80, .4), 0 0 16px rgba(194, 160, 80, .5);
  animation: bg-pulse 1.3s ease-in-out infinite;
}
@keyframes bg-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(194, 160, 80, .4), 0 0 14px rgba(194, 160, 80, .45); }
  50%      { box-shadow: 0 0 0 6px rgba(194, 160, 80, .25), 0 0 22px rgba(194, 160, 80, .65); }
}
/* dark name PLATE under the avatar: gold border, white name, small ★ */
.bg-name {
  color: #fff; font-size: 11px; font-weight: 700;
  background: rgba(12, 15, 22, .85);
  border: 1px solid rgba(201, 164, 83, .8);
  border-radius: 9px; padding: 2px 9px;
  max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bg-name::before { content: '★ '; color: #f3c94f; font-size: 9px; }
.bg-tag {
  font-size: 10px; font-weight: 800; color: #0f4630;
  background: var(--gold); border-radius: 999px; padding: 1px 8px;
}
/* STAGE 6: الموزع = small YELLOW tag hanging off the dealer's plate */
.bg-tag.dealer {
  background: #f7d04a; color: #5a430a; border-radius: 5px;
  margin-top: -3px; position: relative; z-index: 6;
}
.bg-tag.proj { background: #f3d98c; }
/* STAGE 6: CALL pill — dark, white text, pinned next to the caller's
   chip; persists until the next phase (emotes stay white + transient) */
.bg-bidlbl {
  font-size: 12px; font-weight: 800; color: #fff;
  background: rgba(12, 15, 22, .88); border-radius: 9px; padding: 3px 11px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); white-space: nowrap;
  animation: bg-pop .32s cubic-bezier(.3, 1.6, .5, 1); /* STAGE 5: spring pop */
}
/* side callers: the pill hangs beside the chip, toward the rug.
   STAGE 7 · P2-9: clamped so it can never poke outside the viewport. */
.bg-pos-l .bg-bidlbl {
  position: absolute; left: calc(100% + 6px); right: auto; top: 38%;
  max-width: 34vw; overflow: hidden; text-overflow: ellipsis;
}
.bg-pos-r .bg-bidlbl {
  position: absolute; right: calc(100% + 6px); left: auto; top: 38%;
  max-width: 34vw; overflow: hidden; text-overflow: ellipsis;
}
/* STAGE 7 · P1-4: the دبل caller's pill — dark red, stacked under the call */
.bg-bidlbl.dbl { background: #8c2f27; margin-top: 2px; }
.bg-pos-l .bg-bidlbl.dbl, .bg-pos-r .bg-bidlbl.dbl { top: 68%; }
@keyframes bg-pop { from { transform: scale(.4); opacity: 0; } }

/* ---------- playing cards — programmatic SVG faces (STAGE 5) ---------- */
.bg-pcard {
  width: 64px; height: 93px; border-radius: 8px;   /* 200:290 face */
  background-color: #fdfaf1;
  background-size: 100% 100%; background-repeat: no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .32);
  position: relative; user-select: none; -webkit-user-select: none;
  flex: 0 0 auto;
}
.bg-pcard.mini { width: 34px; height: 49px; border-radius: 5px; }

/* ---------- my hand: HUGE arched fan (STAGE 6: Kamelna proportions —
   full-width arc, cards ≈ 22-26% of the screen height, heavy overlap so
   only the big corner indices peek out) ---------- */
.bg-handarea { padding: 2px 0 0; }
.bg-banner {
  text-align: center; font-size: 13px; font-weight: 700; color: #6b4d12;
  background: #f6ecd2; border: 1px solid #e5d5a8; border-radius: 10px;
  padding: 6px 10px; margin: 6px 12px;
}
.bg-banner.tight { margin: 4px 12px; }
.bg-hand {
  display: flex; justify-content: center; align-items: flex-end;
  padding: 18px 8px 4px; min-height: 206px;
}
/* STAGE 7 · P2-8: overlap is CAPPED so the full rank+suit index column
   (the top-left ~25% of the face) of EVERY card stays visible — step =
   card-width + 2×margin must stay ≥ 0.27 × card-width at every size. */
.bg-handslot {                                 /* owns the fan-arc transform */
  transform-origin: 50% 130%;
  margin: 0 -46px; position: relative;         /* 132px card → 40px visible */
}
.bg-hand .bg-pcard {
  width: 132px; height: 191px; border-radius: 12px; margin: 0;
  box-shadow: 0 3px 9px rgba(0, 0, 0, .35);
  transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
}
.bg-hand .bg-pcard.playable { cursor: pointer; }
.bg-hand .bg-pcard.playable:hover,
.bg-hand .bg-pcard.playable:active {
  transform: translateY(-26px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .35), 0 0 0 2px var(--gold);
}
.bg-handslot:hover { z-index: 40 !important; }
.bg-hand .bg-pcard.dim { opacity: .42; pointer-events: none; }
/* deal reveal: staggered flip-in (delay set inline per card) */
.bg-deal-in { animation: bg-flipin .42s cubic-bezier(.25, .8, .3, 1) both; }
@keyframes bg-flipin {
  from { transform: perspective(600px) rotateY(115deg) translateY(14px); opacity: 0; }
}

/* ---------- center trick area ---------- */
.bg-center { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
/* STAGE 5: the SLOT owns the placement transform; the card inside is free
   for the FLIP fly-in / sweep animations (transform never fights CSS). */
.bg-tslot { position: absolute; left: 50%; top: 50%; }
/* STAGE 7 · P2-7: each played card sits CLEARLY toward its owner's seat
   (bigger seat-anchored offsets + owner-pointing tilt) so a full trick
   reads at a glance instead of clustering into an unreadable pile */
.bg-t-b { transform: translate(-50%, 8%) rotate(4deg); }
.bg-t-t { transform: translate(-50%, -108%) rotate(-4deg); }
.bg-t-l { transform: translate(-148%, -54%) rotate(-13deg); }
.bg-t-r { transform: translate(48%, -46%) rotate(13deg); }
.bg-tslot .bg-pcard { width: 72px; height: 104px; border-radius: 10px; }

/* STAGE 7 · P2-7: small won-tricks pile chip per team (🂠 ×N) */
.bg-pile {
  position: absolute; z-index: 2;
  direction: ltr; unicode-bidi: isolate;
  font-size: 11px; font-weight: 800; color: #ffe9b0;
  background: rgba(12, 15, 22, .72); border: 1px solid rgba(201, 164, 83, .55);
  border-radius: 999px; padding: 2px 9px; pointer-events: none;
}
.bg-pile.us { bottom: 6%; right: 5%; }
.bg-pile.them { top: 6%; left: 5%; }

/* trick sweep FALLBACK (no WAAPI / reduced motion; class on .bg-center) */
.bg-center[class*="bg-sweep-"] .bg-tslot { transition: transform .5s ease-in, opacity .5s ease-in; }
.bg-sweep-b .bg-tslot { transform: translate(-50%, 260%) scale(.55) !important; opacity: 0; }
.bg-sweep-t .bg-tslot { transform: translate(-50%, -380%) scale(.55) !important; opacity: 0; }
.bg-sweep-l .bg-tslot { transform: translate(-480%, -50%) scale(.55) !important; opacity: 0; }
.bg-sweep-r .bg-tslot { transform: translate(380%, -50%) scale(.55) !important; opacity: 0; }

/* flip card + hints in the center */
.bg-flipwrap {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.bg-fliplbl {
  font-size: 12px; font-weight: 800; color: #ffe9b0;
  background: rgba(0, 0, 0, .3); border-radius: 999px; padding: 2px 12px;
}
/* STAGE 6: the مشترى flip ≈ 40% of the rug's height */
.bg-flipwrap .bg-pcard { width: 83px; height: 120px; border-radius: 10px; }
.bg-flipcard { box-shadow: 0 4px 18px rgba(0, 0, 0, .45), 0 0 0 2px var(--gold); }
.bg-turnhint {
  position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%);
  color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap;
  background: rgba(0, 0, 0, .35); border-radius: 999px; padding: 4px 14px;
}
.bg-turnhint.soft { background: rgba(0, 0, 0, .22); bottom: 30%; }

/* the مشترى flying from the center to whoever receives it (dealRest) */
.bg-fly-b { animation: bg-flyb .65s ease-in .35s forwards; }
.bg-fly-t { animation: bg-flyt .65s ease-in .35s forwards; }
.bg-fly-l { animation: bg-flyl .65s ease-in .35s forwards; }
.bg-fly-r { animation: bg-flyr .65s ease-in .35s forwards; }
@keyframes bg-flyb { to { transform: translate(-50%, 200%) scale(.5); opacity: 0; } }
@keyframes bg-flyt { to { transform: translate(-50%, -280%) scale(.5); opacity: 0; } }
@keyframes bg-flyl { to { transform: translate(-420%, -50%) scale(.5); opacity: 0; } }
@keyframes bg-flyr { to { transform: translate(320%, -50%) scale(.5); opacity: 0; } }

/* ---------- STAGE 6: bid/دبل pills docked UNDER the hand fan ----------
   ONLY the currently-available actions, as 1-3 WIDE dark pills with equal
   widths filling the row (e.g. «ثري | بس»). No question header — the
   dealer's bubble on the felt already asks. The dark panel shell remains
   only around the round-2 suit picker. */
.bg-bidbar { display: flex; justify-content: center; margin: 4px 10px 0; }
.bg-bidbar-in { width: 100%; animation: bg-sheet-up .25s ease; }
.bg-bidbar-in.panel {
  background: linear-gradient(#33373e, #1e2126);
  border-radius: 16px; padding: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .08);
}
@keyframes bg-sheet-up { from { transform: translateY(30px); opacity: 0; } }
.bg-bidq {
  text-align: center; font-weight: 800; font-size: 13px;
  color: #ffe9b0; margin-bottom: 8px;
}
.bg-bidbar .bg-suitbtn { background: #f7f2e4; border-color: transparent; }
.bg-bidrow { display: flex; gap: 8px; }
.bg-bid {
  flex: 1 1 0; min-width: 0; min-height: 54px; border: none; border-radius: 14px;
  font: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(#3f444d, #22252b); color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 9px rgba(0, 0, 0, .3);
  transition: transform .1s ease, filter .1s ease;
  animation: bg-pop .3s cubic-bezier(.3, 1.6, .5, 1) backwards; /* spring in */
}
.bg-bidrow .bg-bid:nth-child(2) { animation-delay: .05s; }
.bg-bidrow .bg-bid:nth-child(3) { animation-delay: .1s; }
.bg-bidrow .bg-bid:nth-child(4) { animation-delay: .15s; }
.bg-bid:active { transform: scale(.96); }
.bg-bid.hokum b { font-size: 22px; }
.bg-bid.hokum b.redsuit { color: #ff9d8f; }
.bg-bid.dbl b { font-size: 20px; }
.bg-suitrow { display: flex; gap: 8px; margin-bottom: 10px; }
.bg-suitbtn {
  flex: 1; min-height: 64px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.bg-suitbtn b { font-size: 26px; color: #23252a; }
.bg-suitbtn.redsuit b { color: #c0392b; }
.bg-suitbtn span { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.bg-suitbtn:active { background: #f6ecd2; }

/* ---------- round-end / game-end modals ---------- */
.bg-modalbd {
  position: fixed; inset: 0; z-index: 100;   /* inside the stage's context */
  background: rgba(15, 25, 20, .55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.bg-modal {
  width: min(94vw, 420px);
  max-height: 82vh; overflow-y: auto;        /* long قيدها sheets scroll */
  background: var(--card); border-radius: 20px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .35);
  padding: 18px; animation: bg-sheet-up .25s ease;
}
.bg-modal h3 { margin: 0 0 4px; text-align: center; }
.bg-resmeta { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 2px 0 12px; }
.bg-restable { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.bg-resrow {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr;
  padding: 8px 12px; font-size: 14px; text-align: center;
  animation: bg-rowin .35s ease backwards;   /* STAGE 5: staggered slide-up */
}
.bg-resrow:nth-child(2) { animation-delay: .06s; }
.bg-resrow:nth-child(3) { animation-delay: .12s; }
.bg-resrow:nth-child(4) { animation-delay: .18s; }
.bg-resrow:nth-child(5) { animation-delay: .24s; }
@keyframes bg-rowin { from { transform: translateY(10px); opacity: 0; } }
.bg-resrow .lbl { text-align: start; color: var(--ink-soft); font-size: 13px; }
.bg-resrow:nth-child(even) { background: #faf6ec; }
.bg-resrow.head { background: var(--navy); color: #fff; font-weight: 800; }
.bg-resrow.head .lbl { color: rgba(255, 255, 255, .7); }
.bg-resrow:last-child { font-weight: 800; }
.bg-callout {
  text-align: center; font-weight: 800; font-size: 14px;
  border-radius: 10px; padding: 8px 10px; margin-bottom: 10px;
}
.bg-callout.gold { background: #f6ecd2; color: #6b4d12; border: 1px solid #e5d5a8; }
.bg-callout.red { background: #f9e3e0; color: #8c2f27; border: 1px solid #eec6c0; }
.bg-winbanner {
  text-align: center; font-size: 24px; font-weight: 800; color: var(--maroon);
  padding: 18px 6px 10px;
}
.bg-winbanner.us { color: #1e6b47; animation: bg-win 1s ease infinite alternate; }
@keyframes bg-win { from { transform: scale(1); } to { transform: scale(1.06); } }

/* ===========================================================
   STAGE 8 — «النشرة» round-end sheet (Kamelna layout replica)
   A clean dark-on-cream titled card: label:value lines, then a
   لنا | لهم table (الأبناط + النتيجة). Re-reads scoreRound values. */
.bg-nashra-modal { padding: 16px; }
.bg-nashra {
  background: var(--card);
  border: 1.5px solid #e5d5a8; border-radius: 16px;
  overflow: hidden;
}
.bg-nashra-title {
  background: var(--navy); color: #fff;
  text-align: center; font-size: 17px; font-weight: 800;
  padding: 9px 10px; letter-spacing: .04em;
}
.bg-nashra-line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.bg-nashra-lbl { color: var(--ink-soft); font-weight: 700; }
.bg-nashra-mode, .bg-nashra-side { font-weight: 800; color: var(--ink); }
.bg-nashra-res { font-weight: 800; border-radius: 999px; padding: 2px 12px; }
.bg-nashra-res.win { background: #dff3e6; color: #1e6b47; }
.bg-nashra-res.lose { background: #f9e0dc; color: #b03028; }
/* the لنا | لهم table */
.bg-nashra-tbl { padding: 4px 0 2px; }
.bg-nashra-trow {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr;
  padding: 7px 14px; font-size: 14px; text-align: center;
}
.bg-nashra-trow .k { text-align: start; color: var(--ink-soft); font-weight: 700; }
.bg-nashra-trow.head {
  background: #f6ecd2; color: #6b4d12; font-weight: 800;
}
.bg-nashra-trow.head .k { color: #6b4d12; }
.bg-nashra-trow .us { color: var(--navy); font-weight: 800; }
.bg-nashra-trow .them { color: var(--maroon); font-weight: 800; }
.bg-nashra-trow.score { background: #fff6e0; font-size: 16px; }
.bg-nashra-trow.score .us,
.bg-nashra-trow.score .them { font-size: 18px; }

/* ===========================================================
   STAGE 8 — «ضدّ» match-start versus splash
   =========================================================== */
.bg-versus {
  position: absolute; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.bg-versus-word {
  font-size: 84px; font-weight: 800; letter-spacing: .02em;
  color: var(--gold);
  text-shadow: 0 3px 14px rgba(0, 0, 0, .5), 0 0 26px rgba(201, 164, 83, .55);
  animation: bg-versus 1.3s cubic-bezier(.2, .9, .3, 1) forwards;
}
@keyframes bg-versus {
  0%   { opacity: 0; transform: scale(.4); }
  22%  { opacity: 1; transform: scale(1.12); }
  70%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); }
}

/* STAGE 8: the tappable rejoin-grace toast — a touch taller, wraps text */
.bg-swaptoast {
  cursor: pointer; max-width: 82vw; text-align: center;
  white-space: normal; line-height: 1.35;
  background: rgba(114, 47, 55, .95);
}

/* ===========================================================
   STAGE 2 — المشاريع
   =========================================================== */
/* STAGE 7 · P1-5: the «مشروع» pill docks at the bid-bar level (left side),
   OFF the hand fan — a tap can never fall through to a card. */
.bg-projdock {
  display: flex; justify-content: flex-start;
  margin: 4px 14px 0; position: relative; z-index: 60;
}
.bg-projdock .bg-projpill { margin: 0; }
.bg-projpill {
  display: block; margin: 0 auto 2px; border: none; cursor: pointer;
  background: linear-gradient(#f3d98c, #e0b95a); color: #5c430e;
  font: inherit; font-size: 14px; font-weight: 800;
  border-radius: 999px; padding: 8px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(255, 255, 255, .4);
  animation: bg-pillpulse 1.2s ease-in-out infinite;
}
@keyframes bg-pillpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.bg-projpill[disabled] { opacity: .5; animation: none; cursor: default; }

/* trick-2 reveal overlay + المشاريع modal rows */
.bg-projbd { cursor: pointer; }
.bg-projmodal h3 { margin-bottom: 10px; }
.bg-projrow {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; margin-bottom: 8px;
}
.bg-projrow.cancelled { opacity: .45; }
.bg-projrow.cancelled .bg-projcards { filter: grayscale(1); }
.bg-projwho { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.bg-projwho b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-projwho span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.bg-projcards { display: flex; direction: ltr; padding-left: 12px; }
.bg-projcards .bg-pcard.mini { margin-left: -12px; }
.bg-projhint { text-align: center; color: var(--ink-soft); font-size: 12px; margin: 8px 0 0; }

/* round-end: one line per declared project */
.bg-projlines { font-size: 12px; color: var(--ink-soft); text-align: center; margin: -4px 0 10px; }
.bg-projlines div { padding: 1px 0; }
.bg-projlines .cancelled { text-decoration: line-through; opacity: .6; }

/* ===========================================================
   STAGE 3 — turn timers, deal & buy animations
   =========================================================== */

/* avatar wrapper: carries the timer + the dealer's question bubble
   (STAGE 6: the ring overlay is gone — see .bg-avatar.bg-timer) */
.bg-avwrap { position: relative; }
.bg-avatar.bot { font-size: 20px; }

/* «أول؟ / ثاني؟ / دبل؟» — the dealer's question on the current bidder */
.bg-ask {
  position: absolute; top: -22px; left: 50%;
  background: #fff; color: #1c2b22; font-size: 12px; font-weight: 800;
  border-radius: 10px; padding: 3px 10px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35); z-index: 7;
  animation: bg-askpop .3s cubic-bezier(.3, 1.6, .5, 1); /* STAGE 5: spring */
  transform: translateX(-50%);
}
.bg-ask::after {
  content: ''; position: absolute; bottom: -4px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px; background: #fff;
}
@keyframes bg-askpop {
  from { opacity: 0; transform: translateX(-50%) scale(.4); }
  to   { transform: translateX(-50%) scale(1); }
}
/* top seat: the bubble drops BELOW the avatar so the felt doesn't clip it */
.bg-pos-t .bg-ask { top: auto; bottom: -24px; }
.bg-pos-t .bg-ask::after { bottom: auto; top: -4px; }

/* dealing animation: SVG card backs flying dealer → seats (fixed overlay) */
.bg-dealov { position: fixed; inset: 0; pointer-events: none; z-index: 1600; }
.bg-dealcard {
  position: absolute; width: 40px; height: 58px; border-radius: 5px;
  background-color: #16223c;
  background-size: 100% 100%; background-repeat: no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  opacity: .96;
}

/* ===========================================================
   STAGE 4/5 — Kamelna look & feel
   =========================================================== */

/* ----- opponents' card-back fans (live count ≤ 8) — STAGE 6: they peek
   from BEHIND/ABOVE the avatar on EVERY seat (the top chip sits on the
   sand now, so nothing clips it any more) ----- */
.bg-fan {
  position: absolute; left: 50%; bottom: calc(100% - 16px);
  width: 0; height: 40px; pointer-events: none; z-index: 1;
}
.bg-fancard {
  position: absolute; left: 50%; bottom: 0;
  width: 27px; height: 39px; margin-left: -13.5px;
  border-radius: 4px;
  background-color: #16223c;
  background-size: 100% 100%; background-repeat: no-repeat;
  transform-origin: 50% 92%; /* JS adds rotate(…deg) inline per card */
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

/* ----- تعابير speech bubbles (transient, 3s, fixed phrase list) ----- */
.bg-say {
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%); z-index: 9;
  width: max-content; max-width: 150px;
  background: #fff; color: #1c2b22; font-size: 12px; font-weight: 800;
  border-radius: 12px; padding: 6px 10px; text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
  animation: bg-sayin .22s ease;
}
@keyframes bg-sayin { from { opacity: 0; } }
.bg-say::after {
  content: ''; position: absolute; bottom: -4px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px; background: #fff;
}
/* top seat: bubble drops below the avatar (felt clips above) */
.bg-pos-t .bg-say { bottom: auto; top: calc(100% + 6px); }
.bg-pos-t .bg-say::after { bottom: auto; top: -4px; }
/* side seats: hug the felt edge instead of centering (no overflow) */
.bg-pos-l .bg-say { left: 0; transform: none; }
.bg-pos-l .bg-say::after { left: 16px; transform: rotate(45deg); }
.bg-pos-r .bg-say { left: auto; right: 0; transform: none; }
.bg-pos-r .bg-say::after { left: auto; right: 16px; transform: rotate(45deg); }

/* ----- bottom action bar: قيدها · المشاريع · تعابير + my chip -----
   Sits under the fan with iOS safe-area breathing room. */
.bg-actionbar {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(#33373e, #1e2126);
  border-radius: 16px; padding: 8px 10px;
  margin: 6px 8px 8px;                                  /* fallback */
  margin: 6px 8px calc(env(safe-area-inset-bottom) + 8px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.bg-abtn {
  flex: 1; min-height: 44px; min-width: 0;
  border: none; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 800; color: #f2ead6;
  background: linear-gradient(#4d525b, #34383f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 4px rgba(0, 0, 0, .25);
  transition: transform .1s ease;
}
.bg-abtn:active { transform: scale(.96); }
.bg-abtn.gold { background: linear-gradient(#e3bd63, #b98f3e); color: #3d2c07; }
/* STAGE 6: my name PLATE — dark, gold-edged, name + small flame icon,
   inline with the action bar (this IS the bottom player's identity) */
.bg-mechip {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0;
  background: rgba(12, 15, 22, .6);
  border: 1px solid rgba(201, 164, 83, .5);
  border-radius: 12px; padding: 3px 7px;
}
.bg-meav {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(#24365c, #131d33); color: #f2ead6;
  border: 2px solid #d8b25c;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
}
.bg-mename {
  color: #fff; font-size: 12px; font-weight: 700; max-width: 72px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bg-meflame { font-size: 12px; flex: 0 0 auto; }

/* ----- «قيدها» score-sheet rows ----- */
.bg-histrow {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.bg-histrow .h1 {
  flex: 1; min-width: 0; text-align: start;
  display: flex; flex-direction: column; gap: 2px;
}
.bg-histrow .h1 small { color: var(--ink-soft); font-size: 11px; }
.bg-histrow .pts { flex: 0 0 52px; text-align: center; font-weight: 800; }
.bg-histrow .pts.us { color: var(--navy); }
.bg-histrow .pts.them { color: var(--maroon); }
.bg-histrow.head {
  background: var(--navy); color: #fff; font-weight: 800;
  border-bottom: none; border-radius: 10px 10px 0 0;
}
.bg-histrow.head .pts { color: #fff; font-size: 12px; }
.bg-histrow.total {
  background: #f6ecd2; font-weight: 800;
  border-bottom: none; border-radius: 0 0 10px 10px;
}

/* ----- «تعابير» picker grid ----- */
.bg-emotegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bg-emote {
  min-height: 46px; padding: 6px 8px; cursor: pointer;
  border: 1px solid #e5d5a8; border-radius: 12px;
  background: #faf6ec; color: #5c430e;
  font: inherit; font-size: 13px; font-weight: 800;
}
.bg-emote:active { background: #f3d98c; }

/* ---------- mobile portrait tuning (390×844 is the primary target:
   rug ≈ 300px tall, hand cards ≈ 190px) ---------- */
@media (max-width: 430px) {
  .bg-hudbtn { min-height: 42px; min-width: 44px; }
  .bg-scorepill b { font-size: 13px; }
  .bg-board { min-height: 280px; }
  .bg-pcard { width: 56px; height: 81px; }
  .bg-avatar { width: 46px; height: 46px; font-size: 15px; }
  .bg-avatar.bg-timer { font-size: 20px; }
  .bg-name { max-width: 88px; }
  .bg-code { font-size: 24px; letter-spacing: 6px; }
  .bg-bid { min-height: 50px; font-size: 17px; }
  /* hand fan: 8 big cards fit 390px with the index column of EVERY card
     visible (STAGE 7 · P2-8: 118px card, 34px step ≥ index width) */
  .bg-hand { min-height: 190px; padding: 16px 6px 4px; }
  .bg-handslot { margin: 0 -42px; }
  .bg-hand .bg-pcard { width: 118px; height: 171px; }
  .bg-tslot .bg-pcard { width: 68px; height: 99px; }
  .bg-flipwrap .bg-pcard { width: 80px; height: 116px; }
  .bg-fancard { width: 23px; height: 33px; margin-left: -11.5px; }
  .bg-fan { height: 33px; bottom: calc(100% - 14px); }
  .bg-abtn { font-size: 13px; min-height: 42px; }
  .bg-mename { max-width: 56px; }
  .bg-say { max-width: 130px; font-size: 11px; }
  /* STAGE 8: tighter capsule + smaller «ضدّ» so it all fits 390px portrait */
  .bg-plate { gap: 4px; padding: 3px 8px 3px 3px; }
  .bg-nameplate .bg-name { max-width: 72px; }
  .bg-suits { font-size: 8px; gap: 2px; }
  .bg-versus-word { font-size: 64px; }
}

/* very narrow phones: shrink the fan a notch so 8 cards still fit */
@media (max-width: 360px) {
  .bg-hand { min-height: 172px; }
  .bg-handslot { margin: 0 -39px; }
  .bg-hand .bg-pcard { width: 108px; height: 156px; }
}

/* ---------- shorter portrait phones: keep everything on screen ---------- */
@media (max-height: 740px) {
  .bg-board { min-height: 240px; }
  .bg-board .bg-felt { inset: 74px 8px 32px; }  /* game rug only, not the lobby's */
  .bg-hand { min-height: 158px; padding-top: 12px; }
  .bg-handslot { margin: 0 -38px; }             /* STAGE 7: 30px step ≥ index */
  .bg-hand .bg-pcard { width: 106px; height: 154px; }
}

/* ---------- short viewports (landscape phones): allow scrolling ---------- */
@media (max-height: 560px) {
  .bg-stagebody { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .bg-board { min-height: 190px; }
  .bg-hand { min-height: 110px; }
}

/* ---------- prefers-reduced-motion: calm everything down ---------- */
@media (prefers-reduced-motion: reduce) {
  .bg-deal-in, .bg-bidlbl, .bg-ask, .bg-say, .bg-bid,
  .bg-seat.turn .bg-avatar, .bg-projpill, .bg-winbanner.us,
  .bg-resrow, .bg-modal, .bg-bidbar-in, .bg-toast,
  .bg-fly-b, .bg-fly-t, .bg-fly-l, .bg-fly-r { animation: none !important; }
  /* STAGE 8: the «ضدّ» splash still shows briefly, just without motion */
  .bg-versus-word { animation: none !important; opacity: 1; }
  .bg-center[class*="bg-sweep-"] .bg-tslot,
  .bg-hand .bg-pcard, .bg-dealcard { transition: none !important; }
}

/* ===== Native-app feel (research-verified iOS fixes) =====
   The game must never behave like a webpage: no text selection,
   no long-press magnifier/callout, no gray tap flash, no double-tap
   zoom, no rubber-band scrolling. */
.bg-stage, .bg-stage * {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.bg-stage { overscroll-behavior: none; }

/* AI coach button + suggested-card glow */
.bg-abtn.bg-coach{ background:linear-gradient(160deg,#2b6f5a,#1f5344); color:#fff; }
.bg-pcard.bg-hint{ box-shadow:0 0 0 3px #C2A050, 0 0 18px 4px rgba(194,160,80,.7);
  animation:bgHintPulse .6s ease-in-out 3; z-index:5; }
@keyframes bgHintPulse{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-10px); } }
