/* iPad mini 2012 — Safari iOS 9 : pas de variables CSS, pas de grid, pas de gap */
* { box-sizing: border-box; -webkit-tap-highlight-color: rgba(0,0,0,0); }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: #1b1916; color: #f3eee6;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.3;
  -webkit-user-select: none; user-select: none;
  -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; -webkit-appearance: none; border: 0; padding: 0; cursor: pointer; }

.ecran {
  display: -webkit-flex; display: flex;
  height: 100%; padding: 14px 14px 10px;
  -webkit-transition: opacity 1s; transition: opacity 1s;
}
.col { display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; min-height: 0; }
.col-gauche { width: 250px; margin-right: 14px; }
.col-centre { -webkit-flex: 1; flex: 1; margin-right: 14px; min-width: 0; }
.col-droite { width: 250px; }

.titre {
  color: #a69a8a; font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; margin: 2px 2px 8px;
}

/* ---- Gauche ---- */
.horloge { font-size: 84px; font-weight: 200; line-height: 1; letter-spacing: -2px; }
.date { font-size: 20px; color: #d8cfc2; margin: 4px 0 14px; }

.meteo-now { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; margin-bottom: 10px; }
.meteo-now .ic { font-size: 50px; margin-right: 12px; }
.meteo-now .t { font-size: 40px; font-weight: 300; }
.meteo-now .l { font-size: 15px; color: #a69a8a; }

.previsions { background: #26231f; border-radius: 16px; padding: 4px 12px; margin-bottom: 12px; }
.jour { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; padding: 6px 0; border-top: 1px solid #312d28; font-size: 16px; }
.jour:first-child { border-top: 0; }
.jour .n { width: 62px; color: #d8cfc2; }
.jour .ic { width: 34px; font-size: 20px; }
.jour .p { width: 54px; color: #7fb3e6; font-size: 14px; }
.jour .mm { -webkit-flex: 1; flex: 1; text-align: right; }
.jour .mm span { color: #8a7f72; }

.energie { background: #26231f; border-radius: 16px; padding: 12px 14px; font-size: 16px; margin-top: auto; }
.energie.vert { background: #213322; }
.energie b { font-size: 22px; font-weight: 600; }
.energie .s { color: #a69a8a; font-size: 14px; margin-top: 2px; }

/* ---- Centre : chauffage ---- */
.zone { margin-bottom: 10px; }
.tuiles { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -4px; }
.tuile {
  width: -webkit-calc(33.333% - 8px); width: calc(33.333% - 8px);
  margin: 0 4px 8px; height: 96px; border-radius: 16px;
  background: #26231f; color: #f3eee6; text-align: left; padding: 10px 12px;
  position: relative;
}
.tuile .n { font-size: 14px; color: #d8cfc2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tuile .t { font-size: 34px; font-weight: 300; margin-top: 6px; }
.tuile .c { position: absolute; right: 12px; bottom: 12px; font-size: 14px; color: #a69a8a; }
.tuile.chauffe { background: #3a2a1c; }
.tuile.chauffe .c { color: #ff9f43; }
.tuile.off { opacity: .5; }
.tuile.poele { background: #4a2e12; }
.tuile.poele.eteint { background: #26231f; }
.tuile.poele .c { color: #ffc078; font-weight: 700; }

.duo { display: -webkit-flex; display: flex; }
.titre .tz { color: #ffc078; text-transform: none; letter-spacing: 0; font-size: 14px; margin-left: 4px; }
.tuile.appoint .t { font-size: 28px; }
.f-onoff { display: block; width: 100%; margin-top: 14px; padding: 12px; border-radius: 12px; background: #4a2e12; color: #ffc078; font-size: 17px; font-weight: 600; }

/* ---- Centre : lumières ---- */
.lampe {
  width: -webkit-calc(16.666% - 8px); width: calc(16.666% - 8px);
  margin: 0 4px 8px; height: 84px; border-radius: 16px;
  background: #26231f; color: #d8cfc2; font-size: 14px; text-align: left; padding: 8px 10px;
}
.lampe .ic { display: block; font-size: 24px; opacity: .3; margin-bottom: 4px; }
.lampe.on { background: #f5c518; color: #2b2620; font-weight: 700; }
.lampe.on .ic { opacity: 1; }

/* ---- Droite : agenda ---- */
.agenda { -webkit-flex: 1; flex: 1; overflow: hidden; background: #26231f; border-radius: 16px; padding: 6px 14px; }
.a-jour { color: #ffc078; font-size: 14px; font-weight: 700; margin: 8px 0 4px; }
.a-jour.auj { color: #f3eee6; font-size: 16px; }
.evt { display: -webkit-flex; display: flex; padding: 3px 0; font-size: 15px; }
.evt .h { width: 50px; color: #a69a8a; -webkit-flex-shrink: 0; flex-shrink: 0; }
.evt .x { -webkit-flex: 1; flex: 1; min-width: 0; }
.evt .x small { display: block; color: #8a7f72; font-size: 13px; }
.evt.passe { opacity: .4; }
.vide { color: #8a7f72; font-size: 15px; padding: 3px 0; }

/* ---- Centre : stores ---- */
.titre-stores { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.titre-stores .tous { margin-left: auto; }
.pastille {
  height: 28px; padding: 0 12px; margin-left: 6px; border-radius: 14px;
  background: #3a352f; color: #f3eee6; font-size: 13px; font-weight: 700; letter-spacing: 0;
}
.store {
  width: -webkit-calc(33.333% - 8px); width: calc(33.333% - 8px);
  margin: 0 4px 8px; height: 96px; border-radius: 16px; background: #26231f; padding: 8px 10px;
}
.store .n { font-size: 14px; color: #d8cfc2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store .e { font-size: 13px; color: #a69a8a; }
.store .b { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; margin-top: 6px; }
.store .b button { width: 38px; height: 38px; border-radius: 19px; background: #3a352f; color: #f3eee6; font-size: 15px; }
.store.off { opacity: .45; }

/* ---- Droite : musique ---- */
.musique { margin-top: 10px; }
.musique .enceinte { padding: 8px 10px; }
.musique .enceinte:last-child { margin-bottom: 0; }
.musique .mini { width: 34px; height: 34px; font-size: 15px; margin-left: 4px; }
.enceinte { background: #26231f; border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.enceinte .info { -webkit-flex: 1; flex: 1; min-width: 0; }
.enceinte .n { font-size: 15px; font-weight: 700; }
.enceinte .s { font-size: 13px; color: #a69a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini { width: 40px; height: 40px; border-radius: 20px; background: #3a352f; color: #f3eee6; font-size: 18px; margin-left: 6px; }
.mini.play { background: #f3eee6; color: #1b1916; }

/* ---- Fenêtres ---- */
.voile { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,.65); z-index: 10; }
.fenetre {
  position: absolute; left: 50%; top: 50%; width: 420px; margin-left: -210px;
  -webkit-transform: translateY(-50%); transform: translateY(-50%);
  background: #2c2924; border-radius: 24px; padding: 26px; text-align: center;
}
.f-nom { font-size: 26px; font-weight: 700; }
.f-actuelle { color: #a69a8a; font-size: 17px; margin-top: 4px; }
.f-reglage { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; margin: 22px 0 6px; }
.rond { width: 78px; height: 78px; border-radius: 39px; background: #3f3a33; color: #fff; font-size: 40px; }
.f-val { width: 150px; font-size: 52px; font-weight: 300; }
.f-aide { color: #a69a8a; font-size: 15px; }
.f-fermer { margin-top: 22px; width: 100%; height: 56px; border-radius: 16px; background: #f08c00; color: #fff; font-size: 19px; font-weight: 700; }
.f-erreur { color: #ff8a7a; min-height: 22px; margin-top: 8px; }
#code {
  width: 100%; height: 54px; margin-top: 14px; border-radius: 12px; border: 0;
  background: #1b1916; color: #fff; font-size: 24px; text-align: center; letter-spacing: 2px;
}

.alerte {
  position: fixed; left: 50%; bottom: 14px; width: 520px; margin-left: -260px;
  background: #5c1f16; color: #ffd8d0; border-radius: 14px; padding: 10px 14px; text-align: center; z-index: 5;
}

/* ---- Nuit : écran très atténué, l'heure reste lisible ---- */
body.nuit { background: #000; }
body.nuit .ecran > .col { opacity: .12; }
body.nuit .ecran > .col-gauche { opacity: 1; }
body.nuit .col-gauche > * { opacity: .1; }
body.nuit .col-gauche .horloge, body.nuit .col-gauche .date { opacity: .45; }
