/* A dark feed whose colour heats up with the day: blue at Mild, red at Off the rails. */

@property --heat {
  syntax: "<color>";
  inherits: true;
  initial-value: #2f6fed;
}

:root {
  --bg: #08080b;
  --card: #15161a;
  --line: #2a2c33;
  --text: #f1f2f4;
  --muted: #8b8f98;
  --on-heat: #0b0b0f;
  --green: #00ba7c;
  --red: #f4212e;
  --amber: #ffb224;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: --heat 0.9s ease;
}
body[data-level="2"] { --heat: #9a5cf0; }
body[data-level="3"] { --heat: #ff7a1a; }
body[data-level="4"] { --heat: #f0432a; }
body[data-level="5"] { --heat: #ff2d55; }
/* Once the day is played, the whole page takes the result's colour. */
body[data-level="good"] { --heat: #25d394; }
body[data-level="mid"] { --heat: #ffb938; }
body[data-level="bad"] { --heat: #ff6b78; }

/* The glow behind everything, in the current heat colour. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(130% 65% at 50% -12%, color-mix(in srgb, var(--heat) 60%, transparent), transparent 72%);
}

.shell {
  max-width: 34rem;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.muted { color: var(--muted); margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

/* Top bar */
.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.brand { margin: 0; font-size: 1.7rem; font-weight: 900; letter-spacing: -0.035em; }
.brand span { color: var(--heat); }
.day { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.dots { display: flex; gap: 4px; list-style: none; margin: 0.7rem 0 0; padding: 0; }
.dots li { flex: 1; height: 5px; border-radius: 5px; background: rgb(255 255 255 / 0.16); }
.dots .now { background: var(--text); }
.dots .right { background: var(--green); }
.dots .wrong { background: var(--red); }

/* Holds an element's space while it is not shown, so the layout never jumps. */
.held { visibility: hidden; }

/* Accounts, as X shows them: picture, display name, tick, @handle */
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: var(--line);
  color: #fff;
  font-weight: 800;
  object-fit: cover;
}
.avatar.mystery { background: var(--heat); color: var(--on-heat); font-size: 1.5rem; font-weight: 900; }
.account { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.account strong { display: flex; align-items: center; gap: 0.3rem; min-width: 0; font-weight: 800; }
.name, .handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.handle { color: var(--muted); font-size: 0.9rem; }
.scramble { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; letter-spacing: 0.04em; }.tick {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  background: #1d9bf0;
  color: #fff;
  font-size: 0.72em;
  font-weight: 900;
}

/* The post */
.post { padding: 1.1rem 1.15rem; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.post.fresh { animation: rise 0.3s ease-out; }
.byline { display: flex; align-items: center; gap: 0.75rem; }
.text { margin: 0.9rem 0 0.2rem; font-size: 1.42rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; white-space: pre-wrap; overflow-wrap: anywhere; }
.source { display: inline-block; margin-top: 0.7rem; color: var(--muted); font-size: 0.88rem; }

/* The two accounts to choose from, side by side */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 1.1rem 0.6rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.choice .avatar { width: 5rem; height: 5rem; font-size: 1.6rem; }
.choice .account { align-items: center; width: 100%; }
.choice .account strong { justify-content: center; max-width: 100%; }
.choice:not(:disabled):hover { border-color: var(--heat); box-shadow: 0 0 0 3px color-mix(in srgb, var(--heat) 35%, transparent); transform: translateY(-3px); }
.choice:not(:disabled):active { transform: scale(0.985); }
.choice:disabled { cursor: default; }
.face { position: relative; display: grid; }
.mark {
  position: absolute;
  right: -0.25rem;
  bottom: -0.25rem;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 3px solid var(--card);
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}
.choice.right { border-color: var(--green); }
.choice.right .mark { background: var(--green); }
.choice.right .name { color: var(--green); }
.choice.wrong { border-color: var(--red); }
.choice.wrong .mark { background: var(--red); }
.choice.wrong .name { color: var(--red); }
.choice.dim { opacity: 0.45; }

/* The answer lands with a little movement, once: the tick or cross stamps on, the account
   that posted it swells with a ring that fades, a wrong pick shakes its head, and the name
   comes out from behind the mask. Short, and nothing changes size or place. */
.mark { animation: stamp 0.34s 0.05s cubic-bezier(0.3, 1.5, 0.5, 1) backwards; }
.choice.right { animation: swell 0.55s ease-out; }
.choice.wrong { animation: shake 0.38s ease-in-out; }
.choice.dim { animation: step-back 0.35s ease-out; }
.post:not(.fresh) .byline { animation: unmask 0.4s ease-out; }
.choices + .primary:not(.held) { animation: rise 0.3s 0.12s ease-out backwards; }

.primary {
  width: 100%;
  padding: 0.9rem 1.6rem;
  border: 0;
  border-radius: 99px;
  background: var(--heat);
  color: var(--on-heat);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
}
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: scale(0.98); }

/* Results */
.score { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 0.6rem 0 0.4rem; text-align: center; }
/* The score is lit from below in the result's colour: white at the top, fading into it. */
.big {
  margin: 0;
  padding: 0 0.1em 0.06em;
  font-size: 5.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, #fff 28%, var(--heat) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 22px color-mix(in srgb, var(--heat) 35%, transparent));
}
.next { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; margin: 0.4rem 0 1rem; padding: 0.7rem 1.6rem 0.6rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.next span { color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.clock { font-size: 2.4rem; font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
/* Sharing: one wide button, and X's own mark beside it. */
.share { display: flex; gap: 0.6rem; width: 100%; }
.share .primary { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.55rem; }
.share .primary.done { background: var(--green); color: #fff; }
.x { flex: none; display: grid; place-items: center; width: 3.3rem; background: var(--card); border: 1px solid var(--line); border-radius: 99px; color: var(--text); transition: border-color 0.12s; }
.x:hover { border-color: var(--text); }
.icon { width: 1.2em; height: 1.2em; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.icon-share { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3m0 0L7.5 7.5M12 3l4.5 4.5M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-7'/%3E%3C/svg%3E"); }
.done .icon-share { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E"); }
.icon-x { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E"); }

/* More daily games: each card is a scene from the other game, with its name underneath. */
.more { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.more-card { display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; color: inherit; text-decoration: none; transition: border-color 0.12s, transform 0.1s; }
.more-card:hover { border-color: var(--text); }
.more-card:active { transform: scale(0.98); }
.more-shot { display: block; width: 100%; height: auto; aspect-ratio: 6 / 5; object-fit: cover; background: var(--line); }
.more-name { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.65rem 0.5rem; font-weight: 800; }
.more-name img { border-radius: 6px; }

.section-title { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.recap { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
/* Right or wrong shows as a straight bar set inside the card, with a faint wash of the same colour behind it. */
.recap li {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 0.85rem 0.85rem 1.3rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 11%, var(--card)), var(--card) 42%);
  border: 1px solid color-mix(in srgb, var(--tone) 22%, var(--line));
  border-radius: 16px;
}
.recap li::before { content: ""; position: absolute; left: 0.5rem; top: 0.85rem; bottom: 0.85rem; width: 4px; border-radius: 4px; background: var(--tone); }
.recap li.right { --tone: var(--green); }
.recap li.wrong { --tone: var(--red); }
.recap div { min-width: 0; }
.recap p { margin: 0.25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.recap a { display: inline-block; margin-top: 0.45rem; color: var(--muted); font-size: 0.82rem; }

.foot { margin-top: auto; padding-top: 1rem; color: var(--muted); text-align: center; font-size: 0.78rem; }
.foot p { margin: 0; }
.foot nav { display: flex; justify-content: center; gap: 1.2rem; margin-top: 0.5rem; }
.foot a { padding: 0.3rem 0; text-underline-offset: 3px; }
.foot a:hover, .cookie-settings:hover { color: var(--text); }
/* Reads as one more footer link, on the game and on the reading pages. */
.cookie-settings { padding: 0.3rem 0; background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cookie-settings[hidden] { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes stamp { from { opacity: 0; transform: scale(0.2) rotate(-25deg); } }
@keyframes swell {
  0% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); }
  35% { transform: scale(1.035); }
  100% { transform: scale(1); box-shadow: 0 0 0 14px transparent; }
}
@keyframes shake {
  20% { transform: translateX(-6px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
  90% { transform: translateX(2px); }
}
@keyframes step-back { from { opacity: 1; } }
@keyframes unmask { from { opacity: 0; transform: translateY(5px); filter: blur(4px); } }

@media (prefers-reduced-motion: reduce) {
  body, .choice, .primary { transition: none; }
  .post.fresh, .mark, .choice, .post .byline, .choices + .primary { animation: none; }
}
