/* ---------------------------------------------------------------------------
   Jetons du design system : polices et couleurs, modes sombre et clair.

   Refonte de novembre 2026 (Thibaud, maquettes du canevas « Collège en
   ligne · refonte ») : la base de Lycée en ligne, poussee vers le jeu.
   Une couleur, un role : flamme pour jouer et defier, violet pour apprendre,
   cyan pour les codes, le brevet et les XP, rouge combat et or pour la
   Battle School et les trophees.

   Le site est concu d'abord pour le mode sombre, qui est la valeur de `:root`.
   Le mode clair decline les memes roles et s'applique dans deux cas :
   - le visiteur l'a choisi (`<html data-theme="light">`, pose par theme.js) ;
   - il n'a rien choisi et son systeme est en clair (`prefers-color-scheme`).
   Un choix explicite `data-theme="dark"` l'emporte sur le systeme.

   Les composants n'utilisent que ces jetons, jamais une couleur en dur.
   Chaque couleur de texte tient 4,5:1 sur les fonds ou elle est posee.
   --------------------------------------------------------------------------- */

/* Polices auto-hebergees, sous-ensemble latin (licence OFL, voir
   fonts/OFL-*.txt). Aucun appel a un domaine tiers : la CSP n'autorise que
   `'self'`. Baloo 2 pour les titres, chiffres et boutons ; Nunito pour le
   texte courant, comme Lycee en ligne. */
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/baloo-2-600.woff2") format("woff2");
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/baloo-2-700.woff2") format("woff2");
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("./fonts/baloo-2-800.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/nunito-600.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/nunito-700.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("./fonts/nunito-800.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("./fonts/nunito-900.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --t-font-title: "Baloo 2", "Trebuchet MS", sans-serif;
  --t-font-text: "Nunito", "Helvetica Neue", Arial, sans-serif;

  /* Neutres */
  --t-bg: #0b0b0d;
  --t-surface: #17171b;
  --t-low: #111114;
  --t-soft: #222228;
  --t-border: #2e2e35;
  --t-dashed: #4a4a55;
  --t-text: #f5f5f7;
  --t-muted: #a9a9b4;
  --t-nav: #c9c9d3;

  /* Flamme : jouer, defier, bouton principal, onglet actif, liens */
  --t-accent: #ffb020;
  --t-accent-edge: #c77f00;
  --t-accent-light: #ffc94a;
  --t-accent-deep: #ff9a00;
  --t-on-accent: #231942;
  --t-accent-text: #ffb020;
  --t-accent-bg: #2a1e08;
  --t-accent-border: #7a5a1e;
  --t-accent-soft: #e9d2a6;

  /* Violet : apprendre, cours, sauvegarde, information */
  --t-violet: #7b3fe4;
  --t-violet-edge: #5b24b8;
  --t-on-violet: #ffffff;
  --t-info: #a97bff;
  --t-on-info: #1e1240;
  --t-info-text: #c9b6ff;
  --t-info-soft: #e4d8ff;
  --t-info-bg: #231942;
  --t-info-border: #4a3a85;

  /* Cyan : codes, brevet, XP */
  --t-cyan: #3dd6f5;
  --t-cyan-edge: #1fa3bf;
  --t-cyan-deep: #0b7a8f;
  --t-night-1: #2b1b57;
  --t-night-2: #140c30;
  --t-night-line: #4a3a85;
  --t-on-cyan: #0b2a33;
  --t-cyan-text: #a9e8f5;
  --t-cyan-bg: #0b2a33;
  --t-violet-text: #e4d8ff;
  --t-violet-bg: #35276a;

  /* Rouge combat et or : Battle School, trophees, premiere place */
  --t-battle: #d81e4a;
  --t-battle-edge: #8e0f2e;
  --t-on-battle: #ffffff;
  --t-battle-text: #ff9ab8;
  --t-battle-bg: #3a0e1b;
  --t-battle-deep: #2a0912;
  --t-battle-glow: #5a0f25;
  --t-gold: #ffd54a;
  --t-gold-edge: #b38a00;
  --t-gold-text: #ffd54a;
  /* Pages de la Battle School (modele de Lycee en ligne) : voiles, filets et
     marches du podium sur le rouge et le noir, dans les deux themes. */
  --t-bs-soft: #f6cbd7;
  --t-bs-ink: #1b1530;
  --t-bs-white: #ffffff;
  --t-bs-placeholder: #5f5874;
  --t-bs-bronze: #c9c9d6;
  --t-bs-bronze-edge: #5a5a66;
  --t-bs-confetti: #ff5c8a;
  --t-bs-line: rgba(255, 211, 223, 0.18);
  --t-bs-veil: rgba(255, 255, 255, 0.05);
  --t-bs-shade: rgba(0, 0, 0, 0.3);
  --t-bs-ghost: rgba(255, 255, 255, 0.55);
  --t-bs-chip-line: rgba(255, 255, 255, 0.25);
  --t-bs-gold-line: rgba(255, 213, 74, 0.4);
  --t-bs-gold-glow: rgba(255, 213, 74, 0.35);
  --t-silver: #c9c9d3;
  --t-bronze: #e29a5b;

  /* Vert : juste, maitrise */
  --t-success: #3ddc84;
  --t-success-bg: #123524;
  --t-success-border: #1e8a50;

  /* Rose : faux, fragile, revanche */
  --t-danger: #ff5c8a;
  --t-on-danger: #3a0a1c;
  --t-danger-soft: #ffd3df;
  --t-danger-bg: #3a1626;
  --t-danger-border: #6b3550;

  /* Orange : serie */
  --t-streak: #ff8a3d;

  /* Hero et blocs premium : degrade violet profond, lueur doree. Ces
     aplats gardent leurs valeurs dans les deux themes. */
  --t-hero-1: #8f5bff;
  --t-hero-2: #6a2fd6;
  --t-hero-3: #3a1690;
  --t-hero-4: #1e0b52;
  --t-hero-edge: #2a0f6b;
  --t-hero-text: #ffffff;
  --t-hero-soft: #e9e1ff;
  --t-hero-chip: #c9b6ff;
  --t-ticket-1: #221748;
  --t-ticket-2: #140c30;
  --t-profs-1: #221a3e;
  --t-profs-2: #15102a;
  --t-profs-text: #c9c2de;
  --t-overlay: rgba(0, 0, 0, 0.25);
  --t-overlay-light: rgba(255, 255, 255, 0.2);
  --t-overlay-strong: rgba(11, 11, 13, 0.45);
  --t-rim: rgba(201, 182, 255, 0.35);
  --t-glow-gold: rgba(255, 176, 32, 0.25);
  --t-glow-cyan: rgba(61, 214, 245, 0.16);
  --t-gold-wash: rgba(255, 213, 74, 0.12);
  --t-relief-hi: inset 0 3px 0 rgba(255, 255, 255, 0.45);
  --t-relief-soft: inset 0 3px 0 rgba(255, 255, 255, 0.22);
  --t-shadow-hero: 0 24px 48px rgba(74, 29, 153, 0.45);
  --t-shadow-card: 0 16px 32px rgba(0, 0, 0, 0.45);

  /* Classes : une couleur par niveau, texte blanc pose dessus */
  --t-grade-6e: #7b3fe4;
  --t-grade-6e-edge: #5b24b8;
  --t-grade-5e: #0b7a8f;
  --t-grade-5e-edge: #075566;
  --t-grade-4e: #c2410c;
  --t-grade-4e-edge: #8a2e08;
  --t-grade-3e: #c2185b;
  --t-grade-3e-edge: #87103f;
  --t-on-grade: #ffffff;

  /* Matieres : couleur, fond teinte, bordure, et aplat des cartes de matiere
     (Lycee en ligne). */
  --t-maths: #6f97ff;
  --t-maths-bg: #10213f;
  --t-maths-border: #2c3b6b;
  --t-maths-fill: #2f5fe0;
  --t-maths-edge: #2245b8;
  --t-francais: #ff6b8b;
  --t-francais-bg: #2a1620;
  --t-francais-border: #5a2a3d;
  --t-francais-fill: #c8233f;
  --t-francais-edge: #a81f36;
  --t-histoire-geo: #ff9a4d;
  --t-histoire-geo-bg: #2e1d10;
  --t-histoire-geo-border: #5e3a1c;
  --t-histoire-geo-fill: #985a00;
  --t-histoire-geo-edge: #7d4a00;
  --t-svt: #3ddc84;
  --t-svt-bg: #12281c;
  --t-svt-border: #1f5a39;
  --t-svt-fill: #187a45;
  --t-svt-edge: #12603a;
  --t-physique-chimie: #3cc8d4;
  --t-physique-chimie-bg: #102629;
  --t-physique-chimie-border: #1d4b50;
  --t-physique-chimie-fill: #00739a;
  --t-physique-chimie-edge: #005a78;
  --t-anglais: #c58cff;
  --t-anglais-bg: #241536;
  --t-anglais-border: #4a2f6b;
  --t-anglais-fill: #a92bbd;
  --t-anglais-edge: #741b82;
  --t-technologie: #a9b4cc;
  --t-technologie-bg: #1b1f29;
  --t-technologie-border: #3a4152;
  --t-technologie-fill: #4f46e5;
  --t-technologie-edge: #3730a3;
  --t-espagnol: #8fd14a;
  --t-espagnol-bg: #182512;
  --t-espagnol-border: #35541f;
  --t-espagnol-fill: #3f7a00;
  --t-espagnol-edge: #2a5300;
  --t-on-fill: #ffffff;

  /* Couleurs d'avatar (profil, carte de l'eleve), initiale sombre posee
     dessus, identiques dans les deux modes. */
  --t-avatar-cobalt: #6f97ff;
  --t-avatar-orange: #ff9a4d;
  --t-avatar-rose: #ff5c8a;
  --t-avatar-vert: #3ddc84;
  --t-avatar-turquoise: #3dd6f5;
  --t-avatar-violet: #a97bff;
  --t-on-avatar: #14120a;

  /* QR codes : toujours sombre sur clair, quel que soit le theme, pour
     qu'un telephone les lise. */
  --t-qr-dark: #14151b;
  --t-qr-light: #ffffff;

  /* Logo du gabarit : la flamme, orange bordee d'orange fonce, comme sur le
     favicon, identique dans les deux themes. Celui de Lycee en ligne, en
     pied de page, pose la meme flamme sur un carre violet. */
  --t-logo-fill: #ffb020;
  --t-logo-stroke: #ff7a00;

  /* Formes */
  --t-radius-button: 18px;
  --t-radius-card: 24px;
  --t-radius-field: 14px;
  --t-radius-pill: 999px;
  --t-touch: 44px;
  --t-gap: 1rem;
}

/* Valeurs du mode clair, partagees par les deux cas ci-dessous. */
:root[data-theme="light"] {
  color-scheme: light;

  --t-bg: #f7f5ff;
  --t-surface: #ffffff;
  --t-low: #efeafd;
  --t-soft: #efeafd;
  --t-border: #dcd4f2;
  --t-dashed: #9a94ad;
  --t-text: #1b1530;
  --t-muted: #5d5578;
  --t-nav: #3a3450;

  --t-accent-text: #8a5200;
  --t-accent-bg: #fff3dc;
  --t-accent-border: #f0c36b;
  --t-accent-soft: #6b4300;

  --t-info: #6a3fd0;
  --t-on-info: #ffffff;
  --t-info-text: #5b24b8;
  --t-info-soft: #4a1d99;
  --t-info-bg: #e9dfff;
  --t-info-border: #cdb8f5;

  --t-cyan-text: #0b5566;
  --t-cyan-bg: #e3f8fd;
  --t-violet-text: #5b24b8;
  --t-violet-bg: #efe7ff;

  --t-battle-text: #b0284f;
  --t-battle-bg: #fde3ea;
  --t-gold-text: #8a6400;

  --t-success: #157a47;
  --t-success-bg: #e3f6ea;
  --t-success-border: #a6dcbf;

  --t-danger: #c22a52;
  --t-on-danger: #ffffff;
  --t-danger-soft: #8f1d3c;
  --t-danger-bg: #fde3ea;
  --t-danger-border: #f0b3c4;

  --t-streak: #a3480b;

  --t-maths: #2f5fe0;
  --t-maths-bg: #e6edff;
  --t-maths-border: #b8c9f5;
  --t-francais: #c22a52;
  --t-francais-bg: #fde8ee;
  --t-francais-border: #f0b3c4;
  --t-histoire-geo: #a3480b;
  --t-histoire-geo-bg: #fdeee2;
  --t-histoire-geo-border: #f2c6a2;
  --t-svt: #157a47;
  --t-svt-bg: #e3f6ec;
  --t-svt-border: #a6dcbf;
  --t-physique-chimie: #0b7480;
  --t-physique-chimie-bg: #e0f5f7;
  --t-physique-chimie-border: #a3dde3;
  --t-anglais: #8b1fa0;
  --t-anglais-bg: #f8e6fb;
  --t-anglais-border: #e2b5ea;
  --t-technologie: #4f5d7a;
  --t-technologie-bg: #eceff5;
  --t-technologie-border: #c3cad8;
  --t-espagnol: #3d6b0f;
  --t-espagnol-bg: #ecf6e0;
  --t-espagnol-border: #bcdc98;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --t-bg: #f7f5ff;
    --t-surface: #ffffff;
    --t-low: #efeafd;
    --t-soft: #efeafd;
    --t-border: #dcd4f2;
    --t-dashed: #9a94ad;
    --t-text: #1b1530;
    --t-muted: #5d5578;
    --t-nav: #3a3450;

    --t-accent-text: #8a5200;
    --t-accent-bg: #fff3dc;
    --t-accent-border: #f0c36b;
    --t-accent-soft: #6b4300;

    --t-info: #6a3fd0;
    --t-on-info: #ffffff;
    --t-info-text: #5b24b8;
    --t-info-soft: #4a1d99;
    --t-info-bg: #e9dfff;
    --t-info-border: #cdb8f5;

    --t-cyan-text: #0b5566;
    --t-cyan-bg: #e3f8fd;
    --t-violet-text: #5b24b8;
    --t-violet-bg: #efe7ff;

    --t-battle-text: #b0284f;
    --t-battle-bg: #fde3ea;
    --t-gold-text: #8a6400;

    --t-success: #157a47;
    --t-success-bg: #e3f6ea;
    --t-success-border: #a6dcbf;

    --t-danger: #c22a52;
    --t-on-danger: #ffffff;
    --t-danger-soft: #8f1d3c;
    --t-danger-bg: #fde3ea;
    --t-danger-border: #f0b3c4;

    --t-streak: #a3480b;

    --t-maths: #2f5fe0;
    --t-maths-bg: #e6edff;
    --t-maths-border: #b8c9f5;
    --t-francais: #c22a52;
    --t-francais-bg: #fde8ee;
    --t-francais-border: #f0b3c4;
    --t-histoire-geo: #a3480b;
    --t-histoire-geo-bg: #fdeee2;
    --t-histoire-geo-border: #f2c6a2;
    --t-svt: #157a47;
    --t-svt-bg: #e3f6ec;
    --t-svt-border: #a6dcbf;
    --t-physique-chimie: #0b7480;
    --t-physique-chimie-bg: #e0f5f7;
    --t-physique-chimie-border: #a3dde3;
    --t-anglais: #8b1fa0;
    --t-anglais-bg: #f8e6fb;
    --t-anglais-border: #e2b5ea;
    --t-technologie: #4f5d7a;
    --t-technologie-bg: #eceff5;
    --t-technologie-border: #c3cad8;
    --t-espagnol: #3d6b0f;
    --t-espagnol-bg: #ecf6e0;
    --t-espagnol-border: #bcdc98;
  }
}

