/* شيرلي سيستم — shared design system (black / white / red) */
:root {
  --black: #0e0e11;
  --ink: #17171b;
  --red: #e01f26;
  --red-dark: #b8141a;
  --white: #ffffff;
  --paper: #f6f6f8;
  --line: #e7e7ec;
  --muted: #71717a;
  --green: #1f9d55;
  --amber: #d98a00;
  --radius: 18px;
  --shadow: 0 8px 30px rgba(14, 14, 17, .08);
  --shadow-sm: 0 2px 10px rgba(14, 14, 17, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Cairo", Tahoma, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3 { font-weight: 800; }
button { font-family: inherit; }
a { color: inherit; }

.btn {
  border: none; border-radius: 14px; cursor: pointer;
  font-size: 15px; font-weight: 700; padding: 12px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap; min-height: 44px; line-height: 1.25;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn svg.ic { width: 16px; height: 16px; }
.big svg.ic { width: 52px; height: 52px; }
.icon svg.ic { width: 34px; height: 34px; }
svg.ic { vertical-align: -2px; }
.btn:active { transform: scale(.97); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(224, 31, 38, .35); }
.btn-red:hover { background: var(--red-dark); }
.btn-red:disabled { background: #c9c9cf; box-shadow: none; cursor: default; }
.btn-dark { background: var(--black); color: #fff; box-shadow: 0 4px 14px rgba(14, 14, 17, .22); }
.btn-dark:hover { background: #232329; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 4px 14px rgba(31, 157, 85, .3); }
.btn-amber { background: var(--amber); color: #fff; box-shadow: 0 4px 14px rgba(217, 138, 0, .3); }

.card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: 999px;
}
.b-red { background: #fde8e9; color: var(--red); }
.b-amber { background: #fdf3e0; color: var(--amber); }
.b-green { background: #e3f6ec; color: var(--green); }
.b-dark { background: var(--black); color: #fff; }

input, select {
  font-family: inherit; font-size: 15px;
  padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff;
  transition: border-color .12s ease, outline .12s ease, box-shadow .12s ease;
}
input:focus, select:focus { outline: 2px solid var(--red); outline-offset: -1px; border-color: var(--red); }

.overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(14, 14, 17, .6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.overlay.show { display: flex; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; bottom: 96px; right: 50%; transform: translateX(50%);
  background: var(--black); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 700; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60;
}
.toast.show { opacity: 1; }

/* ===== thermal receipt / report printing (80mm, works on 58mm too) ===== */
/* The receipt markup lives in a hidden .receipt div; while printing, body gets
   .print-mode so only the receipt shows. Content is fluid so a 58mm printer
   just gets a narrower roll: change 72mm below to 50mm if needed. */
.receipt { display: none; }
@media print {
  @page { size: 80mm 200mm; margin: 2mm; }
  html, body { background: #fff !important; }
  body.print-mode > *:not(.receipt) { display: none !important; }
  .receipt {
    display: block !important; width: 72mm; margin: 0 auto;
    background: #fff; color: #000;
    font-family: 'Cairo', Arial, sans-serif; font-size: 12px; line-height: 1.5;
  }
  .receipt .r-brand { text-align: center; font-size: 18px; font-weight: 800; clear: both; line-height: 1.35; padding-top: 4px; position: static; }
  .receipt > img:first-child, .receipt .r-vlogo { display: block; width: auto; height: auto; max-width: 44mm; max-height: 20mm; object-fit: contain; margin: 0 auto 8px; position: static; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .receipt .r-sub { text-align: center; font-size: 11px; font-weight: 600; }
  .receipt .r-sep { border: none; border-top: 1px dashed #000; margin: 6px 0; }
  .receipt .r-row { display: flex; justify-content: space-between; gap: 6px; font-weight: 600; }
  .receipt .r-row .r-name { flex: 1; }
  .receipt .r-total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 800; margin-top: 4px; }
  .receipt .r-tr { display: grid; grid-template-columns: 1fr 10mm 14mm 16mm; gap: 2px; font-size: 11px; font-weight: 600; padding: 1px 0; align-items: start; }
  .receipt .r-tr .c-q, .receipt .r-tr .c-p, .receipt .r-tr .c-t { text-align: center; }
  .receipt .r-tr.r-head .c-q, .receipt .r-tr.r-head .c-p, .receipt .r-tr.r-head .c-t { font-size: 9px; line-height: 1.15; }
  .receipt .r-tr .c-n { overflow-wrap: anywhere; }
  .receipt .r-item { margin: 2px 0; font-weight: 600; font-size: 12px; }
  .receipt .r-sm { font-size: 11px; font-weight: 600; }
  .receipt .r-head { font-weight: 800; border-bottom: 1px solid #000; padding-bottom: 2px; }
  .receipt { width: min(72mm, 100%); }
  .receipt .r-frame { border: 2px solid #000; padding: 6px 4px 5px; margin: 0 0 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .receipt .r-frame .r-brand { padding-top: 0; font-size: 17px; letter-spacing: .02em; }
  .receipt .r-hero { display: flex; gap: 6px; margin: 0 0 6px; }
  .receipt .r-hbox { flex: 1; display: flex; flex-direction: column; align-items: center; border: 1px solid #000; padding: 2px 3px; min-width: 0; }
  .receipt .r-hbox .r-k { font-size: 9px; font-weight: 700; }
  .receipt .r-hbox .r-big { font-size: 18px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; text-align: center; unicode-bidi: plaintext; }
  .receipt .r-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; border-top: 2px solid #000; border-bottom: 2px solid #000; padding: 4px 0; margin-bottom: 4px; font-size: 10.5px; }
  .receipt .r-cell { display: flex; flex-direction: column; min-width: 0; }
  .receipt .r-cell .r-k { font-size: 9px; font-weight: 700; color: #000; }
  .receipt .r-cell .r-v { font-weight: 700; unicode-bidi: plaintext; overflow-wrap: anywhere; }
  .receipt .r-tr { grid-template-columns: 8mm 1fr 12mm 14mm; }
  .receipt .r-tr .c-n { text-align: start; unicode-bidi: plaintext; }
  .receipt .r-tr:not(.r-head) { border-bottom: 1px dotted #000; padding: 2px 0; }
  .receipt .r-tr .c-q, .receipt .r-tr .c-p, .receipt .r-tr .c-t { unicode-bidi: isolate; direction: ltr; }
  .receipt .r-tot { display: flex; border-top: 2px solid #000; border-bottom: 1px solid #000; margin-top: 4px; }
  .receipt .r-disc { flex: 0 0 24%; display: flex; flex-direction: column; align-items: center; justify-content: center; border-inline-end: 1px solid #000; padding: 2px; font-size: 10px; font-weight: 800; text-align: center; }
  .receipt .r-disc .r-v { font-size: 13px; }
  .receipt .r-lines { flex: 1; padding: 0 0 0 6px; }
  .receipt .r-trow { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; font-size: 11px; border-bottom: 1px dotted #000; padding: 1px 4px; }
  .receipt .r-trow:last-child { border-bottom: none; }
  .receipt .r-trow .r-name { flex: 1; }
  .receipt .r-total { background: #000; color: #fff; justify-content: center; flex-direction: column; align-items: center; font-size: 17px; margin: 6px 0; padding: 5px 4px; letter-spacing: .04em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .receipt .r-total span:first-child { font-size: 11px; font-weight: 700; }
  .receipt .r-pays .r-row { font-size: 11px; }
  .receipt .r-foot { text-align: center; font-size: 11px; font-weight: 700; margin-top: 6px; margin-bottom: 8px; padding-bottom: 4px; line-height: 1.6; }
  .receipt .r-badge { text-align: center; font-size: 13px; font-weight: 800; border: 1.5px solid #000; border-radius: 6px; padding: 2px 8px; margin: 4px 0; }
}

/* language toggle */
.langToggle {
  background: #1c1c22; color: #fff; border: 1px solid #33333c; border-radius: 10px;
  padding: 7px 14px; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
}
.langToggle:hover { background: var(--red); border-color: var(--red); }

.cx { background: #fde8e9; color: #e01f26; border: none; border-radius: 8px; width: 22px; height: 22px; font-size: 12px; font-weight: 800; cursor: pointer; margin-inline-start: 6px; }

/* Accessibility mode (105): font/padding scaling, no zoom (zoom caused horizontal
   overflow on mobile, نور6-5) */
body.a11y { font-size: 19px; --muted: #3a3a3f; }
body.a11y .btn { min-height: 52px; font-size: 17px; padding: 12px 18px; }
body.a11y input, body.a11y textarea, body.a11y select, body.a11y button { font-size: 17px; }
body.a11y .name { font-size: 18px; }
body.a11y .bar { bottom: 6px; right: 6px; left: 6px; padding: 8px; }
body.a11y .bar .btn { font-size: 15px; padding: 10px 12px; min-height: 46px; }
/* نور7-2: let the header wrap at narrow widths instead of overflowing */
body.a11y header > div:first-child { flex-wrap: wrap; row-gap: 10px; }
body.a11y header > div:first-child > div:last-child { flex-wrap: wrap; flex: 1 1 auto; justify-content: flex-end; }
/* Header button look without the language-toggle behavior */
.hdrBtn { background: #1c1c22; color: #fff; border: 1px solid #33333c; border-radius: 10px; padding: 7px 14px; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.hdrBtn:hover { background: var(--red); border-color: var(--red); }

/* 'new' badge (attendance tab, maintenance due) */
.badge-new { display: inline-block; background: #e01f26; color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }

/* free-trial label next to the NEW badge (text is owner-editable) */
.badges { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.badges:empty { display: none; }
.badge-free { display: inline-block; background: #0e0e11; color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }

/* ---- waiting games: modern sheet in the Sharely look ---- */
#gmModal { position: fixed; inset: 0; background: rgba(14, 14, 17, .6); display: flex; align-items: flex-end; justify-content: center; z-index: 9999; animation: gmFade .18s ease-out; }
#gmSheet { width: 100%; max-width: 480px; max-height: 92vh; display: flex; flex-direction: column; background: #fff; border-radius: 24px 24px 0 0; overflow: hidden; box-shadow: 0 -12px 40px rgba(0, 0, 0, .35); animation: gmUp .22s ease-out; }
#gmHead { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: #0e0e11; color: #fff; font-size: 16px; border-bottom: 3px solid #e01f26; }
#gmX { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; font-family: inherit; }
#gmBox { background: #f6f6f8 !important; border-radius: 0 !important; padding: 16px !important; max-height: none !important; overflow: auto; flex: 1; gap: 12px !important; }
#gmBox > b { font-size: 18px !important; }
#gmBox select, #gmBox input { background: #fff; border: 1.5px solid #e2e2e8 !important; border-radius: 14px !important; }
#gmStatus { background: #0e0e11; color: #fff; border-radius: 14px; padding: 11px 14px; font-size: 15px !important; }
#gmBoard { background: #fff; border-radius: 18px; padding: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); box-sizing: border-box; }
.gmCell, .gmMemCard { border-radius: 16px !important; border-width: 2px !important; box-shadow: 0 2px 6px rgba(0, 0, 0, .06); transition: transform .1s; }
.gmCell:not(:disabled):active, .gmMemCard:not(:disabled):active { transform: scale(.94); }
.gmCell:not(:disabled) { border-color: #e01f26 !important; }
#gmQzText { background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
#gmBox [id^=gmQzOpt] { width: 100%; text-align: start; border-radius: 14px; }
#gmQzScore, #gmMemScore, #gqWait, #gqProg { background: #fff; border-radius: 12px; padding: 8px 12px; }
#gqBoard { background: #fff; border-radius: 16px; padding: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
#gqPlayers span { box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
#gmBox .btn-ghost { background: #fff; border: 1.5px solid #e2e2e8; }
@keyframes gmUp { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes gmFade { from { opacity: 0 } to { opacity: 1 } }
#gmBox select { width: 100%; box-sizing: border-box; }

/* games hub: full screen */
#gmModal { align-items: stretch !important; }
#gmSheet { max-width: none !important; max-height: none !important; height: 100%; border-radius: 0 !important; }
#gmHead { padding: 12px 14px; font-size: 18px; }
#gmX { width: auto !important; height: 36px; border-radius: 18px !important; padding: 0 16px; font-size: 14px !important; font-weight: 800; background: #e01f26 !important; }
#gmBox { max-width: 560px; width: 100%; margin: 0 auto; box-sizing: border-box; }
#gmBox [id^=gmGame_] { flex: 1 1 45% !important; min-height: 64px; font-size: 15px !important; font-weight: 800; border-radius: 16px !important; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }

/* dominoes: ivory tiles with pips on a felt table */
#gmBoard.gmFelt, .gmFelt { background: radial-gradient(ellipse at 50% 40%, #1f7a4a 0%, #14583a 70%, #0e4129 100%) !important; border-radius: 18px; padding: 14px 10px; box-shadow: inset 0 3px 14px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .15); border: 3px solid #3a2a1c; box-sizing: border-box; }
.gmDomTile { display: inline-flex; align-items: center; direction: ltr; background: linear-gradient(160deg, #fffdf5, #ece3cc); border-radius: 8px; border: 1px solid #b9ab88; box-shadow: 0 3px 5px rgba(0, 0, 0, .45), inset 0 1px 0 #fff; flex: none; padding: 2px; transition: transform .1s; }
.gmDomHalf { display: grid; grid-template-columns: repeat(3, 6px); grid-template-rows: repeat(3, 6px); gap: 2px; padding: 4px; }
.gmDomHalf i { width: 6px; height: 6px; border-radius: 50%; }
.gmDomHalf i.on { background: radial-gradient(circle at 35% 35%, #444, #0e0e11); }
.gmDomMid { width: 2px; align-self: stretch; margin: 4px 0; background: #9a8c6b; border-radius: 2px; }
.gmHandTile { cursor: pointer; }
.gmHandTile:hover { transform: translateY(-3px); }
#gmHand { background: #3a2a1c; border-radius: 14px; padding: 10px 8px; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .5); }

/* real-game look for all games */
#gmBox { min-height: calc(100vh - 110px); display: flex; flex-direction: column; gap: 10px; }
.gmWood { background: repeating-linear-gradient(92deg, #9b6a3c 0 6px, #8e5f33 6px 11px, #a3703f 11px 17px) !important; border: 4px solid #4a2f17; border-radius: 16px; padding: 12px !important; box-shadow: inset 0 2px 10px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.25); }
#gmBox .gmCell { aspect-ratio: 1; border-radius: 12px !important; border: 0 !important; background: linear-gradient(160deg, #c99560, #a8723f) !important; box-shadow: inset 0 2px 6px rgba(0,0,0,.45), 0 1px 0 rgba(255,255,255,.2); font-size: 0 !important; position: relative; cursor: pointer; }
#gmBox .gmCell:disabled { opacity: 1; cursor: default; }
.gmPc::after { content: ""; position: absolute; inset: 16%; border-radius: 50%; box-shadow: 0 4px 6px rgba(0,0,0,.5); animation: gmPop .25s ease-out; }
.gmPcO::after { background: radial-gradient(circle at 35% 30%, #ff6b70, #e01f26 55%, #8d0d12); }
.gmPcX::after { background: radial-gradient(circle at 35% 30%, #5a5a63, #0e0e11 60%, #000); }
.gmPcX::before, .gmPcO::before { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.gmPcX::before { content: "X"; } .gmPcO::before { content: "O"; }
@keyframes gmPop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* memory cards: back and face */
#gmBox .gmMemCard { aspect-ratio: 3/4; border-radius: 10px !important; border: 2px solid #fff !important; font-family: inherit; font-weight: 900; font-size: 26px !important; perspective: 600px; box-shadow: 0 3px 6px rgba(0,0,0,.45); cursor: pointer; transition: transform .2s; }
#gmBox .gmMemCard.gmBack { background: repeating-linear-gradient(45deg, #e01f26 0 6px, #b3161c 6px 12px) !important; color: #fff !important; }
#gmBox .gmMemCard.gmFace { background: linear-gradient(160deg, #fffdf5, #ece3cc) !important; }
#gmBox .gmMemCard.gmMatched { opacity: .55; transform: scale(.94); }
#gmBox .gmMemCard.gmFlip { animation: gmFlipK .4s ease-out; }
@keyframes gmFlipK { from { transform: rotateY(90deg) scale(.9); } to { transform: rotateY(0) scale(1); } }
/* race road */
.gmRoad { position: relative; height: 22px; border-radius: 12px; background: repeating-linear-gradient(90deg, #3a3a42 0 18px, #44444d 18px 20px); overflow: visible; direction: ltr; box-shadow: inset 0 2px 5px rgba(0,0,0,.5); }
.gmRoadFill { position: absolute; left: 0; top: 0; height: 100%; opacity: .55; border-radius: 12px; transition: width .5s ease; }
.gmPawn { position: absolute; top: -3px; width: 22px; height: 28px; border-radius: 50% 50% 40% 40%; border: 2px solid #fff; box-shadow: 0 3px 5px rgba(0,0,0,.5); transition: left .5s ease; }
.gmFinish { position: absolute; right: 0; top: 0; width: 14px; height: 100%; border-radius: 0 12px 12px 0; background: repeating-conic-gradient(#fff 0 25%, #0e0e11 0 50%) 0 0 / 8px 8px; }
/* dice */
.gmDie { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(160deg, #fffdf5, #ece3cc); border: 1px solid #b9ab88; box-shadow: 0 4px 7px rgba(0,0,0,.4), inset 0 1px 0 #fff; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 6px; box-sizing: border-box; gap: 2px; animation: gmRoll .5s ease-out; }
.gmDie span { border-radius: 50%; } .gmDie span.on { background: radial-gradient(circle at 35% 35%, #444, #0e0e11); }
@keyframes gmRoll { 0% { transform: rotate(-200deg) scale(.4); opacity: 0; } 70% { transform: rotate(15deg) scale(1.1); } 100% { transform: rotate(0) scale(1); opacity: 1; } }
/* backgammon wood board, triangle points, round checkers */
.gmBgBoard { gap: 10px !important; }
#gmBox .gmPt { background: transparent !important; border: 0 !important; position: relative; padding: 0 !important; height: 92px; min-width: 0; cursor: pointer; }
#gmBox .gmPt::before { content: ""; position: absolute; inset: 0; background: #e8d9b5; clip-path: polygon(0 0, 100% 0, 50% 100%); }
#gmBox .gmPt.gmPtB::before { background: #7a1c1c; }
#gmBox .gmPt:not(.gmPtTop)::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
#gmBox .gmPt.gmSel::before { background: #e01f26 !important; } #gmBox .gmPt.gmDest::before { background: #2fbf6a !important; }
#gmBox .gmPt:disabled { cursor: default; }
.gmChecker { position: absolute; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 3px 4px rgba(0,0,0,.55), inset 0 -2px 3px rgba(0,0,0,.35); z-index: 2; }
#gmBox .gmPtTop .gmChecker { top: 4px; } #gmBox .gmPt:not(.gmPtTop) .gmChecker { bottom: 4px; }
.gmCkB { background: radial-gradient(circle at 35% 30%, #5a5a63, #0e0e11 65%); border: 2px solid #777; } .gmCkR { background: radial-gradient(circle at 35% 30%, #ff6b70, #e01f26 60%, #8d0d12); border: 2px solid #ffc9cb; }
/* quiz */
#gmQzText { background: linear-gradient(160deg, #1a1a20, #0e0e11); color: #fff; border-radius: 18px; padding: 18px 14px; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
#gmBox [id^=gmQzOpt] { border-radius: 16px !important; padding: 14px !important; font-weight: 800; font-size: 15px; color: #fff !important; box-shadow: 0 4px 0 rgba(0,0,0,.3); border: 0 !important; transition: transform .1s; }
#gmBox [id^=gmQzOpt]:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
#gmBox #gmQzOpt0 { background: #e01f26 !important; } #gmBox #gmQzOpt1 { background: #1b4fd8 !important; } #gmBox #gmQzOpt2 { background: #0e7a3d !important; } #gmBox #gmQzOpt3 { background: #a15c00 !important; }
#gmBox [id^=gmQzOpt]:disabled { opacity: .6; }
/* domino: table at bottom centre, tiles slide in */
#gmHand { margin-top: 4px; padding-bottom: 8px; }
.gmDrop { animation: gmDropK .45s cubic-bezier(.2,.9,.3,1.2); }
@keyframes gmDropK { from { transform: translateY(120px) scale(1.25) rotate(-12deg); opacity: .2; } to { transform: none; opacity: 1; } }
.gmFly { transition: transform .2s ease-in, opacity .2s; transform: translateY(-90px) scale(1.15) !important; opacity: .3; }
@media (prefers-reduced-motion: reduce) { .gmDrop, .gmDie, .gmPc::after, .gmMemCard { animation: none !important; } }

.gmYardTile { width: 30px; height: 52px; border-radius: 7px; border: 1px solid #0b2e1d; background: repeating-linear-gradient(45deg, #1a1a20 0 5px, #2a2a33 5px 10px); box-shadow: 0 3px 5px rgba(0,0,0,.5); cursor: pointer; padding: 0; transition: transform .12s; }
.gmYardTile:not(:disabled):hover, .gmYardTile:not(:disabled):active { transform: translateY(-4px); }
.gmYardTile:disabled { opacity: .7; cursor: default; }


.gmPlayCard { position: relative; width: 56px; height: 82px; border-radius: 7px; background: #fff; border: 1px solid #bfc0c6; box-shadow: 0 3px 6px rgba(0,0,0,.35); font-family: inherit; color: #0e0e11; padding: 0; flex: none; direction: ltr; transition: transform .18s, box-shadow .18s; }
.gmPlayCard.red { color: #c4141b; }
.pcCorner { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: 1; gap: 1px; }
.pcCorner b { font-size: 11px; font-weight: 800; letter-spacing: -.5px; } .pcCorner svg { width: 8px; height: 8px; }
.pcCorner.tl { top: 3px; left: 4px; } .pcCorner.br { bottom: 3px; right: 4px; transform: rotate(180deg); }
.pcMid { position: absolute; left: 30%; right: 30%; top: 17%; bottom: 17%; }
.pcPip { position: absolute; width: 9px; height: 9px; transform: translate(-50%, -50%); } .pcPip.pcRot { transform: translate(-50%, -50%) rotate(180deg); } .pcAce { width: 24px; height: 24px; }
.pcFace { position: absolute; inset: -4px -3px; border: 1.5px solid currentColor; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 3px 0; background: linear-gradient(160deg, #fff7e0, #f1dfb0); }
.pcFace em { font-style: normal; font-size: 11px; font-weight: 800; } .pcFaceS { width: 12px; height: 12px; } .pcFaceS.pcRot { transform: rotate(180deg); }
.gmCardBack { background: #fff; border: 3px solid #fff; box-shadow: 0 3px 6px rgba(0,0,0,.4); } .gmCardBack::after { content: ""; position: absolute; inset: 0; border-radius: 4px; background: repeating-linear-gradient(45deg, #e01f26 0 5px, #8d0d12 5px 10px); outline: 1px solid #8d0d12; }
.chFan { display: flex; flex-wrap: nowrap; justify-content: safe center; padding: 24px 24px 22px; direction: ltr; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.chFan .gmPlayCard { margin: 0 -14px 0; transform: translateY(var(--dy, 0)) rotate(var(--rot, 0)); transform-origin: 50% 120%; flex: none; cursor: default; }
.chFan button.gmPlayCard { cursor: pointer; }
.chFan .gmPlayCard.on { transform: translateY(-18px) rotate(var(--rot, 0)); border-color: #e01f26; box-shadow: 0 8px 10px rgba(224,31,38,.45); z-index: 3; }
.chTable { min-height: 120px; display: flex; align-items: center; justify-content: center; }
.chPile { position: relative; display: flex; align-items: center; justify-content: center; width: 120px; height: 100px; } .chPile .gmPlayCard { position: absolute; }
.gmDealIn { animation: gmDealK .45s cubic-bezier(.2,.9,.3,1.1); } .gmToPile { animation: gmToPileK .5s cubic-bezier(.2,.9,.3,1.1); }
@keyframes gmDealK { from { opacity: 0; translate: 0 70px; scale: .6; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes gmToPileK { from { opacity: .2; translate: 0 160px; scale: 1.3; } to { opacity: 1; translate: 0 0; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .gmDealIn, .gmToPile { animation: none !important; } }
/* in-page dialogs (modal-ui.js) */
.sm-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.sm-box { background: #fff; color: #111; border-radius: 18px; padding: 20px; width: min(420px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.sm-msg { font-size: 16px; font-weight: 700; line-height: 1.6; margin-bottom: 14px; white-space: pre-wrap; word-break: break-word; }
.sm-in { width: 100%; padding: 12px; border: 1.5px solid #ddd; border-radius: 12px; font-size: 16px; margin-bottom: 14px; }
.sm-row { display: flex; gap: 10px; flex-direction: row-reverse; }
.sm-row .btn { flex: 1; padding: 12px; font-size: 15px; border-radius: 12px; }
.sm-no { background: #eee; color: #111; }
