/*
 * The platform's identity (Nasser 2026-11-17, replacing «لوحة الفحم»): royal purple #2D1B7F, blue #3B82F6, gold #FBBF24,
 * lavender #EDE9FE and sky #F0F9FF; Tajawal for Arabic and Poppins for Latin text and numbers; 3D icons and the
 * question-mark mascot. One theme only (Nasser 2026-11-17: «نكتفي بالهوية الجديدة فقط ثيم واحد»). This file is the
 * single source of the platform's colours (as on Feudboard): app.css imports it, and the admin «الهوية» page reads it
 * (light in :root, dark in :root[data-theme="dark"]). Light by default, dark by the device (no data-theme) or the
 * visitor's choice (data-theme, set by shell.js). WCAG AA in both (tests/AdminTest.php). Tokens only: no inline styles
 * (strict CSP). Logical properties only (RTL and LTR).
 */
:root {
  --on-brand: #ffffff;
  --brand: #2d1b7f;
  /* A darker shade of the brand for the shared game kit (nhmsv shared/game-ui, GAMES_PHASE2_SPEC §2): the primary
     button's edge and links. The kit's other names (--on-brand, --accent, --surface, --bg, --ink…) are ours already. */
  --brand-ink: #1e1258;
  --tile: #4a34b8;
  --cat: #8b7cf0;
  --accent: #fbbf24;
  --on-accent: #2d1b7f;
  --accent-shadow: #d99a00;
  /* WhatsApp's own green for «ادعُ عبر واتساب» (GAMES_UNIFIED §19.4); dark text keeps AA on it. */
  --wa: #25d366;
  --on-wa: #0b2e1a;
  --blue: #3b82f6;
  --lavender: #ede9fe;
  --bg: #f0f9ff;
  --surface: #ffffff;
  --ink: #1b1340;
  --muted: #5b5488;
  --line: #e4defc;
  --ok: #16a34a;
  --bad: #e11d48;
  /* The admin's «الربط» states besides green and red (nhmsv ADMIN_SYSTEM_PAGES §3.2): blue «مضبوط، لم يُتحقق» and
     orange «غير مربوط», as on Feudboard. */
  --info: #1d4ed8;
  --info-soft: #e7eefd;
  --orange: #b45309;
  --orange-soft: #fdf1e3;
  --strip-bg: #fef3c7;
  --strip-ink: #78350f;
  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  /* Numbers and Latin words (scores, values, codes, timers): Poppins, then Tajawal for anything Arabic. */
  --font-num: 'Poppins', 'Tajawal', system-ui, sans-serif;
  --content-max: 1920px;
  /* The coordinator's side menu (Nasser 2026-11-03); the active item is --accent. */
  --side-bg: #2d1b7f;
  --side-ink: #ffffff;
  --side-muted: #c9c0f5;
  /* Team colours for the showcase (docs/SHOWCASE_PLAN.md, Nasser 2026-11-05): the flashing square, the announcement
     and result panels and the confetti, by the team's place in the turn order (team-1 … team-6). The same in light and
     dark; white text on each passes WCAG AA for large text. */
  --team-1: #e11d48;
  --team-2: #2563eb;
  --team-3: #16a34a;
  --team-4: #c2410c;
  --team-5: #7c3aed;
  --team-6: #0e7490;
  color-scheme: light;
  /* The mascot clips' backdrop (sampled from public/video/mascot-wait.mp4): the waiting room's top panel fades from
     the clip's top edge to its floor so the clip sits in it seamlessly (Nasser 2026-11-19). Same in both themes. */
  --clip-top: #2b1f53;
  --clip-mid: #302259;
  --clip-floor: #433275;
}
:root[data-theme="dark"] {
  --tile: #3b2a96;
  --cat: #8b7cf0;
  --accent: #fcd34d;
  --accent-shadow: #d99a00;
  --lavender: #2a1f66;
  --bg: #120a36;
  --surface: #1d1452;
  --ink: #f2efff;
  --muted: #b3a9e6;
  --line: #33276e;
  --info: #8fb3ff;
  --info-soft: #16264a;
  --orange: #f5b04a;
  --orange-soft: #33240c;
  --strip-bg: #3d2a06;
  --strip-ink: #fde68a;
  --side-bg: #0d0826;
  --side-ink: #f2efff;
  --side-muted: #b3a9e6;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tile: #3b2a96;
    --cat: #8b7cf0;
    --accent: #fcd34d;
    --accent-shadow: #d99a00;
    --lavender: #2a1f66;
    --bg: #120a36;
    --surface: #1d1452;
    --ink: #f2efff;
    --muted: #b3a9e6;
    --line: #33276e;
    --info: #8fb3ff;
    --info-soft: #16264a;
    --orange: #f5b04a;
    --orange-soft: #33240c;
    --strip-bg: #3d2a06;
    --strip-ink: #fde68a;
    --side-bg: #0d0826;
    --side-ink: #f2efff;
    --side-muted: #b3a9e6;
    color-scheme: dark;
  }
}

/* «ثيم صفحاتك» (nhmsv GAMES_UNIFIED §9.14, Nasser 2026-11-21, as Feudboard): two themes besides the identity, on
   <html data-palette> of the coordinator's signed-in pages and the screen and phones of their games. They keep the
   stored names of the 004 ENUM (no migration): plum = «مشمش وعنب», wine = «فوشي ومشمس». Light, then dark (chosen or
   by the device) with more weight; WCAG AA in both (tests/AdminTest.php). */