/* Ilots sombres : le hero, la carte de la bataille des colleges, le bloc des
   professeurs et les ecrans de jeu gardent les valeurs du mode sombre dans
   les deux themes, comme sur Lycee en ligne. Les pages de la Battle School
   (`body[data-page="battle"]`) le sont en entier, hors menu lateral. */
.dark-island,
body[data-page="battle"] .app {
  color-scheme: dark;

  --t-bg: #0b0b0d;
  --t-low: #111114;
  --t-surface: #17171b;
  --t-soft: #222228;
  --t-border: #2e2e35;
  --t-text: #f5f5f7;
  --t-muted: #a9a9b4;
  --t-accent-text: #ffb020;
  --t-accent-bg: #2a1e08;
  --t-accent-border: #7a5a1e;
  --t-accent-soft: #e9d2a6;
  --t-info: #a97bff;
  --t-info-text: #c9b6ff;
  --t-info-bg: #231942;
  --t-info-border: #4a3a85;
  --t-cyan-text: #a9e8f5;
  --t-cyan-bg: #0b2a33;
  --t-violet-text: #e4d8ff;
  --t-violet-bg: #35276a;
  --t-battle-text: #ff9ab8;
  --t-battle-bg: #3a0e1b;
  --t-gold-text: #ffd54a;
  --t-success: #3ddc84;
  --t-success-bg: #123524;
  --t-danger: #ff5c8a;
  --t-danger-bg: #3a1626;
}
