/* Bacheca di casa. Niente CSS grid né variabili: deve funzionare anche su Safari 9 (iPad 2). */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #0b1d45; color: #eaf0ff; overflow: hidden; }
body {
  font: 16px/1.35 -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-text-size-adjust: 100%;
}
input, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#vista {
  position: absolute; top: 0; left: 0; right: 0; bottom: 64px; padding: 10px 10px 0 10px;
  overflow: auto; -webkit-overflow-scrolling: touch;
}

/* ---------- schede ---------- */
.colonne { display: flex; height: 100%; }
.col { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; margin-right: 10px; }
.col:last-child { margin-right: 0; }
.col-persone { flex: 1.15 1 0; }
.scheda {
  background: #13306a; border-radius: 16px; padding: 12px 14px; margin-bottom: 10px;
  overflow: auto; -webkit-overflow-scrolling: touch; flex: 0 0 auto; position: relative;
}
.scheda.cresce { flex: 1 1 0; min-height: 90px; }
.scheda h2 {
  font-size: 17px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center;
}
.scheda h2 .titolo { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piu, .mini {
  width: 34px; height: 34px; border-radius: 17px; font-size: 22px; line-height: 34px; text-align: center;
  background: rgba(255, 255, 255, .15); margin-left: 6px; flex: 0 0 auto;
}
.mini { font-size: 15px; }
.vuoto { color: #9db0d8; text-align: center; padding: 14px 4px; font-size: 14px; }
.persona .vuoto { color: rgba(255, 255, 255, .85); }
.sotto { color: #9db0d8; font-size: 13px; }
.piede { color: rgba(255, 255, 255, .8); font-size: 13px; margin-top: 6px; }

/* righe con il segno di spunta */
.riga {
  display: flex; align-items: center; padding: 9px 4px; border-radius: 10px; font-size: 16px;
}
.riga + .riga { border-top: 1px solid rgba(255, 255, 255, .08); }
.riga .testo { flex: 1; min-width: 0; word-wrap: break-word; }
.riga .sotto { margin-left: 8px; }
.spunta {
  width: 26px; height: 26px; border-radius: 13px; border: 2px solid rgba(255, 255, 255, .6);
  margin-right: 10px; flex: 0 0 auto; text-align: center; line-height: 22px; font-size: 15px;
}
.riga.fatto .testo { text-decoration: line-through; opacity: .55; }
.riga.fatto .spunta { background: #3ddc84; border-color: #3ddc84; color: #0b1d45; }
.riga.in-arrivo { opacity: .5; }
.togli { color: #ff8a8a; font-size: 20px; padding: 0 6px; }

/* ---------- animale ---------- */
.pasti { display: flex; margin: 0 -4px 8px -4px; }
.pasto {
  flex: 1; margin: 0 4px; background: #1d4290; border-radius: 12px; padding: 8px 10px; text-align: left;
  min-height: 62px;
}
.pasto b { display: block; font-size: 14px; }
.pasto.fatto { background: #1f6b4d; }
.passeggiate { display: flex; align-items: center; background: #1d4290; border-radius: 12px; padding: 8px 10px; }
.passeggiate .testo { flex: 1; }
.bottone {
  background: #4f8cff; color: #fff; border-radius: 18px; padding: 7px 14px; font-weight: 600; font-size: 15px;
}
.bottone.grigio { background: rgba(255, 255, 255, .15); }
.bottone.rosso { background: #e5484d; }
.bottone.largo { display: block; width: 100%; padding: 12px; font-size: 17px; margin-top: 8px; }

/* ---------- meteo, orologio, timer ---------- */
.meteo { display: flex; align-items: center; }
.meteo .icona { font-size: 40px; margin-right: 10px; }
.meteo .gradi { font-size: 38px; font-weight: 700; margin-right: 12px; }
.meteo-giorni { display: flex; margin-top: 8px; }
.meteo-giorni div { flex: 1; text-align: center; font-size: 13px; color: #9db0d8; }
.meteo-giorni b { display: block; color: #eaf0ff; font-size: 20px; font-weight: 400; }

.quadrante {
  width: 120px; height: 120px; border-radius: 60px; background: #f4f1e8; position: relative; margin: 2px auto;
  box-shadow: inset 0 0 0 5px #ffd25e;
}
.quadrante.grande { width: 360px; height: 360px; border-radius: 180px; box-shadow: inset 0 0 0 12px #ffd25e; }
.tacca { position: absolute; left: 50%; top: 6%; width: 2%; height: 8%; margin-left: -1%; background: #9aa3b5;
  -webkit-transform-origin: 50% 550%; transform-origin: 50% 550%; }
.lancetta {
  position: absolute; left: 50%; bottom: 50%; border-radius: 4px;
  -webkit-transform-origin: 50% 100%; transform-origin: 50% 100%;
}
.lancetta.h { width: 5%; margin-left: -2.5%; height: 26%; background: #1c2440; }
.lancetta.m { width: 3.4%; margin-left: -1.7%; height: 36%; background: #1c2440; }
.lancetta.s { width: 1.2%; margin-left: -.6%; height: 40%; background: #e5484d; }
.perno { position: absolute; left: 50%; top: 50%; width: 8%; height: 8%; margin: -4% 0 0 -4%; border-radius: 50%;
  background: #e5484d; }

.timer { display: flex; align-items: center; padding: 6px 0; }
.timer .testo { flex: 1; }
.timer .resto { font-size: 26px; font-weight: 700; margin-right: 6px; }
.timer.finito .resto { color: #ff8a8a; }

/* ---------- calendario ---------- */
.mese .settimana { display: flex; }
.mese .giorno {
  flex: 1; text-align: center; padding: 3px 0 5px 0; font-size: 14px; border-radius: 9px; min-height: 30px;
}
.mese .intestazione .giorno { color: #9db0d8; font-size: 12px; font-weight: 700; min-height: 0; }
.mese .giorno.fuori { opacity: .35; }
.mese .giorno.oggi { background: #4f8cff; color: #fff; font-weight: 700; }
.mese .giorno.scelto { box-shadow: inset 0 0 0 2px #fff; }
.puntini { height: 6px; line-height: 6px; }
.puntino { display: inline-block; width: 6px; height: 6px; border-radius: 3px; margin: 0 1px; background: #fff; }
.mese.grande .giorno { min-height: 70px; font-size: 18px; text-align: left; padding: 6px 8px; margin: 2px; }
.mese.grande .intestazione .giorno { min-height: 0; text-align: center; }
.mese.grande .ev { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px;
  padding: 0 4px; margin-top: 2px; color: #fff; }

/* ---------- viste a due colonne (liste, calendario, messaggi, impostazioni) ---------- */
.due { display: flex; height: 100%; }
.due > .lato { width: 34%; margin-right: 10px; }
.due > .principale { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.voce-lista { display: block; width: 100%; text-align: left; padding: 12px; border-radius: 12px; font-size: 17px; margin-bottom: 4px; }
.voce-lista.scelta { background: #4f8cff; }
.aggiungi { display: flex; margin-bottom: 8px; }
.aggiungi input, .campo input, .campo textarea {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 0; background: #eaf0ff; color: #0b1d45;
  font-size: 17px; -webkit-appearance: none;
}
.aggiungi .bottone { margin-left: 8px; }
.fumetto-messaggio { background: #1d4290; border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.fumetto-messaggio .sotto { display: block; margin-bottom: 2px; }
.sezione { margin: 14px 0 6px 0; color: #9db0d8; font-size: 13px; font-weight: 700; text-transform: uppercase; }

/* ---------- barra in basso ---------- */
#barra {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: #081634; display: flex;
  align-items: center; padding: 0 12px; border-top: 1px solid rgba(255, 255, 255, .06);
}
#barra .orario { width: 190px; white-space: nowrap; }
#barra .orario b { font-size: 24px; margin-right: 6px; }
#barra .orario span { color: #9db0d8; font-size: 13px; }
#barra nav { flex: 1; text-align: center; white-space: nowrap; }
#barra nav button { width: 58px; height: 52px; border-radius: 12px; font-size: 22px; line-height: 1.1; opacity: .75; }
#barra nav button small { display: block; font-size: 10px; opacity: .9; }
#barra nav button.attiva { background: rgba(79, 140, 255, .25); opacity: 1; }
.gemini {
  background: #4f8cff; background-image: linear-gradient(135deg, #4f8cff, #9b5cff 60%, #ff6fb1);
  color: #fff; font-weight: 700; border-radius: 26px; padding: 10px 18px; font-size: 17px; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(155, 92, 255, .45);
}

/* ---------- strati sopra la bacheca ---------- */
.strato { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: none; z-index: 10; }
.strato.aperto { display: block; }
#modale { background: rgba(4, 10, 30, .7); z-index: 30; }
.finestra {
  position: absolute; left: 50%; top: 8%; width: 520px; margin-left: -260px; max-height: 84%; overflow: auto;
  -webkit-overflow-scrolling: touch; background: #13306a; border-radius: 20px; padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.finestra h3 { font-size: 20px; margin-bottom: 12px; }
.campo { margin-bottom: 12px; }
.campo label { display: block; color: #9db0d8; font-size: 13px; margin-bottom: 4px; }
.campo input, .campo textarea { display: block; width: 100%; }
.campo textarea { height: 90px; }
.chip {
  display: inline-block; padding: 9px 14px; border-radius: 20px; background: rgba(255, 255, 255, .12);
  margin: 0 6px 6px 0; font-size: 15px;
}
.chip.scelto { background: #4f8cff; color: #fff; }
.chip.colore { width: 40px; height: 40px; padding: 0; border: 3px solid transparent; }
.chip.colore.scelto { border-color: #fff; }
.pulsanti { display: flex; margin-top: 16px; }
.pulsanti .bottone { flex: 1; margin-left: 8px; padding: 12px; font-size: 17px; }
.pulsanti .bottone:first-child { margin-left: 0; }

#banner { position: absolute; top: 8px; left: 50%; width: 640px; margin-left: -320px; z-index: 25; }
.avviso-banner {
  display: flex; align-items: center; background: #ffd25e; color: #1c2440; border-radius: 16px; padding: 12px 14px;
  margin-bottom: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-size: 18px;
}
.avviso-banner.timer { background: #ff6f6f; color: #fff; }
.avviso-banner .testo { flex: 1; }
.avviso-banner .bottone { background: #1c2440; color: #fff; margin-left: 10px; }

#toast {
  position: absolute; bottom: 80px; left: 50%; width: 400px; margin-left: -200px; text-align: center; z-index: 40;
  background: #eaf0ff; color: #0b1d45; padding: 10px 14px; border-radius: 14px; display: none;
}

#riposo { background: #050d22; z-index: 20; text-align: center; }
#riposo .ora-grande { font-size: 150px; font-weight: 200; line-height: 1; margin-top: 70px; letter-spacing: -4px; }
#riposo .data-grande { font-size: 26px; color: #9db0d8; margin-top: 8px; }
#riposo .quadrante.grande { margin-top: 40px; }
#riposo .righe-riposo { margin: 30px auto 0 auto; width: 600px; font-size: 20px; color: #c8d4f0; }
#riposo .righe-riposo div { margin-bottom: 6px; }

#chat { background: #0b1d45; z-index: 15; }
#chat .testata { position: absolute; top: 0; left: 0; right: 0; height: 60px; display: flex; align-items: center; padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08); }
#chat .testata .titolo { flex: 1; font-size: 20px; font-weight: 700; }
#chat .testata button { margin-left: 8px; }
#chat-messaggi { position: absolute; top: 60px; left: 0; right: 0; bottom: 78px; overflow: auto; padding: 14px 16px;
  -webkit-overflow-scrolling: touch; }
.fumetto { max-width: 78%; padding: 11px 15px; border-radius: 18px; margin-bottom: 10px; font-size: 18px;
  white-space: pre-wrap; word-wrap: break-word; -webkit-user-select: text; user-select: text; }
.fumetto.io { background: #4f8cff; color: #fff; margin-left: auto; border-bottom-right-radius: 6px; }
.fumetto.gemini { background: #1d4290; border-bottom-left-radius: 6px; }
.fumetto.errore { background: #6b1f2a; }
.fumetto.attesa { opacity: .6; }
#chat .riga-invio { position: absolute; left: 0; right: 0; bottom: 0; height: 78px; display: flex; align-items: center;
  padding: 0 12px; background: #081634; }
#chat .riga-invio input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: 24px; border: 0; font-size: 18px;
  -webkit-appearance: none; }
#chat .microfono { width: 52px; height: 52px; border-radius: 26px; font-size: 24px; background: #1d4290; margin-right: 10px;
  flex: 0 0 auto; }
#chat .microfono.attivo { background: #e5484d; }
#chat .riga-invio .bottone { margin-left: 10px; padding: 13px 18px; }

#accesso { background: #0b1d45; z-index: 50; text-align: center; padding-top: 18%; }
#accesso input { width: 300px; padding: 14px; border-radius: 14px; border: 0; font-size: 20px; text-align: center; margin: 18px 0 10px 0; }

/* ---------- telefono e schermi stretti ---------- */
@media (max-width: 760px) {
  #vista { padding: 8px 8px 0 8px; }
  .colonne, .due { display: block; height: auto; }
  .col, .due > .lato { margin-right: 0; width: auto; }
  .scheda.cresce { flex: none; }
  #barra { padding: 0 4px; }
  #barra .orario { display: none; }
  #barra nav { text-align: left; }
  #barra nav button { width: 44px; }
  #barra nav button small { display: none; }
  .gemini { padding: 10px 14px; }
  .finestra { left: 3%; width: 94%; margin-left: 0; top: 4%; }
  #banner, #toast { left: 3%; width: 94%; margin-left: 0; }
  #riposo .ora-grande { font-size: 90px; }
  #riposo .righe-riposo { width: auto; padding: 0 16px; }
  .quadrante.grande { width: 260px; height: 260px; }
  .fumetto { max-width: 90%; }
}
