/* reel-lessons.css — The Watch reel's toolbar, transport, captions and save
   button, its video quizzes and the reel search sheet. It also carries the
   #today (Learn) pane base and the tab heading weights, which must load here:
   later sheets refine them. */

/* Today */
#today {
  position: fixed;
  inset: 0;
  z-index: 25;
  overflow-y: auto;
  background: var(--paper);
  display: none;
  padding: 18px 18px calc(96px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}
#today.show {
  display: block;
}
.today-inner {
  max-width: 540px;
  margin: auto;
}
#today h1 {
  font-size: clamp(32px, 8.7vw, 43px);
  line-height: 1.07;
  letter-spacing: -1.2px;
  font-weight: 950;
  margin: 19px 0 18px;
}

/* Reel navigation and controls */
#journeyHeader {
  position: fixed;
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  height: auto;
  padding: 0;
  background: transparent;
  top: calc(10px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  left: 10px;
  right: 10px;
  width: auto;
  transform: none;
}
.reels-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 54px;
  padding: 5px 9px 5px 13px;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  border-radius: 14px;
  color: var(--ink);
}
.reels-toolbar > b {
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.7px;
}
.reels-switch {
  display: flex;
  padding: 2px;
  border-radius: 22px;
  background: var(--panel-2);
}
.reels-switch button {
  font-size: 16px;
  min-height: 38px;
  padding: 6px 16px;
  border-radius: 20px;
  color: var(--ink-2);
  font-weight: 850;
}
.reels-switch .selected {
  background: var(--brand);
  color: var(--on-brand);
}
#reelsSearch {
  width: 40px;
  display: grid;
  place-items: center;
}
#reelsSearch svg {
  width: 24px;
  height: 24px;
}
body.journey-feed .vcap {
  top: calc(84px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  left: 22px;
  right: 22px;
  bottom: auto;
  pointer-events: none;
}
body.journey-feed .vcap .t {
  font-size: 25px;
  line-height: 1.14;
  font-weight: 950;
  letter-spacing: -0.5px;
}
body.journey-feed .vcap .f {
  display: none;
}
body.first-run .lesson-eyebrow,
.lesson-eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
}
.vscrim {
  background: linear-gradient(180deg, #091b3859 0, transparent 32%, transparent 55%, #091b38c9 100%);
}
body.journey-feed .vmute,
.reel-save {
  position: absolute;
  z-index: 3;
  left: auto;
  right: 13px;
  width: 51px;
  height: 66px;
  border: 0;
  box-shadow: none;
  border-radius: 24px;
  background: #13233dc9;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
}
body.journey-feed .vmute {
  top: 46%;
  bottom: auto;
}
.reel-save {
  top: calc(46% - 75px);
  bottom: auto;
}
.reel-save svg,
.vmute svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}
.reel-save span,
.vmute span {
  font-size: 11px;
  font-weight: 800;
}
.reel-save[aria-pressed="true"] {
  background: var(--brand);
  color: var(--on-brand);
}
.reel-check {
  position: absolute;
  z-index: 3;
}
.reel-check.big.caps {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: calc(168px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  width: auto;
  min-width: 182px;
  min-height: 47px;
  padding: 10px 22px;
  border-radius: 28px;
  font-size: 20px;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--brand-lip);
}
.reel-check.big.caps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.reel-check svg {
  width: 24px;
  height: 24px;
  flex: none;
  fill: currentColor;
}
.reel-check.big.caps:active {
  transform: translate(-50%, 3px);
  box-shadow: none;
}
.reel-transport {
  position: absolute;
  z-index: 3;
  left: 14px;
  right: 18px;
  bottom: calc(111px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  min-height: 44px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.reel-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  box-shadow: none;
  cursor: pointer;
}
.reel-toggle:active {
  background: transparent;
  transform: scale(0.94);
}
.reel-toggle svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  filter: drop-shadow(0 1px 3px #0003);
}
.reel-toggle[data-playing="true"] .reel-play-icon,
.reel-toggle[data-playing="false"] .reel-pause-icon {
  display: none;
}
.reel-transport input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y pinch-zoom;
}
.reel-transport input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--brand) 0 var(--progress, 0%), #ffffff59 var(--progress, 0%) 100%);
}
.reel-transport input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0003;
}
.reel-transport input::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #ffffff59;
}
.reel-transport input::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}
.reel-transport input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0003;
}
.reel-toggle:focus-visible,
.reel-transport input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.reel-toggle:disabled,
.reel-transport input:disabled {
  opacity: 0.45;
  cursor: default;
}
.reel-time {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 1px 3px #0005;
}
.reel-swipe {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(86px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  text-align: center;
  color: #fff;
  font-weight: 750;
  font-size: 14px;
  margin: 0;
}
.reel-swipe span {
  padding: 0 10px;
}

/* A single readable question, spoken by our corgi. Both lesson types use
   the same layout; the mascot is decorative so the prompt is read once. */
.vquiz .corgi-question .q,
#cards .guided-page .corgi-question h1 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

/* The answer list scrolls independently; its only primary action stays put. */
body.journey-feed .vquiz {
  padding: 0;
  justify-content: flex-start;
  overflow: hidden;
  overscroll-behavior: contain;
  border-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) solid var(--paper);
}
.vquiz .quiz-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 12px 14px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.vquiz .inner {
  width: 100%;
  max-width: 560px;
  flex: none;
  overflow: visible;
  padding-bottom: 0;
}
.vquiz .lesson-step {
  margin: 0;
}
.vquiz .quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 20px;
  gap: 16px;
}
.vquiz .quiz-count {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
}
.vquiz .lesson-back {
  display: grid;
  place-items: center;
  width: 38px;
  min-height: 44px;
  color: var(--ink);
}
.vquiz .lesson-back svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vquiz .quiz-progress {
  flex: 1;
  height: 12px;
  background: var(--panel-2);
  border-radius: 20px;
  overflow: hidden;
}
.quiz-progress i {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}
.vquiz .corgi-question {
  border-bottom: 1px solid var(--line-1);
}
.vquiz .inner > .sub {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 14px;
}
.vquiz .opts {
  margin-top: 16px;
  gap: 14px;
}
.vquiz .opt {
  font-size: 18px;
  font-weight: 600;
  border: 2px solid var(--line-1);
  border-radius: 15px;
  box-shadow: 0 2px 0 var(--line-1);
  color: var(--ink);
}
.vquiz .opt.is-selected {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-color: var(--brand-soft-2);
  box-shadow: 0 2px 0 var(--brand-soft-2);
}
.vquiz .opt.is-correct {
  background: var(--correct-soft);
  color: var(--correct-ink);
  border-color: var(--correct-line);
  box-shadow: 0 2px 0 var(--correct-line);
  animation: none;
}
.vquiz .opt.is-wrong {
  color: var(--wrong-ink);
  background: var(--wrong-soft);
  border-color: var(--wrong-line);
  box-shadow: 0 2px 0 var(--wrong-line);
}
.vquiz .opt.dim {
  border-color: var(--line-1);
  color: var(--ink);
  background: var(--paper);
}
.quiz-action-bar {
  flex: none;
  width: 100%;
  padding: 12px 14px calc(18px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  border-top: 1px solid var(--line-1);
  background: var(--paper);
}
.vquiz .quiz-action-bar .big {
  display: block;
  width: 100%;
  max-width: 560px;
  min-height: 56px;
  margin: 0 auto;
  border-radius: 15px;
  font-size: 18px;
  font-weight: 700;
  text-transform: none;
  color: #fff;
}
.vquiz .quiz-action-bar .big:disabled {
  background: var(--panel-2);
  color: var(--ink-3);
  box-shadow: 0 3px 0 var(--line-2);
  opacity: 1;
}

/* Search, topic and profile surfaces */
.search-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.search-heading button {
  min-width: 44px;
  font-size: 30px;
}
#reelSearchModal label {
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin: 12px 0 8px;
}
#reelSearchInput {
  width: 100%;
  font: inherit;
  border: 2px solid var(--line-2);
  border-radius: 12px;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
}
#reelSearchResults {
  margin-top: 14px;
}
#reelSearchModal .saved-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}
#reelSavedOnly {
  width: 19px;
  height: 19px;
  accent-color: var(--brand);
}
.search-reel {
  display: flex;
  gap: 12px;
  width: 100%;
  align-items: center;
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.search-reel img {
  width: 54px;
  height: 58px;
  object-fit: cover;
  border-radius: 10px;
}
.search-reel > span:nth-child(2) {
  flex: 1;
}
.search-reel b,
.search-reel small {
  display: block;
}
.search-reel b {
  font-size: 16px;
  font-weight: 900;
}
.search-reel small {
  font-size: 13px;
  color: var(--ink-2);
}
#practice h1,
#home h1,
#settings h1 {
  font-weight: 950;
  letter-spacing: -0.8px;
}

