/*
  Build 1.6.45 retention views (owner-approved mockups mock1_daily_v2, mock2_home_v1, mock3_result_v2):
  Today's goals on Home, the Today's Quiz entry and calendar, and the result's progress block.
  Loaded after home.css, quick-play.css, daily.css and home-spread.css, and owns every property it sets there.
*/

/* ---- Today's goals card ------------------------------------------------------------------------------- */
.todays-goals {
  --goal-ink: var(--ink, #1b2559);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px 12px 11px;
  border-radius: 24px;
  border: 1.5px solid var(--surface-card-border, rgba(27, 37, 89, 0.08));
  background: #fff;
  box-shadow: 0 6px 18px rgba(27, 37, 89, 0.14);
  color: var(--goal-ink);
}
.todays-goals__title {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.15;
  font-weight: var(--w-black, 800);
  color: var(--goal-ink);
}
.todays-goals__list { margin: 0; padding: 0; list-style: none; }
.todays-goals__list li + li { border-top: 1.5px solid #e6e8ef; }
.todays-goals__goal {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 4px 0;
  text-align: left;
  color: inherit;
  background: none;
}
.todays-goals__goal:disabled { cursor: default; opacity: 1; }
.todays-goals__box {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid #c9cdd9;
  background: #f7f8fb;
}
.todays-goals__goal.is-done .todays-goals__box { border-color: #2fae3c; background: #39c449; }
.todays-goals__tick { width: 16px; height: 16px; }
/* one line at every phone width, as mock2 shows: FitLabel shrinks a long label instead of wrapping it */
.todays-goals .todays-goals__label { font-size: min(calc(var(--fit-size, 46) * var(--u)), 15px); font-weight: var(--w-bold, 700); line-height: 1.25; }
.todays-goals__reward { display: flex; align-items: center; justify-content: flex-end; gap: 3px; height: 40px; }
.todays-goals__reward-art { height: 34px; width: auto; max-width: 44px; object-fit: contain; }
.todays-goals__count { font-size: 17px; font-weight: var(--w-black, 800); }
.todays-goals__chest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1.5px solid #e6e8ef;
}
.todays-goals__progress { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.todays-goals__bar { height: 12px; border-radius: 99px; background: #dfe2ea; overflow: hidden; }
.todays-goals__bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(180deg, #58d966, #2fae3c); transition: width 0.4s var(--ease-out, ease-out); }
.todays-goals .todays-goals__hint { font-size: min(calc(var(--fit-size, 38) * var(--u)), 13px); line-height: 1.25; color: #53627b; }
/* the opened-chest line wraps to two lines instead of being cut */
.todays-goals .todays-goals__hint--done { display: block; font-size: 13px; line-height: 1.25; white-space: normal; overflow: visible; }
.todays-goals__chest { width: 60px; height: 48px; object-fit: contain; justify-self: end; }
.todays-goals__chest.is-ready { animation: goals-chest 1.2s ease-in-out infinite alternate; }
.todays-goals__chest-row.is-opened .todays-goals__chest { animation: none; opacity: 0.55; }
@keyframes goals-chest { to { transform: translateY(-3px) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .todays-goals__chest.is-ready { animation: none; } }

/* ---- Home, portrait (phone and portrait tablet): goals on the left, the robot on the path beside them, PLAY below */
.layout-wide .home.home--quick:not(.home--spread) .home-stage--goals .home-stage__robot { position: relative; inset: auto; transform: none; width: auto; max-width: none; margin: 0 0 -12px; height: clamp(150px, 22vh, 260px); }
.layout-wide .home.home--quick:not(.home--spread) .home-stage--goals .home-quick-actions { position: relative; inset: auto; transform: none; width: 100%; }
.layout-wide .home.home--quick:not(.home--spread) .home-stage--goals,
.layout-phone .home.home--quick .home-stage--goals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(80px, 25%);
  grid-template-areas: 'goals robot' 'actions actions';
  align-items: end;
  column-gap: 6px;
  row-gap: 18px;
  padding-inline: var(--gutter);
}
.home.home--quick .home-stage--goals .home-stage__goals { grid-area: goals; }
.layout-wide .home.home--quick:not(.home--spread) .home-stage--goals { flex: 1 0 auto; margin: 0; padding-bottom: 24px; grid-template-columns: minmax(0, 1fr) minmax(160px, 34%); align-content: end; }
.layout-phone .home.home--quick .home-stage--goals .home-stage__robot {
  grid-area: robot;
  justify-self: center;
  height: clamp(132px, 19vh, 220px);
  min-height: 0;
  /* the feet stand a little below the panel's bottom edge, on the path */
  margin-bottom: -12px;
}
.layout-phone .home.home--quick .home-stage--goals .home-quick-actions { grid-area: actions; justify-self: center; width: calc(100% + 2 * var(--gutter) - 160 * var(--u)); }
@media (max-height: 800px) and (orientation: portrait) {
  .layout-phone .home.home--quick .home-stage--goals { row-gap: 14px; padding-top: 10px; }
  .layout-phone .home.home--quick .todays-goals { padding: 10px 12px 9px; border-radius: 20px; }
  .layout-phone .home.home--quick .todays-goals__title { font-size: 18px; margin-bottom: 2px; }
  .layout-phone .home.home--quick .todays-goals__goal { min-height: 38px; gap: 8px; grid-template-columns: 22px minmax(0, 1fr) 40px; }
  .layout-phone .home.home--quick .todays-goals__box { width: 22px; height: 22px; border-radius: 7px; }
  .layout-phone .home.home--quick .todays-goals .todays-goals__label { font-size: min(calc(var(--fit-size, 46) * var(--u)), 14px); }
  .layout-phone .home.home--quick .todays-goals__reward { height: 32px; }
  .layout-phone .home.home--quick .todays-goals__reward-art { height: 28px; }
  .layout-phone .home.home--quick .todays-goals__chest-row { padding-top: 7px; grid-template-columns: minmax(0, 1fr) 50px; }
  .layout-phone .home.home--quick .todays-goals__chest { width: 50px; height: 40px; }
  .layout-phone .home.home--quick .todays-goals .todays-goals__hint { font-size: min(calc(var(--fit-size, 38) * var(--u)), 12px); }
  .layout-phone .home.home--quick .todays-goals .todays-goals__hint--done { font-size: 12px; }
  .layout-phone .home.home--quick .home-stage--goals .home-stage__robot { height: clamp(118px, 17vh, 170px); }
}

/* ---- Home, landscape spread: the goals card closes the left column, under the TODAY card -------------- */
:root.layout-wide .home.home--spread .home__goals { flex: none; }

/* ---- Today's Quiz entry on Home ------------------------------------------------------------------------ */
.home-daily--quick .home-daily__flame { width: 36px; height: 40px; flex: none; }
.layout-phone .home--daily .home-daily--quick .home-daily__flame { width: 28px; height: 32px; }

/* ---- Today's Quiz page: the 7-day streak calendar ---------------------------------------------------- */
.daily-card--quick { gap: 16px; }
.daily-card--quick h2 { font-size: clamp(26px, 7vw, 34px); font-weight: var(--w-black, 800); }
.streak-calendar {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 12px 16px;
  border: 1.5px solid var(--surface-card-border);
  border-radius: var(--surface-card-radius);
  background: var(--surface-card-bg);
}
.streak-calendar__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 24px; font-weight: var(--w-black, 800); color: #1b2559; }
.streak-calendar__flame { width: 30px; height: 34px; flex: none; }
.streak-calendar__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; width: 100%; margin: 0; padding: 0; list-style: none; }
.streak-calendar__day { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.streak-calendar__disc {
  box-sizing: border-box;
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 44px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid #c3c9d3;
  background: #e5e8ed;
  color: #53627b;
  font-size: 19px;
  font-weight: var(--w-black, 800);
}
.streak-calendar__day.is-done .streak-calendar__disc { border-color: #23974b; background: #2fae3c; color: #fff; }
.streak-calendar__day.is-done .streak-calendar__num { position: absolute; top: 8%; font-size: 14px; line-height: 1; }
.streak-calendar__tick { position: absolute; bottom: 14%; width: 46%; height: 40%; }
.streak-calendar__day.is-today .streak-calendar__disc { border: 3px solid #f08a12; background: #fff4df; color: #c9600a; box-shadow: 0 0 0 4px rgba(255, 186, 61, 0.35); }
/* every step's picture is drawn bigger than the one before (owner rule: a bigger reward looks bigger) */
/* each picture's width is its step's share of the column (REWARD_SCALE), so its drawn area grows every day;
   the chest is wider than its column, as in mock1, and stands in the calendar's padding */
.streak-calendar__reward { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 48px; overflow: visible; }
.streak-calendar__reward img { flex: none; width: calc(100% * var(--reward-scale)); max-width: none; height: auto; object-fit: contain; }
/* the chest is wider than its column: lean it into the calendar's right padding, clear of day 6 */
.streak-calendar__day:last-child .streak-calendar__reward img { transform: translateX(3px); }
/* icon and text together on one line (mock1); a long line shrinks to fit instead of wrapping */
.daily-card .streak-calendar__shield { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: none; margin: 0; color: #53627b; }
.daily-card .streak-calendar__shield-text { font-size: min(calc(var(--fit-size, 44) * var(--u)), 15px); line-height: 1.3; min-width: 0; flex: 0 1 auto; }
.streak-calendar__shield-icon { width: 22px; height: 24px; flex: none; }

/* ---- Result: topic level bar with title, and the tomorrow line (mock3_result_v2) ---------------------- */
.result-level {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--surface-card-border);
  border-radius: var(--surface-card-radius);
  background: #fff;
  text-align: left;
}
.result-level__icon { width: 52px; height: 52px; object-fit: contain; }
.result-level__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* "Level 0 Newcomer" never breaks inside itself; the topic name wraps before it */
.result-level__rank { white-space: nowrap; }
.result-level__name { font-size: 17px; line-height: 1.25; font-weight: var(--w-black, 800); color: #1b2559; }
.result-level__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.result-level__track { height: 12px; border-radius: 99px; background: #dfe2ea; overflow: hidden; }
.result-level__track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(180deg, #58d966, #2fae3c); }
.result-level__detail { font-size: 13px; font-weight: var(--w-semibold, 600); color: #53627b; white-space: nowrap; }
.result-tomorrow {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--surface-card-radius);
  background: #fff3d6;
  text-align: left;
}
.result-tomorrow img { width: 48px; height: 40px; object-fit: contain; }
.result-tomorrow b { font-size: 16px; line-height: 1.3; font-weight: var(--w-bold, 700); color: #1b2559; }

/* ---- Daily result: the one-time reminder ask ---------------------------------------------------------- */
.reminder-ask {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: 'icon text' 'actions actions';
  align-items: center;
  gap: 10px 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--surface-card-border);
  border-radius: var(--surface-card-radius);
  background: #fff;
  text-align: left;
}
.reminder-ask__icon { grid-area: icon; width: 40px; height: 44px; object-fit: contain; }
.reminder-ask__text { grid-area: text; margin: 0; font-size: 16px; line-height: 1.3; font-weight: var(--w-bold, 700); color: #1b2559; }
.reminder-ask__actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.reminder-ask__no { min-height: 44px; padding: 0 8px; font-size: 15px; font-weight: var(--w-semibold, 600); color: #53627b; background: none; }
