/* Sbaq (سباق): the public site. Colours, radii, the star pattern and the
   fonts follow Sbaq-Design/screens. Light and dark follow the visitor's
   system setting. Fonts are self-hosted (SIL OFL, licences next to the files
   in assets/fonts/): no request leaves this site. */

@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 400; font-display: swap; src: url(fonts/IBMPlexSansArabic-Regular.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 500 600; font-display: swap; src: url(fonts/IBMPlexSansArabic-SemiBold.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 700; font-display: swap; src: url(fonts/IBMPlexSansArabic-Bold.woff2) format('woff2'); }
@font-face { font-family: 'Aref Ruqaa'; font-weight: 700; font-display: swap; src: url(fonts/ArefRuqaa-Bold.woff2) format('woff2'); }
@font-face { font-family: 'Amiri'; font-weight: 400; font-display: swap; src: url(fonts/Amiri-Regular.woff2) format('woff2'); }

:root {
  color-scheme: light dark;
  --bg: #F5F0E4;
  --surface: #FFFFFF;
  --surface-alt: #EEE7D6;
  --border: #E3DAC6;
  --text: #262D1E;
  --text-2: #636A55;
  --primary: #5C6B47;
  --link: #8A4A22;
  --link-hover: #6B3716;
  --copper: #C8743F;
  --gold: #B8903E;
  --success: #3F7A4A;
  --btn: #B5612E;            /* main button on cream */
  --btn-text: #FFFFFF;
  --btn-hover: #9C5226;
  --accent: #E19A5B;         /* the bell, main button on olive */
  --accent-hover: #EBAC74;
  --on-accent: #2A1E12;
  --olive-a: #5C6B47;        /* olive surfaces: hero, cards, scoreboard */
  --olive-b: #46542F;
  --on-olive: #F5EFE0;
  --on-olive-2: #E2DCC8;
  --on-olive-gold: #E5C77F;
  --score: #2F3826;
  --score-me: #C4D7A4;
  --score-opp: #F2B27E;
  --frame: #B8903E;
  --frame-fill: #F5EFE0;
  --frame-letter: #3B4530;
  --bezel: #2F3826;
  --shadow: 0 8px 24px rgba(38, 45, 30, .08);
  --shadow-lg: 0 24px 60px rgba(38, 45, 30, .22);
  --todo-bg: #FFE9A8;
  --todo-text: #5A3B00;
  /* The eight-point star pattern: an 80px tile, thin gold lines, low opacity. */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='%23D9B25E' stroke-width='1.2' opacity='.16'%3E%3Cpolygon points='40,15.2 46.1,25.2 57.5,22.5 54.8,33.9 64.8,40 54.8,46.1 57.5,57.5 46.1,54.8 40,64.8 33.9,54.8 22.5,57.5 25.2,46.1 15.2,40 25.2,33.9 22.5,22.5 33.9,25.2'/%3E%3Cpolygon points='0,19.8 -19.8,0 0,-19.8 19.8,0'/%3E%3Cpolygon points='80,19.8 60.2,0 80,-19.8 99.8,0'/%3E%3Cpolygon points='0,99.8 -19.8,80 0,60.2 19.8,80'/%3E%3Cpolygon points='80,99.8 60.2,80 80,60.2 99.8,80'/%3E%3C/g%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14170F;
    --surface: #22281B;
    --surface-alt: #2A3122;
    --border: #353D2B;
    --text: #F2EDE1;
    --text-2: #A8AE98;
    --primary: #9BAE78;
    --link: #E9A76F;
    --link-hover: #F4C095;
    --gold: #E0B868;
    --success: #8CC79A;
    --btn: #E39A5C;
    --btn-text: #1B140D;
    --btn-hover: #EDAE79;
    --accent: #E39A5C;
    --accent-hover: #EDAE79;
    --on-accent: #1B140D;
    --olive-a: #4E5D3A;
    --olive-b: #323D24;
    --score: #0E110A;
    --frame: #E0B868;
    --frame-fill: #2A3122;
    --frame-letter: #F2EDE1;
    --bezel: #0E110A;
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
    --todo-bg: #5A4300;
    --todo-text: #FFE9A8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  font-size: 17px; line-height: 1.75; overflow-x: hidden;
}
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; border-radius: 8px; }
.olive :focus-visible, .olive:focus-visible { outline-color: var(--on-olive-gold); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.3; }
ul, ol { margin: 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: 24px; }
.skip { position: absolute; inset-inline-start: 16px; top: -80px; z-index: 10; padding: 10px 16px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; }
.skip:focus { top: 16px; color: var(--on-accent); }

/* Olive surface with the star pattern */
.olive, .card.olive { background-color: var(--olive-b); background-image: var(--pattern), linear-gradient(160deg, var(--olive-a), var(--olive-b)); color: var(--on-olive); }
.olive a { color: var(--on-olive); }

