/* هوية «مسطرة السدو · ليل»: كحلي وزعفراني، والكتابة بأبيض الصوف. الأحمر للجواب الصح بس. */
/* Arabic and Latin (digits) parts of each font; the browser loads only what a page uses. */
@font-face { font-family: "Lalezar"; src: url(/fonts/lalezar/lalezar-arabic-400-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Lalezar"; src: url(/fonts/lalezar/lalezar-latin-400-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Readex"; font-weight: 400; src: url(/fonts/readex/readex-pro-arabic-400-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Readex"; font-weight: 400; src: url(/fonts/readex/readex-pro-latin-400-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Readex"; font-weight: 500; src: url(/fonts/readex/readex-pro-arabic-500-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Readex"; font-weight: 500; src: url(/fonts/readex/readex-pro-latin-500-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Readex"; font-weight: 600; src: url(/fonts/readex/readex-pro-arabic-600-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Readex"; font-weight: 600; src: url(/fonts/readex/readex-pro-latin-600-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  --deep: #161B3F;
  --navy: #1E2452;
  --up: #2A3270;
  --saffron: #F2B233;
  --wool: #F4EDE1;
  --truth: #D63A2F;
  --half: #836A50;
  --wool-dim: rgba(244, 237, 225, .66);
  --wool-faint: rgba(244, 237, 225, .18);
  --r: 14px;
  /* Ruler marks: rows of measuring ticks, a long one every fifth like the ruler band. Only noticeable up close. */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='44'%3E%3Cpath d='M1 0V10M13 0V5M25 0V5M37 0V5M49 0V5' stroke='%2329316B' stroke-width='2'/%3E%3C/svg%3E");
  /* The woven ruler: triangles are the measuring marks. */
  --sadu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='28' fill='%23F2B233'%3E%3Crect width='200' height='2.5'/%3E%3Cpath d='M2 2H38L20 15ZM42 2H78L60 15ZM82 2H118L100 15ZM122 2H158L140 15ZM162 2H198L180 15Z'/%3E%3Crect y='18' width='200' height='1.5'/%3E%3Crect y='18' width='2' height='10'/%3E%3Crect x='39.5' y='18' width='1.5' height='6'/%3E%3Crect x='79.5' y='18' width='1.5' height='6'/%3E%3Crect x='119.5' y='18' width='1.5' height='6'/%3E%3Crect x='159.5' y='18' width='1.5' height='6'/%3E%3C/svg%3E");
  /* Roles that do not flip with the day mode. */
  --on-accent: #1E2452;   /* text on saffron */
  --paper: #F4EDE1;       /* what stays light: QR frames, the payment form */
  --accent-text: #F2B233; /* saffron used as text */
  --logo-q: #F2B233;      /* the logo's «؟» */
  --field-line: transparent; /* the edge of a typing field */
}

/* الوضع النهاري: نفس الهوية بالعكس للي يتعبه الكحلي. خلفية أبيض الصوف بثلاث درجات (بدل الكروت البيضاء)،
   والكتابة كحلي، والزعفراني للأزرار والمسطرة، والأحمر للصح بس. يتبدل من زر وينحفظ في كل جهاز (TQ.setTheme). */
html.day {
  --deep: #E3D8C4;   /* recessed: inputs, bars */
  --navy: #F4EDE1;   /* the page */
  --up: #EAE1D1;     /* cards and secondary buttons */
  --wool: #1E2452;   /* text and drawings */
  --wool-dim: rgba(30, 36, 82, .68);
  --wool-faint: rgba(30, 36, 82, .2);
  --half: #E2C98F;
  --paper: #FFFFFF;
  --accent-text: #9A6500; /* saffron is too pale for text on wool: a deeper saffron */
  --logo-q: #D63A2F;      /* the identity's «؟» on light backgrounds is red */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='44'%3E%3Cpath d='M1 0V10M13 0V5M25 0V5M37 0V5M49 0V5' stroke='%23E3D7C2' stroke-width='2'/%3E%3C/svg%3E");
  --field-line: rgba(30, 36, 82, .22);
  color-scheme: light;
}
html:not(.day) { color-scheme: dark; }
/* By day a typing field is lighter than the card with a thin edge, so it never looks like a button. */
html.day input[type=text], html.day input[type=email], html.day input[type=tel], html.day textarea, html.day select { background: #FFFDF8; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Readex", system-ui, sans-serif;
  background: var(--navy) var(--pattern);
  color: var(--wool);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
.hidden { display: none !important; }
.disp { font-family: "Lalezar", "Readex", sans-serif; font-weight: 400; line-height: 1.25; }
.dim { color: var(--wool-dim); }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- buttons ---------- */
.btn {
  font-family: "Lalezar", "Readex", sans-serif; font-weight: 400;
  border: 0; border-radius: var(--r); background: var(--up); color: var(--wool);
  padding: .5em 1.2em; cursor: pointer; line-height: 1.3;
}
.btn.primary { background: var(--saffron); color: var(--on-accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .tile:focus-visible, input:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; }
.btn.primary:focus-visible { outline-color: var(--wool); }

.pill { display: inline-flex; align-items: center; gap: .4em; background: var(--up); color: var(--accent-text); border-radius: 99px; padding: .15em .9em; font-weight: 500; }
.card { background: var(--up); border-radius: var(--r); }

/* ---------- the ruler band and the logo ---------- */
.sadu { height: 28px; background: var(--sadu) repeat-x; background-size: 200px 28px; }
.logo { display: inline-flex; flex-direction: column; align-items: stretch; }
.logo .word { font-family: "Lalezar", sans-serif; line-height: 1.1; color: var(--wool); }
.logo .word b { font-weight: 400; color: var(--logo-q); }
.logo .ruler { position: relative; height: .32em; background: var(--sadu) repeat-x; background-size: auto 100%; margin-top: .05em; }
.logo .ruler i { position: absolute; top: -.12em; bottom: -.04em; right: 31%; width: .05em; min-width: 2px; background: var(--truth); border-radius: 2px; }
.logo .ruler i::before { content: ""; position: absolute; top: -.05em; left: 50%; width: .14em; height: .14em; min-width: 6px; min-height: 6px; transform: translateX(-50%); border-radius: 50%; background: var(--truth); }

/* ---------- avatars ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2.4em; height: 2.4em; border-radius: 50%; background: var(--up); color: var(--wool);
  font-family: "Lalezar", sans-serif; font-size: 1em; line-height: 1;
  box-shadow: inset 0 0 0 2px var(--wool-faint);
}
.avatar.emoji { font-family: system-ui, "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 1.15em; }
.avatar.on { box-shadow: inset 0 0 0 3px var(--saffron); }

/* ---------- teams: told apart by fill and mark, never by colour ---------- */
.team { display: inline-flex; align-items: center; gap: .35em; border-radius: 99px; padding: .1em .8em; font-weight: 600; white-space: nowrap; }
.team .mk { font-size: .8em; }
.team.t0 { background: var(--saffron); color: var(--on-accent); }
.team.t1 { box-shadow: inset 0 0 0 2px var(--wool); color: var(--wool); }
.team.t2 { background: var(--up); color: var(--wool); }
.team.t3 { box-shadow: inset 0 0 0 2px var(--saffron); color: var(--accent-text); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* The day/night switch as a quiet link (the player's phone). */
.theme-link { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--accent-text); font: 500 14px "Readex", sans-serif; cursor: pointer; padding: 6px 10px; }

/* The round day/night switch at the top of pages (TQ.themeIcon). */
.theme-top { display: inline-flex; }
.theme-icon { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--up); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: none; }
.theme-icon:hover { box-shadow: inset 0 0 0 2px var(--saffron); }
.theme-icon:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
