/* The four screens the phone shows, laid out at 390 x 844.
   Each is a simplified drawing after the app's dark mode, not a capture.
   What they show is chosen on purpose; the rule is in the README beside
   build.py (this file is uploaded, the README is not). */

/* Without motion the phone rests on the chat. */
.today, .board, .insights { opacity: 0; }

/* ---------- 1. Today: the games, as a glimpse ---------- */
.today-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px 0; }
.today-title { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; }
.streak {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px 6px 10px;
  border-radius: 999px;
  background: var(--card);
  font: 700 15px/1 "Spline Sans Mono", ui-monospace, monospace;
}
.streak svg { width: 13px; height: 16px; fill: var(--gold); transform-origin: 50% 80%; }

.game { margin: 12px 16px 0; padding: 14px 16px 18px; border-radius: 20px; background: var(--ground); }
.game-head { display: flex; align-items: center; gap: 10px; height: 24px; }
.game-head .label { font-size: 12px; color: var(--ink-soft); }
/* The running clock and the finished time share one place. */
.slot { position: relative; margin-left: auto; width: 70px; height: 24px; }
.clock {
  position: absolute; right: 0; top: 0;
  height: 24px; overflow: hidden;
  text-align: right; color: var(--ink-soft);
  font: 700 17px/24px "Spline Sans Mono", ui-monospace, monospace;
  opacity: 0;
}
.ticks, .ticks span { display: block; }
.slot .solve-time { position: absolute; right: 0; top: 0; }

/* A fragment of the letter grid: the rows fade out below the first.
   The space above the first row is room for the letters to hop. */
.grid {
  --cell: calc((326px - (var(--n) - 1) * 5px) / var(--n));
  --pitch: calc(var(--cell) + 5px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), var(--cell));
  gap: 5px;
  height: 184px;
  margin-top: 6px;
  padding-top: 8px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 46%, transparent 96%);
  mask-image: linear-gradient(#000 46%, transparent 96%);
}
.cell {
  position: relative;
  height: var(--cell);
  display: grid; place-items: center;
  border-radius: 7px;
  background-color: var(--card);
  font-style: normal;
}
.cell.block { background-color: #0e0d0b; }
.cell b { position: relative; font-size: min(calc(var(--cell) * 0.5), 32px); font-weight: 600; line-height: 1; }
.cell.w1::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(85, 147, 58, 0.26); opacity: 0; }
.cursor {
  position: absolute; left: 0; top: 8px;
  width: var(--cell); height: var(--cell);
  border: 2.5px solid var(--pine); border-radius: 7px;
  opacity: 0;
}

.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 14px; }
.cards i { height: 54px; display: grid; place-items: center; border-radius: 10px; background: var(--card); }
.cards svg { width: 22px; height: 22px; fill: var(--gold); }
.cards svg.off { fill: var(--star-off); }

.section { margin: 26px 22px 0; color: var(--ink-faint); }
.groups { margin: 10px 16px 0; padding: 2px 14px; border-radius: 18px; background: var(--card); }
.groups li { position: relative; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 12px 0; }
.groups li + li { border-top: 1px solid var(--edge); }
.groups .group-mark { width: 36px; height: 36px; border-radius: 10px; }
/* Who has played today, and how many of the group that is. */
.played { display: flex; align-items: center; gap: 9px; color: var(--ink-faint); font: 700 13px/1 "Spline Sans Mono", ui-monospace, monospace; }
.played .faces { --ring: var(--card); }
.played .avatar { width: 24px; height: 24px; margin-left: -7px; }
.played span.pop { color: var(--ink); }

/* ---------- 2. The group's chat ---------- */
.feed { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; padding: 16px 16px 0; }
.feed .swap { display: grid; }
.msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; }
.bubble {
  justify-self: start;
  padding: 11px 16px 12px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--edge);
}
.bubble p { margin-top: 3px; font-size: 16.5px; line-height: 1.35; }
.time { font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.bubble .time { float: right; margin: 0.45em 0 0 14px; }
/* Someone is typing: three dots where their message is about to be. */
.typing { opacity: 0; }
.dots {
  justify-self: start;
  display: flex; gap: 5px;
  padding: 17px 16px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--edge);
}
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); }

