/* Sport Hub – shared styles (fonts, light mode, sizes, print) */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Tajawal:wght@400;500;700;900&family=Changa:wght@500;700;800&family=Lalezar&family=Reem+Kufi:wght@500;700&display=swap');
:root { --acc: 255 230 0; }
html[data-font="cairo"] body { font-family: 'Cairo', system-ui, sans-serif; }
html[data-font="tajawal"] body { font-family: 'Tajawal', system-ui, sans-serif; }
html[data-font="system"] body { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
html[data-fsize="sm"] { font-size: 14px; } html[data-fsize="md"] { font-size: 16px; }
html[data-fsize="lg"] { font-size: 17.5px; } html[data-fsize="xl"] { font-size: 19px; }
html[data-template="rounded"] .rounded-2xl, html[data-template="rounded"] .rounded-3xl { border-radius: 1.75rem; }
html[data-template="compact"] .p-5 { padding: .9rem; } html[data-template="compact"] .p-6 { padding: 1rem; }

/* ---- theme variables (set by assets/themes.js; defaults = Sport Hub Classic) ---- */
:root { --bg: 9 9 11; --card: 24 24 27; --input: 39 39 42; --side: 18 18 21; --line: 39 39 42; --text: 250 250 250; --muted: 161 161 170;
        --acc-ink: 0 0 0; --acc2: 255 230 0; --acc-text: 255 230 0; --radius: 20px; }
body, .bg-brandDark { background-color: rgb(var(--bg)) !important; color: rgb(var(--text)); }
.bg-brandCard, .bg-sidebarBg { background-color: rgb(var(--card)) !important; color: rgb(var(--text)); }
.bg-sidebarBg { background-color: rgb(var(--side)) !important; }
.bg-brandInput { background-color: rgb(var(--input)) !important; }
.text-white { color: rgb(var(--text)) !important; }
.bg-red-600.text-white, .bg-red-500.text-white, .bg-emerald-600.text-white, .bg-black\/70.text-white { color: #fff !important; }
.text-zinc-200, .text-zinc-300 { color: rgb(var(--text) / .86) !important; }
.text-zinc-400, .text-zinc-500 { color: rgb(var(--muted)) !important; }
.border-zinc-800, .border-zinc-700, .divide-zinc-800\/60 > * { border-color: rgb(var(--line)) !important; }
.text-brandYellow { color: rgb(var(--acc-text)) !important; }
.bg-brandYellow.text-black, .bg-brandYellow { color: rgb(var(--acc-ink)) !important; }
.rounded-3xl { border-radius: calc(var(--radius) * 1.2); } .rounded-2xl { border-radius: var(--radius); }
.inp { width: 100%; background: rgb(var(--input)); border-radius: calc(var(--radius) * .6); padding: 10px 13px; font-size: .9rem; color: rgb(var(--text)); margin-top: 4px; border: 1px solid transparent; }
input, select, textarea { color: rgb(var(--text)); }
.inp:focus { outline: none; border-color: rgb(var(--acc)); }
.btn { font-size: .78rem; font-weight: 700; border-radius: calc(var(--radius) * .55); padding: 7px 12px; border: 1px solid rgb(var(--line)); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: rgb(var(--text)); }
.btn:hover { background: rgba(127,127,127,.15); } .btn:disabled { opacity: .5; }
.btn-acc { background: rgb(var(--acc)); color: rgb(var(--acc-ink)); border-color: rgb(var(--acc)); }
.btn-red { color: #f87171; } .btn-green { color: #34d399; }
.card { background: rgb(var(--card)); border: 1px solid rgb(var(--line)); border-radius: var(--radius); color: rgb(var(--text)); }
.tbl { width: 100%; font-size: .78rem; } .tbl th { color: rgb(var(--muted)); font-weight: 700; } .tbl th, .tbl td { padding: 9px 11px; text-align: start; border-bottom: 1px solid rgb(var(--line)); vertical-align: top; }
.plan-tbl { border-collapse: collapse; border: 1px solid rgb(var(--line)); border-radius: 12px; } .plan-tbl th, .plan-tbl td { border: 1px solid rgb(var(--line)); line-height: 1.75; overflow-wrap: anywhere; font-size: .82rem; } .plan-tbl thead th { background: rgb(var(--line) / .35); }
dialog.sh-modal { background: rgb(var(--card)); color: rgb(var(--text)); border: 1px solid rgb(var(--line)); border-radius: calc(var(--radius) * 1.1); padding: 0; width: min(720px, 95vw); max-height: 92vh; }
dialog.sh-modal.wide { width: min(1050px, 96vw); }
dialog.sh-modal::backdrop { background: rgba(0,0,0,.7); }
/* light templates: keep status colours readable on white */
html[data-mode="light"] .text-emerald-300, html[data-mode="light"] .text-emerald-400 { color: #047857 !important; }
html[data-mode="light"] .text-red-300, html[data-mode="light"] .text-red-400, html[data-mode="light"] .btn-red { color: #b91c1c !important; }
html[data-mode="light"] .text-orange-300 { color: #c2410c !important; } html[data-mode="light"] .text-amber-300 { color: #b45309 !important; }
html[data-mode="light"] .text-sky-300 { color: #0369a1 !important; } html[data-mode="light"] .text-yellow-300 { color: #a16207 !important; }
html[data-mode="light"] .text-violet-300 { color: #6d28d9 !important; } html[data-mode="light"] .text-lime-300 { color: #4d7c0f !important; }
html[data-mode="light"] .btn-green { color: #047857 !important; }
html[data-mode="light"] .bg-red-900\/50 { background: #fee2e2 !important; } html[data-mode="light"] .text-red-200 { color: #991b1b !important; }
/* display fonts & background accents per template */
html[data-display="changa"] h1, html[data-display="changa"] h2, html[data-display="changa"] .text-2xl.font-black, html[data-display="changa"] .text-xl.font-black { font-family: 'Changa', 'Cairo', sans-serif; letter-spacing: -.01em; }
html[data-display="lalezar"] h1, html[data-display="lalezar"] h2, html[data-display="lalezar"] .text-2xl.font-black, html[data-display="lalezar"] .text-xl.font-black { font-family: 'Lalezar', 'Cairo', sans-serif; font-weight: 400 !important; letter-spacing: .01em; }
html[data-display="reem"] h1, html[data-display="reem"] h2, html[data-display="reem"] .text-2xl.font-black, html[data-display="reem"] .text-xl.font-black { font-family: 'Reem Kufi', 'Tajawal', sans-serif; text-transform: uppercase; letter-spacing: .04em; }
html[data-pattern="glow"] body { background-image: radial-gradient(60vw 40vw at 85% -10%, rgb(var(--acc2) / .16), transparent 60%), radial-gradient(50vw 40vw at 0% 110%, rgb(var(--acc) / .14), transparent 60%); background-attachment: fixed; }
html[data-pattern="grid"] body { background-image: linear-gradient(rgb(var(--line) / .35) 1px, transparent 1px), linear-gradient(90deg, rgb(var(--line) / .35) 1px, transparent 1px); background-size: 48px 48px; background-attachment: fixed; }
html[data-pattern="stripes"] body { background-image: repeating-linear-gradient(90deg, rgb(var(--text) / .035) 0 2px, transparent 2px 60px); background-attachment: fixed; }
html[data-pattern="diagonal"] body { background-image: linear-gradient(135deg, rgb(var(--acc2) / .10) 0 25%, transparent 25% 60%, rgb(var(--acc) / .07) 60% 70%, transparent 70%); background-attachment: fixed; }
html[data-pattern="blobs"] body { background-image: radial-gradient(30vw 30vw at 90% 10%, rgb(var(--acc2) / .14), transparent 70%), radial-gradient(35vw 35vw at 5% 95%, rgb(var(--acc) / .16), transparent 70%); background-attachment: fixed; }
html[data-pattern="waves"] body { background-image: radial-gradient(120% 60% at 50% 120%, rgb(var(--acc) / .18), transparent 60%); background-attachment: fixed; }
.theme-prev { overflow: hidden; font-family: inherit; min-height: 118px; }
.theme-card { display: block; text-align: start; border-radius: 16px; padding: 6px; }
.theme-card.on { outline: 3px solid rgb(var(--acc)); }
.nav-a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: calc(var(--radius) * .6); font-size: .8rem; font-weight: 700; color: rgb(var(--muted)); }
.nav-a:hover { background: rgba(127,127,127,.12); color: inherit; } .nav-a.on { background: rgb(var(--acc)); color: rgb(var(--acc-ink)); }
.chip { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 8px; border: 1px solid rgb(var(--line)); white-space: nowrap; }
.avatar { border-radius: 9999px; object-fit: cover; background: rgb(var(--input)); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; flex-shrink: 0; overflow: hidden; }
.dot { width: 9px; height: 9px; border-radius: 99px; background: #ef4444; display: inline-block; }
.scroll-x { overflow-x: auto; }
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; inset: 0; background: #fff !important; color: #000 !important; padding: 24px; }
  .print-area .tbl th, .print-area .tbl td { border-color: #ccc; color: #000 !important; }
  .no-print { display: none !important; }
}

/* ---- v2: single-row academy list, segmented toggle, info tiles ---- */
.acad-row { display: grid; grid-template-columns: auto minmax(160px, 1.2fr) minmax(140px, 1.4fr) auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid rgba(127,127,127,.18); }
.acad-row:last-child { border-bottom: 0; }
.acad-row:hover { background: rgb(255 255 255 / .03); }
.acad-name:hover b { text-decoration: underline; }
.acad-actions .btn[disabled] { opacity: .35; pointer-events: none; }
@media (max-width: 760px) {
  .acad-row { grid-template-columns: auto 1fr; }
  .acad-loc { grid-column: 2; }
  .acad-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
.seg { display: inline-flex; border-radius: 12px; padding: 3px; background: rgb(255 255 255 / .05); gap: 2px; }
.seg button { padding: 6px 12px; border-radius: 9px; font-size: 12px; font-weight: 800; opacity: .7; }
.seg button.on, .seg a.on { background: rgb(var(--acc)); color: rgb(var(--acc-ink)); opacity: 1; }
.info { background: rgb(255 255 255 / .04); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.info .k { font-size: 10px; opacity: .6; }
.info .v { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }

/* ---- v2 finance section ---- */
.fin-nav { display: flex; gap: 4px; overflow-x: auto; padding: 4px; margin-bottom: 16px; border-radius: 16px; background: rgba(127,127,127,.08); scrollbar-width: thin; }
.fin-nav a { white-space: nowrap; padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 700; opacity: .8; }
.fin-nav a:hover { opacity: 1; background: rgba(127,127,127,.12); }
.fin-nav a.on { background: rgb(var(--acc)); color: rgb(var(--acc-ink)); opacity: 1; }
.fin-badge { background: #ef4444; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 10px; }
.fin-hero { border-color: rgb(var(--acc) / .6) !important; background: linear-gradient(135deg, rgb(var(--acc) / .10), transparent); }
.fin-bar { height: 6px; border-radius: 99px; background: rgba(127,127,127,.25); overflow: hidden; margin: 8px 0 4px; }
.fin-bar i { display: block; height: 100%; background: rgb(var(--acc)); border-radius: 99px; }
.tabx { padding: 6px 10px; font-size: 12px; font-weight: 800; border-bottom: 2px solid transparent; opacity: .7; }
.tabx.on { border-color: #ef4444; opacity: 1; }
.todo-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid rgba(127,127,127,.15); border-inline-start: 3px solid transparent; }
.todo-row.overdue { border-inline-start-color: #ef4444; }
.todo-row.soon { border-inline-start-color: #f59e0b; }
.todo-row.expired { border-inline-start-color: #38bdf8; }
.fin-tbl td, .fin-tbl th { vertical-align: middle; }
.fin-tbl tr.st-overdue td { background: rgba(239,68,68,.06); }
.fin-tbl tr.st-overdue td:first-child { box-shadow: inset -3px 0 0 #ef4444; }
[dir="ltr"] .fin-tbl tr.st-overdue td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.fin-tbl tr.st-paid td:first-child, .fin-tbl tr.st-soon td:first-child { box-shadow: inset -3px 0 0 #10b981; }

/* ---- v2 weekly schedule (Saturday → Friday) ---- */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .week-grid { grid-template-columns: 1fr; } }
.week-col { background: rgba(127,127,127,.06); border-radius: 16px; padding: 10px; min-height: 140px; }
.week-col.today { outline: 2px solid rgb(var(--acc)); }
.sess { display: block; width: 100%; text-align: start; border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; font-size: 12px;
  background: rgba(127,127,127,.10); border-inline-start: 4px solid rgb(var(--acc)); }
.sess:hover { background: rgba(127,127,127,.18); }
.sess.cancelled { opacity: .5; border-inline-start-color: #ef4444; text-decoration: line-through; }
.sess.done { border-inline-start-color: #10b981; }
.wz-day { border: 1px solid rgba(127,127,127,.2); border-radius: 14px; padding: 10px; }
.nav-sec { font-size: 10px; font-weight: 900; letter-spacing: .04em; opacity: .5; margin: 14px 10px 4px; text-transform: uppercase; }
.sess { color: rgb(var(--text)); }

/* ---------------- v3: libraries (exercises / nutrition / drills / programs / BMI) ---------------- */
.lib-hero { background: linear-gradient(135deg, rgb(var(--acc) / .16), rgb(var(--acc2, var(--acc)) / .06) 60%, transparent); }
.lib-hero-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: rgb(var(--acc) / .18); }
.lib-card { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.lib-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgb(0 0 0 / .25); }
.lib-card.on { border-color: rgb(var(--acc)); box-shadow: 0 0 0 2px rgb(var(--acc) / .35); }
.lib-img { position: relative; aspect-ratio: 4 / 3; background: rgb(0 0 0 / .25); overflow: hidden; }
.lib-img img { transition: transform .3s ease; } .lib-card:hover .lib-img img { transform: scale(1.04); }
.lib-check { position: absolute; top: 8px; inset-inline-start: 8px; }
.lib-check input { position: absolute; opacity: 0; width: 26px; height: 26px; cursor: pointer; z-index: 2; }
.lib-check span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: rgb(0 0 0 / .55); border: 2px solid #fff; }
.lib-check input:checked + span { background: rgb(var(--acc)); border-color: rgb(var(--acc)); }
.lib-check input:checked + span::after { content: '✓'; color: rgb(var(--acc-ink)); font-weight: 900; font-size: 14px; }
.lib-ok { position: absolute; top: 8px; inset-inline-start: 8px; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: #16a34a; color: #fff; font-weight: 900; }
.lib-dot { width: 8px; height: 8px; border-radius: 99px; background: rgb(var(--acc)); display: inline-block; }
.lib-sendbar { position: sticky; top: 72px; z-index: 20; border-color: rgb(var(--acc) / .6); }
.lib-plan-img { position: relative; height: 150px; overflow: hidden; }
.lib-plan-cap { position: absolute; inset: auto 0 0 0; padding: 12px; background: linear-gradient(transparent, rgb(0 0 0 / .8)); }
.lib-meal { border-inline-start: 3px solid rgb(var(--acc) / .7); padding: 4px 10px; background: rgb(var(--input) / .45); border-radius: 8px; }
.lib-pl { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; border: 1px solid rgb(var(--line)); font-size: 12px; cursor: pointer; }
.lib-pl:has(input:checked) { border-color: rgb(var(--acc)); background: rgb(var(--acc) / .1); }
.lib-pl[hidden] { display: none; }
.lib-bmi-bar { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, #38bdf8 0 28%, #22c55e 28% 56%, #f59e0b 56% 78%, #ef4444 78%); }
.lib-bmi-bar span { position: absolute; top: -5px; width: 20px; height: 20px; margin-inline-start: -10px; border-radius: 99px; background: #fff; border: 3px solid rgb(var(--bg)); box-shadow: 0 2px 6px rgb(0 0 0 / .4); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- v3: receipt ---------------- */
.rcpt { max-width: 720px; margin: auto; font-size: 13px; line-height: 1.8; color: #111; }
.rcpt-head { display: flex; gap: 16px; align-items: center; border-bottom: 3px solid var(--rc, #111); padding-bottom: 12px; }
.rcpt-logo { width: 74px; height: 74px; object-fit: contain; border-radius: 12px; }
.rcpt-no { margin-inline-start: auto; text-align: end; }
.rcpt-no b { display: block; font-size: 20px; color: var(--rc, #111); }
.rcpt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 14px; }
.rcpt-tbl { width: 100%; border-collapse: collapse; margin-top: 14px; } .rcpt-tbl td, .rcpt-tbl th { border: 1px solid #ccc; padding: 6px 10px; text-align: start; }
.rcpt-total { font-size: 22px; font-weight: 900; margin-top: 10px; }
.rcpt-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.rcpt-sign div { border-top: 1.5px dashed #555; padding-top: 6px; text-align: center; color: #444; }

/* ---------------- v3: animated "Sports Hub" logo on the login page (follows the active template) ---------------- */
.sh-mark { width: 92px; height: 92px; filter: drop-shadow(0 10px 24px rgb(var(--acc) / .45)); }
.sh-mark .ring { transform-origin: 50% 50%; animation: shspin 14s linear infinite; }
.sh-mark .ball { transform-origin: 50% 50%; animation: shpulse 2.6s ease-in-out infinite; }
.sh-word { font-weight: 900; letter-spacing: -.02em; background: linear-gradient(90deg, rgb(var(--acc)), rgb(var(--acc-text, var(--acc))), rgb(var(--acc)));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shshine 5s linear infinite; }
@keyframes shspin { to { transform: rotate(360deg); } }
@keyframes shpulse { 50% { transform: scale(1.06); } }
@keyframes shshine { to { background-position: 200% center; } }
@media (prefers-reduced-motion: reduce) { .sh-mark .ring, .sh-mark .ball, .sh-word { animation: none; } }

/* ---------------- v4: scrollbars in their standard place (right edge) for Arabic pages, slim and themed ----------------
   Chrome puts the scrollbar of any scrolling box on the LEFT when the text is right-to-left (sidebar, windows, lists).
   The box scrolls left-to-right while its content stays right-to-left, so the bar sits on the right like the page bar. */
[dir="rtl"] .overflow-y-auto:not(.sb-keep), [dir="rtl"] .overflow-auto:not(.sb-keep) { direction: ltr; }
[dir="rtl"] .overflow-y-auto:not(.sb-keep) > *, [dir="rtl"] .overflow-auto:not(.sb-keep) > * { direction: rtl; }
[dir="rtl"] #side { border-inline-end-width: 0; border-left-width: 1px; }
* { scrollbar-width: thin; scrollbar-color: rgb(var(--muted) / .45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(var(--muted) / .4); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--acc) / .7); background-clip: padding-box; border: 2px solid transparent; }
html { scrollbar-gutter: stable; }

/* v5: the opened list of a <select> must stay readable on every template (light or dark) */
select option, select optgroup { background-color: rgb(var(--input)); color: rgb(var(--text)); }
[data-mode="dark"] .inp, [data-mode="dark"] select { color-scheme: dark; }
[data-mode="light"] .inp, [data-mode="light"] select { color-scheme: light; }

.pay-opt { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 12px; border: 1px solid rgb(var(--line)); cursor: pointer; }
.pay-opt:has(input:checked) { border-color: rgb(var(--acc)); background: rgb(var(--acc) / .12); font-weight: 800; }
.pay-opt input { accent-color: rgb(var(--acc)); }

/* ---------------- v11: home page – big rotating platform logo + glowing icons (follow the active template colours) ---------------- */
.sh-mark-sm { width: 52px; height: 52px; }
.sh-mark-xl { width: 210px; height: 210px; filter: drop-shadow(0 0 28px rgb(var(--acc) / .55)) drop-shadow(0 18px 40px rgb(var(--acc) / .35)); }
@media (min-width: 768px) { .sh-mark-xl { width: 250px; height: 250px; } }
.sh-hero-mark { position: relative; display: grid; place-items: center; padding: 18px; }
.sh-hero-mark::before { content: ''; position: absolute; inset: -6%; border-radius: 9999px; z-index: 0;
  background: radial-gradient(circle, rgb(var(--acc) / .38), rgb(var(--acc) / .10) 45%, transparent 68%); filter: blur(6px); animation: shglow 3.4s ease-in-out infinite; }
.sh-hero-mark > a { z-index: 1; }
.sh-orbit { position: absolute; inset: 0; border-radius: 9999px; border: 2px dashed rgb(var(--acc) / .35); animation: shspin 30s linear infinite reverse; z-index: 0; }
@keyframes shglow { 50% { opacity: .55; transform: scale(1.07); } }
.glow-ic { width: 54px; height: 54px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 27px;
  background: linear-gradient(145deg, rgb(var(--acc) / .26), rgb(var(--acc) / .06)); border: 1px solid rgb(var(--acc) / .5);
  box-shadow: 0 0 22px rgb(var(--acc) / .35), inset 0 0 14px rgb(var(--acc) / .18); transition: box-shadow .25s, transform .25s; }
.glow-ic > span { filter: drop-shadow(0 0 8px rgb(var(--acc) / .8)); }
.feat { transition: transform .25s, border-color .25s; }
.feat:hover { transform: translateY(-4px); border-color: rgb(var(--acc) / .55); }
.feat:hover .glow-ic { box-shadow: 0 0 36px rgb(var(--acc) / .65), inset 0 0 16px rgb(var(--acc) / .25); transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { .sh-hero-mark::before, .sh-orbit { animation: none; } }

/* v22: a very long word or name (or a pasted link) wraps instead of pushing the page sideways */
#view, dialog, #sh-toast, .card { overflow-wrap: break-word; }
#view h1, #view h2, #view h3, dialog h2, dialog h3 { overflow-wrap: anywhere; }
#view .grid > * { min-width: 0; }
/* names (bold) never push a row off the screen – a very long one wraps */
#view b, dialog b { overflow-wrap: anywhere; }
/* v28.8: on phones nothing may push the page sideways (iPhone then cut the scanner and the page) */
@media (max-width: 640px) { html, body { overflow-x: clip; } }
/* v26.3: the QR scanner – a frame over the camera, and the whole screen on phones */
.sh-scan-frame { position: absolute; inset: 14%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }
.sh-scan-cam { overflow: hidden; border-radius: 1rem; }
@media (max-width: 640px) {
  /* v28.8: iPhone (Safari) sized the dialog from "100%" to only part of the screen – fixed size from the screen itself */
  dialog.sh-modal.sh-scan { position: fixed; top: 0; left: 0; right: auto; bottom: auto; transform: none;
    width: 100vw; min-width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh;
    margin: 0; border-radius: 0; border: 0; box-sizing: border-box; overflow: hidden; }
  dialog.sh-modal.sh-scan > div { width: 100%; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; }
  dialog.sh-modal.sh-scan .sh-scan-body, dialog.sh-modal.sh-scan form, dialog.sh-modal.sh-scan [data-last] { width: 100%; max-width: 100%; box-sizing: border-box; }
  dialog.sh-modal.sh-scan > div { max-height: 100vh !important; max-height: 100dvh !important; height: 100%; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  dialog.sh-modal.sh-scan .sh-scan-cam { max-width: none; }
  dialog.sh-modal.sh-scan video { aspect-ratio: auto !important; height: min(58dvh, 100vw); width: 100%; max-width: 100%; }
}
/* v27: the player's registration number next to his name */
.pno { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; line-height: 1; padding: 3px 6px; margin-inline-start: 6px;
  border-radius: 999px; background: rgba(250,204,21,.14); color: #facc15; border: 1px solid rgba(250,204,21,.35); font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: middle; }
html[data-mode="light"] .pno { color: #854d0e; background: #fef9c3; border-color: #fde047; }
.tno { margin-inline-start: 4px; background: rgba(56,189,248,.14); color: #7dd3fc; border-color: rgba(56,189,248,.4); }
html[data-mode="light"] .tno { color: #075985; background: #e0f2fe; border-color: #7dd3fc; }
@media print { .pno { color: #111 !important; background: none !important; border-color: #999 !important; } }

/* v28.6 – ready for the phone app (Android / iOS): keep content clear of the notch and the home bar.
   env(...) is 0 in normal browsers, so the web version looks exactly the same. */
body:not(.p-4) { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
@media (display-mode: standalone) { body:not(.p-4) { padding-top: env(safe-area-inset-top, 0px); } }
#cattBar, .sh-safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }
