/* Today home — mobile first at 390px */
.today-screen {
  display: none;
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
}
/* Me: the profile cards, then the collection, in one scrolling screen. */
.me-inner { padding-bottom: 0; }
.me-collection .today-head { display: none; }
.me-collection .today-inner { padding-top: 8px; }

.me-streak{ padding: 16px; }
.me-streak-count {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}
.me-streak-count strong {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--tracking-head);
  font-size: 26px;
}

.me-save { display: block; text-decoration: none; }
.today-inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}
.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}
.today-wordmark {
  margin: 0;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.today-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.today-finn {
  display: flex;
  align-items: center;
  gap: 12px;
}
.today-finn p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}
.today-finn p { color: var(--ink); }
.today-title {
  margin: 18px 0 8px;
  font-family: var(--font-ui);
  font-size: 22px;
}

.level-ring {
  --p: 0;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--info) calc(var(--p) * 1%), var(--line) 0);
  display: grid;
  place-items: center;
}
.level-ring span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-ui); font-variant-numeric: tabular-nums;
  font-size: 20px;
}

.quest-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.quest-row.is-done { border-color: var(--win); }
.quest-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--raised);
  color: var(--on-color);
}
.quest-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--action);
  color: var(--on-action);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
}
.quest-row.is-done .quest-go { background: var(--win); }
.quest-copy { min-width: 0; }
.quest-title {
  display: block;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.quest-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-ui); font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.quest-row.is-done .quest-meta { color: var(--win-ink); }
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}
.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.week-label {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-ui);
}
.week-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
}
.week-dot.is-filled {
  background: var(--info);
  border-color: var(--info);
}
.week-dot.is-today {
  border-style: dashed;
  border-color: var(--coin);
}
.today-retry,
.level-sheet-close {
  min-height: 44px;
  margin-top: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--action);
  color: var(--on-action);
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
}
.quest-row:focus-visible,
.today-retry:focus-visible,
.level-sheet-close:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
.xp-toast {
  pointer-events: none; /* a status toast never blocks a tap (it sat over the boss stop) */
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--coin);
  color: var(--coin-ink);
  font-family: var(--font-ui); font-variant-numeric: tabular-nums;
  font-size: 16px;
}
.level-sheet {
  position: fixed;
  z-index: var(--z-celebrate, 95);
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}
.level-sheet-card {
  position: relative;
  width: min(100%, 320px);
  padding: 24px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
  overflow: hidden;
}
.level-sheet-card h2 {
  margin: 8px 0 0;
  font-family: var(--font-ui);
}
.level-sheet-card p {
  margin: 4px 0 0;
  color: var(--coin-ink);
}
.level-sheet-card .finn { margin: 0 auto; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute;
  top: 16%;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: xp-confetti 700ms ease-out forwards;
}
@keyframes xp-confetti {
  to { transform: translateY(140px) rotate(160deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .xp-toast,
  .level-sheet,
  .map-sheet,
  .confetti i {
    animation: none;
    transition: none;
  }
}

@media (max-width: 360px) {
  .today-inner,
  .composer-wrap { max-width: 100%; }
}

.pill-xp.is-xp-bounce { animation: xp-pill 600ms ease; }
.is-shake { animation: juice-shake 180ms linear; }
.is-screen-shake { animation: juice-screen 200ms linear; }
.pill-streak.is-grow svg {
  transform-origin: center bottom;
  animation: flame-grow 600ms ease;
}
.quest-row.is-quest-pop { animation: quest-pop 400ms ease; }
.level-sheet-line { color: var(--ink); }

@keyframes xp-pill {
  40% { transform: translateY(-4px) scale(1.06); }
  100% { transform: none; }
}
@keyframes juice-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@keyframes juice-screen {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@keyframes flame-grow {
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
@keyframes quest-pop {
  40% { transform: scale(1.04); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pill-xp.is-xp-bounce,
  .is-shake,
  .is-screen-shake,
  .pill-streak.is-grow svg,
  .quest-row.is-quest-pop { animation: none; }
}

.daily-chest { margin-top: 12px; }
.chest-contents {
  margin: 4px 0;
  color: var(--coin-ink);
  font-family: var(--font-ui); font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
}
.daily-chest .chest-art,
.daily-chest .chest-art img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.daily-chest .lottie-slot { width: 160px; height: 120px; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .daily-chest .lottie-slot { height: 64px; }
}

.level-sheet-unlock {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 2px solid var(--coin);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--coin) 12%, var(--raised));
  line-height: 1.4;
}
.level-sheet-unlock b { color: var(--coin-ink); }
.level-sheet-where { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }

/* Today's quests as Finn's first chat message (docs/redesign/CANVAS.md 2.1). */
.bubble.quest-card-msg { padding: 12px; }
.quest-card { display: grid; gap: 10px; }
.quest-card-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--tracking-head);
  font-size: 20px;
  color: var(--ink);
}
.quest-card-rows { display: grid; gap: 8px; }
.quest-card .daily-chest {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--coin);
  border-radius: var(--r-control);
  background: var(--paper);
  box-shadow: none;
}
.quest-card .daily-chest .chest-art { grid-row: 1 / span 3; grid-column: 1; }
.quest-card .daily-chest > p { grid-column: 2; margin: 0; }
.quest-card .daily-chest .lottie-slot { grid-column: 1 / -1; justify-self: center; }
.quest-card-loading { margin: 0; color: var(--muted); }
