/* MotoGP 2026 — arrival quiz (fan profile).
   Two required questions, no skip and no close: the card leaves only after
   both a team and a rider have been picked. Palette and type follow site.css. */

html.quiz-lock,
html.quiz-lock body { overflow: hidden; }

.quiz {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  transition: opacity 0.42s ease, visibility 0.42s;
}
.quiz.is-out { opacity: 0; visibility: hidden; }

.quiz-bg { position: absolute; inset: 0; background:
  radial-gradient(1100px 560px at 50% -12%, rgba(225, 6, 0, 0.18), transparent 62%),
  radial-gradient(900px 480px at 50% 112%, rgba(198, 161, 91, 0.10), transparent 60%),
  #05090d; }
.quiz-bg::before,
.quiz-bg::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 16px;
  background: repeating-conic-gradient(#e8e8e8 0 25%, #0a0a0a 0 50%) 0 0 / 16px 16px;
  opacity: 0.92;
}
.quiz-bg::before { top: 0; }
.quiz-bg::after { bottom: 0; }

.quiz-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(780px, 100%);
  max-height: min(92vh, 880px);
  min-height: 0;
  background: linear-gradient(180deg, #0c1219, #080d13 58%, #070b10);
  border: 1px solid rgba(198, 161, 91, 0.34);
  border-top: 3px solid var(--red);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.quiz-card::before {
  content: "MOTOGP";
  position: absolute;
  right: -14px;
  bottom: -34px;
  font-size: 148px;
  line-height: 1;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.045em;
  color: #fff;
  opacity: 0.03;
  pointer-events: none;
}

.quiz-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 26px 13px;
  border-bottom: 1px solid var(--line);
}
.quiz-brand { font-size: 15px; font-weight: 800; letter-spacing: 0.32em; }
.quiz-year { font-size: 10px; font-weight: 600; letter-spacing: 0.2em; color: var(--gold); }
.quiz-kicker {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8c8c8c;
}

.quiz-prog { display: flex; gap: 6px; padding: 14px 26px 0; }
.quiz-prog i { flex: 1; height: 3px; background: rgba(255, 255, 255, 0.09); transition: background 0.2s; }
.quiz-prog i.is-on { background: var(--red); }

/* Start lights: five red lamps on a small gantry under the card header.
   Lights stay dark while html.i18n-wait hides the body, so the sequence only
   plays once the card is actually on screen: reds light one by one, all go
   dark together at 3.1s and the row turns green = race start / go. Pure CSS,
   nothing to block the quiz. */
.quiz-lights {
  display: flex;
  justify-content: center;
  gap: 13px;
  width: max-content;
  margin: 13px auto 0;
  padding: 8px 20px;
  direction: ltr;
  background: linear-gradient(180deg, #1b2129, #0d1116);
  border: 1px solid rgba(198, 161, 91, 0.24);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 6px 18px rgba(0, 0, 0, 0.45);
}
.quiz-lights i {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #351311;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8), 0 0 0 2px #12161b;
}
/* green GO lamp switches on the moment the reds go out */
.quiz-lights i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle at 38% 32%, #b9f6c8, #2fd16f 55%, #0b6b38);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 0 15px 3px rgba(47, 209, 111, 0.55);
  animation: qgo 0.22s linear 3.1s 1 forwards;
}
html.i18n-wait .quiz-lights i { animation: none; }
html.i18n-wait .quiz-lights i::after { animation: none; opacity: 0; }
.quiz-lights i:nth-child(1) { animation: qlamp 2.95s steps(1, end) 0.15s 1 both; }
.quiz-lights i:nth-child(2) { animation: qlamp 2.61s steps(1, end) 0.49s 1 both; }
.quiz-lights i:nth-child(3) { animation: qlamp 2.27s steps(1, end) 0.83s 1 both; }
.quiz-lights i:nth-child(4) { animation: qlamp 1.93s steps(1, end) 1.17s 1 both; }
.quiz-lights i:nth-child(5) { animation: qlamp 1.59s steps(1, end) 1.51s 1 both; }
@keyframes qlamp {
  0%, 13.9% { background: #351311; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8), 0 0 0 2px #12161b; }
  14%, 99.9% {
    background: radial-gradient(circle at 38% 32%, #ff7a6e, #e10600 52%, #8f0400);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 0 0 2px #12161b, 0 0 15px 3px rgba(225, 6, 0, 0.6);
  }
  100% { background: #351311; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8), 0 0 0 2px #12161b; }
}
@keyframes qgo {
  from { opacity: 0; }
  to { opacity: 1; }
}

.quiz-q {
  padding: 15px 26px 13px;
  font-size: clamp(1.22rem, 2.5vw, 1.72rem);
  font-weight: 800;
  letter-spacing: -0.012em;
  line-height: 1.12;
}

.quiz-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 26px 24px;
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(198, 161, 91, 0.4) transparent;
}
.quiz-opts[hidden] { display: none !important; }
.quiz-opts::-webkit-scrollbar { width: 8px; }
.quiz-opts::-webkit-scrollbar-thumb { background: rgba(198, 161, 91, 0.35); }
.quiz-opts::-webkit-scrollbar-track { background: transparent; }

.qopt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 50px;
  padding: 8px 11px 8px 15px;
  text-align: start;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.14s, background 0.14s;
}
.qopt::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--tc, #666);
}
.qopt:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.qopt:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.qopt.is-pick { border-color: var(--gold); background: rgba(198, 161, 91, 0.1); }
.qopt.is-pick::before { width: 4px; background: var(--red); }

.qnum {
  flex: 0 0 auto;
  width: 44px;
  padding: 2px 0;
  text-align: center;
  font-size: 19px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #fff;
  background: #12161b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.14s, border-color 0.14s;
}
.qopt.is-pick .qnum { background: var(--red); border-color: var(--red); }

.qmain { display: flex; flex-direction: column; min-width: 0; }
.qmain b {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qmain small {
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.4;
  color: #8c8c8c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qflag { flex: 0 0 auto; margin-left: auto; }
.qflag .fg { border-radius: 1px; }

html[dir="rtl"] .qopt::before { left: auto; right: 0; }
html[dir="rtl"] .qflag { margin-left: 0; margin-right: auto; }

@media (max-width: 640px) {
  .quiz { padding: 10px; }
  .quiz-card { max-height: 94vh; }
  .quiz-card::before { font-size: 96px; bottom: -22px; }
  .quiz-head { padding: 14px 16px 11px; }
  .quiz-brand { font-size: 13px; letter-spacing: 0.28em; }
  .quiz-prog { padding: 12px 16px 0; }
  .quiz-lights { gap: 10px; padding: 6px 15px; margin-top: 10px; }
  .quiz-lights i { width: 16px; height: 16px; }
  .quiz-q { padding: 13px 16px 11px; }
  .quiz-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 16px 18px; }
  .qopt { gap: 8px; min-height: 46px; padding: 7px 8px 7px 11px; }
  .qnum { width: 34px; font-size: 15px; }
  .qmain b { font-size: 12px; }
  .qmain small { display: none; }
  .qflag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.i18n-wait .quiz-lights i,
  .quiz-lights i {
    animation: none;
    background: radial-gradient(circle at 38% 32%, #ff7a6e, #e10600 52%, #8f0400);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 0 0 2px #12161b, 0 0 12px 2px rgba(225, 6, 0, 0.45);
  }
  .quiz-lights i::after { animation: none; opacity: 0; }
}
