/* Écran familial : thème sombre permanent, disposition C, aucune barre de défilement.
   Toutes les tailles sont en rem ; la taille de base suit la fenêtre (16 px à 1280×800,
   12 px à 1024×600, ~21,6 px à 1920×1080). */
:root {
  --fond: #0f1419;
  --carte: #1a2129;
  --carte-jour: #243042;
  --texte: #e6e9ee;
  --doux: #94a3b8;
  --tres-doux: #64748b;
  --accent: #fbbf24;
  --alerte: #b45309;
  font-size: clamp(11px, min(1.25vw, 2vh), 40px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Souris masquée après 3 s sans mouvement (classe posée par app.js) ; le champ du jeton la garde. */
body.souris-cachee { cursor: none; }

#root { height: 100%; }

/* ---- Grille principale ---- */
.ecran {
  height: 100%;
  padding: 1rem;
  display: grid;
  grid-template-columns: 39fr 61fr;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.6rem 1rem;
}

.gauche {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  min-width: 0;
}

/* ---- Heure, date, météo actuelle ---- */
.entete { display: flex; align-items: center; gap: 1rem; }
.horloge { flex: 1; min-width: 0; }
#heure {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.date { font-size: 1.4rem; color: var(--doux); margin-top: 0.3rem; }
.actuel {
  background: var(--carte);
  border-radius: 0.6rem;
  padding: 0.5rem 0.9rem;
  text-align: center;
  max-width: 45%;
}
.actuel-l1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1.1;
}
.ico { display: inline-flex; line-height: 1; }
.condition {
  font-size: 0.9rem;
  color: var(--doux);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Listes d'événements (lignes de hauteur fixe : app.js mesure leur pas) ---- */
.liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  overflow: hidden;
}
.liste > li { flex: none; }

.ev {
  border-left: 0.3rem solid var(--c);
  background: #1f2933;
  border-radius: 0.35rem;
  padding: 0 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .ev { background: color-mix(in srgb, var(--c) 20%, transparent); }
}
.ev b { font-weight: 600; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.ev.pastille {
  background: var(--c);
  color: #111;
  border-left: 0;
  font-weight: 600;
}
.plus, .vide {
  display: flex;
  align-items: center;
  padding-left: 0.6rem;
  color: var(--doux);
}
.vide { color: var(--tres-doux); }

/* ---- Aujourd'hui ---- */
.aujourdhui {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--carte-jour);
  border: 1px solid var(--accent);
  border-radius: 0.6rem;
  padding: 0.7rem 0.8rem;
}
.aujourdhui h2 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.aujourdhui .liste { flex: 1; }
.aujourdhui .liste > li { height: 3.6rem; font-size: 1.5rem; }
.aujourdhui .ev { display: flex; flex-direction: column; justify-content: center; }
.aujourdhui .ev.pastille { display: block; line-height: 3.6rem; }
.l1, .lieu { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lieu { font-size: 1rem; color: var(--doux); }
.ev.past { opacity: 0.45; }
/* En cours ou prochain : liseré jaune (décision 15 de la spec). */
.ev.next { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---- Météo sur 3 jours ---- */
.previsions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.meteo-jour, .meteo-vide {
  background: var(--carte);
  border-radius: 0.6rem;
  padding: 0.45rem 0.4rem;
  text-align: center;
  color: var(--doux);
  font-size: 1rem;
  min-width: 0;
}
.meteo-vide { grid-column: 1 / -1; }
/* Météo de plus de 2 h : atténuée, avec son heure (« Météo de HH:MM »). */
.meteo-ancienne .actuel-l1, .meteo-ancienne .condition, .previsions.meteo-ancienne { opacity: 0.5; }
.meteo-age { font-size: 0.9rem; color: var(--accent); white-space: nowrap; }
.meteo-jour .lib { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meteo-jour .ico { font-size: 2.4rem; color: var(--texte); margin: 0.15rem 0; }
.meteo-jour .tmp { font-size: 1.3rem; color: var(--texte); font-weight: 600; white-space: nowrap; }

.avertissement {
  background: var(--alerte);
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.5rem 0.8rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.avertissement.orange { background: #c2410c; }
.avertissement.red { background: #b91c1c; }
.avertissement > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Jours suivants (compacts pour afficher le plus d'événements) ---- */
.semaine {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.jour {
  flex: 1 0 auto;
  background: var(--carte);
  border-radius: 0.5rem;
  padding: 0.3rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
/* Pendant la mesure (app.js), les jours reprennent leur hauteur de contenu. */
.mesure .jour { flex-grow: 0; }
.jour h3 { margin: 0; font-size: 0.9rem; color: var(--doux); font-weight: 600; }
.jour .liste > li { height: 1.6rem; line-height: 1.6rem; font-size: 0.95rem; }
.attente {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--doux);
  font-size: 1.6rem;
}

/* ---- Pied ---- */
.pied {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--doux);
}
.maj.ancienne { color: var(--accent); }
.legende i {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 0.2em;
  background: var(--c);
  margin: 0 0.35em 0 1em;
  vertical-align: middle;
}

/* ---- Jeton ---- */
.plein-ecran {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.plein-ecran .message { font-size: 1.6rem; color: var(--doux); }
#form-jeton {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: auto;
}
#form-jeton .message { width: 100%; text-align: center; margin: 0; font-weight: 600; }
#form-jeton input, #form-jeton button {
  font: inherit;
  padding: 0.4rem 0.7rem;
  border-radius: 0.4rem;
  border: 1px solid #475569;
  background: var(--carte);
  color: var(--texte);
}
#form-jeton input { margin-left: 0.5rem; }
#form-jeton button { background: #38bdf8; color: var(--fond); border: 0; font-weight: 600; }
.jeton-refuse, .jeton-requis {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: #7f1d1d;
  box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.5);
}
.jeton-requis { background: #334155; }
.jeton-refuse #form-jeton, .jeton-requis #form-jeton { font-size: 1.1rem; }
.jeton-refuse #form-jeton .message, .jeton-requis #form-jeton .message { width: auto; }
