/* Screens: Today (dial + day sheet), Videos (streak + archive), Squad (invite, members, hours). */

/* ---- shared header --------------------------------------------------------------------------- */

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 0; }
.top__titles { min-width: 0; }
.top__title {
  margin: 0;
  font: 700 26px/1.1 var(--font-display);
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top__sub { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }

.streak-chip { height: 36px; padding: 0 14px 0 10px; font: 700 16px/1 var(--font-display); }
.streak-chip__fire { font-size: 17px; }

/* ---- the day dial ---------------------------------------------------------------------------- */

.dial-card { display: grid; justify-items: center; gap: 18px; padding: 22px 18px 18px; }

.dial { position: relative; width: min(100%, 300px); aspect-ratio: 1; }
.dial__svg { width: 100%; height: 100%; overflow: visible; }
.dial__face { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; }

.dial__seg {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  transition-property: stroke, opacity;
  transition-duration: 300ms;
}

.dial__seg--ahead { stroke: var(--line-strong); }
.dial__seg--missed { stroke: var(--text-3); stroke-width: 5; opacity: 0.45; }
.dial__seg--filled { stroke: var(--lime); filter: drop-shadow(0 0 6px rgb(200 245 60 / 0.35)); }
:root[data-theme="light"] .dial__seg--filled { stroke: #9bd000; filter: none; }
.dial__seg--now { stroke: var(--coral); animation: now-pulse 1.8s ease-in-out infinite; }

.is-entering .dial__seg {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: seg-draw 600ms var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 45ms + 80ms);
}
.is-entering .dial__seg--now {
  animation: seg-draw 600ms var(--ease-out) forwards, now-pulse 1.8s ease-in-out 1.4s infinite;
  animation-delay: calc(var(--i) * 45ms + 80ms), 1.4s;
}

@keyframes seg-draw { to { stroke-dashoffset: 0; } }

.dial__hand { fill: var(--coral); animation: hand-in 500ms var(--ease-spring) 700ms both; transform-origin: center; transform-box: fill-box; }
.dial__hand { filter: drop-shadow(0 0 6px var(--coral)); }
@keyframes hand-in { from { opacity: 0; transform: scale(0); } }
@keyframes now-pulse { 50% { opacity: 0.45; } }

.dial__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  pointer-events: none;
}

.dial__value { display: flex; align-items: flex-start; font-family: var(--font-display); line-height: 0.9; }
.dial__pct { font-size: 68px; font-weight: 700; letter-spacing: -0.04em; }
.dial__unit { margin: 6px 0 0 3px; font-size: 26px; font-weight: 600; color: var(--text-2); }
.dial__caption { color: var(--text-2); font-size: 14px; }

.me-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  font-size: 14px;
}
.me-line__mine { font-weight: 600; }
.me-line__next { color: var(--text-2); }

.daily-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-elev-2);
  color: var(--text-2);
  font-size: 13px;
}
.daily-note__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }

.daily-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: calc(var(--r-sm) + 10px); /* concentric with the 12px media inside */
  background: var(--violet-soft);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  transition-property: transform;
  transition-duration: 150ms;
}
.daily-card:active { transform: scale(0.98); }
.daily-card__media { width: 84px; }
.daily-card__text { display: grid; gap: 3px; }
.daily-card__kicker { color: var(--violet); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.daily-card__title { font: 700 20px/1.1 var(--font-display); }
.daily-card__meta { color: var(--text-2); font-size: 13px; }
.daily-card .play-badge span { width: 40px; height: 40px; }
.daily-card .play-badge svg { width: 16px; height: 16px; margin-left: 2px; }

/* ---- day sheet (hours x friends) ------------------------------------------------------------- */

.sheet-card { padding: 18px 14px 10px; }
.sheet-card__head {
  display: grid;
  grid-template-columns: 64px 1fr 34px;
  align-items: end;
  gap: 10px;
  padding: 0 4px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-card__title { grid-column: 1 / -1; margin: 0 0 10px; font: 600 16px/1.2 var(--font-display); }
.legend { grid-column: 2; }

.rows { margin: 0; padding: 4px 0 0; list-style: none; }

.row {
  display: grid;
  grid-template-columns: 64px 1fr 34px;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 5px 4px;
  border-radius: var(--r-sm);
}
.row + .row { margin-top: 2px; }
.row--open { background: var(--coral-soft); }
.row--upcoming .row__time { color: var(--text-3); }

.row__time { display: grid; font-weight: 600; font-size: 14px; white-space: nowrap; }
.row--open .row__time { color: var(--coral); }
.row__left { font-weight: 500; font-size: 11px; color: var(--coral); opacity: 0.85; }

.row__cells {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(14px, 24px));
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.cell {
  justify-self: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition-property: transform, background-color;
  transition-duration: 200ms;
}
.cell--sent { background: var(--c); box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / 0.12); }
.cell--waiting { box-shadow: inset 0 0 0 2px var(--c); animation: now-pulse 1.8s ease-in-out infinite; }
.cell--missed {
  display: grid;
  place-items: center;
  background: none;
}
.cell--missed::before { content: "z"; font: 700 12px/1 var(--font-display); color: var(--text-3); }
.cell--upcoming { width: 6px; height: 6px; background: var(--line-strong); }

.row__thumb { width: 30px; justify-self: end; border: 0; padding: 0; cursor: pointer; }
.row__thumb.media { aspect-ratio: 9 / 16; border-radius: 7px; }
.row__thumb--empty {
  aspect-ratio: 9 / 16;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: default;
}
.row--open .row__thumb--empty { box-shadow: inset 0 0 0 1.5px var(--coral); opacity: 0.5; }

.row--ahead { grid-template-columns: auto 1fr; color: var(--text-3); font-size: 13px; border-top: 1px dashed var(--line-strong); border-radius: 0; margin-top: 6px; padding-top: 10px; }
.row__ahead { font-weight: 600; }
.row__ahead-note { justify-self: end; }

/* ---- videos ---------------------------------------------------------------------------------- */

.streak { display: grid; gap: 16px; padding: 20px 18px 16px; }
.streak__top { display: flex; align-items: center; gap: 14px; }
.streak__flame {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--bg-elev-2);
  font-size: 30px;
  filter: grayscale(1);
  opacity: 0.6;
}
.streak__flame.is-lit { background: var(--coral-soft); filter: none; opacity: 1; }
.streak__title { margin: 0; font: 700 22px/1.15 var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }
.streak__sub { margin: 5px 0 0; color: var(--text-2); font-size: 13px; text-wrap: pretty; }