:root {
  /* The three dots of each choice in «ثيم صفحاتك» (brand, accent, background), whatever theme the page is in. */
  --pal-charcoal-1: #2d1b7f;
  --pal-charcoal-2: #fbbf24;
  --pal-charcoal-3: #f0f9ff;
  --pal-plum-1: #5b2a86;
  --pal-plum-2: #ff8a1f;
  --pal-plum-3: #fff6ec;
  --pal-wine-1: #a21caf;
  --pal-wine-2: #ffd43b;
  --pal-wine-3: #fdf4ff;
}
:root[data-palette="plum"] {
  --brand: #5b2a86;
  --brand-ink: #3d1a5c;
  --on-brand: #ffffff;
  --tile: #7a3fb0;
  --cat: #b78be0;
  --accent: #ff8a1f;
  --on-accent: #3a1a00;
  --accent-shadow: #d96a00;
  --lavender: #ffe6cc;
  --bg: #fff6ec;
  --surface: #ffffff;
  --ink: #2b1a0e;
  --muted: #6b5240;
  --line: #f1dfcc;
  --side-bg: #3d1a5c;
  --side-ink: #ffffff;
  --side-muted: #e2c9f5;
}
:root[data-palette="wine"] {
  --brand: #a21caf;
  --brand-ink: #701a75;
  --on-brand: #ffffff;
  --tile: #b83ac4;
  --cat: #e08aea;
  --accent: #ffd43b;
  --on-accent: #3a2600;
  --accent-shadow: #d4a900;
  --lavender: #fae8ff;
  --bg: #fdf4ff;
  --surface: #ffffff;
  --ink: #2a0e2e;
  --muted: #6e4a72;
  --line: #f0dcf3;
  --side-bg: #5c1460;
  --side-ink: #ffffff;
  --side-muted: #f5c8f8;
}
:root[data-palette="plum"][data-theme="dark"] {
  --tile: #4a2a6e;
  --cat: #b78be0;
  --accent: #ffa04d;
  --on-accent: #3a1a00;
  --accent-shadow: #d96a00;
  --lavender: #3a2614;
  --bg: #1c1209;
  --surface: #2a1b0d;
  --ink: #fff1e3;
  --muted: #c9ae96;
  --line: #45301c;
  --side-bg: #1c0b2e;
  --side-ink: #f3e6ff;
  --side-muted: #c4a3f0;
  color-scheme: dark;
}
:root[data-palette="wine"][data-theme="dark"] {
  --tile: #6b1e75;
  --cat: #e08aea;
  --accent: #ffe066;
  --on-accent: #3a2600;
  --accent-shadow: #d4a900;
  --lavender: #3a1a40;
  --bg: #170a1a;
  --surface: #251029;
  --ink: #fdeeff;
  --muted: #c7a5cc;
  --line: #43224a;
  --side-bg: #22082a;
  --side-ink: #fdeeff;
  --side-muted: #e0a8e8;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="plum"]:not([data-theme="light"]) {
    --tile: #4a2a6e;
    --cat: #b78be0;
    --accent: #ffa04d;
    --on-accent: #3a1a00;
    --accent-shadow: #d96a00;
    --lavender: #3a2614;
    --bg: #1c1209;
    --surface: #2a1b0d;
    --ink: #fff1e3;
    --muted: #c9ae96;
    --line: #45301c;
    --side-bg: #1c0b2e;
    --side-ink: #f3e6ff;
    --side-muted: #c4a3f0;
    color-scheme: dark;
  }
  :root[data-palette="wine"]:not([data-theme="light"]) {
    --tile: #6b1e75;
    --cat: #e08aea;
    --accent: #ffe066;
    --on-accent: #3a2600;
    --accent-shadow: #d4a900;
    --lavender: #3a1a40;
    --bg: #170a1a;
    --surface: #251029;
    --ink: #fdeeff;
    --muted: #c7a5cc;
    --line: #43224a;
    --side-bg: #22082a;
    --side-ink: #fdeeff;
    --side-muted: #e0a8e8;
    color-scheme: dark;
  }
}

/* The big screen's looks (Nasser 2026-11-06: «نمط يحدده المنسق يتناسب مع العرض»), on <html data-look> of the screen
   page only: «تلفاز» keeps the theme (dark), «بروجكتر» is light because a projector washes out dark colours, «قاعة
   مضيئة» is pure black with bright edges for lit halls. Doubled attribute for weight over the dark rules. */
:root {
  --scr-bg: var(--brand);
  --scr-ink: #ffffff;
  --scr-edge: transparent;
  --look-projector-bg: #eef1f4;
  --look-projector-ink: #101418;
  --look-projector-edge: #b9c0c9;
  --look-projector-tile: #ffffff;
  --look-contrast-bg: #000000;
  --look-contrast-ink: #ffffff;
  --look-contrast-edge: #ffffff;
  --look-contrast-tile: #111111;
}
:root[data-look="projector"][data-look] {
  --scr-bg: var(--look-projector-bg);
  --scr-ink: var(--look-projector-ink);
  --scr-edge: var(--look-projector-edge);
  --tile: var(--look-projector-tile);
}
:root[data-look="contrast"][data-look] {
  --scr-bg: var(--look-contrast-bg);
  --scr-ink: var(--look-contrast-ink);
  --scr-edge: var(--look-contrast-edge);
  --tile: var(--look-contrast-tile);
}
