/* Family dashboard: sized in rem, and rem scales with the screen width,
   so it looks the same on the 85" TV, a tablet or a laptop. */
:root {
  --bg: #0f141b;
  --panel: rgba(16, 21, 29, 0.68);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f6fa;
  --muted: #b3bdcb;
  --faint: #8592a3;
  --accent: #ffb547;
  --now: #3ddc97;
  --up: #3ddc97;
  --down: #ff6b6b;
  --r: 1.4rem;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 1.05vw; }
@media (max-aspect-ratio: 4/3) { html { font-size: 1.6vw; } }
html, body { height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: "Nunito", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden; cursor: none; -webkit-font-smoothing: antialiased;
}
ul { list-style: none; }

#app {
  position: relative; z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1.2rem 1.8rem;
  padding: 1.4rem 2rem 1rem;
  transition: opacity 2s;
}
body.quiet #app { opacity: 0.35; }

/* ---------- agenda: full height, the star of the screen ---------- */
.panel {
  background: var(--panel); border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.07);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.agenda-panel { padding: 1.4rem 1.7rem; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.agenda-panel > * { flex-shrink: 0; }
h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.7rem; }
.allday { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem; }
.allday:empty { display: none; }
.chip { font-size: 1.5rem; font-weight: 700; padding: 0.3rem 1rem; border-radius: 99rem; background: rgba(255,255,255,0.09); border-left: 0.4rem solid; }

