/* ─────────────────────────────────────────────
   Variables — reprises de styles.css pour rester
   dans l'identité Super Momo sans charger tout le
   feuillet du site principal.
   ───────────────────────────────────────────── */
:root {
  --black:       #0a0a0a;
  --black2:      #141414;
  --black3:      #1f1f1f;
  --orange:      #ff6b00;
  --orange2:     #ff8124;
  --orange-dim:  #cc5500;
  --orange-glow: rgba(255,107,0,.18);
  --muted:       #6a6a6a;
  --border:      rgba(10,10,10,.12);
  --border2:     rgba(10,10,10,.22);
  --radius:      12px;
  --radius2:     16px;
  --pause:       #5a5a5a;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Barlow', Arial, sans-serif;
  background: #f4f4f2;
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .run-groupe-nom, .run-chrono, .topbar-brand span {
  font-family: 'Barlow Condensed', 'Barlow', Arial, sans-serif;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

.ecran-cachee { display: none !important; }
.bloc-cachee  { display: none !important; }

/* ── Barre du haut ─────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--black);
  border-bottom: 3px solid var(--orange);
}
.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-weight: 900; letter-spacing: .1em; text-transform: uppercase; font-size: 15px;
}
.topbar-logo { height: 32px; width: auto; border-radius: 6px; }
.topbar-run .topbar-circuit {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 14px;
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-droite { display: flex; align-items: center; gap: 16px; }
.horloge {
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .03em;
  font-variant-numeric: tabular-nums; opacity: .85;
}

.btn {
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border2);
  background: #fff; color: var(--black);
  font-weight: 700; font-size: 13px; letter-spacing: .03em;
  transition: transform .12s ease, background .15s, color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-outline { background: #fff; border-color: var(--border2); }
.btn-pause { border-color: var(--pause); color: var(--pause); }
.btn-lancer {
  background: var(--orange); border-color: var(--orange); color: #fff;
  font-size: 16px; padding: 16px 24px; width: 100%; border-radius: var(--radius);
  text-transform: uppercase; letter-spacing: .05em;
}
.btn-lancer:hover { background: var(--orange-dim); border-color: var(--orange-dim); }
.btn-lancer:disabled { background: #ccc; border-color: #ccc; cursor: not-allowed; transform: none; }

/* ─────────────────────────────────────────────
   ÉCRAN LOGIN
   ───────────────────────────────────────────── */
#ecran-login { background: var(--black); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-wrap { width: 100%; max-width: 340px; text-align: center; }
.login-logo { width: 84px; height: auto; margin-bottom: 16px; }
.login-titre { color: #fff; font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 24px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.login-sous { color: rgba(255,255,255,.55); font-size: 13.5px; margin: 0 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-input {
  padding: 14px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06); color: #fff; font-size: 20px; text-align: center;
  letter-spacing: .3em; font-weight: 700;
}
.login-input::placeholder { color: rgba(255,255,255,.35); letter-spacing: normal; font-weight: 400; }
.login-erreur { color: #ff6b6b; font-size: 13px; font-weight: 700; margin-top: 14px; }

/* ─────────────────────────────────────────────
   ÉCRAN CONFIG
   ───────────────────────────────────────────── */
.config-wrap {
  max-width: 760px; margin: 0 auto; padding: 24px 20px 64px;
  display: flex; flex-direction: column; gap: 20px;
}
.carte {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius2);
  padding: 20px 22px;
}
.carte-titre {
  margin: 0 0 6px; font-weight: 900; font-size: 22px; text-transform: uppercase; letter-spacing: .02em;
}
.carte-aide { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }

.champ { margin-bottom: 14px; }
.champ label { display: block; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.champ input[type="text"], .champ input[type="number"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border2); border-radius: 8px; font-size: 15px;
}
.champ input[type="file"] { font-size: 13.5px; }
.ligne-heure-depart { display: flex; gap: 8px; }
.ligne-heure-depart input[type="time"] { flex: 1; padding: 10px 12px; border: 1px solid var(--border2); border-radius: 8px; font-size: 15px; }
.ligne-heure-depart .btn { flex: 0 0 auto; padding: 10px 14px; font-size: 13px; }

.image-apercu {
  margin-top: 10px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  max-height: 260px; display: flex; align-items: center; justify-content: center; background: #f7f7f5;
}
.image-apercu img { width: 100%; height: 100%; object-fit: contain; display: block; }
.image-apercu-vide { padding: 30px 0; color: var(--muted); font-size: 13.5px; }

/* Groupes */
.liste-groupes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ligne-groupe {
  display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--border); border-radius: 10px;
}
.ligne-groupe input[type="color"] { width: 40px; height: 36px; border: none; border-radius: 8px; padding: 0; cursor: pointer; background: none; }
.ligne-groupe input[type="text"] { padding: 8px 10px; border: 1px solid var(--border2); border-radius: 7px; font-size: 14px; font-weight: 600; }
.duree-presets { display: flex; gap: 4px; }
.duree-presets button {
  padding: 6px 9px; border-radius: 6px; border: 1px solid var(--border2); background: #fff; font-size: 12.5px; font-weight: 700;
}
.duree-presets button.actif { background: var(--black); border-color: var(--black); color: #fff; }
.duree-custom { display: flex; align-items: center; gap: 4px; }
.duree-custom input { width: 54px; padding: 6px 6px; text-align: center; border: 1px solid var(--border2); border-radius: 6px; font-size: 13px; }
.duree-custom span { font-size: 12px; color: var(--muted); }
.btn-suppr-groupe {
  border: none; background: none; color: var(--muted); font-size: 18px; padding: 4px 8px; border-radius: 6px; line-height: 1;
}
.btn-suppr-groupe:hover { background: #fdecea; color: #c0392b; }

/* Chips groupes (ajout au planning) */
.chips-groupes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  padding: 8px 14px; border-radius: 99px; border: none; color: #fff;
  font-weight: 700; font-size: 13.5px; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { filter: brightness(1.08); }

/* Planning */
.liste-planning { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.planning-vide { color: var(--muted); font-size: 13.5px; font-style: italic; margin: 6px 0 0; }
.ligne-planning {
  display: grid; grid-template-columns: 6px auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: #f7f7f5; border: 1px solid var(--border);
}
.ligne-planning .pastille { width: 6px; height: 28px; border-radius: 4px; }
.ligne-planning .numero { font-size: 12px; color: var(--muted); font-weight: 700; min-width: 18px; }
.ligne-planning .nom-bloc { font-weight: 700; font-size: 14.5px; }
.ligne-planning .duree-inline { display: flex; align-items: center; gap: 4px; }
.ligne-planning .duree-inline input { width: 50px; padding: 5px; text-align: center; border: 1px solid var(--border2); border-radius: 6px; font-size: 13px; }
.ligne-planning .duree-inline span { font-size: 11.5px; color: var(--muted); }
.actions-ligne { display: flex; gap: 2px; }
.actions-ligne button {
  border: none; background: none; color: var(--muted); font-size: 15px; padding: 4px 6px; border-radius: 6px;
}
.actions-ligne button:hover { background: #eee; color: var(--black); }
.actions-ligne button.suppr:hover { background: #fdecea; color: #c0392b; }

/* ─────────────────────────────────────────────
   ÉCRAN RUN
   ───────────────────────────────────────────── */
.run-wrap {
  display: grid; grid-template-columns: 340px 1fr; gap: 0; min-height: calc(100vh - 62px);
  background: #f4f4f2;
}
.run-gauche { background: #fff; border-right: 1px solid var(--border); padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.run-logo-panel {
  flex: 0 0 auto; padding: 30px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: #f7f7f5; border-radius: var(--radius2); border: 1px solid var(--border);
}
.run-logo-grand { width: 120px; height: auto; border-radius: 10px; }
.run-logo-texte {
  text-align: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  letter-spacing: .06em; font-size: 20px; text-transform: uppercase; color: var(--black); line-height: 1.3;
}
.run-logo-texte span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--orange); }

.run-planning-panel {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  background: #f7f7f5; border-radius: var(--radius2); border: 1px solid var(--border); padding: 18px;
}
.run-planning-entete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.run-planning-titre { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; }
.filtre-planning {
  font-size: 12.5px; font-weight: 700; padding: 5px 8px; border-radius: 7px;
  border: 1px solid var(--border2); background: #fff; color: var(--black); max-width: 150px;
}
.run-planning-prochaine {
  background: var(--orange-glow); border: 1px solid var(--orange); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--black);
}
.run-planning-liste { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.run-planning-item {
  display: grid; grid-template-columns: 52px 6px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; font-size: 13.5px;
  color: var(--muted); transition: background .2s;
}
.run-planning-item .heure { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--black); }
.run-planning-item .pastille-mini { width: 6px; height: 22px; border-radius: 4px; }
.run-planning-item .nom { font-weight: 700; }
.run-planning-item .duree { font-size: 12px; opacity: .8; }
.run-planning-item.item-passe { opacity: .4; }
.run-planning-item.item-actif { background: var(--orange-glow); }
.run-planning-item.item-actif .heure, .run-planning-item.item-actif .nom { color: var(--black); }

.run-droite { padding: 32px; display: flex; flex-direction: column; gap: 26px; }
.run-eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .2em; font-size: 12px; font-weight: 700; text-align: center; }

.bloc-en-cours, .bloc-pause, .bloc-fin {
  position: relative;
  background: #fff; border-radius: var(--radius2); padding: 40px 30px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  border: 2px solid var(--border);
  transition: border-color .3s, background .3s;
}
.horloge-carte {
  position: absolute; top: 24px; right: 30px;
  color: var(--black); opacity: 1; font-size: 32px; font-weight: 800;
}
.run-groupe-nom {
  color: var(--black); font-weight: 900; font-size: clamp(26px, 4vw, 40px); text-transform: uppercase; letter-spacing: .02em; text-align: center;
}
.run-chrono {
  color: var(--black); font-weight: 900; font-size: clamp(70px, 14vw, 150px); line-height: 1; letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.run-chrono.alerte { color: var(--orange); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* Bandeau drapeau à damier — dernières secondes d'une session (pas la pause) */
.damier-bandeau {
  width: 100%; max-width: 460px;
  padding: 8px 0;
  text-align: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 14px;
  border-radius: 8px;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.9);
  background-color: #000;
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  animation: damier-defile .8s linear infinite;
}
@keyframes damier-defile {
  from { background-position: 0 0, 12px 12px; }
  to   { background-position: 24px 0, 36px 12px; }
}

.run-barre { width: 100%; max-width: 460px; height: 10px; border-radius: 99px; background: var(--border); overflow: hidden; }
.run-barre-remplie { height: 100%; width: 100%; background: var(--orange); border-radius: 99px; transition: width 1s linear, background .3s; }

.run-controles { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.run-controles .btn { background: #fff; color: var(--black); border-color: var(--border2); }
.run-controles .btn-pause { border-color: var(--orange); color: var(--orange); }

.run-suite { }
.run-suite-titre { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.run-suite-liste { display: flex; gap: 8px; flex-wrap: wrap; }
.run-suite-item {
  padding: 8px 14px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; gap: 8px; opacity: .9;
}
.run-suite-item .duree { opacity: .75; font-weight: 600; }

/* Photo du circuit, zoomable au clic */
.run-photo-circuit {
  flex: 1 1 auto; min-height: 160px; max-height: 42vh;
  border-radius: var(--radius2); border: 1px solid var(--border); background: #f7f7f5;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  color: var(--muted); font-size: 13.5px;
}
.run-photo-circuit img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }

.lightbox {
  position: fixed; inset: 0; z-index: 999; background: rgba(10,10,10,.92);
  display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out;
}
.lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 8px; }

@media (max-width: 860px) {
  .run-wrap { grid-template-columns: 1fr; }
  .run-gauche { padding: 16px; }
  .run-planning-liste { max-height: 260px; }
  .run-droite { padding: 20px; }
}
