:root {
  --panel-bg: rgba(0,0,0,0.55);
  --panel-bg-mobile: rgba(0,0,0,0.7);
  --text:#fff;
  --muted:#ddd;
  --accent:#38bdf8;
  --font: system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Arial,sans-serif;
}

/* RESET */
*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  -webkit-font-smoothing:antialiased;
}

/* BODY = image entière centrée + bandes noires */
html, body {
  width:100%;
  height:100%;
  overflow:hidden;
  background-color:#000;
  font-family:var(--font);
  color:var(--text);
  text-shadow:0 2px 4px rgba(0,0,0,.9);
}

/* fond image de l'école */
body {
  background-position:center center;
  background-repeat:no-repeat;
  background-size:contain;     /* image entière visible */
  background-color:#000;
  background-image:url("./ecole/1.png");
}

/* Bandeau haut */
.top-overlay {
  position:fixed;
  left:0;
  right:0;
  top:0;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
  padding:10px 20px;
  background:rgba(0,0,0,0);
  color:var(--text);
  font-weight:600;
  line-height:1.3;
  z-index:1000;
  font-size:clamp(14px,1vw,16px);
}

.top-left{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}
.school-emoji{
  font-size:20px;
  line-height:1;
}
.top-title{
  font-size:clamp(16px,1.4vw,20px);
  font-weight:700;
}
.top-clock{
  font-size:clamp(16px,1.4vw,20px);
  font-weight:700;
  min-width:60px;
  text-align:right;
  white-space:nowrap;
}

/* PANELS — version compacte */
.panel {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);   /* centrage vertical parfait */
  background: var(--panel-bg);
  color: var(--text);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 25px rgba(0,0,0,.8);
  padding: 10px 14px;
  line-height: 1.25;
  font-size: clamp(13px,0.9vw,15px);
  z-index: 900;
  max-width: 340px;
  min-width: 240px;
}

.panel-now { left:0.8vw; }
.panel-forecast { right:0.8vw; }

.panel-title {
  font-weight:700;
  font-size:clamp(15px,1vw,18px);
  border-bottom:1px solid rgba(255,255,255,0.4);
  margin-bottom:6px;
  color:var(--text);
  display:inline-block;
  line-height:1.2;
}
.big-temp {
  font-weight:700;
  font-size:clamp(28px,2vw,40px);
  line-height:1.1;
  margin-bottom:10px;
  color:var(--text);
}
.line{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:2px;
  margin-bottom:3px;
}
.lab{
  font-weight:500;
  color:var(--muted);
  min-width:70px;
}
.val{
  font-weight:600;
  color:var(--text);
  margin-left:2px;
}
.iconNow{
  font-weight:600;
  font-size:clamp(14px,1vw,18px);
  line-height:1.2;
  margin-left:6px;
}

/* contenu panneau droit */
.sub-block{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:40px;   /* augmente l’espace entre les deux sections */
}

.sub-title{
  font-weight:700;
  font-size:clamp(15px,1vw,18px);
  border-bottom:1px solid rgba(255,255,255,0.4);
  padding-bottom:4px;
  color:var(--text);
  line-height:1.2;
}
.slot-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.slot-line{
  display:flex;
  flex-direction:column;
  gap:3px;
  border:1px solid rgba(255,255,255,0.2);
  border-radius:6px;
  background:rgba(0,0,0,0.25);
  padding:6px 8px;
  box-shadow:0 10px 20px rgba(0,0,0,.6);
}
.slot-toprow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:clamp(13px,0.9vw,15px);
  line-height:1.2;
  font-weight:600;
  color:var(--text);
}
.slot-hour,
.slot-day{
  font-weight:600;
  color:var(--text);
}
.slot-ico{
  font-size:18px;
  line-height:1;
}
.slot-temp{
  font-weight:600;
  color:var(--accent);
  white-space:nowrap;
}
.slot-rain{
  font-weight:500;
  color:var(--muted);
  font-size:clamp(13px,1vw,15px);
  line-height:1.2;
  opacity:.9;
}

/* Toast */
.toast{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:10vh;
  background:rgba(0,0,0,0.8);
  border:1px solid rgba(255,255,255,0.3);
  color:#fff;
  font-size:12px;
  line-height:1.3;
  padding:4px 8px;
  border-radius:4px;
  box-shadow:0 20px 30px rgba(0,0,0,.9);
  font-weight:600;
  display:none;
  z-index:9999;
}

/* --- MODE MOBILE --- */
@media(max-width:800px){

  /* le corps devient scrollable */
  html, body {
    height:auto;
    min-height:100vh;
    overflow-y:auto;
  }

  /* sur mobile, on privilégie le plein écran esthétique */
  body{
    background-size:cover;          /* au lieu de contain */
    background-position:center center;
    background-attachment:fixed;    /* effet fond fixe agréable */
  }

  /* barre du haut reste visible mais ne mange pas trop d'espace */
  .top-overlay{
    position:sticky;
    top:0;
    left:0;
    right:0;
    z-index:1000;
    padding:8px 12px;
    font-size:14px;
    line-height:1.2;
  }
  .top-title{
    font-size:16px;
  }
  .top-clock{
    font-size:16px;
  }
  .school-emoji{
    font-size:18px;
  }

  /* on ne laisse plus les panneaux en fixed gauche/droite */
  .panel{
    position:relative;
    top:unset;
    left:unset;
    right:unset;
    transform:none;
    max-width:90%;
    min-width:0;
    width:90%;
    margin:12px auto;
    background:var(--panel-bg-mobile);
    backdrop-filter: blur(4px);
    box-shadow:0 12px 24px rgba(0,0,0,.8);
    border-radius:12px;
    border:1px solid rgba(255,255,255,0.3);
    font-size:15px;
    line-height:1.35;
    padding:12px 14px;
  }

  /* les deux panneaux se suivent verticalement */
  .panel-now{
    order:1;
  }
  .panel-forecast{
    order:2;
  }

  /* marges internes un peu plus aérées sur mobile */
  .panel-title,
  .sub-title{
    font-size:16px;
    line-height:1.3;
    margin-bottom:8px;
  }

  .big-temp{
    font-size:32px;
    line-height:1.2;
    margin-bottom:10px;
  }

  .line{
    font-size:15px;
    line-height:1.4;
    margin-bottom:6px;
  }

  .lab{
    min-width:auto;
    font-size:15px;
  }
  .val{
    font-size:15px;
  }
  .iconNow{
    font-size:16px;
  }

  .slot-toprow{
    font-size:15px;
    line-height:1.3;
  }
  .slot-rain{
    font-size:14px;
    line-height:1.3;
  }

  /* plus d’espace entre "En journée" et "Prochains jours" en mobile aussi */
  .sub-block{
    gap:8px;
    margin-bottom:20px;
  }

  .toast{
    position:fixed;
    bottom:20px;
    left:50%;
    transform:translateX(-50%);
    font-size:13px;
    line-height:1.3;
    padding:6px 10px;
  }
}
