/* 🎲 שש־בש בשוק (owner, 2026-11-06) — the game screen over the souk (backgammon.js) */
.bg-dlg {
  --bg-ink: #f6ead2; --bg-gold: #e2b65a; --bg-panel: rgba(28, 16, 8, .94);
  position: fixed; inset: 0; z-index: 2147483000; background: #140c07; color: var(--bg-ink);
  font-family: Rubik, Arial, sans-serif; direction: rtl; overflow: hidden; touch-action: none;
}
/* an upright phone: the whole screen turned sideways (like the book), the board fills it */
.bg-dlg.sideways { inset: auto; top: 0; left: 0; transform-origin: top left; transform: rotate(90deg) translateY(-100%); }
.bg-stage { position: absolute; inset: 0; }
.bg-stage canvas { display: block; width: 100%; height: 100%; }

.bg-side {
  position: absolute; top: 0; bottom: 0; right: 0; width: var(--sw, 14%); min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none;
}
.bg-side > * { pointer-events: auto; }
.bg-corner { position: absolute; top: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.bg-ctl { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: calc(100% - 14px); max-width: 230px; }
.bg-ic, .bg-btn {
  font: inherit; color: var(--bg-ink); background: rgba(40, 22, 10, .88); border: 1px solid rgba(226, 182, 90, .6);
  border-radius: 4px; min-height: 40px; min-width: 40px; padding: 6px 10px; cursor: pointer;
}
.bg-ic { font-size: 18px; padding: 4px 6px; }
.bg-btn:hover, .bg-ic:hover { background: rgba(70, 40, 18, .95); }
.bg-btn:focus-visible, .bg-ic:focus-visible, .bg-lv:focus-visible, .bg-mv:focus-visible, .bg-link:focus-visible, .bg-moves summary:focus-visible { outline: 3px solid #ffd36a; outline-offset: 2px; }
.bg-status {
  margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; text-align: center; color: #fff3d6;
  background: rgba(20, 10, 4, .82); border: 1px solid rgba(226, 182, 90, .35); border-radius: 4px; padding: 5px 6px;
}
.bg-status:empty { display: none; }
.bg-dice, .bg-pips { font-size: 12px; text-align: center; background: rgba(0, 0, 0, .45); padding: 3px 6px; border-radius: 4px; }
.bg-dice:empty, .bg-pips:empty { display: none; }
/* the throw button (owner, 2026-11-06): garnet velvet in a gold frame, two ivory dice and gold letters;
   it blinks while it's the player's turn to throw */
.bg-roll {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 19px; font-weight: 800; letter-spacing: .5px; padding: 10px 8px; color: #ffe7a8;
  text-shadow: 0 1px 0 #5a1a10, 0 0 8px rgba(255, 210, 120, .45);
  background: radial-gradient(120% 140% at 50% 0%, #b7303a 0%, #7d1420 55%, #4a0a12 100%);
  border: 2px solid #e8bf62; border-radius: 12px;
  box-shadow: inset 0 0 0 2px #5a0e16, inset 0 0 0 3px rgba(255, 220, 140, .55), inset 0 6px 10px rgba(255, 255, 255, .14), 0 4px 14px rgba(0, 0, 0, .45);
}
.bg-roll::before {   /* a light running over the velvet */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 236, 180, .35) 48%, transparent 66%);
  transform: translateX(-120%);
}
.bg-roll:hover { filter: brightness(1.12); background: radial-gradient(120% 140% at 50% 0%, #c93a45 0%, #8d1a26 55%, #540c15 100%); }
.bg-roll:active { transform: translateY(1px) scale(.98); }
.bg-rdice { display: inline-flex; gap: 4px; }
.bg-d {
  display: inline-block; width: 19px; height: 19px; border-radius: 4px;
  background-color: #fbf3df; box-shadow: inset -2px -2px 3px rgba(120, 90, 50, .45), 0 1px 2px rgba(0, 0, 0, .5);
  --p: radial-gradient(circle, #2a1608 0 1.9px, transparent 2.4px);
  background-repeat: no-repeat; background-size: 7px 7px;
}
.bg-d5 { background-image: var(--p), var(--p), var(--p), var(--p), var(--p); background-position: 2px 2px, 10px 2px, 6px 6px, 2px 10px, 10px 10px; transform: rotate(-12deg); }
.bg-d3 { background-image: var(--p), var(--p), var(--p); background-position: 2px 2px, 6px 6px, 10px 10px; transform: rotate(9deg) translateY(2px); }
.bg-roll:not([hidden]) { animation: bgPulse 1.1s ease-in-out infinite; }
.bg-roll:not([hidden])::before { animation: bgShine 2.2s ease-in-out infinite; }
.bg-roll:not([hidden]) .bg-d5 { animation: bgJig 1.1s ease-in-out infinite; }
.bg-roll:not([hidden]) .bg-d3 { animation: bgJig2 1.1s ease-in-out infinite; }
@keyframes bgShine { 0%, 35% { transform: translateX(-120%); } 75%, 100% { transform: translateX(120%); } }
@keyframes bgJig { 50% { transform: rotate(10deg) translateY(-2px); } }
@keyframes bgJig2 { 50% { transform: rotate(-14deg) translateY(-1px); } }
@keyframes bgPulse {   /* the blink: the frame and the glow light up and dim */
  0%, 100% { border-color: #e8bf62; filter: brightness(1); box-shadow: inset 0 0 0 2px #5a0e16, inset 0 0 0 3px rgba(255, 220, 140, .55), inset 0 6px 10px rgba(255, 255, 255, .14), 0 4px 14px rgba(0, 0, 0, .45); }
  50% { border-color: #fff3c4; filter: brightness(1.28); box-shadow: inset 0 0 0 2px #5a0e16, inset 0 0 0 3px rgba(255, 240, 190, .95), inset 0 6px 10px rgba(255, 255, 255, .22), 0 0 22px 6px rgba(255, 205, 100, .85); }
}
.bg-undo { font-size: 14px; }
.bg-moves { position: relative; font-size: 13px; text-align: center; }
.bg-moves summary { cursor: pointer; list-style: none; background: rgba(40, 22, 10, .88); border: 1px solid rgba(226, 182, 90, .45); border-radius: 4px; min-height: 36px; display: grid; place-items: center; }
.bg-moves summary::-webkit-details-marker { display: none; }
/* the list of moves opens over the board, beside the strip */
.bg-mlist {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); width: min(340px, 52vw);
  display: flex; flex-wrap: wrap; gap: 6px; max-height: 70vh; overflow: auto; padding: 10px;
  background: rgba(28, 16, 8, .95); border: 1px solid rgba(226, 182, 90, .55); border-radius: 6px;
}
.bg-dlg.sideways .bg-mlist { max-height: 70vw; width: min(340px, 52vh); }
.bg-mv { font: inherit; font-size: 14px; color: var(--bg-ink); background: rgba(40, 22, 10, .85); border: 1px solid rgba(226, 182, 90, .45); border-radius: 4px; min-height: 36px; padding: 4px 10px; cursor: pointer; }

.bg-panel { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 4, 2, .45); padding: 16px; }
.bg-panel[hidden] { display: none; }
.bg-card {
  background: var(--bg-panel); border: 1px solid rgba(226, 182, 90, .55); border-radius: 8px; padding: 18px 20px;
  width: min(440px, 100%); max-height: 100%; overflow: auto; text-align: center; box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}
.bg-card h2 { margin: 0 0 8px; font-family: "Secular One", Rubik, sans-serif; color: var(--bg-gold); font-size: 22px; }
.bg-card p { margin: 6px 0; line-height: 1.45; }
.bg-lvt { font-weight: 600; margin-top: 12px !important; }
.bg-lvs { display: flex; gap: 8px; justify-content: center; margin: 6px 0 14px; }
.bg-lv { font: inherit; color: var(--bg-ink); background: rgba(60, 34, 14, .9); border: 1px solid rgba(226, 182, 90, .45); border-radius: 4px; min-height: 42px; min-width: 76px; cursor: pointer; }
.bg-lv.on { background: #e2b65a; color: #2a1608; font-weight: 700; border-color: #fff1c8; }
.bg-go { font-size: 18px; font-weight: 700; color: #2a1608; background: linear-gradient(#f5d58a, #d6a344); border-color: #fff1c8; padding: 10px 22px; }
.bg-danger { background: #8c1d2e; border-color: #e6a0a8; }
.bg-danger:hover { background: #a3263a; }
.bg-link { display: block; margin: 10px auto 0; font: inherit; font-size: 14px; color: var(--bg-ink); background: none; border: 0; text-decoration: underline; cursor: pointer; min-height: 36px; }
.bg-note { font-size: 13px; opacity: .85; }
.bg-warn { color: #ffd6a0; font-weight: 600; }
.bg-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

@media (max-height: 460px) {
  .bg-card { padding: 12px 14px; }
  .bg-card h2 { font-size: 19px; }
  .bg-ctl { gap: 4px; }
  .bg-roll { font-size: 16px; padding: 7px 4px; gap: 6px; }
  .bg-ic, .bg-btn { min-height: 36px; min-width: 36px; }
  .bg-pips { display: none; }
}
.bg-dlg.sideways .bg-ctl { gap: 4px; }
.bg-dlg.sideways .bg-roll { font-size: 16px; padding: 7px 4px; gap: 6px; }
.bg-dlg.sideways .bg-ic, .bg-dlg.sideways .bg-btn { min-height: 36px; min-width: 36px; }
.bg-dlg.sideways .bg-pips { display: none; }

@media (prefers-reduced-motion: reduce) { .bg-roll:not([hidden]), .bg-roll::before, .bg-roll .bg-d { animation: none !important; } }
html.a11y-still .bg-roll, html.a11y-still .bg-roll::before, html.a11y-still .bg-roll .bg-d { animation: none !important; }

/* 👥 against a person (2026-11-06) */
.bg-person { width: 100%; font-weight: 700; font-size: 17px; padding: 10px; background: #1f4e79; border-color: #9cc3e6; }
.bg-person:hover { background: #2a6299; }
.bg-go { width: 100%; }
.bg-or { margin: 6px 0 !important; opacity: .8; }
.bg-wait { font-size: 17px; font-weight: 600; }
.bg-chk { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 10px 0; }
.bg-card input[type=text] { font: inherit; width: 100%; max-width: 260px; padding: 8px 10px; border-radius: 4px; border: 1px solid #e2b65a; background: #fff8ea; color: #2a1608; }
.bg-card a.bg-btn { display: block; text-decoration: none; text-align: center; }
.bg-timer { font-size: 13px; font-weight: 700; text-align: center; background: rgba(0, 0, 0, .5); padding: 3px 6px; border-radius: 4px; color: #ffe7b0; }
.bg-timer:empty { display: none; }
.bg-timer.low { background: #8c1d2e; color: #fff; }
/* 🔗 inviting a friend (2026-11-06) */
.bg-friend { width: 100%; margin-top: 8px; font-weight: 700; background: #1d6b52; border-color: #9fe0c5; }
.bg-friend:hover { background: #24805f; }
.bg-wa { display: block; width: 100%; margin: 8px 0 6px; text-align: center; text-decoration: none; font-weight: 700; background: #1f7a43; border-color: #9fe0b4; }
.bg-card .bg-linkbox { direction: ltr; font-size: 13px; max-width: 100%; margin: 6px 0; }
.bg-card > .bg-btn + .bg-btn { margin-top: 6px; }

/* 💾 the saved game (owner, 2026-11-06) */
.bg-saved { display: grid; gap: 4px; margin: 4px 0 10px; padding: 10px; border: 2px solid #14e0cf; border-radius: 12px; background: rgba(20, 224, 207, .1); }
.bg-saved .bg-note { margin: 0; }
/* a move of one checker over several dice */
.bg-mv.bg-combo { border-color: #14e0cf; box-shadow: inset 0 0 0 1px #14e0cf; }
.bg-btn.bg-nosave { background: transparent; border: 1px solid rgba(226, 182, 90, .55); }

/* only the throw button on the board's side (owner, 2026-11-06): the status line, the dice line and the
   pips are read to screen readers only; the list of moves stays for the keyboard / screen readers and
   shows only while it has focus; no undo button */
.bg-status, .bg-dice, .bg-pips {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.bg-moves:not(:focus-within) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ✦ the first screen — a velvet-and-gold lobby (owner, 2026-11-07) ✦ */
.bg-panel.lobby {
  background: radial-gradient(120% 90% at 50% 0%, rgba(120, 40, 30, .55), transparent 60%),
              radial-gradient(90% 80% at 50% 120%, rgba(20, 80, 70, .45), transparent 60%),
              rgba(6, 3, 2, .72);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  padding: 10px; overflow: auto; touch-action: pan-y;
}
.bg-card.bg-lobby {
  position: relative; width: min(860px, 100%); padding: 16px 18px 12px; border-radius: 22px;
  background:
    radial-gradient(100% 60% at 50% 0%, rgba(226, 182, 90, .18), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #2c130e 0%, #1c0c08 55%, #130806 100%);
  border: 2px solid #c9993f;
  box-shadow: inset 0 0 0 4px #1c0c08, inset 0 0 0 5px rgba(240, 205, 130, .55), 0 0 0 1px rgba(0, 0, 0, .6),
              0 24px 70px rgba(0, 0, 0, .75), 0 0 60px rgba(226, 182, 90, .14);
  animation: bgLobbyIn .55s cubic-bezier(.2, .9, .25, 1.15) both;
}
/* gold corner flourishes */
.bg-card.bg-lobby::before, .bg-card.bg-lobby::after {
  content: ''; position: absolute; width: 28px; height: 28px; pointer-events: none;
  border: 2px solid #e8bf62; opacity: .8;
}
.bg-card.bg-lobby::before { top: 6px; right: 6px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.bg-card.bg-lobby::after { bottom: 6px; left: 6px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }

.bg-crest { display: flex; justify-content: center; gap: 8px; margin: 0 0 2px; }
.bg-crest .bg-d { width: 26px; height: 26px; background-size: 9px 9px; --p: radial-gradient(circle, #2a1608 0 2.5px, transparent 3.1px); }
.bg-crest .bg-d5 { background-position: 3px 3px, 14px 3px, 8.5px 8.5px, 3px 14px, 14px 14px; animation: bgFloat 3.2s ease-in-out infinite; }
.bg-crest .bg-d3 { background-position: 3px 3px, 8.5px 8.5px, 14px 14px; animation: bgFloat2 3.2s ease-in-out infinite; }
@keyframes bgFloat { 50% { transform: rotate(6deg) translateY(-4px); } }
@keyframes bgFloat2 { 50% { transform: rotate(-4deg) translateY(-2px); } }

.bg-card.bg-lobby h2.bg-title {
  margin: 0; font-family: "Secular One", Rubik, sans-serif; font-size: clamp(30px, 5vw, 44px); line-height: 1.05; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.bg-title span {
  background: linear-gradient(180deg, #fff4c9 0%, #f0c96a 45%, #b47d26 75%, #f3d58a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #3a1a08) drop-shadow(0 0 14px rgba(240, 190, 90, .35));
}
.bg-title::before, .bg-title::after { content: ''; height: 2px; flex: 0 1 90px; background: linear-gradient(90deg, transparent, #e8bf62); }
.bg-title::after { background: linear-gradient(90deg, #e8bf62, transparent); }
.bg-card.bg-lobby p.bg-tag { margin: 2px 0 12px; color: #f3dfb6; font-size: 14px; letter-spacing: .4px; opacity: .9; }

/* the saved game: a glowing turquoise bar on top */
.bg-resumebar {
  display: flex; align-items: center; gap: 12px; text-align: right; margin: 0 0 12px; padding: 9px 12px;
  border-radius: 14px; border: 2px solid #14e0cf;
  background: linear-gradient(90deg, rgba(20, 224, 207, .2), rgba(20, 224, 207, .06));
  box-shadow: 0 0 18px rgba(20, 224, 207, .35), inset 0 0 12px rgba(20, 224, 207, .15);
  animation: bgTurq 2.4s ease-in-out infinite;
}
@keyframes bgTurq { 50% { box-shadow: 0 0 28px rgba(20, 224, 207, .6), inset 0 0 16px rgba(20, 224, 207, .25); } }
.bg-rsic { font-size: 26px; }
.bg-rstx { flex: 1; display: grid; gap: 1px; min-width: 0; }
.bg-rstx b { color: #b8fff6; font-size: 16px; }
.bg-rstx small { font-size: 12.5px; opacity: .85; }
.bg-resumebar .bg-cta { width: auto; flex: none; padding: 0 16px; }

/* three choice cards */
.bg-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bg-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 26px 12px 12px; margin-top: 22px; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .015));
  border: 1px solid var(--tone-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 22px rgba(0, 0, 0, .35);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  animation: bgOptIn .5s cubic-bezier(.2, .9, .25, 1.2) both;
}
.bg-opt:nth-child(2) { animation-delay: .08s; }
.bg-opt:nth-child(3) { animation-delay: .16s; }
.bg-opt:hover, .bg-opt:focus-within { transform: translateY(-3px); border-color: var(--tone); box-shadow: 0 0 0 1px var(--tone), 0 12px 30px rgba(0, 0, 0, .45), 0 0 26px var(--tone-glow); }
.bg-opt.c-gold { --tone: #f0c96a; --tone-line: rgba(240, 201, 106, .45); --tone-glow: rgba(240, 201, 106, .3); }
.bg-opt.c-blue { --tone: #8cc4ff; --tone-line: rgba(140, 196, 255, .4); --tone-glow: rgba(110, 170, 255, .3); }
.bg-opt.c-green { --tone: #7fe3b4; --tone-line: rgba(127, 227, 180, .4); --tone-glow: rgba(90, 220, 160, .3); }
.bg-medal {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px;
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--tone) 35%, #3a1e0c 100%);
  box-shadow: 0 0 0 3px #1c0c08, 0 0 0 5px var(--tone), 0 6px 14px rgba(0, 0, 0, .55), 0 0 18px var(--tone-glow);
}
.bg-medal span { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.bg-opt h3 { margin: 4px 0 0; font-family: "Secular One", Rubik, sans-serif; font-size: 19px; color: var(--tone); }
.bg-card .bg-opt p.bg-sub { margin: 0 0 6px; font-size: 13px; opacity: .85; line-height: 1.3; min-height: 2.6em; }
.bg-opt .bg-lvs { margin: 0 0 8px; gap: 4px; width: 100%; }
.bg-opt .bg-lv { flex: 1; min-width: 0; min-height: 36px; border-radius: 999px; font-size: 14px; }
.bg-opt .bg-cta { margin-top: auto; }

/* the big buttons */
.bg-cta {
  width: 100%; min-height: 44px; border-radius: 12px; font: inherit; font-size: 16.5px; font-weight: 800; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .35); color: #fff; letter-spacing: .3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 4px 12px rgba(0, 0, 0, .35);
  transition: filter .15s, transform .1s;
}
.bg-cta:hover { filter: brightness(1.12); }
.bg-cta:active { transform: translateY(1px); }
.bg-cta:focus-visible, .bg-lnk:focus-visible { outline: 3px solid #ffd36a; outline-offset: 2px; }
.bg-cta-gold { color: #2a1608; background: linear-gradient(180deg, #ffe5a0, #e0ac4a 60%, #b8832c); border-color: #fff1c8; }
.bg-cta-blue { background: linear-gradient(180deg, #3d7fc4, #1f4e8a); }
.bg-cta-green { background: linear-gradient(180deg, #2f9c6f, #16603f); }
.bg-cta-turq { color: #04302c; background: linear-gradient(180deg, #8ff7ec, #14c9b9); border-color: #d9fffb; }

.bg-foot { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.bg-lnk { font: inherit; font-size: 14px; color: #f3dfb6; background: none; border: 0; cursor: pointer; text-decoration: none; min-height: 36px; padding: 0 6px; border-bottom: 1px dashed rgba(243, 223, 182, .45); }
.bg-lnk:hover { color: #fff; border-bottom-color: #fff; }
.bg-dot { color: #c9993f; font-size: 10px; }

@keyframes bgLobbyIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes bgOptIn { from { opacity: 0; transform: translateY(16px); } }

/* narrow / short screens (a phone is shown sideways, so it is short rather than narrow) */
@media (max-width: 560px) {
  .bg-opts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .bg-card .bg-opt p.bg-sub { min-height: 0; }
}
@media (max-height: 460px) {
  .bg-card.bg-lobby { padding: 10px 14px 6px; }
  .bg-crest { display: none; }
  .bg-card.bg-lobby h2.bg-title { font-size: 28px; }
  .bg-card.bg-lobby p.bg-tag { margin: 0 0 6px; font-size: 13px; }
  .bg-resumebar { margin-bottom: 4px; padding: 5px 10px; }
  .bg-opt { padding: 22px 10px 9px; margin-top: 20px; }
  .bg-medal { width: 40px; height: 40px; top: -20px; font-size: 20px; }
  .bg-opt h3 { font-size: 17px; }
  .bg-card .bg-opt p.bg-sub { min-height: 0; margin-bottom: 4px; }
  .bg-cta { min-height: 40px; font-size: 15px; }
  .bg-foot { margin-top: 4px; }
}
.bg-dlg.sideways .bg-card.bg-lobby { padding: 10px 14px 6px; }
.bg-dlg.sideways .bg-crest { display: none; }
.bg-dlg.sideways .bg-card.bg-lobby h2.bg-title { font-size: 28px; }
.bg-dlg.sideways .bg-card.bg-lobby p.bg-tag { margin: 0 0 6px; font-size: 13px; }
.bg-dlg.sideways .bg-opt { padding: 22px 10px 9px; margin-top: 20px; }
.bg-dlg.sideways .bg-medal { width: 40px; height: 40px; top: -20px; font-size: 20px; }
.bg-dlg.sideways .bg-card .bg-opt p.bg-sub { min-height: 0; margin-bottom: 4px; }
.bg-dlg.sideways .bg-cta { min-height: 40px; font-size: 15px; }
.bg-dlg.sideways .bg-opts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

@media (prefers-reduced-motion: reduce) { .bg-card.bg-lobby, .bg-opt, .bg-crest .bg-d, .bg-resumebar { animation: none !important; } .bg-opt { transition: none; } }
html.a11y-still .bg-card.bg-lobby, html.a11y-still .bg-opt, html.a11y-still .bg-crest .bg-d, html.a11y-still .bg-resumebar { animation: none !important; }
.bg-dlg.sideways .bg-card.bg-lobby p.bg-tag { display: none; }
.bg-dlg.sideways .bg-card.bg-lobby h2.bg-title { font-size: 24px; }
.bg-dlg.sideways .bg-resumebar { margin: 4px 0 0; padding: 4px 10px; }
.bg-dlg.sideways .bg-opt { margin-top: 18px; padding-top: 20px; }
.bg-dlg.sideways .bg-opt .bg-lvs { margin-bottom: 5px; }
.bg-dlg.sideways .bg-foot { margin-top: 2px; }

/* ↶ going back + ⚡ the automatic race (owner, 2026-11-08) */
.bg-undo, .bg-auto {
  font-size: 14px; font-weight: 700; border-radius: 10px; min-height: 40px; line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 3px 8px rgba(0, 0, 0, .35);
}
.bg-undo { background: linear-gradient(180deg, #4a3a22, #2c1f10); border-color: #d8b56a; color: #ffeec4; }
.bg-auto { background: linear-gradient(180deg, #1aa89c, #0b6d66); border-color: #8ff7ec; color: #fff; }
.bg-auto[aria-pressed=true] { background: linear-gradient(180deg, #8c1d2e, #5e101c); border-color: #f2a5ae; }
.bg-dlg.sideways .bg-undo, .bg-dlg.sideways .bg-auto { font-size: 12.5px; padding: 4px; }
@media (max-height: 460px) { .bg-undo, .bg-auto { font-size: 12.5px; padding: 4px; } }

/* ✦ the gold throw medallion in the middle of the board (owner, 2026-11-08) ✦ */
.bg-rollwrap {
  position: absolute; top: 0; bottom: 0; left: 0; right: var(--sw, 14%);
  display: grid; place-items: center; pointer-events: none; z-index: 2;
}
.bg-rollwrap .bg-roll.bg-gold {
  pointer-events: auto; position: relative; isolation: isolate; overflow: visible;
  width: clamp(130px, 30vmin, 230px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%;
  font: inherit; cursor: pointer; color: #4a2a06; letter-spacing: 0;
  background:
    radial-gradient(circle at 34% 26%, #fffbe6 0%, #ffe9a6 14%, transparent 34%),
    radial-gradient(circle at 50% 55%, #f7d675 0%, #e3ac3a 48%, #b97a17 78%, #7d4e0a 100%);
  box-shadow:
    inset 0 0 0 4px #fff0b8, inset 0 0 0 7px #a86c12, inset 0 0 0 9px #ffe08a,
    inset 0 -10px 22px rgba(90, 50, 0, .55), inset 0 10px 18px rgba(255, 255, 230, .6),
    0 10px 28px rgba(0, 0, 0, .55), 0 0 0 3px rgba(60, 30, 0, .45);
  text-shadow: none; filter: none;
  animation: bgGold 1.6s ease-in-out infinite;
}
.bg-rollwrap .bg-roll.bg-gold[hidden] { display: none; }
.bg-rollwrap .bg-roll.bg-gold::before { display: none; }
/* a ring of light turning round the rim */
.bg-gring {
  position: absolute; inset: -9px; border-radius: 50%; z-index: -1; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(255, 240, 180, .95) 72%, #fff 75%, rgba(255, 220, 120, .9) 78%, transparent 88% 100%);
  -webkit-mask: radial-gradient(circle, transparent 64%, #000 66%); mask: radial-gradient(circle, transparent 64%, #000 66%);
  animation: bgSpin 2.6s linear infinite;
}
/* the embossed gold die */
.bg-gdie {
  position: relative; width: 38%; aspect-ratio: 1; border-radius: 18%;
  background: linear-gradient(145deg, #fff6cf 0%, #f3c856 38%, #c98d1f 72%, #8f5a0c 100%);
  box-shadow: inset 2px 2px 3px rgba(255, 255, 240, .9), inset -3px -3px 6px rgba(90, 50, 0, .6), 0 4px 8px rgba(70, 35, 0, .55);
  transform: rotate(-10deg);
  animation: bgDieJig 1.6s ease-in-out infinite;
}
.bg-gdie i {
  position: absolute; width: 17%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #8a5208, #3a1f02 70%);
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 245, 200, .7);
  translate: -50% -50%;
}
/* five pips + the middle = a "5" (p6 sits in the middle) */
.bg-gdie .p1 { left: 26%; top: 26%; } .bg-gdie .p2 { left: 74%; top: 26%; }
.bg-gdie .p3 { left: 26%; top: 74%; } .bg-gdie .p4 { left: 74%; top: 74%; }
.bg-gdie .p5 { left: 50%; top: 50%; } .bg-gdie .p6 { display: none; }
.bg-rollwrap .bg-gold .bg-rtxt {
  font-family: "Secular One", Rubik, sans-serif; font-weight: 400; line-height: 1.05; text-align: center;
  font-size: clamp(17px, 4.6vmin, 30px); color: #4a2606;
  text-shadow: 0 1px 0 rgba(255, 248, 210, .9), 0 -1px 0 rgba(120, 70, 0, .35);
  max-width: 80%;
}
.bg-rollwrap .bg-roll.bg-gold:hover { filter: brightness(1.08); }
.bg-rollwrap .bg-roll.bg-gold:active { transform: scale(.96); }
.bg-rollwrap .bg-roll.bg-gold:focus-visible { outline: 4px solid #fff3c4; outline-offset: 6px; }
@keyframes bgGold {
  0%, 100% { transform: scale(1); box-shadow: inset 0 0 0 4px #fff0b8, inset 0 0 0 7px #a86c12, inset 0 0 0 9px #ffe08a, inset 0 -10px 22px rgba(90, 50, 0, .55), inset 0 10px 18px rgba(255, 255, 230, .6), 0 10px 28px rgba(0, 0, 0, .55), 0 0 18px 4px rgba(255, 205, 90, .45); }
  50% { transform: scale(1.06); box-shadow: inset 0 0 0 4px #fff6cf, inset 0 0 0 7px #b97a17, inset 0 0 0 9px #fff0b0, inset 0 -10px 22px rgba(90, 50, 0, .5), inset 0 10px 18px rgba(255, 255, 240, .75), 0 10px 28px rgba(0, 0, 0, .55), 0 0 44px 14px rgba(255, 215, 110, .85); }
}
@keyframes bgSpin { to { transform: rotate(360deg); } }
@keyframes bgDieJig { 0%, 100% { transform: rotate(-10deg); } 25% { transform: rotate(6deg) translateY(-4%); } 50% { transform: rotate(-4deg); } 75% { transform: rotate(10deg) translateY(-3%); } }
.bg-dlg.sideways .bg-rollwrap .bg-roll.bg-gold { width: clamp(120px, 34vw, 200px); }
.bg-dlg.sideways .bg-rollwrap .bg-gold .bg-rtxt { font-size: clamp(16px, 5vw, 26px); }
@media (prefers-reduced-motion: reduce) { .bg-rollwrap .bg-roll.bg-gold, .bg-gring, .bg-gdie { animation: none !important; } }
html.a11y-still .bg-rollwrap .bg-roll.bg-gold, html.a11y-still .bg-gring, html.a11y-still .bg-gdie { animation: none !important; }
/* 🎵 the souk's music from the board's side strip — the panel opens toward the board */
.bg-corner .mus-pop { left: auto; right: 0; transform: none; }
