/* Card mode: one question per screen, built for thumbs.
   Inherits the palette, type, masthead, tach, and legal from styles.css. */

.cards-body { min-height: 100vh; }

.tach-big { height: 8px; }

.card-stage {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 16px 8px;
}

.card-stage .back-btn { margin-bottom: 6px; }

.card { opacity: 1; }

.card.swap { animation: cardIn 180ms ease-out; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .card.swap { animation: none; }
}

.kicker {
  font-size: 18px;
  font-weight: 600;
  color: var(--steel);
  margin: 0 0 8px;
}

.question {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 22px;
  color: var(--ink);
}

.option-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  font: inherit;
  font-size: 21px;
  font-weight: 600;
  text-align: left;
  background: var(--panel);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
}

.option:hover { background: #F4F6F7; }

.option.selected {
  background: var(--ink);
  color: var(--panel);
}

.option:focus-visible,
.big-input:focus-visible,
.big-next:focus-visible {
  outline: 3px solid var(--redline);
  outline-offset: 2px;
}

.typed-row { margin-top: 4px; }

.big-input {
  width: 100%;
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  padding: 16px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
}

.big-next {
  width: 100%;
  margin-top: 12px;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  background: var(--ink);
  color: var(--panel);
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
}

.field-error {
  color: var(--redline);
  font-size: 17px;
  font-weight: 600;
  margin: 10px 0 0;
  min-height: 1.2em;
}

.finish-copy {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
}

.finish-copy a { color: var(--redline); }

.big-input::placeholder {
  font-weight: 400;
  color: var(--steel);
}

/* The car rides the tach, nose at the leading edge of progress */

.tach-wrap { position: relative; }

.tach-car {
  position: absolute;
  top: -11px;
  left: 9%;
  height: 22px;
  width: auto;
  transform: translateX(-86%);
  transition: left 400ms ease;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .tach-car { transition: none; }
}

.logo-link { display: block; }

.logo-link:focus-visible {
  outline: 3px solid var(--redline);
  outline-offset: 3px;
}

/* Road scene: the bar becomes a solid red road with a sky lane above it,
   the car drives the lane with wheels on the road, and a checkered
   finish gate stands at the far right. Scoped to the card page only. */

.cards-body .tach-wrap {
  padding-top: 26px;
  background: var(--panel);
}

.cards-body .tach {
  background: var(--redline);
}

.cards-body .tach-fill { display: none; }

.cards-body .tach-redline {
  width: 16px;
  top: -24px;
  bottom: -1px;
  background: repeating-conic-gradient(var(--ink) 0% 25%, #FFFFFF 0% 50%) 0 0 / 8px 8px;
  border-left: 1px solid var(--ink);
}

.cards-body .tach-car {
  top: auto;
  bottom: 7px;
  height: 24px;
  transform: translateX(-80%);
}

/* Skip: present for optional questions, visually second fiddle to Next */

.big-skip {
  width: 100%;
  margin-top: 10px;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  background: none;
  color: var(--steel);
  border: 2px solid #C6CCCF;
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
}

.big-skip:hover { color: var(--ink); border-color: var(--steel); }

.big-skip:focus-visible {
  outline: 3px solid var(--redline);
  outline-offset: 2px;
}

/* Finish line celebration: the car crosses the gate and fireworks pop */

.cards-body .tach-car.finished {
  transform: translateX(-45%);
  transition: left 900ms ease-in, transform 900ms ease-in;
}

.burst {
  position: absolute;
  right: 10px;
  bottom: 26px;
  width: 0;
  height: 0;
  pointer-events: none;
}

.burst span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--redline);
  opacity: 0;
  animation: spark 1100ms ease-out var(--d) 3;
}

.burst span:nth-child(3n) { background: var(--ink); }
.burst span:nth-child(4n) { background: #F2B705; width: 5px; height: 5px; }

@keyframes spark {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .cards-body .tach-car.finished { transition: none; }
  .burst span { animation: none; opacity: 0; }
}

/* Road scene refinements: nothing clips, the gate is a real gate,
   the car is always fully visible, and controls soften up */

.cards-body .tach { overflow: visible; }

.cards-body .tach-redline { width: 34px; }

.cards-body .tach-car.finished {
  transform: translateX(-100%);
  transition: left 900ms ease-in, transform 900ms ease-in;
}

.cards-body .option,
.cards-body .big-input,
.cards-body .big-next,
.cards-body .big-skip {
  border-radius: 999px;
}

.cards-body .option {
  padding: 18px 26px;
  background-color: var(--panel);
  background-image: linear-gradient(var(--redline), var(--redline));
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 0% 100%;
  transition: background-size 340ms ease-out, color 220ms ease-out 90ms, border-color 340ms ease-out;
}

.cards-body .option:hover { background-color: #F4F6F7; }

.cards-body .option.confirming,
.cards-body .option.selected {
  background-size: 100% 100%;
  color: #FFFFFF;
  border-color: var(--redline);
}

.cards-body .option-stack.locked { pointer-events: none; }
.cards-body .big-input { padding: 16px 24px; }

.cards-body .big-next {
  background: var(--redline);
  color: #FFFFFF;
}

.cards-body .big-next:hover { background: #C5281C; }

/* Finish stays in the road: same height as the asphalt, full 34px length,
   finer checkers so the pattern reads at road height */

.cards-body .tach-redline {
  top: 0;
  bottom: 0;
  background: repeating-conic-gradient(var(--ink) 0% 25%, #FFFFFF 0% 50%) 0 0 / 4px 4px;
  border-left: none;
}

/* The way home from the finish line */

a.home-link {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 22px;
}