@media (max-width: 959px) {
  body.journey-feed .vcap {
    text-shadow:
      0 1px 5px #10161fd9,
      0 0 20px #10161fbf;
  }
}
@media (min-width: 720px) and (max-width: 959px) {
  #journeyHeader {
    width: 520px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}
@media (max-width: 359px) {
  .reels-switch button {
    padding: 6px 11px;
    font-size: 14px;
  }
  .reels-toolbar > b {
    font-size: 20px;
  }
}
@media (min-width: 960px) {
  body {
    background: var(--paper);
  }
  body.journey-feed {
    --journey-stage-width: min(560px, 54dvh, calc(100vw - var(--desktop-rail) - 100px));
  }
  body.watch-mode #reel {
    width: var(--journey-stage-width);
    border-color: var(--line-2);
    box-shadow: 0 12px 36px #15253617;
  }
  #journeyHeader {
    width: calc(var(--journey-stage-width) - 20px);
    left: calc(50% + var(--desktop-centre-shift));
    top: calc(50% - var(--journey-stage-width) * 8 / 9 + 10px);
    transform: translateX(-50%);
    border-radius: 22px 22px 0 0;
  }
  body.journey-feed .vcard video {
    top: 0;
    height: 100%;
    object-fit: contain;
  }
  body.journey-feed .vcap {
    top: 83px;
    bottom: auto;
  }
  body.journey-feed .vmute {
    top: 46%;
    bottom: auto;
  }
  .reel-save {
    top: calc(46% - 75px);
    bottom: auto;
  }
  .reel-check.big.caps {
    bottom: 95px;
  }
  .reel-transport {
    bottom: 37px;
  }
  .reel-swipe {
    bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-progress i {
    transition: none;
  }
}