.agenda li { display: grid; grid-template-columns: 8rem 3.8rem 1fr; gap: 1rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.agenda li:last-child { border-bottom: 0; }
.agenda .when { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.agenda .mark { display: flex; justify-content: center; align-self: stretch; align-items: center; }
.agenda .bar { width: 0.5rem; align-self: stretch; border-radius: 99rem; min-height: 2.8rem; }
.agenda .info { min-width: 0; }
.agenda .what { font-size: 2.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda .sub { font-size: 1.3rem; color: var(--faint); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda li.past { opacity: 0.4; }
.agenda li.now .when, .agenda li.next .when { color: var(--text); }
.agenda li.now { background: linear-gradient(90deg, rgba(61,220,151,0.10), transparent 70%); border-radius: 0.8rem; }
.agenda li.msg, .agenda li.more { display: block; font-size: 1.6rem; color: var(--faint); font-weight: 600; padding: 0.7rem 0; border-bottom: 0; }
.agenda li.more { font-size: 1.35rem; }
.agenda li.divider {
  display: block; font-size: 1.35rem; font-weight: 800; color: var(--accent);
  padding: 1.1rem 0 0.3rem; border-bottom: 1px solid rgba(255,181,71,0.35);
}
.agenda li.tmr { padding: 0.4rem 0; }
.agenda li.tmr .when { font-size: 1.55rem; }
.agenda li.tmr .what { font-size: 1.65rem; color: #dfe5ee; }
.agenda li.tmr .tile { width: 3rem; height: 3rem; }
.tag { font-size: 1rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.1rem 0.55rem; border-radius: 99rem; }
.tag.now { background: var(--now); color: #06261a; }
.tag.next { background: var(--accent); color: #2b1b00; }
.who-chip { font-size: 1.15rem; font-weight: 800; color: #0f141b; padding: 0.12rem 0.65rem; border-radius: 99rem; margin-right: 0.6rem; vertical-align: middle; }

/* logo tiles (club logos or built-in icons) */
.tile {
  width: 3.6rem; height: 3.6rem; border-radius: 1rem; background: #fff;
  display: inline-grid; place-items: center; flex: none; overflow: hidden;
  box-shadow: 0 0.15rem 0.5rem rgba(0,0,0,0.3);
}
.tile img { width: 86%; height: 86%; object-fit: contain; }
.tile .fb { display: none; width: 78%; height: 78%; }
.tile .fb svg { width: 100%; height: 100%; display: block; }
.tile.nologo .fb { display: block; }
.tile.xs { width: 1.5rem; height: 1.5rem; border-radius: 0.4rem; box-shadow: none; margin-right: 0.4rem; vertical-align: -0.3rem; }

/* ---------- right side: clock, weather, quiet week ---------- */
.side { display: flex; flex-direction: column; min-height: 0; transition: opacity 2s ease; }
.top { display: flex; justify-content: space-between; align-items: flex-start; }
.greeting { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.time { font-size: 6.4rem; font-weight: 300; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.time .ampm { font-size: 2.2rem; color: var(--muted); margin-left: 0.5rem; font-weight: 600; letter-spacing: 0; }
.date { font-size: 1.9rem; font-weight: 600; color: #dfe5ee; margin-top: 0.2rem; }
.place { min-height: 1.8rem; font-size: 1.35rem; color: #dfe5ee; margin-top: 0.3rem; display: flex; align-items: center; gap: 0.5rem; opacity: 0; transition: opacity 2.5s; }
.place.show { opacity: 1; }
.place svg { width: 1.3rem; height: 1.3rem; flex: none; }

.now-weather { display: flex; align-items: center; gap: 0.8rem; margin-top: 1.2rem; }
.now-weather .icon svg { width: 5.6rem; height: 5.6rem; }
.now-weather .temp { font-size: 4.6rem; font-weight: 300; line-height: 1; }
.now-weather .desc { font-size: 1.5rem; color: var(--muted); font-weight: 600; }
.now-weather .hilo { font-size: 1.5rem; font-weight: 700; }
.now-weather .hilo .lo { color: var(--muted); }
.hours { display: flex; justify-content: space-between; margin: 1rem 0; padding: 0.5rem 1rem; border-radius: 1rem; background: rgba(10,14,20,0.35); }
.hour { text-align: center; font-size: 1.2rem; color: var(--muted); font-weight: 700; }
.hour svg { width: 2.1rem; height: 2.1rem; display: block; margin: 0.1rem auto; }
.hour .t { color: var(--text); font-size: 1.45rem; }
.hour .p { font-size: 1rem; color: #8cc8ff; min-height: 1.2rem; }

.week-wrap {
  flex: 1; min-height: 0; overflow: hidden;
  background: rgba(10, 14, 20, 0.42); border-radius: var(--r); padding: 1rem 1.3rem;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
h3 { font-size: 1.25rem; font-weight: 800; color: var(--faint); margin-bottom: 0.4rem; }
.wk-day { display: grid; grid-template-columns: 4.6rem 5.6rem 1fr; gap: 0.6rem; align-items: start; padding: 0.35rem 0; border-top: 1px solid rgba(255,255,255,0.06); color: var(--muted); }
.wk-day:first-child { border-top: 0; }
.wk-name { font-size: 1.35rem; font-weight: 800; color: #dfe5ee; line-height: 1.1; }
.wk-name small { display: block; font-size: 1rem; color: var(--faint); font-weight: 600; }
.wk-wx { display: flex; align-items: center; gap: 0.25rem; font-size: 1.2rem; font-weight: 700; color: #dfe5ee; }
.wk-wx svg { width: 1.9rem; height: 1.9rem; }
.wk-wx .lo { color: var(--faint); margin-left: 0.3rem; }
.wk-evs { display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; font-size: 1.2rem; font-weight: 600; min-width: 0; padding-top: 0.15rem; }
.wk-ev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wk-ev b { color: var(--faint); font-weight: 800; }
.wk-ev .dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.4rem; vertical-align: 0.1rem; }
.wk-more, .wk-free { color: var(--faint); }
.status { font-size: 0.95rem; color: var(--faint); text-align: right; padding-top: 0.4rem; font-weight: 600; }

/* ---------- tickers ---------- */
.tickers { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.45rem; }
.ticker {
  display: flex; align-items: center; height: 3rem; border-radius: 99rem; overflow: hidden;
  background: rgba(8, 11, 16, 0.78); border: 1px solid rgba(255,255,255,0.07);
}
.tk-label {
  flex: none; height: 100%; display: flex; align-items: center; padding: 0 1.2rem;
  font-size: 1.2rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #10151d;
}
#ticker-sports .tk-label { background: #ff8a65; }
#ticker-markets .tk-label { background: #7fd1ae; }
.tk-viewport { flex: 1; overflow: hidden; height: 100%; display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 2rem, #000 calc(100% - 2rem), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 2rem, #000 calc(100% - 2rem), transparent 100%); }
.tk-track { display: flex; width: max-content; will-change: transform; }
.tk-track.run { animation: tk linear infinite; }
@keyframes tk { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk-copy { display: flex; align-items: center; flex: none; }
.tk-item { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 1.45rem; font-weight: 600; white-space: nowrap; }
.tk-item b { font-weight: 800; }
.tk-sep { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: rgba(255,255,255,0.3); margin: 0 1.6rem; flex: none; }
.tk-crest { width: 1.8rem; height: 1.8rem; object-fit: contain; }
.tk-empty { color: var(--faint); padding-left: 1rem; }
.dim { color: var(--faint); }
.live { color: #06261a; background: var(--now); font-size: 1rem; font-weight: 800; padding: 0.05rem 0.5rem; border-radius: 99rem; }
.sc { font-weight: 800; padding: 0 0.45rem; border-radius: 0.4rem; background: rgba(255,255,255,0.12); }
.sc.res-W { background: rgba(61,220,151,0.28); }
.sc.res-L { background: rgba(255,107,107,0.28); }
.nospoil { font-size: 1.15rem; font-weight: 800; color: #ffd7c9; background: rgba(239,68,68,0.25); padding: 0.1rem 0.6rem; border-radius: 99rem; }
.chg { font-weight: 800; display: inline-flex; align-items: center; gap: 0.25rem; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.chg.flat { color: var(--faint); }
.arw { width: 0; height: 0; border-left: 0.42rem solid transparent; border-right: 0.42rem solid transparent; }
.arw.up { border-bottom: 0.65rem solid var(--up); }
.arw.down { border-top: 0.65rem solid var(--down); }

/* ---------- travel photo backgrounds ---------- */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); }
.bg-layer {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 2.5s ease; will-change: opacity, transform;
}
.bg-layer.show { opacity: 1; }
.bg-layer.zoom { animation: bgzoom 600s linear forwards; }
@keyframes bgzoom { from { transform: scale(1); } to { transform: scale(1.12); } }
#bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(5,8,12,0.55) 0%, rgba(5,8,12,0.15) 55%, rgba(5,8,12,0.35) 100%),
    linear-gradient(180deg, rgba(5,8,12,0.45) 0%, rgba(5,8,12,0.05) 35%, rgba(5,8,12,0.15) 70%, rgba(5,8,12,0.75) 100%);
}
body.has-bg .greeting, body.has-bg .time, body.has-bg .date, body.has-bg .place,
body.has-bg .now-weather, body.has-bg .status { text-shadow: 0 0.1rem 0.6rem rgba(0,0,0,0.6); }

.agenda-panel, .hours, .week-wrap, .status { transition: opacity 2s ease; }
body.photo-moment .agenda-panel, body.photo-moment .hours, body.photo-moment .week-wrap, body.photo-moment .status { opacity: 0; }