.heat { display: grid; grid-template-columns: repeat(21, 1fr); gap: 4px; }
.heat__cell { aspect-ratio: 1; border-radius: 4px; background: var(--bg-elev-2); }
.heat__cell.is-on { background: var(--lime); }
:root[data-theme="light"] .heat__cell.is-on { background: #9bd000; }
.heat__cell.is-today { box-shadow: 0 0 0 1.5px var(--bg-elev), 0 0 0 3px var(--violet); }
.is-entering .heat__cell { animation: rise-in 300ms var(--ease-out) both; animation-delay: calc(var(--i) * 18ms); }
.heat__legend { display: flex; justify-content: space-between; margin-top: -8px; color: var(--text-3); font-size: 11px; }

.days { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.day { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 10px; border-radius: calc(var(--r-sm) + 10px); }
.day__thumb { width: 76px; border: 0; padding: 0; cursor: pointer; }
.day--gone { grid-template-columns: 44px 1fr; }
.day--gone .day__date { font-size: 16px; }
.day__thumb--gone {
  display: grid;
  place-items: center;
  width: 44px;
  cursor: default;
  color: var(--text-3);
  font: 700 15px/1 var(--font-display);
}
.day__thumb--gone small { font-size: 10px; vertical-align: super; }
.day__body { display: grid; align-content: center; gap: 2px; min-width: 0; }
.day__weekday { color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.day__date { font: 700 19px/1.2 var(--font-display); }
.day__stats { color: var(--text-2); font-size: 13px; }
.day__actions { display: flex; gap: 8px; margin-top: 10px; }
.play-badge--small span { width: 34px; height: 34px; }
.play-badge--small svg { width: 14px; height: 14px; margin-left: 2px; }

/* ---- squad ----------------------------------------------------------------------------------- */

.invite { display: grid; grid-template-columns: 116px 1fr; gap: 16px 16px; align-items: center; padding: 16px; }
.invite__qr {
  padding: 10px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.qr { display: block; width: 100%; height: auto; }
.qr__dots { fill: var(--qr-dot); }
.qr__eye-ring { fill: none; stroke: var(--violet); stroke-width: 1; }
.qr__eye-core { fill: var(--violet); }
.invite__body { display: grid; gap: 8px; min-width: 0; }
.invite__title { margin: 0; font: 700 19px/1.15 var(--font-display); }
.invite__text { margin: 0; color: var(--text-2); font-size: 13px; text-wrap: pretty; }
.invite__actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.invite__actions .btn { flex: 1; }
.invite__actions .icon-btn--lg { width: 48px; height: 48px; }
.icon-btn--lg { width: 44px; height: 44px; border-radius: var(--r-md); }

.members { margin: 0; padding: 6px; list-style: none; }
.member { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 10px; }
.member + .member { border-top: 1px solid var(--line); }
.member__body { display: grid; flex: 1; min-width: 0; }
.member__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member__tags { color: var(--text-3); font-size: 13px; }
.icon-btn--quiet { background: transparent; color: var(--text-3); }

.hours { display: grid; gap: 16px; padding: 18px 16px 16px; }
.hours__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hours__title { margin: 0; font: 600 16px/1.2 var(--font-display); }
.hours__summary { color: var(--text-2); font-size: 13px; }

.picker { display: grid; gap: 8px; }
.picker__label { color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.picker__pills {
  display: flex;
  gap: 6px;
  margin: 0 -16px;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.picker__pills::-webkit-scrollbar { display: none; }

.hour-pill {
  flex: none;
  min-width: 64px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--bg-elev-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  scroll-snap-align: start;
  transition-property: background-color, color, transform;
  transition-duration: 150ms;
}
.hour-pill:active { transform: scale(0.95); }
.hour-pill[aria-pressed="true"] { background: var(--text); color: var(--bg); }

@media (max-width: 360px) {
  .invite { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .invite__qr { width: 160px; }
  .invite__actions { justify-content: center; }
  .dial__pct { font-size: 56px; }
}