/* One result card per player per day; it fills in as they play. */
.result {
  position: relative;
  margin-left: 42px;
  padding: 11px 15px 14px;
  border: 1.5px solid rgba(247, 244, 237, 0.2);
  border-radius: 20px;
}
.result.mine { margin-bottom: 10px; border-color: rgba(247, 244, 237, 0.5); }
.result-head { display: flex; align-items: center; gap: 9px; }
.result-head .time { margin-left: auto; }
.row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 11px; margin-top: 11px; }
.row .label { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.reactions { position: absolute; left: 0; right: 0; bottom: -15px; display: flex; justify-content: center; gap: 6px; }
.reactions li {
  padding: 1px 11px 2px;
  border-radius: 999px;
  background: var(--chip);
  box-shadow: 0 0 0 1px var(--edge);
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; word-spacing: 0.2em;
}
/* Reactions float up off your card as they come in. */
.fly { position: absolute; left: 50%; bottom: -8px; margin-left: -15px; font-size: 30px; line-height: 1; opacity: 0; }
.composer {
  position: absolute; left: 16px; right: 16px; bottom: 34px;
  padding: 13px 20px 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-faint);
}

/* ---------- 3. The group's leaderboard ---------- */
.when { display: flex; justify-content: center; gap: 4px; margin-top: 14px; color: var(--ink-faint); }
.when span { padding: 6px 12px 5px; border-radius: 8px; }
.when .on { background: var(--chip); color: var(--ink); }

/* The top three, each riding up on its own block. The space above them is
   where the crown comes down. */
.podium {
  display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px;
  margin: 0 22px; padding-top: 46px;
  overflow: hidden;
}
.place { position: relative; display: grid; justify-items: center; }
.place .avatar { width: 58px; height: 58px; }
.place .who { margin-top: 9px; font-size: 16px; }
.place .lap, .place .solve-time { margin-top: 7px; }
.place .lap { padding: 5px 0 4px; }
.plinth {
  width: 100%; height: 128px;
  margin-top: 13px; padding-top: 14px;
  border-radius: 14px 14px 0 0;
  text-align: center; color: var(--stamp);
  font: 700 36px/1 "Spline Sans Mono", ui-monospace, monospace;
}
/* Gold, silver and bronze. */
.first .avatar { width: 74px; height: 74px; }
.first .who { font-weight: 700; }
.first .plinth { height: 190px; background: var(--gold); }
.second .plinth { background: #bdb7ab; }
.third .plinth { height: 84px; background: #c58d5c; }
.podium .crown { position: absolute; left: 50%; top: -31px; width: 38px; height: 30px; margin-left: -19px; fill: var(--gold); }

.ranks { margin: 0 16px; padding: 2px 16px; border-radius: 0 0 18px 18px; background: var(--card); }
.ranks li { display: grid; grid-template-columns: 16px 32px 1fr auto; align-items: center; gap: 12px; padding: 9px 0; }
.ranks li + li { border-top: 1px solid var(--edge); }
.rank { text-align: center; color: var(--ink-faint); font: 700 14px/1 "Spline Sans Mono", ui-monospace, monospace; }
.who { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 500; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 22px 0; font-size: 14px; color: var(--ink-faint); }
.waiting .avatar { filter: grayscale(1) brightness(0.7); }

/* ---------- 4. The group's insights ---------- */
.panel { margin: 12px 16px 0; padding: 14px 16px 16px; border-radius: 18px; background: var(--card); }
.panel .label { color: var(--ink-faint); }
.note { font-size: 13px; line-height: 1.35; color: var(--ink-soft); }

/* Two people, the score between them, and a bar split the same way. */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 12px; }
.side { display: grid; justify-items: center; gap: 7px; }
.side .avatar { width: 56px; height: 56px; }
.score { display: flex; align-items: center; gap: 12px; font: 700 46px/1 "Spline Sans Mono", ui-monospace, monospace; }
.score i { font-style: normal; font-size: 28px; color: var(--ink-faint); }
.tug { height: 8px; margin-top: 16px; border-radius: 4px; overflow: hidden; background: #9682e0; }
.tug i { display: block; height: 100%; border-right: 5px solid var(--card); background: var(--tile); transform-origin: 0 50%; scale: 0.571 1; }
.duel .note { margin-top: 11px; text-align: center; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 13px; }
.week li { display: grid; justify-items: center; gap: 8px; color: var(--ink-faint); font: 600 12px/1 "Spline Sans Mono", ui-monospace, monospace; }
.week .avatar { width: 38px; height: 38px; }
.week .now { color: var(--ink); }

.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 16px 0; }
.award { display: grid; justify-items: center; margin: 0; padding: 20px 10px 17px; text-align: center; }
.award .avatar { width: 52px; height: 52px; }
.medal { position: relative; }
.medal i { position: absolute; right: -12px; bottom: -6px; font-size: 23px; font-style: normal; line-height: 1; }
.award .label { margin-top: 14px; font-size: 9.5px; letter-spacing: 0.1em; }
.award .who { margin-top: 5px; font-size: 17px; font-weight: 600; }
.award .note { margin-top: 3px; font-size: 12.5px; }
