/* KulliQ — Baloot score keeper with its own card-room identity: royal burgundy like the back of a playing card
   (a fine gold diamond lattice), ivory cards, gold for the leader and the big buttons, black ♠ for the first team,
   red ♥ for the second. No green. ONE SCREEN like an app (no page scroll): the score on top, the round in
   the middle, «تراجع» and «سجّل» at the bottom; sizes follow the screen height so it fits small phones too. */
/* the two fonts come with the page (fonts/, kept on the phone by sw.js) instead of from Google once it shows: the
   numbers took another font for a moment on every refresh (owner, 2026-10-31). Google's own files, their arabic and
   latin parts; «fallback» waits a tenth of a second for them (time enough from the phone) and never holds the page. */
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: fallback; src: url("fonts/plex-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: fallback; src: url("fonts/plex-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: fallback; src: url("fonts/plex-arabic-500.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: fallback; src: url("fonts/plex-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: fallback; src: url("fonts/plex-arabic-600.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: fallback; src: url("fonts/plex-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: fallback; src: url("fonts/plex-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: fallback; src: url("fonts/plex-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lalezar"; font-weight: 400; font-display: fallback; src: url("fonts/lalezar-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "Lalezar"; font-weight: 400; font-display: fallback; src: url("fonts/lalezar-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --wine: #8a1636; --wine-d: #4d0a1d; --wine-l: #b52a4c; --wine-x: #2a0510;
  --cream: #fffaf0; --cream-2: #f5eedd; --edge: #e2d6bb;
  --ink: #1d2230; --muted: #6f6a5e; --red: #cf2640; --red-d: #a01a30;
  --gold: #f2b632; --gold-l: #ffd970; --gold-d: #a8750b;
  --coffee: #6b3e1e;
  --ta: #1d2230; --tb: #cf2640;
  --ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --fun: "Lalezar", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  /* heights that shrink on short screens */
  --gap: clamp(4px, 1vh, 9px);
  --rowH: clamp(40px, 6.4vh, 60px);
  --multH: clamp(36px, 5.4vh, 48px);
  --chipH: clamp(32px, 4.8vh, 42px);
  --numF: clamp(1.9rem, 6.4vh, 3.8rem);
  --scoreF: clamp(2.1rem, 7vh, 3.4rem);
  --boxH: clamp(62px, 11vh, 92px);
  --sValF: clamp(1.9rem, 5.4vh, 2.8rem);
  --keyF: clamp(1.35rem, 3.6vh, 1.9rem);
  color-scheme: dark;
}
@supports (height: 100dvh) {
  :root { --gap: clamp(4px, 1dvh, 9px); --rowH: clamp(40px, 6.4dvh, 60px); --multH: clamp(36px, 5.4dvh, 48px);
    --chipH: clamp(32px, 4.8dvh, 42px); --numF: clamp(1.9rem, 6.4dvh, 3.8rem); --scoreF: clamp(2.1rem, 7dvh, 3.4rem);
    --boxH: clamp(62px, 11dvh, 92px); --sValF: clamp(1.9rem, 5.4dvh, 2.8rem); --keyF: clamp(1.35rem, 3.6dvh, 1.9rem); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; overflow: hidden; }
body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; color: #fff; font-family: var(--ui); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; background-color: var(--wine-d);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cpath d='M17 0L34 17L17 34L0 17Z' fill='none' stroke='%23ffd970' stroke-opacity='.09'/%3E%3Ccircle cx='17' cy='17' r='1.5' fill='%23ffd970' fill-opacity='.13'/%3E%3C/svg%3E"),
    radial-gradient(130% 75% at 50% 0%, var(--wine-l), var(--wine) 42%, var(--wine-x) 100%); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.red { color: var(--red); }

.app { height: 100vh; height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; }

/* the bar */
.bTop { flex: none; display: flex; align-items: center; gap: 8px; padding: max(6px, env(safe-area-inset-top)) 12px 4px; }
.brand { display: inline-flex; }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.bTitle { margin: 0; font-family: var(--fun); font-weight: 400; font-size: 1.3rem; line-height: 1.2; color: var(--gold-l); }
/* «صكة جديدة» always in sight, at the top */
.newTop { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 .75rem 0 .6rem; border: 1.5px solid var(--gold); border-radius: 12px;
  background: rgba(242, 182, 50, .14); color: var(--gold-l); font-weight: 700; font-size: .88rem; white-space: nowrap; }
.newTop svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.newTop:active { transform: translateY(1px); background: rgba(242, 182, 50, .28); }
/* «تقليدي | متطور» where the title was; the title shows again on wide screens */
.styleSeg { flex: none; margin-inline-end: auto; display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 217, 112, .45); }
.styleSeg button { height: 30px; padding: 0 .62rem; border: 0; border-radius: 9px; background: none; color: rgba(255, 255, 255, .78); font-weight: 700;
  font-size: .84rem; white-space: nowrap; }
.styleSeg button.on { background: linear-gradient(var(--gold-l), var(--gold)); color: var(--ink); box-shadow: 0 2px 0 var(--gold-d); }
@media (max-width: 499px) { .bTitle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
@media (max-width: 400px) { .newTop { padding: 0 .55rem 0 .45rem; font-size: .82rem; } .bTop { gap: 5px; } .styleSeg button { padding: 0 .5rem; font-size: .8rem; }
  .bTop .iconBtn { width: 34px; height: 34px; } }
/* the 🎤 joined the top row (2026-10-26): the logo goes first, then the words of «صكة جديدة» (its icon stays) */
@media (max-width: 380px) { .brand { display: none; } }
@media (max-width: 350px) { .newTop { font-size: 0; gap: 0; padding: 0 .55rem; } }
.iconBtn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .07);
  border-radius: 12px; color: #fff; flex: none; }
.iconBtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#sfxBtn .off, #micBtn .off { display: none; }
#micBtn[aria-pressed="false"] { color: rgba(255, 255, 255, .5); }
#micBtn[aria-pressed="false"] .off { display: inline; }
/* listening: red (owner, 2026-10-26), with a slow glow */
#micBtn[aria-pressed="true"] { color: #fff; background: linear-gradient(#ff5d5d, #d62a2a); border-color: #ff8a8a; animation: micOn 2s ease-in-out infinite; }
@keyframes micOn { 50% { box-shadow: 0 0 0 4px rgba(255, 70, 70, .35); } }
/* what the phone heard, a moment under the top row while the 🎤 is on */
.earSaw { position: fixed; z-index: 60; top: calc(max(6px, env(safe-area-inset-top)) + 46px); left: 50%; transform: translateX(-50%);
  max-width: calc(100vw - 32px); margin: 0; padding: 4px 12px; border-radius: 99px; background: rgba(20, 4, 10, .78); color: #fff;
  font-size: .82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.pwa .earSaw { top: calc(env(safe-area-inset-top) + 62px); }
#sfxBtn[aria-pressed="false"] .on { display: none; }
#sfxBtn[aria-pressed="false"] .off { display: inline; }
#sfxBtn[aria-pressed="false"] { color: rgba(255, 255, 255, .5); }

/* ---------- the scoreboard: two cards fanned on the table ---------- */
.board { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 8px 14px 2px; perspective: 900px; }
.pcard { position: relative; display: grid; justify-items: center; gap: 2px; padding: 16px 8px 8px; border-radius: 16px; background: var(--cream);
  color: var(--ink); min-width: 0; --tilt: -2deg; transform: rotate(var(--tilt));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05), inset 0 0 0 4px var(--cream), inset 0 0 0 5px var(--edge), 0 8px 0 -4px rgba(0, 0, 0, .18), 0 14px 26px rgba(0, 0, 0, .35);
  transition: box-shadow .3s ease; }
.pcard[data-t="b"] { --tilt: 2deg; --tc: var(--tb); }
.pcard[data-t="a"] { --tc: var(--ta); }
.idx { position: absolute; font-size: 1.05rem; line-height: 1; color: var(--tc); }
.idx.top { top: 8px; inset-inline-start: 10px; }
.idx.bot { bottom: 8px; inset-inline-end: 10px; transform: rotate(180deg); }
.crown { position: absolute; top: -16px; font-size: 1.25rem; opacity: 0; transform: translateY(8px) scale(.6); transition: .35s cubic-bezier(.3, 1.6, .5, 1); }
.board[data-lead="a"] .pcard[data-t="a"], .board[data-lead="b"] .pcard[data-t="b"] {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05), inset 0 0 0 4px var(--cream), inset 0 0 0 5px var(--gold), 0 0 0 3px var(--gold), 0 0 22px rgba(242, 182, 50, .55), 0 14px 26px rgba(0, 0, 0, .35); }
.board[data-lead="a"] .pcard[data-t="a"] .crown, .board[data-lead="b"] .pcard[data-t="b"] .crown { opacity: 1; transform: none; }
.tName { border: 0; background: var(--tc); color: #fff; border-radius: 99px; padding: 0 .8rem; font-weight: 700; font-size: .9rem; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.tScore { font-family: var(--fun); font-weight: 400; font-size: var(--scoreF); line-height: 1; color: var(--tc); font-variant-numeric: tabular-nums; margin-top: 2px; }
.bar { width: 80%; height: 6px; border-radius: 9px; background: var(--cream-2); box-shadow: inset 0 0 0 1px var(--edge); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--tc), color-mix(in srgb, var(--tc) 60%, var(--gold))); border-radius: inherit;
  transition: width .6s cubic-bezier(.3, 1.3, .5, 1); }
.tWins { position: absolute; bottom: 6px; inset-inline-start: 10px; font-size: .68rem; color: var(--muted); font-weight: 700; }
.mid { display: grid; justify-items: center; gap: 5px; z-index: 1; }
.chip152 { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--fun); font-size: 1.05rem; color: var(--ink);
  background: radial-gradient(circle, var(--gold-l) 0 52%, var(--gold) 53%); border: 3px dashed rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 3px var(--gold-d), 0 5px 12px rgba(0, 0, 0, .35); }
/* the deal: a little table — the 152 chip in the middle, four seats round it (you at the bottom, your right on
   the right, your partner on top); the gold card sits at the dealer's seat and turns counter-clockwise */
/* sizes: the table (--dt), its seats (--sd) and the gold card (--tw × --th); smaller on short screens */
.dealBtn { --dt: 100px; --sd: 22px; --tw: 30px; --th: 40px; display: grid; justify-items: center; gap: 14px; }
.dealTap { position: relative; border: 0; background: none; padding: 0; color: inherit; border-radius: 50%; }
/* a little speaker on the table: a tap says who deals */
.dealSpk { position: absolute; top: 2px; right: 2px; width: calc(var(--sd) + 2px); height: calc(var(--sd) + 2px); display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(var(--gold-l), var(--gold)); color: var(--ink); box-shadow: 0 0 0 2px var(--wine-d), 0 2px 4px rgba(0, 0, 0, .4); z-index: 2; }
.dealSpk svg { width: 64%; height: 64%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dealTap.say .dealTable::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--gold-l); animation: sayRing .9s ease-out 2; pointer-events: none; }
@keyframes sayRing { from { opacity: 1; transform: scale(.85); } to { opacity: 0; transform: scale(1.35); } }
.dealTap.say .dealSpk { animation: sayPop .45s ease 3; }
@keyframes sayPop { 50% { transform: scale(1.3); } }
.dealTable { position: relative; width: var(--dt); height: var(--dt); display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, .3) 0 58%, rgba(255, 217, 112, .18) 59% 61%, rgba(0, 0, 0, 0) 62%); }
.dealTable .chip152 { width: calc(var(--dt) * .48); height: calc(var(--dt) * .48); font-size: calc(var(--dt) * .17); border-width: 3px; }
.seatDot { position: absolute; width: var(--sd); height: var(--sd); border-radius: 50%; display: grid; place-items: center; font-size: calc(var(--sd) * .55); line-height: 1;
  background: #fffaf0; color: var(--ta); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.seatDot.sd1, .seatDot.sd3 { color: var(--tb); }
.seatDot.sd0 { bottom: -2px; left: calc(50% - var(--sd) / 2); }
.seatDot.sd1 { right: -2px; top: calc(50% - var(--sd) / 2); }
.seatDot.sd2 { top: -2px; left: calc(50% - var(--sd) / 2); }
.seatDot.sd3 { left: -2px; top: calc(50% - var(--sd) / 2); }
.seatDot.on { opacity: 0; }
.dealRing { position: absolute; inset: 0; pointer-events: none; transition: transform .7s cubic-bezier(.3, 1.25, .5, 1); }
.dealToken { position: absolute; bottom: calc(var(--th) * -.27); left: 50%; width: var(--tw); height: var(--th); margin-left: calc(var(--tw) / -2); display: grid; place-items: center; font-style: normal;
  font-size: calc(var(--th) * .55); line-height: 1; border-radius: 6px; color: var(--wine-d); background: linear-gradient(var(--gold-l), var(--gold));
  box-shadow: 0 0 0 2px #fff, 0 0 16px rgba(255, 217, 112, .95), 0 3px 6px rgba(0, 0, 0, .45); transition: transform .7s cubic-bezier(.3, 1.25, .5, 1);
  animation: dealGlow 1.6s ease-in-out infinite; }
@keyframes dealGlow { 50% { box-shadow: 0 0 0 2px #fff, 0 0 26px rgba(255, 217, 112, 1), 0 3px 6px rgba(0, 0, 0, .45); } }
.dealWho { display: inline-flex; align-items: center; gap: 5px; border: 2px solid var(--gold); background: rgba(0, 0, 0, .34); color: var(--gold-l);
  border-radius: 12px; padding: 3px 12px 4px; font-weight: 700; white-space: nowrap; max-width: 132px; overflow: hidden;
  box-shadow: 0 0 12px rgba(242, 182, 50, .22); }
.dealWho small { font-size: .74rem; opacity: .85; }
.dealWho b { font-size: 1.02rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.dealWho .pen { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.dealWho:active { transform: translateY(1px); }
.dealTap:active .dealTable { transform: scale(.96); }

/* «من يوزّع؟»: the four seats round a little table; the dealer is gold */
.dPick { position: relative; width: min(300px, 100%); aspect-ratio: 1 / 1; margin: 4px auto 6px; border-radius: 26px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cpath d='M13 0L26 13L13 26L0 13Z' fill='none' stroke='%23ffd970' stroke-opacity='.1'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 45%, var(--wine-l), var(--wine) 60%, var(--wine-x));
  box-shadow: inset 0 0 0 5px var(--wine-d), inset 0 0 0 7px rgba(255, 217, 112, .5); }
.dpMid { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--fun); font-size: 1.15rem; color: var(--ink); background: radial-gradient(circle, var(--gold-l) 0 52%, var(--gold) 53%);
  border: 3px dashed rgba(255, 255, 255, .85); box-shadow: 0 0 0 3px var(--gold-d); }
.dp { position: absolute; width: 104px; min-height: 58px; display: grid; justify-items: center; align-content: center; gap: 1px; padding: 4px 6px; border-radius: 14px;
  border: 2px solid rgba(255, 217, 112, .6); background: rgba(0, 0, 0, .32); color: #fff; font-weight: 700; line-height: 1.2; }
.dp i { font-style: normal; font-size: .9rem; }
.dp b { font-size: 1rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp small { font-size: .7rem; opacity: .75; }
.dp.s0 { bottom: 12px; left: 50%; margin-left: -52px; }
.dp.s2 { top: 12px; left: 50%; margin-left: -52px; }
.dp.s1 { right: 10px; top: 50%; margin-top: -29px; width: 84px; }
.dp.s3 { left: 10px; top: 50%; margin-top: -29px; width: 84px; }
.dp.on { background: linear-gradient(var(--gold-l), var(--gold)); border-color: #fff; color: var(--ink); box-shadow: 0 0 18px rgba(255, 217, 112, .7); }
.dp:active { transform: scale(.96); }
.midRow { display: grid; justify-items: center; gap: 5px; }
.roundsBtn, .newsBtn { display: inline-flex; align-items: center; gap: 3px; border: 1px solid rgba(255, 217, 112, .55); background: rgba(0, 0, 0, .2); color: var(--gold-l);
  border-radius: 99px; padding: .12rem .5rem; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.roundsBtn { color: #fff; border-color: rgba(255, 255, 255, .35); }
.roundsBtn svg, .newsBtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.newsBtn:disabled { opacity: .35; }

/* «انعكاس!»: the score on a strip turned round for the other side of the table; the calculator keeps working under it */
.mirBand { flex: none; padding-top: env(safe-area-inset-top); background: rgba(0, 0, 0, .3); box-shadow: 0 2px 0 var(--gold); }
.app.mirOn .bTop { padding-top: 6px; }
/* the strip takes height from the number pad: where that leaves it too small, the little dealer table gives way (the name stays) */
@media (max-height: 760px) { .mirOn .dealTap { display: none; } .app.mirOn .board { padding-top: 12px; } }
@media (max-height: 960px) { .mirOn:has(.entry:not(.simple)) .dealTap { display: none; } .app.mirOn:has(.entry:not(.simple)) .board { padding-top: 12px; } }
.mirIn { height: clamp(62px, calc(22vh - 80px), 104px); height: clamp(62px, calc(22dvh - 80px), 104px); padding: 8px 12px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; transform: rotate(180deg); }
.mirCard { --tc: var(--ta); display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; padding: 0 8px; border-radius: 14px; background: var(--cream); box-shadow: inset 0 0 0 1px var(--edge); }
.mirCard[data-t="b"] { --tc: var(--tb); }
.mirBand[data-lead="a"] .mirCard[data-t="a"], .mirBand[data-lead="b"] .mirCard[data-t="b"] { box-shadow: 0 0 0 3px var(--gold); }
.mirCard span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 99px; padding: 0 .7rem; background: var(--tc); color: #fff; font-weight: 700; font-size: .92rem; line-height: 1.6; }
.mirCard b { flex: none; font-family: var(--fun); font-weight: 400; line-height: 1; color: var(--tc); font-size: clamp(2.3rem, 6.4vh, 3.5rem); font-size: clamp(2.3rem, 6.4dvh, 3.5rem); font-variant-numeric: tabular-nums; }
#mirBtn[aria-pressed="true"] { background: linear-gradient(var(--gold-l), var(--gold)); border-color: var(--gold); color: var(--ink); }

/* score animations: the card flips, the points float up */
.pcard.flip { animation: flip .56s ease; }
@keyframes flip { 0% { transform: rotate(var(--tilt)) rotateY(0); } 50% { transform: rotate(var(--tilt)) rotateY(90deg) scale(1.04); } 100% { transform: rotate(var(--tilt)) rotateY(0); } }
.floatGain { position: absolute; top: 30%; inset-inline: 0; text-align: center; font-family: var(--fun); font-size: 1.9rem; color: var(--gold-d);
  text-shadow: 0 2px 0 #fff; pointer-events: none; animation: rise 1.3s ease forwards; direction: ltr; }
@keyframes rise { 0% { opacity: 0; transform: translateY(14px) scale(.7); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-60px) scale(1); } }
.board.deal .pcard { animation: deal .6s cubic-bezier(.2, .9, .25, 1.1) both; }
.board.deal .pcard[data-t="b"] { animation-delay: .14s; }
@keyframes deal { from { transform: translate(0, -160px) rotate(-30deg) scale(.5); opacity: 0; } }

/* ---------- the round: one cream card that fills the middle ---------- */
.entry { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: var(--gap) 10px 0; padding: 10px; border-radius: 20px;
  background: var(--cream); color: var(--ink); display: flex; flex-direction: column; gap: var(--gap);
  box-shadow: inset 0 0 0 5px var(--cream), inset 0 0 0 6px var(--edge), 0 8px 0 -3px rgba(0, 0, 0, .2), 0 14px 26px rgba(0, 0, 0, .3); }
.entry.locked { opacity: .6; pointer-events: none; filter: grayscale(.4); }

.seg { display: flex; gap: 6px; min-width: 0; flex: none; }
.seg button { flex: 1; min-width: 0; min-height: var(--multH); display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 .3rem;
  border: 2px solid var(--edge); background: var(--cream-2); color: var(--ink); border-radius: 13px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 3px 0 var(--edge); transition: transform .08s, background .15s, color .15s, box-shadow .15s; }
.seg button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.seg button > span { overflow: hidden; text-overflow: ellipsis; }
.seg button i { font-style: normal; font-size: 1.1rem; }
.seg.big button { min-height: var(--rowH); font-size: 1.2rem; }
.seg.big button i { font-size: 1.25rem; }
.teamSeg button[data-v="a"] i { color: var(--ta); }
.teamSeg button[data-v="b"] i { color: var(--tb); }
.teamSeg button.on[data-v="a"] { background: var(--ta); border-color: var(--ta); color: #fff; box-shadow: 0 3px 0 #000; }
.teamSeg button.on[data-v="a"] i { color: #fff; }
.teamSeg button.on[data-v="b"] { background: var(--tb); border-color: var(--tb); color: #fff; box-shadow: 0 3px 0 var(--red-d); }
.teamSeg button.on[data-v="b"] i { color: #fff; }
.modeSeg button[data-v="sun"] i { color: var(--gold-d); }
.modeSeg button.on[data-v="sun"] { background: linear-gradient(var(--gold-l), var(--gold)); border-color: var(--gold-d); box-shadow: 0 3px 0 var(--gold-d); }
.modeSeg button.on[data-v="hokm"] { background: var(--ink); border-color: #000; color: var(--gold-l); box-shadow: 0 3px 0 #000; }
.multSeg { gap: 5px; }
.multSeg button { position: relative; font-size: .95rem; }
.multSeg button.on { background: linear-gradient(var(--gold-l), var(--gold)); border-color: var(--gold-d); box-shadow: 0 3px 0 var(--gold-d); }
.multSeg button.on[data-v="1"] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 3px 0 #000; }
.multSeg button.on[data-v="g"] { background: var(--coffee); border-color: #4a2a12; color: #fff; box-shadow: 0 3px 0 #3a200d; }
.multSeg button.lockd { opacity: .7; }
.multSeg button.lockd::after { content: "🔒"; position: absolute; top: 2px; inset-inline-end: 4px; font-size: .62rem; }
.seg.suits button { font-size: 1.4rem; }
.seg.suits button.on { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 3px 0 #000; }
.seg.suits button.red.on { background: var(--red); border-color: var(--red); }

.gahwa { padding: 12px; border-radius: 16px; background: linear-gradient(135deg, #f5e3cf, #ead0b2); color: #4a2a12; display: grid; gap: 10px; }
.gahwa > b { font-family: var(--fun); font-weight: 400; font-size: 1.35rem; text-align: center; }

/* on tall screens the spare height goes to the two number boxes: bigger, clearer numbers */
.calc { flex: 1 0 auto; display: flex; flex-direction: column; gap: var(--gap); }
.unitRow { display: flex; align-items: center; gap: 8px; }
.unitSeg { gap: 3px; }
.unitSeg button { min-height: 32px; padding: 0 .85rem; font-size: .86rem; border-radius: 10px; box-shadow: 0 2px 0 var(--edge); }
.unitSeg button.on { background: var(--wine); border-color: var(--wine-d); color: #fff; box-shadow: 0 2px 0 var(--wine-d); }
#totalHint { font-weight: 700; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.cardsTool { margin-inline-start: auto; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 0 .7rem 0 .5rem;
  background: var(--wine); color: #fff; font-weight: 700; font-size: .84rem; box-shadow: 0 2px 0 var(--wine-d); white-space: nowrap; }
.cardsTool:disabled { opacity: .4; cursor: not-allowed; }
.fan { position: relative; width: 24px; height: 20px; flex: none; direction: ltr; }
.fan i { position: absolute; bottom: 0; left: 6px; width: 12px; height: 17px; border-radius: 2px; background: #fff; color: var(--ink); font-style: normal;
  font-size: .5rem; font-weight: 700; line-height: 1.5; text-align: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); transform-origin: 50% 110%; }
.fan i:nth-child(1) { transform: rotate(-22deg); }
.fan i:nth-child(2) { color: var(--red); }
.fan i:nth-child(3) { transform: rotate(22deg); }

.abnat { flex: 1 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ab { display: grid; grid-template-rows: auto 1fr; background: #fff; border: 2px solid var(--edge); border-top: 5px solid var(--ta); border-radius: 14px; padding: 4px 8px 2px;
  box-shadow: 0 3px 0 var(--edge); min-width: 0; }
.ab[data-t="b"] { border-top-color: var(--tb); }
.ab:focus-within { border-color: var(--gold); border-top-color: var(--gold); box-shadow: 0 3px 0 var(--gold-d), 0 0 0 4px rgba(242, 182, 50, .25); }
.abHead { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.abName { display: inline-flex; gap: 4px; font-size: .86rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.abName i { font-style: normal; color: var(--ta); }
.ab[data-t="b"] .abName i { color: var(--tb); }
.conv { font-weight: 700; font-size: .9rem; color: var(--gold-d); white-space: nowrap; }
.kbPill { margin-inline-start: auto; border: 1.5px solid var(--edge); background: var(--cream-2); color: var(--muted); border-radius: 99px; padding: 0 .55rem;
  font-size: .74rem; font-weight: 700; line-height: 22px; }
.kbPill.on { background: linear-gradient(var(--gold-l), var(--gold)); border-color: var(--gold-d); color: var(--ink); }
.kbPill:disabled { opacity: .45; }
.ab input { width: 100%; height: 100%; min-height: 0; text-align: center; font-family: var(--fun); font-size: var(--numF); line-height: 1.1; border: 0; background: transparent; padding: 0; outline: none;
  color: var(--ink); font-variant-numeric: tabular-nums; }
.ab[data-t="b"] input { color: var(--tb); }
.ab input:disabled { opacity: .5; }
.ab input::placeholder { color: #d8cfb9; }

/* «تقليدي»: two boxes of a normal size and the page's own number pad under them (no phone keyboard) */
.entry.simple { display: flex; }
.entry.simple > .buyRow, .entry.simple > #modeSeg, .entry.simple > #multSeg, .entry.simple > #gahwaPart, .entry.simple > #calcPart { display: none; }
.tradPart { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: var(--gap); }
.sTop { display: flex; align-items: center; gap: 8px; }
.sModeSeg { flex: 1; gap: 4px; }
.sModeSeg button { min-height: 32px; font-size: .9rem; border-radius: 10px; box-shadow: 0 2px 0 var(--edge); }
.sModeSeg button[data-v="sun"] i { color: var(--gold-d); }
.sModeSeg button.on[data-v="sun"] { background: linear-gradient(var(--gold-l), var(--gold)); border-color: var(--gold-d); box-shadow: 0 2px 0 var(--gold-d); }
.sModeSeg button.on[data-v="hokm"] { background: var(--ink); border-color: #000; color: var(--gold-l); box-shadow: 0 2px 0 #000; }
.sBoxes { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sBox { position: relative; display: grid; justify-items: center; align-content: center; gap: 0; height: var(--boxH); padding: 4px 6px; border: 2px solid var(--edge);
  border-top: 5px solid var(--ta); border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--edge); min-width: 0;
  transition: border-color .15s, box-shadow .15s; }
.sBox[data-t="b"] { border-top-color: var(--tb); }
.sBox.act { border-color: var(--gold); border-top-color: var(--gold); box-shadow: 0 3px 0 var(--gold-d), 0 0 0 4px rgba(242, 182, 50, .28); }
.sName { display: inline-flex; gap: 5px; font-size: .86rem; font-weight: 700; color: var(--muted); white-space: nowrap; line-height: 1.2; }
.sName i { font-style: normal; color: var(--ta); }
.sBox[data-t="b"] .sName i { color: var(--tb); }
.sVal { display: inline-flex; align-items: center; min-height: 1.1em; font-family: var(--fun); font-weight: 400; font-size: var(--sValF); line-height: 1.05;
  font-variant-numeric: tabular-nums; direction: ltr; border-radius: 8px; padding: 0 4px; }
.sBox[data-t="b"] .sVal { color: var(--tb); }
.sVal:empty::before { content: "0"; color: #d8cfb9; }
.sBox.auto .sVal { opacity: .55; }
/* the box being typed: a blinking caret; a box just tapped shows its number chosen, the next digit rewrites it */
.sBox.act:not(.sel) .sVal::after { content: ""; width: 3px; height: .8em; margin-inline-start: 3px; border-radius: 2px; background: var(--gold-d); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.sBox.sel .sVal { background: rgba(242, 182, 50, .35); }
.sBox.full { animation: nudge .3s; }
@keyframes nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.sConv { min-height: 1em; font-size: .76rem; font-weight: 700; color: var(--gold-d); line-height: 1.1; white-space: nowrap; }
.sConv:empty { display: none; }
.keypad { flex: 1 1 auto; min-height: 0; max-height: 300px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, minmax(30px, 1fr));
  gap: 6px; direction: ltr; }
.keypad button { min-height: 0; border: 2px solid var(--edge); border-radius: 12px; background: var(--cream-2); color: var(--ink); font-family: var(--fun); font-weight: 400;
  font-size: var(--keyF); line-height: 1; box-shadow: 0 3px 0 var(--edge); -webkit-user-select: none; user-select: none; transition: transform .06s, box-shadow .06s; }
.keypad button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); background: #fff1c9; }
.keypad button:disabled { opacity: .45; }
/* delete: a solid burgundy key-shape with a white ✕ (a long press clears the whole box) */
.keypad .kDel { display: grid; place-items: center; color: var(--wine); background: linear-gradient(#fbeef1, #f4dde3); border-color: #e7c3cc; box-shadow: 0 3px 0 #dbb0bb; }
.keypad .kDel svg { width: clamp(30px, 4.6dvh, 38px); height: auto; }
.keypad .kDel .kb { fill: currentColor; }
.keypad .kDel .kx { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.keypad .kDel:active { background: #efcfd7; box-shadow: 0 1px 0 #dbb0bb; }
.keypad .kDel.wipe { animation: wipe .35s ease; }
@keyframes wipe { 40% { transform: scale(.92); background: var(--wine); color: #fff; } }
/* ↶ تراجع: one step back (what was typed, then the last round, edit or deletion) */
.keypad .kUndo { display: grid; place-items: center; align-content: center; gap: 1px; font-family: var(--ui); font-weight: 700; color: var(--ink);
  background: linear-gradient(#fff7e0, #fbe9b9); border-color: #e6cf8f; box-shadow: 0 3px 0 #d8bd72; }
.keypad .kUndo svg { width: clamp(20px, 3.2dvh, 26px); height: auto; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.keypad .kUndo small { font-size: .74rem; line-height: 1.1; }
.keypad .kUndo:active { background: #f7dfa0; box-shadow: 0 1px 0 #d8bd72; }
.entry.locked .kUndo { pointer-events: auto; }

/* «تقليدي» coffee: the boxes and the pad give way to one question, who won it */
.tGahwa { flex: 1 1 auto; min-height: 0; display: grid; align-content: center; justify-items: center; gap: clamp(6px, 1.6dvh, 14px); padding: 12px;
  border-radius: 16px; background: linear-gradient(160deg, #f7e8d6, #e8cdae); border: 2px solid #d9b893; color: #4a2a12; text-align: center; animation: slide .25s ease; }
.tGahwa > b { font-family: var(--fun); font-weight: 400; font-size: clamp(1.4rem, 4dvh, 1.9rem); line-height: 1.2; }
.tGahwa .seg { width: 100%; }
.tGahwa small { font-size: .82rem; font-weight: 700; opacity: .8; }
.tgCup { position: relative; font-size: clamp(2.4rem, 7dvh, 3.4rem); line-height: 1; padding-top: 14px; }
.tgCup i { position: absolute; top: 0; width: 6px; height: 18px; border-radius: 6px; background: rgba(107, 62, 30, .35); filter: blur(1px); animation: steam 1.8s ease-in infinite; }
.tgCup i:nth-child(1) { left: 34%; }
.tgCup i:nth-child(2) { left: 48%; animation-delay: .6s; }
.tgCup i:nth-child(3) { left: 62%; animation-delay: 1.2s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(10px) scaleY(.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px) scaleY(1.2) rotate(8deg); } }
.tgBack { border: 0; background: none; color: var(--coffee); font-weight: 700; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; padding: .2rem .5rem; }

/* a small legend sitting on the top edge of a row, like a fieldset's */
.buyRow, .projRow { position: relative; }
.legend { position: absolute; top: -8px; right: 50%; transform: translateX(50%); z-index: 1; padding: 0 7px; border-radius: 99px; background: var(--cream);
  color: var(--muted); font-size: .66rem; font-weight: 700; line-height: 15px; white-space: nowrap; pointer-events: none; }
/* the buyer turns green with «✓ المشتري», so nobody wonders who bought */
#buyerSeg button { flex-wrap: wrap; row-gap: 0; }
#buyerSeg .buyTag { display: none; flex-basis: 100%; font-size: .7rem; font-weight: 700; line-height: 1.1; opacity: .95; }
#buyerSeg button.on { background: linear-gradient(#2fbf6b, #16a34a); border-color: #15803d; color: #fff; box-shadow: 0 3px 0 #14532d; }
#buyerSeg button.on i { color: #fff; }
#buyerSeg button.on .buyTag { display: block; }

/* projects on one row: ♠ / ♥ picks the team, then its projects */
.projRow { display: flex; align-items: stretch; gap: 6px; padding-top: 4px; }
.projTeam { flex: none; gap: 4px; }
.projTeam button { min-height: var(--chipH); width: 40px; flex: none; padding: 0; border-radius: 11px; box-shadow: 0 2px 0 var(--edge); }
.projTeam button i { font-size: 1.15rem; }
.chips { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.pchip { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; position: relative; min-height: var(--chipH); border: 2px solid var(--edge); background: var(--cream-2); color: var(--ink); border-radius: 11px;
  font-weight: 700; font-size: .82rem; padding: 6px 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 0 var(--edge);
  transition: background .15s, border-color .15s; }
.pchip:active { transform: translateY(2px); box-shadow: none; }
.pchip.on { background: linear-gradient(var(--gold-l), var(--gold)); border-color: var(--gold-d); box-shadow: 0 2px 0 var(--gold-d); }
.pchip.bal.on { background: linear-gradient(var(--gold-l), var(--gold)); border-color: var(--gold-d); color: var(--ink); box-shadow: 0 2px 0 var(--gold-d); }
.pchip i { position: absolute; top: 1px; font-style: normal; font-size: .62rem; color: #fff; border-radius: 99px; padding: 0 3px; line-height: 13px;
  animation: pop .25s cubic-bezier(.3, 1.8, .5, 1); }
.pchip i.bA { inset-inline-start: 2px; background: var(--ta); }
.pchip i.bB { inset-inline-end: 2px; background: var(--tb); }
@keyframes pop { from { transform: scale(.3); } }

/* ---------- the line above the buttons: the next step, the projects question, or the result ---------- */
.resultLine { flex: none; margin: var(--gap) 10px 0; min-height: 50px; display: flex; align-items: center; justify-content: center; }
.stepHint { margin: 0; text-align: center; color: var(--gold-l); font-size: 1rem; font-weight: 700; }
.tieAsk { width: 100%; display: flex; align-items: center; gap: 8px; background: #fdf0cf; color: #7a5208; border-radius: 14px; padding: 5px 8px; font-weight: 700;
  font-size: .9rem; }
.tieAsk .seg { flex: 1; }
.tieAsk .seg button { min-height: 38px; }
.resultBtn { width: 100%; min-height: 50px; display: flex; align-items: center; gap: 8px; border: 2px dashed var(--gold); background: var(--cream); color: var(--ink);
  border-radius: 14px; padding: 4px 10px; animation: slide .25s ease; }
@keyframes slide { from { opacity: 0; transform: translateY(6px); } }
.verdict { font-weight: 700; font-size: .84rem; border-radius: 99px; padding: .1rem .7rem; background: var(--wine); color: #fff; white-space: nowrap; }
.v-lose { background: var(--red); }
.v-tie { background: var(--muted); }
.v-kaboot { background: linear-gradient(var(--gold-l), var(--gold)); color: var(--ink); }
.v-gahwa { background: var(--coffee); }
.v-plain { background: var(--ink); }
.v-raise { background: linear-gradient(var(--gold-l), var(--gold)); color: var(--ink); }
.rg { flex: 1; display: inline-flex; align-items: baseline; justify-content: center; gap: 5px; }
.rg small { font-weight: 700; color: var(--muted); font-size: .82rem; }
.rg b { direction: ltr; unicode-bidi: isolate; font-family: var(--fun); font-weight: 400; font-size: 1.6rem; line-height: 1; color: var(--ta); }
.rg[data-t="b"] b { color: var(--tb); }
.info { margin-inline-start: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .8rem;
  font-weight: 700; background: var(--cream-2); color: var(--muted); border: 1px solid var(--edge); flex: none; }

/* ---------- the bottom: undo beside record ---------- */
.actBar { flex: none; display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: var(--gap) 10px max(10px, env(safe-area-inset-bottom)); }
.actBar.coffee { grid-template-columns: 70px 70px 1fr; }
/* the coffee: dark roast with a cup; pressed while «من فاز بالقهوة؟» is open */
.coffeeBtn { display: grid; place-items: center; align-content: center; gap: 0; min-height: 56px; border: 2px solid #4a2a12; border-radius: 16px; color: #fff; font-weight: 700;
  background: linear-gradient(#8b5a33, var(--coffee)); box-shadow: 0 4px 0 #3a200d; }
.coffeeBtn span { font-size: 1.45rem; line-height: 1.1; }
.coffeeBtn small { font-size: .74rem; line-height: 1.2; }
.coffeeBtn:active { transform: translateY(2px); box-shadow: 0 2px 0 #3a200d; }
.coffeeBtn[aria-pressed="true"] { border-color: var(--gold-l); box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(242, 182, 50, .5); }
.coffeeBtn:disabled { opacity: .35; transform: none; }
.undoBtn { display: grid; place-items: center; align-content: center; gap: 0; min-height: 56px; border: 2px solid rgba(255, 255, 255, .25); border-radius: 16px;
  background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; }
.undoBtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.undoBtn small { font-size: .74rem; line-height: 1.2; }
.undoBtn:active { transform: translateY(2px); }
.undoBtn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.goBtn { display: block; width: 100%; min-height: 56px; border: 0; border-radius: 16px; font-family: var(--fun); font-weight: 400; font-size: 1.4rem;
  color: var(--ink); background: linear-gradient(var(--gold-l), var(--gold)); box-shadow: 0 5px 0 var(--gold-d), 0 10px 20px rgba(0, 0, 0, .3);
  transition: transform .08s, box-shadow .08s; }
.goBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--gold-d); }
.goBtn:disabled { background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .5); box-shadow: none; cursor: not-allowed; transform: none; }
.goBtn.danger { background: linear-gradient(#e2445c, var(--red)); color: #fff; box-shadow: 0 5px 0 var(--red-d), 0 10px 20px rgba(160, 26, 48, .3); }
.sheet .goBtn { margin-top: 12px; }
.sheet .goBtn:disabled { background: var(--cream-2); color: #b5ab94; box-shadow: 0 5px 0 var(--edge); }
.link { border: 0; background: none; color: var(--wine); font-weight: 700; padding: .3rem; }

/* ---------- sheets ---------- */
dialog.sheet { width: min(560px, 100%); max-height: 88dvh; margin: auto auto 0; border: 0; border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); background: var(--cream); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
dialog.sheet[open] { animation: up .25s cubic-bezier(.2, .9, .3, 1.1); }
dialog::backdrop { background: rgba(26, 2, 10, .62); backdrop-filter: blur(2px); }
@keyframes up { from { transform: translateY(40px); opacity: .3; } }
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 24px; } }
.sHead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sHead h2 { margin: 0; font-family: var(--fun); font-weight: 400; font-size: 1.35rem; color: var(--wine); margin-inline-end: auto; }
.sheet .iconBtn { color: var(--ink); border-color: var(--edge); background: #fff; }
.hint { margin: 8px 0; font-size: .84rem; color: var(--muted); }
.fld { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lbl { flex: 0 0 56px; font-weight: 700; color: var(--muted); font-size: .9rem; }
.fld .seg { flex: 1; }
.steps { margin: 0; padding-inline-start: 1.3rem; font-size: .95rem; color: var(--ink); display: grid; gap: 6px; }

/* the rounds, like the paper sheet: one column per team */
.hCols, .rounds li { display: grid; grid-template-columns: 26px 1fr 56px 56px; gap: 8px; align-items: center; }
.hCols { font-size: .82rem; color: var(--muted); font-weight: 700; padding: 4px 0; border-bottom: 2px solid var(--edge); }
.hCols span:nth-child(n+3) { text-align: center; }
.hCols .ca { color: var(--ta); }
.hCols .cb { color: var(--tb); }
.rounds { list-style: none; margin: 0; padding: 0; }
.rounds li { padding: 7px 0; border-bottom: 1px dashed var(--edge); }
.rN { color: var(--muted); font-size: .8rem; text-align: center; font-weight: 700; }
.rD { font-size: .84rem; color: var(--muted); min-width: 0; }
.rD em { font-style: normal; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 0 .45rem; background: var(--cream-2); color: var(--ink); }
.rD em.vLose { background: #fbe0e5; color: var(--red-d); }
.rD em.vGold { background: #fff1c9; color: #7a5208; }
.rD em.vCoffee { background: #ead0b2; color: #4a2a12; }
.rG { display: grid; justify-items: center; text-align: center; font-family: var(--fun); font-weight: 400; font-size: 1.4rem; line-height: 1.15; color: var(--ta); }
/* the total after each round, to find where a mistake started */
.rG small { font-family: var(--ui); font-weight: 700; font-size: .68rem; color: var(--muted); line-height: 1.2; }
.rEdit { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-inline-end: 4px; border-radius: 7px; background: var(--cream-2); color: var(--wine);
  font-size: .8rem; vertical-align: middle; }
.undoRow { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0 0 8px; padding: 0 12px; border: 2px solid #e6cf8f; border-radius: 13px;
  background: linear-gradient(#fff7e0, #fbe9b9); color: var(--ink); font-weight: 700; font-size: .92rem; text-align: start; box-shadow: 0 3px 0 #d8bd72; }
.undoRow svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.undoRow:active { transform: translateY(2px); box-shadow: 0 1px 0 #d8bd72; }
#roundsDlg.editMode #newGameBtn { display: none; }
.plClear { margin-top: 8px; border: 1.5px solid var(--edge); background: #fff; color: var(--red-d); border-radius: 10px; padding: .3rem .8rem; font-weight: 700; font-size: .84rem; }
.drawClear { padding: 0 .2rem; font-size: .84rem; text-decoration: underline; text-underline-offset: 3px; }
.rG + .rG { color: var(--tb); }
.empty { color: var(--muted); text-align: center; font-size: .9rem; margin: 14px 0 4px; }
.newBtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; min-height: 52px; border: 2px solid var(--wine);
  background: #fff; color: var(--wine); border-radius: 16px; font-weight: 700; font-size: 1.02rem; box-shadow: 0 4px 0 var(--wine); }
.newBtn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--wine); }
.newBtn span { font-size: 1.4rem; line-height: 1; }

/* rules */
.rules h3 { font-size: .98rem; margin: 16px 0 6px; color: var(--red-d); }
.rules h3:first-child { margin-top: 0; }
.rules p, .rules li { font-size: .92rem; line-height: 1.7; }
.rules ul { padding-inline-start: 1.2rem; margin: 6px 0; }
.tableWrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--edge); padding: 6px 8px; text-align: center; }
th { color: var(--muted); font-weight: 700; }
td:first-child, th:first-child { text-align: start; }

/* the cards picker */
.cardGrid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; direction: ltr; margin-bottom: 10px; }
.pc { aspect-ratio: 5 / 7; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; padding: 3px 0 2px; border-radius: 8px;
  border: 1px solid #d9cfb8; background: #fff; color: var(--ink); box-shadow: 0 2px 0 #d9cfb8; line-height: 1; transition: transform .14s cubic-bezier(.3, 1.6, .5, 1), box-shadow .14s; }
.pc b { font-size: .95rem; }
.pc span { font-size: 1.15rem; }
.pc small { font-size: .62rem; color: #8b836f; }
.pc.red { color: var(--red); }
.pc.trump { background: #fff6dc; border-color: #e3b55a; }
.pc.on { transform: translateY(-5px) rotate(-3deg); border: 2px solid var(--gold-d); background: #fff1c9; box-shadow: 0 8px 14px rgba(168, 117, 11, .35); }
.swRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; padding: 10px 0; position: relative; }
.swRow > span { display: grid; }
.swRow small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.sw { position: absolute; opacity: 0; inset-inline-end: 0; width: 52px; height: 30px; margin: 0; cursor: pointer; z-index: 1; }
.swT { width: 52px; height: 30px; border-radius: 99px; background: var(--edge); position: relative; flex: none; transition: background .2s; pointer-events: none; }
.swT::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: inset-inline-start .2s; }
.sw:checked + .swT { background: var(--wine); }
.sw:checked + .swT::after { inset-inline-start: 25px; }
.sw:focus-visible + .swT { outline: 3px solid var(--gold); }
.cFoot { display: flex; align-items: center; justify-content: space-between; }
/* «📷 صوّر الأوراق» (2026-10-27) */
.photoRow { margin: 0 0 10px; text-align: center; }
.photoBtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 1.1rem; border: 2px solid var(--gold-d); border-radius: 14px;
  background: linear-gradient(var(--gold-l), var(--gold)); color: var(--ink); font-weight: 800; font-size: 1rem; }
.photoBtn.busy { opacity: .75; }
.photoBtn .betaTag { background: var(--ink); color: var(--gold-l); }
.photoNote { margin: 6px 0 0; font-size: .74rem; color: var(--muted); line-height: 1.5; }
.cSum b { font-family: var(--fun); font-weight: 400; font-size: 1.8rem; color: var(--wine); }
.cSum small { color: var(--muted); font-size: .8rem; margin-inline-start: 4px; }

/* the menu */
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.names label { display: grid; gap: 4px; font-size: .86rem; font-weight: 700; color: var(--muted); }
.names i { font-style: normal; }
.field { width: 100%; border: 2px solid var(--edge); background: #fff; border-radius: 12px; padding: .55rem .7rem; font-weight: 700; color: var(--ink); }
.field:focus { outline: none; border-color: var(--gold); }
.setBox { border-top: 1px dashed var(--edge); border-bottom: 1px dashed var(--edge); margin: 8px 0 4px; }
.mItem { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; min-height: 50px; border: 2px solid var(--edge); background: #fff;
  border-radius: 14px; padding: 0 14px; font-weight: 700; margin-top: 8px; color: var(--ink); box-shadow: 0 3px 0 var(--edge); }
.mItem span { font-size: 1.3rem; line-height: 1; }
.mItem.quiet { color: var(--muted); font-weight: 600; }
.mLinks { margin: 14px 0 0; text-align: center; font-size: .86rem; }
.mLinks a { color: var(--wine); font-weight: 700; text-decoration: none; }
.win, .ask { text-align: center; }
.win .trophy { font-size: 3.6rem; line-height: 1.2; animation: bounce 1s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bounce { from { transform: scale(.2) rotate(-30deg); } }
.win h2, .ask h2 { margin: 0; font-family: var(--fun); font-weight: 400; font-size: 1.9rem; color: var(--wine); }
.win p, .ask p { margin: 4px 0 6px; color: var(--muted); font-weight: 600; }
.win .mItem, .ask .mItem { justify-content: center; }
.askIco { font-size: 3rem; line-height: 1.1; color: var(--red); }

/* confetti of suits for the winner */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti i { position: absolute; top: -50px; font-style: normal; animation: fall linear forwards; text-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
@keyframes fall { to { transform: translateY(115vh) rotate(var(--r)); } }

.toast { position: fixed; inset-inline: 0; bottom: calc(132px + env(safe-area-inset-bottom)); margin: 0 auto; width: max-content; max-width: calc(100% - 32px);
  background: var(--ink); color: #fff; padding: .55rem 1rem; border-radius: 14px; font-weight: 600; font-size: .9rem; opacity: 0; transform: translateY(10px);
  transition: .25s; pointer-events: none; z-index: 120; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); border: 1px solid rgba(255, 217, 112, .4); }
.toast.show { opacity: 1; transform: none; }
/* a toast with an action («إعادة» after an undo) can be tapped */
.toast.act { display: flex; align-items: center; gap: 10px; pointer-events: auto; padding-inline-end: .5rem; }
.toast.act:not(.show) { pointer-events: none; }
.toast button { flex: none; border: 0; border-radius: 10px; padding: .3rem .8rem; background: linear-gradient(var(--gold-l), var(--gold)); color: var(--ink); font-weight: 800; }

/* short screens (small phones, a browser with big bars): buyer and sun/hokm share one row, the cards get smaller */
@media (max-height: 680px) {
  .entry { display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
  .entry > * { grid-column: 1 / -1; }
  .entry > .buyRow { grid-column: 1; }
  .entry > #modeSeg { grid-column: 2; }
  .seg.big button { font-size: 1.05rem; gap: 3px; }
  .bTop { padding-bottom: 2px; }
  .board { padding-top: 4px; }
  .pcard { padding: 12px 6px 6px; }
  .tName { font-size: .8rem; }
  .chip152 { width: 38px; height: 38px; font-size: .9rem; }
  .dealBtn { --dt: 84px; --sd: 19px; --tw: 26px; --th: 34px; gap: 11px; }
  .dealWho { padding: 2px 10px 3px; }
  .dealWho b { font-size: .95rem; }
  .newsBtn span { display: none; }
  .midRow { display: flex; gap: 3px; }
  .mid { gap: 3px; }
  .resultLine, .resultBtn { min-height: 44px; }
  .goBtn, .undoBtn, .coffeeBtn { min-height: 50px; }
}
@media (max-height: 680px) and (min-width: 0) { :root { --scoreF: clamp(1.8rem, 6.2dvh, 2.6rem); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
#voiceKindSeg button.on, #newsModeSeg button.on { background: var(--wine); border-color: var(--wine-d); color: #fff; box-shadow: 0 3px 0 var(--wine-d); }

/* ---------- «دق الولد»: the partners' draw ---------- */
.resultLine { gap: 10px; }
.drawPill { flex: none; display: inline-flex; align-items: center; gap: 9px; min-height: 46px; border: 2px solid var(--gold); border-radius: 14px; padding: 0 1rem 0 .85rem;
  background: linear-gradient(rgba(255, 217, 112, .26), rgba(242, 182, 50, .12)); color: var(--gold-l); font-weight: 700; font-size: 1.06rem; white-space: nowrap;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .3), 0 0 16px rgba(242, 182, 50, .25); }
.drawPill:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
/* two jacks fanned, one black and one red */
.jfan { position: relative; width: 30px; height: 28px; flex: none; direction: ltr; }
.jfan i { position: absolute; bottom: 0; width: 18px; height: 25px; display: grid; align-content: center; justify-items: center; border-radius: 3px; background: #fffaf0;
  font-style: normal; font-family: var(--ui); font-weight: 700; font-size: .7rem; line-height: .95; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); transform-origin: 50% 100%; }
.jfan small { font-size: .62rem; }
.jfan i:nth-child(1) { left: 2px; color: var(--ink); transform: rotate(-14deg); }
.jfan i:nth-child(2) { left: 11px; color: var(--red); transform: rotate(12deg); }
.drawSheet .hint { text-align: center; margin-top: 0; }
.dtable { position: relative; width: min(330px, 100%); aspect-ratio: 1 / 1; margin: 6px auto 8px; border-radius: 30px; overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cpath d='M13 0L26 13L13 26L0 13Z' fill='none' stroke='%23ffd970' stroke-opacity='.1'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 45%, var(--wine-l), var(--wine) 60%, var(--wine-x));
  box-shadow: inset 0 0 0 5px var(--wine-d), inset 0 0 0 7px rgba(255, 217, 112, .5), 0 10px 24px rgba(0, 0, 0, .3); }
.seat { position: absolute; display: grid; justify-items: center; gap: 5px; width: 92px; z-index: 1; }
.seat.s0 { bottom: 10px; left: 50%; transform: translateX(-50%); }
.seat.s2 { top: 10px; left: 50%; transform: translateX(-50%); }
.seat.s1 { right: 8px; top: 50%; transform: translateY(-50%); }
.seat.s3 { left: 8px; top: 50%; transform: translateY(-50%); }
.seat input { width: 86px; text-align: center; border: 1.5px solid rgba(255, 217, 112, .6); background: rgba(0, 0, 0, .3); color: #fff; border-radius: 99px;
  padding: 2px 6px; font-weight: 700; font-size: .78rem; transition: background .3s, border-color .3s; }
.seat input::placeholder { color: rgba(255, 255, 255, .8); }
.seat input:disabled { opacity: 1; }
.seat .slot { width: 46px; height: 64px; border-radius: 7px; border: 1.5px dashed rgba(255, 217, 112, .45); transition: box-shadow .3s; }
.seat.got.black .slot, .seat.team.black .slot { box-shadow: 0 0 0 3px #fff, 0 0 18px rgba(255, 255, 255, .6); }
.seat.got.red .slot, .seat.team.red .slot { box-shadow: 0 0 0 3px var(--gold-l), 0 0 18px rgba(255, 217, 112, .8); }
.seat.team.black input { background: var(--ink); border-color: #fff; }
.seat.team.red input { background: var(--red); border-color: var(--gold-l); }
.deck { position: absolute; left: 50%; top: 50%; width: 46px; height: 64px; margin: -32px 0 0 -23px; }
/* the back: the KulliQ logo in the middle (the owner, 2026-10-29), on the burgundy lattice */
.deck i, .fcard .bk { position: absolute; inset: 0; border-radius: 6px; border: 2px solid #fffaf0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Crect x='1' y='1' width='58' height='58' rx='17' fill='%23fffaf0'/%3E%3Cg transform='translate%286 6%29'%3E%3Crect width='48' height='48' rx='13' fill='%237a1430'/%3E%3Cpath d='M21.2 9h5.6l-1.5 20.5h-2.6z' fill='%23e8c36a'/%3E%3Ccircle cx='24' cy='36.5' r='3.3' fill='%23e8c36a'/%3E%3C/g%3E%3C/svg%3E") center / 46% auto no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M5 0L10 5L5 10L0 5Z' fill='%23ffd970' fill-opacity='.35'/%3E%3C/svg%3E"), linear-gradient(135deg, #b52a4c, #6b0d26);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.deck i:nth-child(1) { transform: translate(-3px, 3px) rotate(-4deg); }
.deck i:nth-child(2) { transform: translate(2px, 1px) rotate(3deg); }
.fcard { position: absolute; left: 0; top: 0; width: 46px; height: 64px; z-index: 2; perspective: 400px; transition: transform .36s cubic-bezier(.2, .8, .3, 1); }
.fcard .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .3s ease; }
.fcard.up .in { transform: rotateY(180deg); }
.fcard .bk, .fcard .fc { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fcard .fc { position: absolute; inset: 0; border-radius: 6px; transform: rotateY(180deg); background: #fffaf0; border: 1px solid #e2d6bb; color: var(--ink);
  display: grid; align-content: center; justify-items: center; line-height: 1; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.fcard .fc.red { color: var(--red); }
.fcard .fc b { font-size: 1.15rem; }
.fcard .fc span { font-size: 1.35rem; }
.fcard.dim { opacity: .78; filter: saturate(.7); }
.fcard.jack { z-index: 3; }
.fcard.jack .fc { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(255, 217, 112, .95); animation: jackPop .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes jackPop { 40% { transform: rotateY(180deg) scale(1.35); } }
.drawResult { display: grid; gap: 6px; margin-bottom: 4px; animation: slide .3s ease; }
.drawResult p { margin: 0; text-align: center; color: var(--muted); font-size: .84rem; font-weight: 600; }
.dteam { display: flex; align-items: center; gap: 10px; border-radius: 14px; padding: 8px 12px; color: #fff; font-weight: 700; }
.dteam.black { background: var(--ink); }
.dteam.red { background: var(--red); }
.dteam i { font-style: normal; font-size: 1.1rem; letter-spacing: 2px; background: rgba(255, 255, 255, .92); border-radius: 99px; padding: 0 .5rem; }
.dteam.black i { color: var(--ink); }
.dteam.red i { color: var(--red); }
.dteam b { font-size: 1.05rem; }

/* editing a recorded round */
.editBar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: #fdf0cf; color: #7a5208; font-weight: 700; font-size: .9rem; }
.editBar > span { margin-inline-end: auto; }
.editBar button { border: 1.5px solid currentColor; background: #fff; border-radius: 9px; padding: .15rem .55rem; font-weight: 700; font-size: .8rem; }
.editBar .editDel { color: var(--red-d); }
.editBar .editCancel { color: var(--muted); }
.rounds li { cursor: pointer; border-radius: 8px; }
.rounds li:active, .rounds li:focus-visible { background: var(--cream-2); outline: none; }

/* ✕ clears the chosen team's projects */
.projClear { flex: none; width: 32px; min-height: var(--chipH); border: 2px solid var(--edge); background: #fff; color: var(--red-d); border-radius: 11px;
  font-weight: 800; font-size: .95rem; box-shadow: 0 2px 0 var(--edge); }
.projClear:disabled { opacity: .35; }

/* players' names in the menu */
.players { margin: 6px 0; }
.players > b { font-size: .9rem; }
.players > b small { color: var(--muted); font-weight: 600; font-size: .74rem; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.pgrid label { display: grid; gap: 3px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.plHint { margin: 6px 0 0; font-size: .78rem; }

/* «دق الولد» on the whole screen: bigger table, cards, names and result */
dialog.full { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding-top: max(12px, env(safe-area-inset-top)); }
dialog.full[open] { display: flex; flex-direction: column; }
@media (min-width: 640px) { dialog.full { width: min(560px, 100%); margin: auto; border-radius: 24px; height: min(100dvh, 860px); } }
/* «دق الولد» v2 (2026-10-21, owner: «فخم، والورق أكبر وأوضح عشان الكل يشوف أي ولد جاه»): a tall felt table that takes
   the screen, the cards sized from the table (container units), each jack shown big in the middle with its holder's
   name, and under the table a man who scratches his chin waiting for his partner. The foot and the buttons keep one
   height, so the table never changes size while cards are in the air. */
.drawSheet .hint { flex: none; margin: 0 0 6px; font-size: .8rem; }
.drawSheet .dtable { flex: 1 1 0; min-height: 250px; width: 100%; aspect-ratio: auto; margin: 0 0 8px; border-radius: 34px; container-type: size;
  --cw: clamp(40px, min(23cqw, (100cqh - 160px) / 4.2), 112px); --ch: calc(var(--cw) * 1.4);
  background:
    radial-gradient(60% 45% at 50% 50%, rgba(255, 217, 112, .16), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cpath d='M15 0L30 15L15 30L0 15Z' fill='none' stroke='%23ffd970' stroke-opacity='.09'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 45%, #9e1e40, var(--wine) 55%, #3a0614);
  box-shadow: inset 0 0 0 6px #3a0614, inset 0 0 0 8px rgba(255, 217, 112, .8), inset 0 0 0 10px #3a0614, inset 0 0 46px rgba(0, 0, 0, .5), 0 12px 26px rgba(0, 0, 0, .3); }
.drawSheet .seat { width: max(var(--cw), min(112px, 31cqw)); gap: 5px; }
.drawSheet .seat.s0 { bottom: 14px; }
.drawSheet .seat.s2 { top: 14px; }
.drawSheet .seat.s1 { right: 12px; }
.drawSheet .seat.s3 { left: 12px; }
.drawSheet .seat input { width: min(112px, 31cqw); padding: 4px 8px; font-size: 16px; font-weight: 800; border: 1.5px solid rgba(255, 217, 112, .75); background: rgba(20, 2, 8, .55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: background .3s, border-color .3s, box-shadow .3s, transform .3s; }
.drawSheet .seat.turn input { border-color: var(--gold-l); box-shadow: 0 0 0 3px rgba(255, 217, 112, .45), 0 0 16px rgba(255, 217, 112, .5); }
.drawSheet .seat.got input { transform: scale(1.06); }
.drawSheet .seat .slot, .drawSheet .deck, .drawSheet .fcard { width: var(--cw); height: var(--ch); }
.drawSheet .seat .slot { border-radius: calc(var(--cw) * .1); border: 1.5px dashed rgba(255, 217, 112, .4); }
.drawSheet .deck { margin: calc(var(--ch) / -2) 0 0 calc(var(--cw) / -2); }
/* the cards: a wine back with a gold frame; a cream face with corner signs, a big rank and suit; a jack: gold, a crown */
.drawSheet .deck i, .drawSheet .fcard .bk { border-radius: calc(var(--cw) * .1);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Crect x='1' y='1' width='58' height='58' rx='17' fill='%23fffaf0'/%3E%3Cg transform='translate%286 6%29'%3E%3Crect width='48' height='48' rx='13' fill='%237a1430'/%3E%3Cpath d='M21.2 9h5.6l-1.5 20.5h-2.6z' fill='%23e8c36a'/%3E%3Ccircle cx='24' cy='36.5' r='3.3' fill='%23e8c36a'/%3E%3C/g%3E%3C/svg%3E") center / 46% auto no-repeat, /* the KulliQ logo (2026-10-29) */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M5 0L10 5L5 10L0 5Z' fill='%23ffd970' fill-opacity='.32'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #b52a4c, #5c0b20);
  box-shadow: inset 0 0 0 calc(var(--cw) * .05) #5c0b20, inset 0 0 0 calc(var(--cw) * .065) rgba(255, 217, 112, .7), 0 3px 6px rgba(0, 0, 0, .4); }
.dtable .fc { border-radius: calc(var(--cw) * .1); background: linear-gradient(160deg, #fffdf6, #f3ead2); border: 1px solid #d8c9a2; color: var(--ink);
  display: grid; place-content: center; justify-items: center; line-height: 1;
  box-shadow: inset 0 0 0 calc(var(--cw) * .05) #fffdf6, inset 0 0 0 calc(var(--cw) * .065) rgba(168, 117, 11, .35), 0 3px 6px rgba(0, 0, 0, .35); }
.dtable .fc.red { color: var(--red); }
.dtable .fc b { font-family: var(--fun); font-weight: 400; font-size: calc(var(--cw) * .5); line-height: .95; }
.dtable .fc span { font-size: calc(var(--cw) * .4); }
.dtable .fc em { position: absolute; top: 6%; left: 9%; display: grid; justify-items: center; font-style: normal; font-weight: 800; font-size: calc(var(--cw) * .19); line-height: .95; }
.dtable .fc em i { font-style: normal; }
.dtable .fc em.br { top: auto; left: auto; bottom: 6%; right: 9%; transform: rotate(180deg); }
.dtable .fc.j { background: linear-gradient(160deg, #fff6d6, #f1d684);
  box-shadow: inset 0 0 0 calc(var(--cw) * .05) #fff6d6, inset 0 0 0 calc(var(--cw) * .075) var(--gold), 0 3px 6px rgba(0, 0, 0, .35); }
.dtable .fc .jcrown { width: calc(var(--cw) * .44); height: auto; margin-bottom: 1px; fill: var(--gold-d); }
.drawSheet .fcard.jack .fc { box-shadow: inset 0 0 0 calc(var(--cw) * .05) #fff6d6, inset 0 0 0 calc(var(--cw) * .075) var(--gold), 0 0 0 4px var(--gold), 0 0 26px rgba(255, 217, 112, 1); }
.drawSheet .fcard.dim { opacity: .82; filter: saturate(.75) brightness(.96); }
/* a jack in the middle of the table, big, with its holder's name */
.jackShow { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; justify-items: center; gap: 8px; overflow: hidden; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255, 217, 112, .22), rgba(20, 2, 8, .84) 62%); animation: jsIn .22s ease both; }
.jackShow.out { animation: jsOut .2s ease forwards; }
.jackShow::before { content: ""; position: absolute; left: 50%; top: 45%; width: 170cqmax; height: 170cqmax; margin: -85cqmax 0 0 -85cqmax; opacity: .45;
  background: repeating-conic-gradient(rgba(255, 217, 112, .5) 0 6deg, transparent 6deg 20deg); animation: spin 14s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 0 12%, transparent 50%); mask: radial-gradient(circle, #000 0 12%, transparent 50%); }
.jsCard { --cw: clamp(80px, min(32cqw, 30cqh), 170px); position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); animation: jsPop .5s cubic-bezier(.3, 1.7, .5, 1) both; }
.jsCard .fc { position: absolute; inset: 0; }
.jsCard .fc.j { box-shadow: inset 0 0 0 calc(var(--cw) * .05) #fff6d6, inset 0 0 0 calc(var(--cw) * .075) var(--gold), 0 0 0 5px var(--gold), 0 0 40px rgba(255, 217, 112, .95); }
/* a standard face (2026-10-29): its place in img/cards.webp (or img/jacks.webp), set on the card by cardFace(). A thin
   white margin round the picture and a real card's small corners, so the corner index shows whole; a jack's gold
   frame outside the card, not over its edge (the owner's phone showed both cut, 2026-10-30). The padding keeps 5:7. */
.dtable .fc.pic, .dtable .fc.pic.j { padding: 5.6% 4%; border-radius: calc(var(--cw) * .06); border-color: #d9d2c4; overflow: hidden;
  background: var(--img) var(--bx) var(--by) / var(--bw) var(--bh) no-repeat content-box, #fff; }
.drawSheet .fcard.jack .fc.pic, .dtable .jsCard .fc.pic.j { box-shadow: 0 0 0 calc(var(--cw) * .045) var(--gold), 0 0 26px rgba(255, 217, 112, 1); }
.jsWho { position: relative; max-width: 90cqw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--fun); font-weight: 400;
  font-size: clamp(1.6rem, 10cqw, 2.6rem); line-height: 1.15; color: var(--gold-l); text-shadow: 0 3px 0 rgba(0, 0, 0, .45), 0 0 20px rgba(242, 182, 50, .5);
  animation: bounce .6s cubic-bezier(.3, 1.8, .5, 1) .1s both; }
.jsWhat { position: relative; padding: 3px 14px; border-radius: 99px; background: #fffaf0; color: var(--ink); font-weight: 800; font-size: 1.02rem; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.jsWhat.red { color: var(--red); }
@keyframes jsIn { from { opacity: 0; } }
@keyframes jsOut { to { opacity: 0; } }
@keyframes jsPop { from { transform: scale(.25) rotate(-14deg); opacity: 0; } }
/* under the table: the man who waits for his partner, then the two teams */
.drawFoot { flex: none; display: flex; align-items: center; gap: 10px; height: 108px; margin-bottom: 8px; }
.thinker { position: relative; flex: none; margin: 0; width: 106px; height: 106px; }
.thinkSay { position: relative; flex: 1; margin: 0; padding: 10px 14px; border-radius: 18px; background: #fff; border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--edge);
  color: var(--ink); font-weight: 800; font-size: 1.02rem; line-height: 1.45; }
.thinkSay::before { content: ""; position: absolute; right: -9px; top: calc(50% - 8px); width: 14px; height: 14px; background: #fff;
  border-top: 2px solid var(--edge); border-right: 2px solid var(--edge); transform: rotate(45deg); }
.thinkPop { position: absolute; right: 0; bottom: calc(100% - 4px); white-space: nowrap; padding: 3px 10px; border-radius: 12px; background: linear-gradient(var(--gold-l), var(--gold));
  color: var(--ink); font-weight: 800; font-size: .86rem; box-shadow: 0 2px 0 var(--gold-d), 0 4px 10px rgba(0, 0, 0, .2); transform-origin: 80% 100%;
  animation: bounce .6s cubic-bezier(.3, 1.8, .5, 1) both; }
.thinkPop:empty { display: none; }
.drawFoot .drawResult { flex: 1; align-content: center; gap: 6px; margin: 0; }
.drawFoot .dteam { min-height: 40px; padding: 4px 12px; border-radius: 14px; border: 2px solid rgba(255, 217, 112, .6); box-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.drawFoot .dteam b { font-size: 1.12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawFoot .dteam i { font-size: 1rem; }
.drawFoot .drawResult p { font-size: .76rem; }
.drawBtns { flex: none; display: flex; gap: 8px; }
.drawBtns .goBtn { flex: 1; width: auto; }
.drawApply { flex: 1; min-height: 56px; border: 2px solid var(--gold-d); border-radius: 16px; background: #fff; color: var(--ink); font-weight: 800; font-size: 1rem; line-height: 1.25;
  box-shadow: 0 4px 0 var(--gold-d); }
.drawApply:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-d); }
/* the man: two pictures, thinking (a slow sway, faster while the cards are dealt) and laughing (a quick bounce) */
.thkImg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transform-origin: 50% 90%;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .18)); transition: opacity .25s; }
.thkThink { animation: thkMuse 4s ease-in-out infinite; }
.thkLaugh { opacity: 0; }
.thinker.busy .thkThink { animation-duration: 1.6s; }
.thinker.laugh .thkThink { opacity: 0; }
.thinker.laugh .thkLaugh { opacity: 1; animation: thkHaha .3s ease-in-out infinite alternate; }
@keyframes thkMuse { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-1px); } }
@keyframes thkHaha { from { transform: rotate(-3deg); } to { transform: rotate(1.5deg) translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .thkImg, .thinker.laugh .thkLaugh { animation: none; } }
.drawSheet .sHead .drawClear { flex: none; font-size: .84rem; }
/* «قرعة المجلس» (2026-10-26) */
.mjList { display: grid; gap: 8px; margin: 4px 0 8px; }
.mjRow { display: flex; gap: 8px; align-items: center; }
.mjRow .field { flex: 1; min-width: 0; transition: border-color .12s, background .12s, opacity .2s; }
.mjDel { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--edge); background: #fff; color: var(--ink); font-weight: 800; }
.mjAdd { display: block; margin: 0 auto 10px; padding: .45rem 1.1rem; border-radius: 99px; border: 1.5px dashed var(--edge); background: none; color: var(--ink); font-weight: 800; }
.mjRow.lit .field { border-color: var(--gold-l); background: #fffbea; }
.mjRow.in .field { border-color: var(--gold); background: #ffefc0; }  /* gold, never green on this page */
.mjRow.out .field { opacity: .45; }
.mjOut { margin: 0 0 10px; text-align: center; font-weight: 700; line-height: 1.7; }
.mjOut p { margin: 0; }
/* a short screen: no rules line, a smaller man and result, so the table and its cards keep their room */
@media (max-height: 740px) {
  .drawSheet .hint { display: none; }
  .drawFoot { height: 84px; margin-bottom: 6px; }
  .thinker { width: 84px; height: 84px; }
  .thinkSay { padding: 7px 11px; font-size: .9rem; }
  .drawFoot .dteam { min-height: 34px; padding: 2px 10px; }
  .drawFoot .dteam b { font-size: 1rem; }
  .drawFoot .drawResult p { display: none; }
  .drawBtns .goBtn, .drawApply { min-height: 48px; }
}
@media (max-height: 600px) {
  .drawFoot { height: 64px; }
  .thinker { width: 62px; height: 62px; }
  .thinkSay { padding: 5px 9px; font-size: .82rem; line-height: 1.35; }
  .drawFoot .dteam { min-height: 28px; }
  .drawFoot .dteam b { font-size: .92rem; }
}
.newsHint { margin: -4px 0 6px; font-size: .74rem; }

/* ---------- the coffee is won: a dancer and the music ---------- */
.party { position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; overflow: hidden;
  padding: max(14px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom)); text-align: center; color: #fff;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cpath d='M17 0L34 17L17 34L0 17Z' fill='none' stroke='%23ffd970' stroke-opacity='.1'/%3E%3C/svg%3E"),
    radial-gradient(90% 60% at 50% 42%, #6b3e1e, var(--wine-d) 55%, var(--wine-x));
  animation: partyIn .35s ease; }
@keyframes partyIn { from { opacity: 0; } }
.party.out { animation: partyOut .3s ease forwards; }
@keyframes partyOut { to { opacity: 0; } }
.pRays { position: absolute; left: 50%; top: 42%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax; pointer-events: none; opacity: .3;
  background: repeating-conic-gradient(from 0deg, rgba(255, 217, 112, .55) 0 7deg, transparent 7deg 22deg); animation: spin 16s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 55%); mask: radial-gradient(circle, #000 0 18%, transparent 55%); }
@keyframes spin { to { transform: rotate(360deg); } }
.pStage { position: relative; z-index: 1; display: flex; justify-content: center; align-items: flex-end; gap: 2vw; }
.pStage::before { content: ""; position: absolute; left: 50%; bottom: 22px; width: 110%; height: 30%; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 217, 112, .4), transparent); }
.pD { position: relative; margin: 0; display: grid; justify-items: center; }
.dancer { position: relative; display: block; height: min(44dvh, 330px, 64vw); width: auto; aspect-ratio: 220 / 320; overflow: visible;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .35)); --b: .469s; }
/* the partner: mirrored (the two dance as a pair) and in a white ghutra */
.pD + .pD .dancer { transform: scaleX(-1); }
.pD + .pD .dancer .shm { fill: #f8f7f2; stroke: #d6d2c6; }
/* the dancers are two pictures the owner made (2026-10-29; the drawn ones' shemagh was wrong). They dance
   (2026-10-30, owner: «قبل كانت تتحرك وترقص»): each picture twice, its upper half rocking from the waist and its
   lower half stepping, the whole bouncing on the beat and turning round every two bars; the second one a beat later */
.dancer.pic { position: relative; height: min(40dvh, 320px, 64vw); width: auto; aspect-ratio: var(--ar); transform: none;
  animation: dzBounce var(--b) ease-in-out infinite, dzTurn calc(var(--b) * 16) linear infinite; }
.dancer.pic img { position: absolute; inset: 0; width: 100%; height: 100%; }
.dancer.pic .dzL { clip-path: inset(45% 0 0 0); transform-origin: 50% 100%; animation: dzStep calc(var(--b) * 2) ease-in-out infinite; }
.dancer.pic .dzU { clip-path: inset(0 0 51% 0); transform-origin: 50% 49%; animation: dzRock calc(var(--b) * 2) ease-in-out infinite; }
.pD + .pD .dancer.pic, .pD + .pD .dancer.pic img { animation-delay: calc(var(--b) * -1); }
@keyframes dzBounce { 0%, 100% { translate: 0 0; } 45% { translate: 0 -6%; } }
@keyframes dzTurn { 0%, 49.9% { scale: 1 1; } 50%, 100% { scale: -1 1; } }
@keyframes dzRock { 0%, 100% { rotate: -9deg; } 50% { rotate: 9deg; } }
@keyframes dzStep { 0%, 100% { rotate: 3deg; translate: -3% 0; } 50% { rotate: -3deg; translate: 3% 0; } }
@media (prefers-reduced-motion: reduce) { .dancer.pic, .dancer.pic img { animation: none; } }
@keyframes hop { to { translate: 0 -8%; } }
.pName { margin-top: -6px; max-width: 46vw; padding: 2px 14px 3px; border-radius: 99px; background: linear-gradient(var(--gold-l), var(--gold)); color: var(--ink);
  font-family: var(--fun); font-size: clamp(1.15rem, 3.4dvh, 1.6rem); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 3px 0 var(--gold-d), 0 0 18px rgba(242, 182, 50, .45); animation: bounce .8s cubic-bezier(.3, 1.8, .5, 1) .3s both; }
.pName:empty { display: none; }
/* fireworks */
.pFx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fw { position: absolute; width: 0; height: 0; }
.fw i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c);
  animation: fw 1.1s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes fw { 0% { transform: rotate(var(--a)) translateY(0) scale(1.2); opacity: 1; } 70% { opacity: 1; } 100% { transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) scale(.4); opacity: 0; } }
.dancer * { transform-box: view-box; }
.dancer .skin { fill: #d9a574; }
.dancer .sleeve { fill: #fbfaf5; stroke: #cfcabd; stroke-width: 1.5; }
.dancer .dEye { fill: #2b1d14; transform-origin: 110px 81px; animation: blink 3.2s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.dancer .dShadow { fill: rgba(0, 0, 0, .35); transform-origin: 110px 306px; animation: dShadow var(--b) ease-in-out infinite; }
@keyframes dShadow { 50% { transform: scale(.82); } }
.dancer .dSway { transform-origin: 110px 300px; animation: dSway calc(var(--b) * 4) ease-in-out infinite; }
@keyframes dSway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.dancer .dBounce { animation: dBounce var(--b) ease-in-out infinite; }
@keyframes dBounce { 50% { transform: translateY(-13px); } }
.dancer .dFoot path { fill: #3b2314; }
.dancer .dFoot rect { fill: #ece7da; }
.dancer .dFootL { animation: dStep calc(var(--b) * 2) ease-in-out infinite; }
.dancer .dFootR { animation: dStep calc(var(--b) * 2) ease-in-out infinite calc(var(--b) * -1); }
@keyframes dStep { 0%, 50%, 100% { transform: translateY(0); } 25% { transform: translateY(-11px); } }
.dancer .dThobe { transform-origin: 110px 120px; animation: dSwish calc(var(--b) * 2) ease-in-out infinite; }
@keyframes dSwish { 0%, 100% { transform: skewX(5deg); } 50% { transform: skewX(-5deg); } }
.dancer .dHead { transform-origin: 110px 108px; animation: dHead calc(var(--b) * 2) ease-in-out infinite; }
@keyframes dHead { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.dancer .dFlapL { transform-origin: 92px 92px; animation: dFlapL var(--b) ease-in-out infinite alternate; }
.dancer .dFlapR { transform-origin: 128px 92px; animation: dFlapR var(--b) ease-in-out infinite alternate; }
@keyframes dFlapL { from { transform: rotate(-6deg); } to { transform: rotate(10deg); } }
@keyframes dFlapR { from { transform: rotate(6deg); } to { transform: rotate(-10deg); } }
/* the arms take turns up and down; the dallah and the finjan stay upright in the hands */
.dancer .dArmL { transform-origin: 80px 130px; animation: dArmL calc(var(--b) * 2) ease-in-out infinite; }
.dancer .dForeL { transform-origin: 80px 164px; animation: dForeL calc(var(--b) * 2) ease-in-out infinite; }
.dancer .dHoldL { transform-origin: 80px 204px; animation: dHoldL calc(var(--b) * 2) ease-in-out infinite; }
.dancer .dArmR { transform-origin: 140px 130px; animation: dArmR calc(var(--b) * 2) ease-in-out infinite; }
.dancer .dForeR { transform-origin: 140px 164px; animation: dForeR calc(var(--b) * 2) ease-in-out infinite; }
.dancer .dHoldR { transform-origin: 140px 204px; animation: dHoldR calc(var(--b) * 2) ease-in-out infinite; }
@keyframes dArmL { 0%, 100% { transform: rotate(30deg); } 50% { transform: rotate(150deg); } }
@keyframes dForeL { 0%, 100% { transform: rotate(55deg); } 50% { transform: rotate(25deg); } }
@keyframes dHoldL { 0%, 100% { transform: rotate(-85deg); } 50% { transform: rotate(-175deg); } }
@keyframes dArmR { 0%, 100% { transform: rotate(-150deg); } 50% { transform: rotate(-30deg); } }
@keyframes dForeR { 0%, 100% { transform: rotate(-25deg); } 50% { transform: rotate(-55deg); } }
@keyframes dHoldR { 0%, 100% { transform: rotate(175deg); } 50% { transform: rotate(85deg); } }
.pTitle { position: relative; z-index: 1; margin: 0 0 6px; font-family: var(--fun); font-weight: 400; font-size: clamp(1.8rem, 5.4dvh, 2.6rem); line-height: 1.2;
  color: var(--gold-l); text-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 0 22px rgba(242, 182, 50, .55); animation: bounce .8s cubic-bezier(.3, 1.8, .5, 1); }
.pSub { position: relative; z-index: 1; margin: 10px 0 12px; font-weight: 700; font-size: 1.1rem; opacity: .92; direction: rtl; }
.party .goBtn { position: relative; z-index: 1; max-width: 320px; }
.pNotes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pNotes i { position: absolute; bottom: 30%; font-style: normal; line-height: 1; color: var(--gold-l); text-shadow: 0 2px 6px rgba(0, 0, 0, .4); animation: noteUp 2.6s ease-out forwards; }
@keyframes noteUp { 0% { opacity: 0; transform: translateY(20px) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), -46vh) rotate(var(--r)) scale(1.1); } }
/* the league's champions: the party's colours, standing still in a double frame (owner, 2026-11-03). --u is one pixel on
   a phone and grows with the screen, so the words fill a TV; a phone on its side still holds it all. vh, not dvh: a
   TV's browser may be old. The button grows more slowly: the names are what the room reads */
.champ { --u: min(calc(100vw / 390), calc(100vh / 420)); gap: 0; padding-inline: calc(var(--u) * 26); }
.champ::before { content: ""; position: absolute; pointer-events: none;
  inset: max(calc(var(--u) * 14), env(safe-area-inset-top)) max(calc(var(--u) * 14), env(safe-area-inset-right)) max(calc(var(--u) * 14), env(safe-area-inset-bottom)) max(calc(var(--u) * 14), env(safe-area-inset-left));
  border: calc(var(--u) * 2) solid var(--gold-l); border-radius: calc(var(--u) * 18); outline: var(--u) solid var(--gold-l); outline-offset: calc(var(--u) * -8); }
.chT { position: relative; font-size: calc(var(--u) * 70); line-height: 1.1; margin-bottom: calc(var(--u) * 8); }
.champ .pTitle { margin: 0; font-size: calc(var(--u) * 42); animation: none; }
.champ .pSub { margin: calc(var(--u) * 6) 0 calc(var(--u) * 26); font-size: calc(var(--u) * 18); opacity: .85; }
.champ .pStage { flex-wrap: wrap; gap: calc(var(--u) * 10); margin: 0 0 calc(var(--u) * 34); }
.champ .pStage::before { display: none; }
.champ .pName { margin: 0; max-width: 88vw; padding: calc(var(--u) * 6) calc(var(--u) * 22) calc(var(--u) * 7); font-size: calc(var(--u) * 26); animation: none; }
.champ .goBtn { width: min(100%, calc(var(--u) * 200 + 120px)); max-width: 100%; min-height: calc(var(--u) * 24 + 32px); font-size: calc(var(--u) * 9 + 12px); }
.dp i.red { color: #ff9aa9; }

/* «لسّا ما فطروا»: a bubble on the late team's card, a hungry shake, breakfast floating up */
.fatoor { position: absolute; left: 50%; top: 52%; z-index: 5; display: grid; justify-items: center; padding: 5px 12px 7px; border-radius: 16px;
  background: #fff6dc; color: var(--ink); border: 2px solid var(--gold-d); font-weight: 800; font-size: .92rem; line-height: 1.2; white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35); pointer-events: none; transform: translate(-50%, -50%) rotate(-6deg);
  animation: fatIn .55s cubic-bezier(.3, 1.8, .5, 1), fatOut .4s ease 4.3s forwards; }
.fatoor b { font-size: 1.7rem; line-height: 1.1; font-weight: 400; }
@keyframes fatIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(-30deg); } }
@keyframes fatOut { to { opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(10deg); } }
.pcard.hungry { animation: hungry .45s ease 4; }
@keyframes hungry { 25% { transform: rotate(calc(var(--tilt) - 5deg)); } 75% { transform: rotate(calc(var(--tilt) + 5deg)); } }
.fatFly { position: absolute; left: 50%; bottom: 18%; z-index: 4; font-size: 1.5rem; line-height: 1; pointer-events: none; opacity: 0;
  animation: fatFly 2s ease-out forwards; }
@keyframes fatFly { 0% { opacity: 0; transform: translate(-50%, 0) scale(.5); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), -120px) rotate(var(--r)) scale(1.2); } }
.rEdit { font-style: normal; }

/* ---------- 2026-10-20: a small menu, sheets that keep their title and «تم» in sight ---------- */
/* the «تجريبي» badge on the calculator's icon */
.brand { position: relative; }
.beta { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); font-style: normal; font-size: .52rem; font-weight: 800; line-height: 1.5; padding: 0 4px;
  border-radius: 99px; background: var(--gold); color: var(--ink); white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); pointer-events: none; }
/* every sheet's title row stays at the top while it scrolls */
dialog.sheet > .sHead { position: sticky; top: 0; z-index: 5; background: var(--cream); margin: -16px -16px 10px; padding: 14px 16px 8px; }
dialog.sheet:not(.full) > .sHead { top: -16px; } /* the sheet's own padding: the title sticks at its very top */
dialog.full > .sHead { margin-top: 0; padding-top: 0; }
.doneBtn { flex: none; min-height: 38px; border: 0; border-radius: 12px; padding: 0 1.2rem; background: linear-gradient(var(--gold-l), var(--gold)); color: var(--ink);
  font-weight: 800; font-size: .95rem; box-shadow: 0 3px 0 var(--gold-d); }
.doneBtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-d); }
/* the phone's keyboard: a sheet stays above it (iPhones keep the page's height and cover its bottom) */
@media (max-width: 639px) {
  dialog.sheet:not(.full) { margin-bottom: var(--kb, 0px); max-height: min(88dvh, calc(var(--vvh, 100dvh) - 12px - env(safe-area-inset-top))); }
  dialog.full { margin-top: var(--vvt, 0px); height: var(--vvh, 100dvh); max-height: var(--vvh, 100dvh); }
}
/* the menu: eight tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { position: relative; display: grid; justify-items: center; align-content: center; gap: 5px; min-height: 76px; padding: 8px 2px; border: 2px solid var(--edge);
  border-radius: 14px; background: #fff; color: var(--ink); font-weight: 700; font-size: .78rem; line-height: 1.2; box-shadow: 0 3px 0 var(--edge); }
.tile > span { font-size: 1.55rem; line-height: 1; }
.tile em { position: absolute; top: -8px; inset-inline-start: 50%; transform: translateX(50%); font-style: normal; font-size: .56rem; font-weight: 800; line-height: 1.5;
  background: var(--gold); color: var(--ink); border-radius: 99px; padding: 0 5px; white-space: nowrap; }
.tile:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
@media (max-width: 340px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.betaNote { margin: 12px 0 0; padding: 8px 10px; border-radius: 12px; background: #fff6dc; color: #7a5208; font-size: .82rem; font-weight: 600; text-align: center; }
.betaNote .link { padding: 0 .2rem; text-decoration: underline; text-underline-offset: 3px; }
.betaTag { font-style: normal; font-family: var(--ui); font-size: .62rem; font-weight: 800; vertical-align: middle; background: var(--gold); color: var(--ink); border-radius: 99px;
  padding: .05rem .45rem; }
/* the suggestion */
.ideaForm { display: grid; gap: 8px; }
.ideaForm textarea { resize: vertical; min-height: 110px; font-weight: 600; line-height: 1.6; }
.ideaRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ideaRow .field { font-weight: 600; font-size: .9rem; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ideaNote { min-height: 1.2em; margin: 0; text-align: center; color: var(--red-d); font-weight: 700; }

/* ---------- «الدوري» (تجريبي) ---------- */
.lgBar { flex: none; margin: var(--gap) 10px 0; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 12px; border: 1.5px solid var(--gold);
  border-radius: 12px; background: rgba(0, 0, 0, .3); color: var(--gold-l); font-weight: 700; font-size: .84rem; text-align: start; }
.lgBar b { white-space: nowrap; }
.lgBar small { margin-inline-start: auto; min-width: 0; color: #fff; opacity: .85; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leagueSheet #lgBody { display: grid; gap: 14px; padding-bottom: 14px; }
.lgIntro { margin: 0; }
.lgName, .lgSec { display: grid; gap: 6px; }
.lgName > span, .lgSec > b { font-size: .9rem; font-weight: 700; color: var(--ink); }
.lgTeams { display: grid; gap: 6px; }
.lgTeam { display: grid; grid-template-columns: 22px 1fr 1fr 34px; gap: 6px; align-items: center; }
.lgTeam > b { text-align: center; color: var(--muted); font-size: .85rem; }
.lgTeam .field, .lgPl .field { padding: .45rem .6rem; font-size: .92rem; }
.lgX { height: 38px; border: 1.5px solid var(--edge); background: #fff; color: var(--red-d); border-radius: 10px; font-weight: 800; }
.lgAdd { justify-self: start; border: 2px dashed var(--edge); background: none; color: var(--wine); border-radius: 12px; padding: .35rem .9rem; font-weight: 700; }
.lgPl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lgDrawBar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.lgDrawBtn { border: 0; border-radius: 12px; padding: .45rem 1rem; background: var(--wine); color: #fff; font-weight: 800; box-shadow: 0 3px 0 var(--wine-d); }
.lgDrawBtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wine-d); }
.lgPairs { display: grid; gap: 6px; margin-top: 8px; }
.lgPair { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: #fff; border: 2px solid var(--gold); font-weight: 700;
  animation: pairIn .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.lgPair > i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .8rem; background: var(--wine); color: #fff; }
@keyframes pairIn { from { opacity: 0; transform: translateY(10px) scale(.9); } }
.lgInfo { margin: 0; text-align: center; font-weight: 700; color: var(--wine); font-size: .88rem; }
.lgHead { display: grid; gap: 2px; }
.lgHead b { font-family: var(--fun); font-weight: 400; font-size: 1.4rem; color: var(--wine); line-height: 1.2; }
.lgHead small { color: var(--muted); font-weight: 700; font-size: .8rem; }
.leagueSheet .seg button.on { background: var(--wine); border-color: var(--wine-d); color: #fff; box-shadow: 0 3px 0 var(--wine-d); }
.leagueSheet .seg button:disabled { opacity: .5; cursor: not-allowed; }
.lgTbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.lgTbl th { font-size: .72rem; color: var(--muted); font-weight: 700; }
.lgTbl td, .lgTbl th { padding: 8px 3px; text-align: center; border-bottom: 1px solid var(--edge); }
.lgTbl .tn { text-align: start; font-weight: 700; }
.lgTbl .rk { width: 24px; font-family: var(--fun); color: var(--wine); font-size: 1.05rem; }
.lgTbl tr.top td { background: #fff6dc; }
.lgRound > h3 { margin: 4px 0 6px; font-size: .9rem; color: var(--red-d); }
.lgM { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; background: #fff;
  border: 2px solid var(--edge); margin-bottom: 6px; }
.lgM.live { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 182, 50, .3); }
.lgM.done { background: var(--cream-2); }
.lgT { font-size: .7rem; font-weight: 800; color: #fff; background: var(--wine); border-radius: 8px; padding: 2px 6px; white-space: nowrap; }
.lgVs { display: grid; gap: 1px; font-weight: 700; font-size: .9rem; min-width: 0; }
.lgVs > span { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.lgVs > span > u { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lgVs > span > em { font-style: normal; font-family: var(--fun); font-weight: 400; font-size: 1.05rem; color: var(--muted); }
.lgVs > span.w { color: var(--wine); }
.lgVs > span.w > em { color: var(--wine); }
.lgVs > i { font-style: normal; font-size: .68rem; color: var(--muted); }
.lgAct { display: flex; flex-direction: column; gap: 4px; }
.lgAct button { border: 1.5px solid var(--edge); background: var(--cream-2); color: var(--ink); border-radius: 10px; padding: .3rem .55rem; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.lgAct button.play { background: linear-gradient(var(--gold-l), var(--gold)); border-color: var(--gold-d); }
.lgRest { font-size: .8rem; color: var(--muted); margin: 0 0 6px; }
.lgChamp { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 14px; border-radius: 16px; background: linear-gradient(160deg, #fff3cf, #f6d98a);
  border: 2px solid var(--gold-d); }
.lgChamp > span { font-weight: 800; color: #7a5208; }
.lgChamp > b { font-family: var(--fun); font-weight: 400; font-size: 1.6rem; color: var(--wine); line-height: 1.2; }
.lgChamp .goBtn { max-width: 280px; min-height: 46px; font-size: 1.15rem; }
.lgFoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.lgResRow { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.lgResRow > span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.lgResRow > b { text-align: center; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lgResRow input { text-align: center; font-family: var(--fun); font-weight: 400; font-size: 1.35rem; padding: .3rem; }
.lgResNote { margin-top: 0; }
.lgResClear { display: block; margin: 8px auto 0; color: var(--red-d); }

/* ---------- the league: formats, live, the share sheet (2026-10-21) ---------- */
.lgFmt { flex-wrap: wrap; }
.lgFmt button { flex: 1 1 30%; font-size: .84rem; }
.lgT { display: grid; justify-items: center; line-height: 1.15; }
.lgT b { font-size: .72rem; }
.lgT small { font-size: .56rem; font-weight: 700; opacity: .85; }
.lgVs > span.tbd > u { color: var(--muted); font-weight: 600; font-size: .84rem; }
.lgWait { font-size: .74rem; font-weight: 700; color: var(--muted); }
.lgAway { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 800; color: var(--red-d); white-space: nowrap; }
.lgM.away { border-color: #f1b8c2; }
.liveDot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e2445c; box-shadow: 0 0 0 0 rgba(226, 68, 92, .6); animation: liveDot 1.4s infinite; }
.liveDot.off { background: #b5ab94; animation: none; }
@keyframes liveDot { 70% { box-shadow: 0 0 0 7px rgba(226, 68, 92, 0); } }
.lgTools { display: flex; gap: 8px; }
.lgTools button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border: 2px solid var(--wine); border-radius: 12px;
  background: #fff; color: var(--wine); font-weight: 800; font-size: .88rem; }
.lgTools button.on { background: var(--wine); color: #fff; }
.lgTools button:active { transform: translateY(1px); }
.lgGroupT { margin: 10px 0 4px; font-size: .92rem; color: var(--red-d); }
.qrBox { display: grid; justify-items: center; gap: 6px; }
.qrBox canvas { width: min(250px, 66vw); height: auto; border-radius: 14px; background: #fff; box-shadow: 0 0 0 2px var(--edge), 0 8px 18px rgba(0, 0, 0, .15); }
.qrCode { font-family: var(--fun); font-weight: 400; font-size: 1.9rem; letter-spacing: 6px; color: var(--wine); direction: ltr; line-height: 1.2; }
.qrLink { max-width: 100%; color: var(--muted); font-size: .72rem; word-break: break-all; text-align: center; }
.qrHint { text-align: center; }
.qrBtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qrBtns .mItem { margin-top: 0; justify-content: center; }
.qrStop { display: block; margin: 10px auto 0; color: var(--red-d); }

/* ---------- 2026-10-21: the owner's iPhone notes ---------- */
/* an iPhone zooms the page into any field under 16px (the sheet then grows past the screen): every field is 16px */
.field, .seat input, .drawSheet .seat input, .lgTeam .field, .ideaRow .field { font-size: 16px; }
/* opened from the home screen: the app fills the whole screen (no band at the bottom) and the bar sits below the
   status bar and its fade */
.pwa .app { position: fixed; inset: 0; height: auto; margin: 0 auto; }
.pwa .bTop { padding-top: calc(env(safe-area-inset-top) + 16px); }
.pwa dialog.full { padding-top: calc(env(safe-area-inset-top) + 16px); }
/* the league's draw: the method, the number of players, the cards to take out, the teams after it */
.lgHow button { font-size: .88rem; }
.lgHowHint { margin: 2px 0 0; }
.lgCount { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 0; }
.lgCount span { font-weight: 700; color: var(--muted); }
.lgCount button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--wine); background: #fff; color: var(--wine); font-size: 1.4rem; font-weight: 800; line-height: 1; }
.lgCount button:active { transform: scale(.94); }
.lgCount b { min-width: 2.4ch; text-align: center; font-family: var(--fun); font-weight: 400; font-size: 2rem; color: var(--wine); }
.lgCardsT { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 10px 0 2px; font-weight: 700; font-size: .86rem; color: var(--ink); }
.lgCardsT .link { padding: 0 .2rem; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
/* the whole deck: a row for each suit, the cards that came out are lifted */
.lgDeck { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.lgDeck button { display: grid; place-items: center; align-content: center; gap: 2px; aspect-ratio: 5 / 7; padding: 0; border-radius: 7px; background: #fff;
  border: 1.5px solid var(--edge); box-shadow: 0 2px 0 var(--edge); font: inherit; font-weight: 800; font-size: .92rem; line-height: 1; color: var(--ink);
  transition: transform .15s, box-shadow .15s, background-color .15s; }
.lgDeck button small { font-size: .9rem; }
.lgDeck button.red { color: var(--red); }
.lgDeck button.on { border-color: var(--wine); background: #fff3cf; box-shadow: 0 0 0 2px var(--gold), 0 4px 0 var(--wine-d); transform: translateY(-3px); }
#lgDrawBox .lgDrawBtn { display: block; width: 100%; min-height: 46px; margin-top: 10px; font-size: 1.02rem; }
.lgResT { display: block; margin: 12px 0 6px; font-size: .9rem; }
.lgResT small { color: var(--muted); font-weight: 600; font-size: .76rem; }
.lgTeam.pop { animation: pairIn .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.lgTeam.pop .field { border-color: var(--gold); }
/* a new version on the site: one tap loads it */
.updBar { position: fixed; z-index: 90; top: calc(env(safe-area-inset-top) + 10px); inset-inline: 0; margin: 0 auto; width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px; border-radius: 99px; padding-block: .4rem; padding-inline: .95rem .4rem; background: var(--ink); color: #fff;
  font: inherit; font-weight: 700; font-size: .9rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); border: 1px solid rgba(255, 217, 112, .4); animation: updIn .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.updBar[hidden] { display: none; }
.updBar b { border-radius: 99px; padding: .3rem .9rem; background: linear-gradient(var(--gold-l), var(--gold)); color: var(--ink); font-weight: 800; }
@keyframes updIn { from { transform: translateY(-40px); opacity: 0; } }
.verNo { display: block; margin-top: 4px; font-size: .72rem; font-weight: 600; opacity: .75; }
.verNo:empty { display: none; }
/* ---------- 2026-10-21: every sheet alike: its ✕ for the thumb and always in sight; pulled down, it closes ---------- */
/* on a phone a sheet takes the whole width (the browser's own limit for dialogs left a band on each side), so every ✕
   sits at the same place */
@media (max-width: 639px) { dialog.sheet { max-width: 100%; } }
dialog.sheet > .sHead { min-height: 44px; touch-action: none; transition: box-shadow .2s; }
dialog.sheet.scrolled > .sHead { box-shadow: 0 8px 10px -9px rgba(42, 5, 16, .45); }
dialog.sheet:not(.full) > .sHead::before { content: ""; position: absolute; top: 5px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px;
  background: var(--edge); }
dialog.sheet > .sHead .iconBtn { flex: none; width: 44px; height: 44px; border-radius: 14px; border-width: 1.5px; }
dialog.sheet > .sHead .iconBtn svg { width: 22px; height: 22px; stroke-width: 2.4; }
dialog.sheet > .sHead .doneBtn { min-height: 44px; }
/* no zoom on a double tap */
html, dialog { touch-action: manipulation; }
/* the صكات under a team: a tap offers to set them back to zero */
.tWins { cursor: pointer; padding: 6px; margin: -6px; }
.tWins:not(:empty)::after { content: " ↺"; opacity: .7; }

/* ---------- the looks (owner, 2026-11-02: a friend who plays seriously found the first look loud; a calm set that was flat and dark the owner found gloomy; the owner's pick is the royal navy, with the numbers in Libre Baskerville and clear borders on everything) ----------
   No data-th on <html> is the first look, everything above as it was. Navy is calm and still alive: no pattern, no tilt, no
   glow, but real colour, a frame on every card and a clear line round every control. Each rule below repeats a selector from
   above after :where([data-th]), which adds no weight, so it wins by coming later and an «on» state above still counts until
   it is restated here. The borders: --bw is their width, --edge the lines on light surfaces, --line those on the blue page,
   --frame the frame inside a card. */
@font-face { font-family: "Libre Baskerville"; font-weight: 700; font-display: fallback; src: url("fonts/baskerville-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Noto Naskh Arabic"; font-weight: 700; font-display: fallback; src: url("fonts/naskh-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
/* the royal navy: a clear blue with cream cards and warm gold */
html[data-th="navy"], [data-tm="navy"] { --pgT: #1f4290; --pg: #14295a; --pgFg: #fff; --pgDim: #c5d0ea; --ctl: rgba(255, 255, 255, .1); --ctlFg: #fff;
  --cardBg: #fffdf7; --panel: #fffdf7; --cream: #fffdf7; --cream-2: #f5efe0; --ink: #14295a; --muted: #6f7488; --key: #f7f2e6; --faint: #d8d2c2;
  --ta: #14295a; --tb: #c0213c; --red: #c0213c; --red-d: #971a2f; --wine: #14295a; --wine-d: #0e1e45; --acc: #e3b54a; --accFg: #14295a; --accD: #b88c2a; --ring: #e3b54a; --dark: #14295a;
  --gold: #e3b54a; --gold-l: #f0cf7a; --gold-d: #a67c1c; --fun: "Libre Baskerville", "Noto Naskh Arabic", serif; --funW: 700; --name: "Noto Naskh Arabic", "IBM Plex Sans Arabic", serif;
  --bw: 1.5px; --edge: #14295a; --line: #e3b54a; --frame: #c9a24a; }
/* the first look, for its own row in the list when another look is on */
[data-tm="now"] { --pgT: #b52a4c; --pg: #8a1636; --pgFg: #fff; --cardBg: #fffaf0; --ta: #1d2230; --tb: #cf2640; --fun: "Lalezar", "IBM Plex Sans Arabic", sans-serif; --funW: 400; --name: "IBM Plex Sans Arabic", sans-serif; --line: rgba(255, 255, 255, .4); --frame: transparent; }

:where([data-th]) body { background: var(--pg) linear-gradient(var(--pgT), var(--pg)); color: var(--pgFg); }
/* the top row */
:where([data-th]) .brand img { box-shadow: none; }
:where([data-th]) .beta { display: none; }
:where([data-th]) .bTitle { font-family: var(--name); font-weight: 700; color: var(--pgFg); }
:where([data-th]) .styleSeg { background: var(--ctl); border: var(--bw) solid var(--line); }
:where([data-th]) .styleSeg button { color: var(--pgDim); font-weight: 600; }
:where([data-th]) .styleSeg button.on { background: var(--acc); color: var(--accFg); box-shadow: none; }
:where([data-th]) .newTop { border: var(--bw) solid var(--line); background: var(--ctl); color: var(--ctlFg); font-weight: 600; }
:where([data-th]) .newTop:active { background: var(--ctl); }
:where([data-th]) .iconBtn { border: var(--bw) solid var(--line); background: var(--ctl); color: var(--ctlFg); }
:where([data-th]) #sfxBtn[aria-pressed="false"] { color: var(--pgDim); }
:where([data-th]) #mirBtn[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--accFg); }

/* the board: two cards lying straight, each with a frame like a playing card, the leader's in gold */
:where([data-th]) .board { padding-top: 10px; perspective: none; align-items: stretch; gap: 10px; }
:where([data-th]) .mid { align-self: center; }
:where([data-th]) .pcard { --tilt: 0deg; transform: none; align-content: center; gap: 4px; padding: 14px 8px 12px; border-radius: 16px; background: var(--cardBg); color: var(--ink);
  box-shadow: inset 0 0 0 4px var(--cardBg), inset 0 0 0 calc(4px + var(--bw)) var(--frame), 0 8px 18px rgba(20, 25, 50, .16); }
:where([data-th]) .board[data-lead="a"] .pcard[data-t="a"], :where([data-th]) .board[data-lead="b"] .pcard[data-t="b"] {
  box-shadow: inset 0 0 0 4px var(--cardBg), inset 0 0 0 calc(4px + var(--bw)) var(--ring), 0 0 0 2.5px var(--ring), 0 8px 18px rgba(20, 25, 50, .16); }
:where([data-th]) .crown, :where([data-th]) .idx.bot { display: none; }
:where([data-th]) .idx.top { top: 10px; inset-inline-start: 12px; }
:where([data-th]) .tName { box-shadow: none; font-family: var(--name); }
:where([data-th]) .tScore { margin-top: 0; }
:where([data-th]) .bar { width: 72%; height: 5px; background: var(--cream-2); box-shadow: inset 0 0 0 1px var(--edge); }
:where([data-th]) .bar i { background: var(--tc); }
:where([data-th]) .tWins { position: static; font-size: .7rem; font-weight: 600; }
:where([data-th]) .floatGain { color: var(--gold-d); text-shadow: none; }
:where([data-th]) .fatoor { background: var(--cream-2); border: var(--bw) solid var(--acc); box-shadow: 0 6px 14px rgba(20, 25, 50, .2); }
/* the little table */
:where([data-th]) .dealBtn { --dt: 88px; --sd: 20px; --tw: 24px; --th: 32px; gap: 12px; }
@media (max-height: 680px) { :where([data-th]) .dealBtn { --dt: 78px; --sd: 18px; --tw: 21px; --th: 28px; gap: 9px; } }
:where([data-th]) .dealTable { background: var(--ctl); box-shadow: inset 0 0 0 var(--bw) var(--line); }
:where([data-th]) .chip152 { background: var(--acc); border: 0; box-shadow: none; color: var(--accFg); font-family: var(--ui); font-weight: 700; }
:where([data-th]) .dealTable .chip152 { border: 0; }
:where([data-th]) .seatDot { background: #fff; box-shadow: 0 0 0 var(--bw) var(--frame), 0 1px 2px rgba(20, 25, 50, .25); }
:where([data-th]) .dealToken { background: var(--acc); color: var(--accFg); box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(20, 25, 50, .3); animation: none; border-radius: 5px; }
:where([data-th]) .dealSpk { background: #fff; color: var(--ink); box-shadow: 0 0 0 var(--bw) var(--frame), 0 1px 2px rgba(20, 25, 50, .25); }
:where([data-th]) .dealWho { border: var(--bw) solid var(--line); background: var(--ctl); color: var(--ctlFg); box-shadow: none; border-radius: 10px; }
:where([data-th]) .dealWho b { font-family: var(--name); font-weight: 700; }
:where([data-th]) .roundsBtn, :where([data-th]) .newsBtn { border: var(--bw) solid var(--line); background: var(--ctl); color: var(--ctlFg); font-weight: 600; }
/* «انعكاس!» */
:where([data-th]) .mirBand { background: rgba(20, 25, 50, .08); box-shadow: 0 var(--bw) 0 var(--line); }
:where([data-th]) .mirCard { border-radius: 12px; background: var(--cardBg); box-shadow: inset 0 0 0 var(--bw) var(--frame), 0 2px 8px rgba(20, 25, 50, .14); }
:where([data-th]) .mirBand[data-lead="a"] .mirCard[data-t="a"], :where([data-th]) .mirBand[data-lead="b"] .mirCard[data-t="b"] { box-shadow: 0 0 0 2.5px var(--ring); }
:where([data-th]) .mirCard span { font-family: var(--name); }
/* no crown to make room for here, and «متطور» under the strip needs the height */
@media (max-height: 760px) { :where([data-th]) .app.mirOn .board { padding-top: 4px; } }
@media (max-height: 960px) { :where([data-th]) .app.mirOn:has(.entry:not(.simple)) .board { padding-top: 4px; } :where([data-th]) .mirOn:has(.entry:not(.simple)) .pcard { padding-block: 8px; } }
:where([data-th]) .lgBar { border: var(--bw) solid var(--line); background: var(--ctl); color: var(--ctlFg); }
:where([data-th]) .lgBar small { color: var(--pgDim); }

/* the round */
:where([data-th]) .entry { border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 4px var(--panel), inset 0 0 0 calc(4px + var(--bw)) var(--frame), 0 8px 20px rgba(20, 25, 50, .16); }
:where([data-th]) .seg button { border: var(--bw) solid var(--edge); background: var(--cream-2); color: var(--ink); box-shadow: none; font-weight: 600; }
:where([data-th]) .seg button:active { box-shadow: none; }
:where([data-th]) .unitSeg button, :where([data-th]) .sModeSeg button, :where([data-th]) .projTeam button, :where([data-th]) .unitSeg button.on { box-shadow: none; }
:where([data-th]) .teamSeg button.on[data-v="a"], :where([data-th]) .teamSeg button.on[data-v="b"], :where([data-th]) .multSeg button.on[data-v="g"], :where([data-th]) .seg.suits button.on { box-shadow: none; }
:where([data-th]) .modeSeg button.on[data-v="sun"], :where([data-th]) .sModeSeg button.on[data-v="sun"], :where([data-th]) .multSeg button.on { background: var(--acc); border-color: var(--accD); color: var(--accFg); box-shadow: none; }
:where([data-th]) .modeSeg button.on[data-v="sun"] i, :where([data-th]) .sModeSeg button.on[data-v="sun"] i { color: inherit; }
:where([data-th]) .modeSeg button.on[data-v="hokm"], :where([data-th]) .sModeSeg button.on[data-v="hokm"], :where([data-th]) .multSeg button.on[data-v="1"] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
:where([data-th]) #voiceKindSeg button.on, :where([data-th]) #newsModeSeg button.on, :where([data-th]) .leagueSheet .seg button.on { box-shadow: none; }
/* the buyer stays green, the one green on this page, flat */
:where([data-th]) #buyerSeg button.on { background: #2e9a5f; border-color: #1f7a48; color: #fff; box-shadow: none; }
:where([data-th]) .cardsTool { box-shadow: none; }
:where([data-th]) .ab { background: #fff; border: var(--bw) solid var(--edge); border-top: 3px solid var(--ta); box-shadow: none; }
:where([data-th]) .ab[data-t="b"] { border-top-color: var(--tb); }
:where([data-th]) .ab:focus-within { border-color: var(--acc); border-top-color: var(--acc); box-shadow: 0 0 0 2px var(--acc); }
:where([data-th]) .abName, :where([data-th]) .sName { font-family: var(--name); font-size: .95rem; }
:where([data-th]) .kbPill.on { background: var(--acc); border-color: var(--accD); color: var(--accFg); }
:where([data-th]) .ab input::placeholder { color: var(--faint); }
:where([data-th]) .sBox { border: var(--bw) solid var(--edge); border-top: 3px solid var(--ta); border-radius: 12px; background: #fff; color: var(--ink); box-shadow: none; }
:where([data-th]) .sBox[data-t="b"] { border-top-color: var(--tb); }
:where([data-th]) .sBox.act { border-color: var(--acc); border-top-color: var(--acc); box-shadow: 0 0 0 2px var(--acc); }
:where([data-th]) .sName { color: var(--muted); }
:where([data-th]) .sVal { color: var(--ta); }
:where([data-th]) .sVal:empty::before { color: var(--faint); }
:where([data-th]) .sBox.act:not(.sel) .sVal::after { background: var(--acc); }
:where([data-th]) .sBox.sel .sVal { background: color-mix(in srgb, var(--acc) 22%, transparent); }
/* the digits black and a little heavier than the font's own bold, its heaviest (owner) */
:where([data-th]) .keypad button { border: var(--bw) solid var(--edge); background: var(--key); color: #000; -webkit-text-stroke: .6px #000; box-shadow: none; }
:where([data-th]) .keypad button:active { background: var(--cream-2); box-shadow: none; }
:where([data-th]) .keypad .kDel { background: var(--key); border-color: var(--edge); color: var(--tb); box-shadow: none; }
:where([data-th]) .keypad .kDel .kx { stroke: var(--key); }
:where([data-th]) .keypad .kDel:active { background: var(--cream-2); box-shadow: none; }
:where([data-th]) .keypad .kUndo { background: var(--key); border-color: var(--edge); color: var(--muted); -webkit-text-stroke: 0; box-shadow: none; font-weight: 600; }
:where([data-th]) .keypad .kUndo:active { background: var(--cream-2); box-shadow: none; }
:where([data-th]) .pchip { border: var(--bw) solid var(--edge); box-shadow: none; }
:where([data-th]) .pchip:active { box-shadow: none; }
:where([data-th]) .pchip.on, :where([data-th]) .pchip.bal.on { background: var(--acc); border-color: var(--accD); color: var(--accFg); box-shadow: none; }
:where([data-th]) .projClear, :where([data-th]) .kbPill { border: var(--bw) solid var(--edge); box-shadow: none; }

/* the line above the buttons, and the buttons */
:where([data-th]) .stepHint { color: var(--pgFg); font-size: .95rem; font-weight: 600; }
:where([data-th]) .resultBtn { border: var(--bw) solid var(--edge); background: var(--cream); color: var(--ink); box-shadow: 0 2px 8px rgba(20, 25, 50, .12); }
:where([data-th]) .drawPill { border: var(--bw) solid var(--line); background: var(--ctl); color: var(--ctlFg); box-shadow: none; font-weight: 600; font-size: .98rem; }
:where([data-th]) .drawPill:active { box-shadow: none; }
:where([data-th]) .undoBtn, :where([data-th]) .coffeeBtn { border: var(--bw) solid var(--line); border-radius: 14px; background: var(--ctl); color: var(--ctlFg); box-shadow: none; font-weight: 600; }
:where([data-th]) .coffeeBtn:active { box-shadow: none; }
:where([data-th]) .coffeeBtn[aria-pressed="true"] { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
:where([data-th]) .goBtn { border: var(--bw) solid var(--accD); border-radius: 14px; background: var(--acc); color: var(--accFg); box-shadow: 0 3px 0 var(--accD); font-family: var(--name); font-size: 1.3rem; font-weight: 700; }
:where([data-th]) .goBtn:active { box-shadow: 0 1px 0 var(--accD); }
:where([data-th]) .goBtn:disabled { background: rgba(255, 255, 255, .14); border-color: var(--line); color: rgba(255, 255, 255, .62); box-shadow: none; }
:where([data-th]) .goBtn.danger { background: var(--red); border-color: var(--red-d); color: #fff; box-shadow: 0 3px 0 var(--red-d); }
:where([data-th]) .sheet .goBtn:disabled { background: var(--cream-2); border-color: var(--edge); color: var(--muted); box-shadow: none; }

/* the sheets: the colours already follow; the lines and the headings change here */
:where([data-th]) dialog.sheet { box-shadow: 0 0 0 var(--bw) var(--frame); }
:where([data-th]) dialog::backdrop { background: rgba(15, 20, 40, .45); }
:where([data-th]) .sHead h2, :where([data-th]) .win h2, :where([data-th]) .ask h2, :where([data-th]) .lgHead b, :where([data-th]) .lgChamp > b, :where([data-th]) .gahwa > b, :where([data-th]) .tGahwa > b { font-family: var(--name); font-weight: 700; }
:where([data-th]) .doneBtn { border: var(--bw) solid var(--accD); background: var(--acc); color: var(--accFg); box-shadow: 0 2px 0 var(--accD); }
:where([data-th]) .doneBtn:active { box-shadow: none; }
:where([data-th]) .newBtn, :where([data-th]) .newBtn:active { box-shadow: none; }
:where([data-th]) .field, :where([data-th]) .mItem, :where([data-th]) .tile, :where([data-th]) .pc, :where([data-th]) .lgM { border: var(--bw) solid var(--edge); }
:where([data-th]) .mItem, :where([data-th]) .tile, :where([data-th]) .tile:active, :where([data-th]) .pc { box-shadow: none; }
:where([data-th]) .plClear, :where([data-th]) .mjDel, :where([data-th]) .lgX, :where([data-th]) .lgAct button, :where([data-th]) .lgAdd, :where([data-th]) .mjAdd, :where([data-th]) .thinkSay, :where([data-th]) .undoRow, :where([data-th]) .drawApply { border-width: var(--bw); border-color: var(--edge); }
:where([data-th]) .thinkSay, :where([data-th]) .undoRow, :where([data-th]) .undoRow:active, :where([data-th]) .drawApply, :where([data-th]) .drawApply:active { box-shadow: none; }
:where([data-th]) .thinkSay::before { border-color: var(--edge); }
:where([data-th]) .swT { background: #cfd5e3; box-shadow: inset 0 0 0 var(--bw) var(--edge); }
/* the tables of «من يوزّع؟» and «دق الولد»: one colour with a fine gold line */
:where([data-th]) .dPick, :where([data-th]) .dtable, :where([data-th]) .drawSheet .dtable { background: var(--dark); box-shadow: inset 0 0 0 5px rgba(0, 0, 0, .18), inset 0 0 0 6px var(--gold); }
:where([data-th]) .dpMid { background: var(--gold); border: 0; color: #2a1c06; box-shadow: none; font-family: var(--ui); font-weight: 700; }
:where([data-th]) .dp { border: var(--bw) solid var(--line); background: rgba(255, 255, 255, .1); color: #fff; }
:where([data-th]) .dp.on { background: var(--gold); border-color: var(--gold); color: #2a1c06; box-shadow: none; }
:where([data-th]) .seat input, :where([data-th]) .drawSheet .seat input { border: var(--bw) solid var(--line); background: rgba(0, 0, 0, .22); box-shadow: none; }
:where([data-th]) .seat .slot, :where([data-th]) .drawSheet .seat .slot { border: 1px dashed rgba(255, 255, 255, .5); }
/* the end of a game: its own party colours, in the look's table colour */
:where([data-th]) .party { background: var(--dark); }
:where([data-th]) .pName { box-shadow: none; }
:where([data-th]) .party .goBtn { background: var(--gold); color: #2a1c06; box-shadow: none; }
/* numbers in the look's font and weight */
:where([data-th]) .tScore, :where([data-th]) .sVal, :where([data-th]) .mirCard b, :where([data-th]) .keypad button, :where([data-th]) .rg b, :where([data-th]) .rG, :where([data-th]) .cSum b, :where([data-th]) .ab input, :where([data-th]) .lgTbl .rk, :where([data-th]) .lgCount b, :where([data-th]) .qrCode, :where([data-th]) .lgVs > span > em, :where([data-th]) .lgResRow input { font-weight: var(--funW); }
:where([data-th]) .keypad .kUndo { font-weight: 600; }
/* the list of looks: each row painted in its own colours, a tap changes the page behind at once */
#themeDlg::backdrop { background: none; backdrop-filter: none; }
.thList { display: grid; gap: 8px; }
#themeDlg .hint { margin: 12px 0 0; }
.thRow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 62px; padding: 6px 12px; border: 0; border-radius: 12px; background: linear-gradient(var(--pgT), var(--pg)); color: var(--pgFg); box-shadow: 0 0 0 1.5px var(--line); text-align: start; }
.thRow[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--cream), 0 0 0 4.5px var(--ink); }
.thRow[aria-pressed="true"] .thName::after { content: "  ✓"; }
.thName { flex: 1; min-width: 0; font-family: var(--name); font-weight: 700; font-size: 1.08rem; }
.thNums { flex: none; display: flex; gap: 5px; direction: ltr; }
.thNums b { min-width: 46px; padding: 2px 6px; border-radius: 7px; background: var(--cardBg); box-shadow: inset 0 0 0 1.5px var(--frame); color: var(--ta); font-family: var(--fun); font-weight: var(--funW); font-size: 1.15rem; line-height: 1.5; text-align: center; }
.thNums b + b { color: var(--tb); }
