/* ==========================================================================
   oss-quiz.css — "Erkennen Sie den Stack" logo guessing game
   Builds on base.css / home.css / subpage.css. Logos are inline <svg>s
   coloured via `fill: currentColor`, so they follow the light/dark theme;
   the brand colour is revealed only once an answer is locked in.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero stack marquee — a teaser wall of the projects in play
   -------------------------------------------------------------------------- */

.stack-marquee {
  margin-top: var(--s-7);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.stack-track {
  display: flex;
  gap: var(--s-6);
  width: max-content;
  animation: stack-scroll 80s linear infinite;
}

.stack-marquee:hover .stack-track { animation-play-state: paused; }

.stack-logo {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--ink-4);
}

.stack-logo svg { width: 100%; height: 100%; display: block; }
.stack-logo svg path { fill: currentColor; }

@keyframes stack-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   2. Quiz shell
   -------------------------------------------------------------------------- */

.quiz-shell { max-width: 760px; margin: 0 auto; }

.quiz-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-6);
}

.quiz-bar b { color: var(--ink); font-weight: 600; }
.quiz-bar .quiz-streak { color: var(--signal); }

/* --------------------------------------------------------------------------
   3. Logo stage
   -------------------------------------------------------------------------- */

.quiz-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: var(--s-7) var(--s-6);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  margin-bottom: var(--s-6);
}

/* result pulse behind the logo — green on right, red on wrong (single, slow) */
.quiz-stage.flash-ok { animation: flash-ok 1.5s ease-in-out; }
.quiz-stage.flash-no { animation: flash-no 1.5s ease-in-out; }
@keyframes flash-ok {
  0%   { background: var(--paper-2); border-color: var(--line); }
  35%  { background: rgba(46, 160, 67, 0.34); border-color: rgba(46, 160, 67, 0.9); }
  100% { background: var(--paper-2); border-color: var(--line); }
}
@keyframes flash-no {
  0%   { background: var(--paper-2); border-color: var(--line); }
  35%  { background: rgba(214, 57, 28, 0.32); border-color: rgba(214, 57, 28, 0.9); }
  100% { background: var(--paper-2); border-color: var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-stage.flash-ok, .quiz-stage.flash-no { animation-duration: 0.6s; }
}

.quiz-logo {
  width: clamp(120px, 30vw, 190px);
  height: clamp(120px, 30vw, 190px);
  color: var(--ink);
  transition: color 0.45s ease, opacity 0.25s ease, transform 0.25s ease;
}

.quiz-logo svg { width: 100%; height: 100%; display: block; }
.quiz-logo svg path { fill: currentColor; }

.quiz-logo.is-swapping { opacity: 0; transform: scale(0.96); }

/* --------------------------------------------------------------------------
   4. Options
   -------------------------------------------------------------------------- */

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

.quiz-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

/* Plain-language tooltip — helps non-techies reason about each option */
.quiz-opt[data-desc]::after {
  content: attr(data-desc);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 230px;
  padding: 7px 11px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  border-radius: var(--r-2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.13s ease, transform 0.13s ease;
  z-index: 6;
}
.quiz-opt[data-desc]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.13s ease;
  z-index: 6;
}
.quiz-opt[data-desc]:hover::after,
.quiz-opt[data-desc]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.quiz-opt[data-desc]:hover::before,
.quiz-opt[data-desc]:focus-visible::before { opacity: 1; }

.quiz-opt .k {
  flex: none;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--t-xxs);
  color: var(--ink-4);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
}

.quiz-opt .label { flex: 1 1 auto; }
.quiz-opt .mark { flex: none; font-weight: 700; opacity: 0; }

.quiz-opt:hover:not(:disabled) { border-color: var(--ink); }
.quiz-opt:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.quiz-opt:disabled { cursor: default; }

.quiz-opt.is-correct {
  border-color: var(--signal);
  background: var(--signal-soft);
  color: var(--signal-ink);
}
.quiz-opt.is-correct .k { border-color: var(--signal); color: var(--signal); }
.quiz-opt.is-correct .mark { opacity: 1; color: var(--signal); }

.quiz-opt.is-wrong {
  border-color: var(--line);
  color: var(--ink-4);
}
.quiz-opt.is-wrong .label { text-decoration: line-through; }
.quiz-opt.is-wrong .mark { opacity: 1; color: var(--ink-4); }

/* --------------------------------------------------------------------------
   5. Footer row — feedback + next
   -------------------------------------------------------------------------- */

.quiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-5);
  min-height: 46px;
}

.quiz-feedback {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  color: var(--ink-3);
}
.quiz-feedback .ok { color: var(--signal); }
.quiz-feedback .quiz-link { color: var(--ink); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.quiz-feedback .quiz-link:hover { color: var(--signal); border-color: var(--signal); }

.quiz-next {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  flex: none;
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: var(--t-sm);
  font-weight: 500;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.quiz-next:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.quiz-next[hidden] { display: none; }

/* --------------------------------------------------------------------------
   6. Result screen
   -------------------------------------------------------------------------- */

.quiz-result { text-align: center; max-width: 560px; margin: 0 auto; }
.quiz-result[hidden] { display: none; }

.quiz-result .score {
  font-family: var(--font-sans);
  font-size: clamp(56px, 12vw, 96px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  margin: 0;
}
.quiz-result .score b { color: var(--signal); font-weight: 600; }

.quiz-result .verdict {
  font-family: var(--font-sans);
  font-size: var(--t-lg);
  color: var(--ink);
  margin: var(--s-5) 0 var(--s-2);
  text-wrap: balance;
}

.quiz-result .detail {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin: 0 0 var(--s-7);
}
.quiz-result .detail b { color: var(--ink); }

.quiz-result .quiz-actions {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* secondary (outline) button, e.g. link to the sovereignty page */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover { border-color: var(--ink); color: var(--signal); }

/* --------------------------------------------------------------------------
   7. No-JS fallback
   -------------------------------------------------------------------------- */

.quiz-noscript {
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  color: var(--ink-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-3);
  padding: var(--s-7);
}

/* --------------------------------------------------------------------------
   8. Responsive + motion
   -------------------------------------------------------------------------- */

@media (max-width: 560px) {
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-foot { flex-direction: column-reverse; align-items: stretch; }
  .quiz-next { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .stack-track { animation: none; }
  .stack-marquee { overflow-x: auto; }
  .quiz-logo { transition: background-color 0.2s ease; }
}