/* ---------- Header & nav ---------- */
.nav { padding-block: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand img { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.wordmark { font-family: 'Aref Ruqaa', 'IBM Plex Sans Arabic', serif; font-weight: 700; font-size: 34px; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-links a { min-height: 44px; padding: 0 14px; display: flex; align-items: center; font-size: 15px; font-weight: 600; text-decoration: none; border-radius: 999px; }
.nav-links a:hover { background: rgba(245, 239, 224, .12); }
.nav-links a.cta, .olive .nav-links a.cta { padding: 0 20px; margin-inline-start: 8px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.nav-links a.cta:hover { background: var(--accent-hover); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-end-start-radius: 36px; border-end-end-radius: 36px; }
.hero-body { padding-block: 40px 72px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 48px; }
.hero-copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.verse { font-family: 'Amiri', 'IBM Plex Sans Arabic', serif; font-size: 26px; line-height: 1.6; color: var(--on-olive-gold); }
.hero h1 { font-size: clamp(38px, 5.6vw, 68px); line-height: 1.25; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { max-width: 560px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.85; color: var(--on-olive-2); }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 14px; border-radius: 999px; background: rgba(245, 239, 224, .14); font-size: 14px; font-weight: 600; }
.pill i { width: 8px; height: 8px; border-radius: 999px; background: #F28B6B; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { min-height: 58px; padding: 8px 26px; border-radius: 18px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-size: 18px; font-weight: 700; line-height: 1.3; text-decoration: none; cursor: pointer; }
.btn-accent, .olive a.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-strong { background: var(--btn); color: var(--btn-text); }
.btn-strong:hover { background: var(--btn-hover); color: var(--btn-text); }
.btn-ghost { border: 1.5px solid rgba(245, 239, 224, .45); background: transparent; color: var(--on-olive); font-weight: 600; }
.btn-ghost:hover { border-color: var(--on-olive); }
.btn small { display: block; font-size: 12px; font-weight: 600; }
.btn .two { display: flex; flex-direction: column; align-items: flex-start; }
.hero-note { font-size: 14px; color: var(--on-olive-2); }

.hero-phone { flex: 0 1 auto; margin-inline: auto; position: relative; padding: 8px 36px 0; }
.phone { position: relative; width: 280px; padding: 9px; border-radius: 46px; background: var(--bezel); box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, .1); }
.phone img { display: block; width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: 38px; }
.bell { position: absolute; bottom: 56px; inset-inline-end: -6px; width: 132px; height: 132px; filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .35)); }
.bell svg { display: block; width: 100%; height: 100%; }

/* ---------- Strip ---------- */
.strip ul { list-style: none; padding: 22px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.strip li { min-height: 40px; padding: 6px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.strip li::before { content: ''; width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); }

/* ---------- Sections ---------- */
.section { padding-block: 72px 16px; display: flex; flex-direction: column; gap: 36px; }
.section-head { display: flex; flex-direction: column; gap: 10px; max-width: 660px; }
.eyebrow { font-size: 15px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ''; width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); }
h2 { font-size: clamp(30px, 3.8vw, 44px); }
.section-head p { font-size: 18px; color: var(--text-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; }

/* How it plays */
.step { overflow: hidden; display: flex; flex-direction: column; }
.step-text { padding: 26px 26px 0; display: flex; flex-direction: column; gap: 8px; }
.step-n { align-self: flex-start; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--primary); }
.step h3 { font-size: 23px; }
.step p { font-size: 16px; color: var(--text-2); }
.step-shot { margin-top: 22px; height: 330px; position: relative; overflow: hidden; background-color: var(--surface-alt); display: flex; justify-content: center; }
.step-shot img { flex: none; width: 236px; height: auto; margin-top: 26px; align-self: flex-start; border: 8px solid var(--bezel); border-bottom: 0; border-radius: 34px 34px 0 0; box-shadow: var(--shadow-lg); }
.callout { border-radius: 20px; padding: 18px 22px; background: var(--surface-alt); border: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.callout svg { flex: none; color: var(--copper); }
.callout span { font-size: 17px; }

/* Categories */
.cats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cat { padding: 24px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.star { width: 84px; height: 84px; }
.star polygon { fill: var(--frame-fill); stroke: var(--frame); stroke-width: 3; stroke-linejoin: round; }
.star text { font-family: 'Aref Ruqaa', serif; font-weight: 700; font-size: 44px; fill: var(--frame-letter); }
.cat h3 { font-size: 20px; }
.cat p { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* Modes */
.mode { padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.mode .icon { width: 52px; height: 52px; border-radius: 16px; background: var(--surface-alt); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.mode h3 { font-size: 23px; }
.mode p { font-size: 16px; color: var(--text-2); }
.tag { align-self: flex-start; padding: 3px 12px; border-radius: 999px; background: var(--surface-alt); color: var(--primary); font-size: 13px; font-weight: 700; }
.mode.olive { border-color: transparent; }
.mode.olive .icon { background: rgba(245, 239, 224, .14); color: var(--on-olive-gold); }
.mode.olive p { color: var(--on-olive-2); }
.mode.olive .tag { background: var(--accent); color: var(--on-accent); }

/* League */
.league { border-radius: 32px; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 32px; padding: 48px 44px 0; }
.league-copy { flex: 1 1 380px; min-width: 0; padding-bottom: 48px; display: flex; flex-direction: column; gap: 16px; }
.league-copy .eyebrow { color: var(--on-olive); }
.league-copy > p { font-size: 18px; color: var(--on-olive-2); }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 5px 16px; border-radius: 999px; background: rgba(245, 239, 224, .14); font-size: 15px; font-weight: 600; }
.checks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; }
.checks svg { flex: none; margin-top: 5px; color: var(--on-olive-gold); }
.league-shots { flex: 1 1 380px; align-self: flex-end; display: flex; justify-content: center; align-items: flex-start; gap: 18px; height: 400px; overflow: hidden; }
.league-shots img { width: 46%; max-width: 230px; height: auto; border: 8px solid var(--bezel); border-bottom: 0; border-radius: 34px 34px 0 0; box-shadow: var(--shadow-lg); }
.league-shots picture:last-child img { margin-top: 48px; }
.league-shots picture { display: contents; }

/* Fair play */
.fair { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.fair > div { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.fair .icon { width: 46px; height: 46px; border-radius: 14px; background: var(--surface-alt); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.fair h3 { font-size: 19px; }
.fair p { font-size: 15px; color: var(--text-2); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.faq summary { min-height: 60px; padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; font-size: 18px; font-weight: 700; border-radius: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; color: var(--primary); transition: transform .2s; }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details p { padding: 0 22px 20px; font-size: 16px; color: var(--text-2); }

/* Download */
.download { margin-block: 72px; border-radius: 32px; padding: 44px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.download-copy { flex: 1 1 340px; display: flex; flex-direction: column; gap: 10px; }
.download h2 { font-size: clamp(28px, 3.4vw, 40px); }
.download p { font-size: 18px; color: var(--on-olive-2); }

/* English summary on the landing page */
.en-summary { padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.en-summary h2 { font-size: 28px; }
.en-summary p { color: var(--text-2); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer .wrap { padding-block: 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand-small { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); }
.brand-small img { width: 36px; height: 36px; border-radius: 10px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.footer nav a { min-height: 44px; padding: 0 10px; display: flex; align-items: center; font-size: 15px; color: var(--text); text-decoration: none; border-radius: 10px; }
.footer nav a:hover { text-decoration: underline; }

/* ---------- Document pages (privacy, terms, support, delete account, invite) ---------- */
.doc-head { border-end-start-radius: 28px; border-end-end-radius: 28px; }
.doc { max-width: 800px; margin: 0 auto; padding: 44px 24px 72px; }
.doc h1 { font-size: clamp(30px, 5vw, 42px); margin-bottom: 6px; }
.doc .updated { color: var(--text-2); font-size: 14px; margin-bottom: 22px; }
.doc h2 { font-size: 22px; margin: 34px 0 8px; color: var(--primary); }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-inline-start: 24px; }
.doc li { margin-bottom: 8px; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 52px 0; }
.doc strong { font-weight: 700; }
.doc .room-code { display: inline-block; padding: 2px 14px; border-radius: 12px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 26px; letter-spacing: .14em; }
.doc .actions { margin-top: 20px; }
/* A value the owner still has to fill in. Search the site for "[OWNER:". */
.todo { padding: 1px 6px; border-radius: 6px; background: var(--todo-bg); color: var(--todo-text); font-weight: 700; unicode-bidi: isolate; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .nav-links a:not(.cta):not(.lang) { display: none; }
  .hero-body { padding-block: 20px 52px; gap: 36px; }
  .section { padding-block: 56px 8px; }
  .league { padding: 32px 22px 0; }
  .league-copy { padding-bottom: 8px; }
  .league-shots { height: 320px; }
  .download { margin-block: 56px; padding: 30px 22px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 18px; }
  .wordmark { font-size: 30px; }
  .brand img { width: 40px; height: 40px; }
  .nav-links a { padding: 0 10px; }
  .nav-links a.cta { padding: 0 16px; margin-inline-start: 0; }
  .hero { border-end-start-radius: 28px; border-end-end-radius: 28px; }
  .verse { font-size: 22px; }
  .actions, .actions .btn { width: 100%; }
  .hero-phone { padding-inline: 20px; }
  .phone { width: 250px; }
  .bell { width: 108px; height: 108px; inset-inline-end: -8px; }
  .grid { grid-template-columns: 1fr; }
  .cats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat { padding: 18px 10px; }
  .faq summary { font-size: 17px; padding-inline: 18px; }
  .faq details p { padding-inline: 18px; }
  .footer .wrap { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
