/* feed.css — The question feed scroller: cards, options, correct/wrong states and the celebration.
   Split from app.module.css; load order in app.html preserves the original cascade. */

/* ---------- feed scroller ---------- */
#reel {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;

  touch-action: pan-y pinch-zoom;
}

#reel::-webkit-scrollbar {
  display: none;
}

.card {
  height: 100dvh;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: calc(96px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) 16px calc(96px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  background: var(--paper);
}

.card .inner {
  width: 100%;
  max-width: 540px;
  min-height: 0;
  margin: 0 auto;
  overflow-y: auto;
  scrollbar-width: none;

  /* overflow clips painting at the box edge, and the last child's 4px lip
     (plus its 4px pressed travel) paints below its border box — without this
     inset the bottom shadow is sliced off against the background. */
  padding-bottom: 8px;
}

.card .inner::-webkit-scrollbar {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--line-2);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-2);
  margin-bottom: 16px;
  font-size: 0.875rem;
  font-weight: 600;
}

.tag .rev {
  color: var(--brand-ink);
}

.q {
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  margin: 0 0 8px;
  white-space: pre-line;
  text-wrap: balance;
}

/* Keep the full approved corgi beside the question, with room for its ears
   and paws. Score and status cards keep their plain headline. */
.inner:has(.opts) > .q {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100px;
  margin: 0 0 12px 96px;
  padding: 12px 16px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r);
  background: var(--paper);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  text-wrap: pretty;
}

.inner:has(.opts) > .q > .feed-question-mascot {
  position: absolute;
  left: -96px;
  top: 50%;
  transform: translateY(-50%);
  width: 84px;
  height: 94px;
  pointer-events: none;
  object-fit: contain;
}

.inner:has(.opts) > .q::after {
  content: "";
  position: absolute;
  left: -7px;
  top: calc(50% - 6px);
  width: 12px;
  height: 12px;
  background: var(--paper);
  border-left: 1.5px solid var(--line-2);
  border-bottom: 1.5px solid var(--line-2);
  transform: rotate(45deg);
}

.sub {
  color: var(--ink-2);
  font-weight: 500;
  margin: 0 0 20px;
}

.opts {
  display: grid;
  gap: 12px;
}

/* The signature control: 1.5px stroke, solid 4px lip beneath, presses into the lip. */
.opt {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: var(--drop) var(--lip);
  transition:
    transform 0.08s var(--ease),
    box-shadow 0.08s var(--ease),
    border-color 0.12s var(--ease),
    background 0.12s var(--ease),
    color 0.12s var(--ease);
}

.opt:not(:disabled):active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--lip);
}

@media (hover: hover) {
  .opt:not(:disabled):hover {
    background: var(--panel);
  }
}

.opt .l {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--line-1);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
  transition:
    background 0.12s var(--ease),
    color 0.12s var(--ease);
}

.opt.sel {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
  box-shadow: var(--drop) var(--brand);
}

.opt.sel .l {
  background: var(--brand);
  color: var(--on-brand);
}

.opt.right {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-ink);
  box-shadow: var(--drop) var(--green);
  animation: correct-pop 0.4s var(--ease);
}

.opt.right .l {
  background: var(--green);
  color: #fff;
}

.opt.wrong {
  border-color: var(--wrong);
  background: var(--wrong-soft);
  color: var(--wrong-ink);
  box-shadow: var(--drop) var(--wrong);
  animation: shake 0.4s var(--ease);
}

.opt.wrong .l {
  background: var(--wrong);
  color: #fff;
}

/* The kit greys the unchosen answers out in place rather than sinking them.
   The text used to take --disabled too, which put it at 1.40:1 on white — the
   two options you did not pick effectively vanished, and they are exactly the
   ones a learner needs to read to see why they were wrong. The chrome stays
   greyed; only the words come back. */
.opt.dim {
  border-color: var(--disabled);
  color: var(--ink-2);
  box-shadow: var(--drop) var(--disabled);
}

.opt.dim .l {
  background: var(--line-1);
  color: var(--ink-2);
}

.opt:disabled {
  cursor: default;
}

@keyframes correct-pop {
  35% {
    transform: scale(1.02);
  }

  70% {
    transform: scale(0.995);
  }
}

@keyframes shake {
  20% {
    transform: translateX(-7px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(3px);
  }
}

/* ---------- celebration ---------- */
.cf {
  position: absolute;
  width: 9px;
  height: 9px;
  z-index: 6;
  pointer-events: none;
  border: 0 !important;
  border-radius: 2px;
  animation: cfly 0.9s var(--ease) forwards;
}

@keyframes cfly {
  to {
    transform: translate(var(--dx), var(--dy)) rotate(320deg);
    opacity: 0;
  }
}
