/* sphinx_quiz — full-screen Kahoot-like quiz app. */

#sphinx-quiz-app {
  --sq-bg: #0d1319;
  --sq-bg-soft: #232f40;
  --sq-border: #33415a;
  --sq-text: #e8edf4;
  --sq-muted: #8fa1b8;
  --sq-blue: #4b8bbe;
  --sq-yellow: #ffd43b;
  --sq-green: #26890c;
  --sq-red: #e21b3c;
  --sq-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--sq-bg);
  color: var(--sq-text);
  overflow-y: auto;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--sq-border) transparent;
}
#sphinx-quiz-app::-webkit-scrollbar {
  width: 8px;
}
#sphinx-quiz-app::-webkit-scrollbar-track {
  background: transparent;
}
#sphinx-quiz-app::-webkit-scrollbar-thumb {
  background: var(--sq-border);
  border-radius: 99px;
}

body.sq-app-active {
  overflow: hidden;
}
body.sq-app-active .quiz-page-body h1:not(.sq-typed),
body.sq-app-active .quiz-page-footer {
  display: none;
}

#sphinx-quiz-app .sq-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  box-sizing: border-box;
  animation: sq-screen-in 0.4s ease-out;
}
@keyframes sq-screen-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#sphinx-quiz-app button {
  font-family: inherit;
}
/* Buttons follow the cover's style guide: mono pills like the chips. */
#sphinx-quiz-app .sq-btn {
  font-family: var(--sq-mono);
  border: 2px solid var(--sq-muted);
  background: transparent;
  color: var(--sq-muted);
  border-radius: 99px;
  padding: 0.55rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
#sphinx-quiz-app .sq-btn:hover {
  transform: translateY(-2px);
  color: var(--sq-text);
  border-color: var(--sq-text);
}
#sphinx-quiz-app .sq-btn-primary {
  border-color: var(--sq-yellow);
  color: var(--sq-yellow);
  font-weight: 700;
}
#sphinx-quiz-app .sq-btn-primary:hover {
  background: var(--sq-yellow);
  color: #0d1319;
  border-color: var(--sq-yellow);
}
#sphinx-quiz-app .sq-btn:focus-visible,
#sphinx-quiz-app .sq-fan-card:focus-visible,
#sphinx-quiz-app .sq-chip:focus-visible,
#sphinx-quiz-app .sq-opt:focus-visible,
#sphinx-quiz-app .sq-cycle:focus-visible {
  outline: 2px solid var(--sq-yellow);
  outline-offset: 2px;
}
#sphinx-quiz-app svg {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.25em;
}

#sphinx-quiz-app code.literal {
  font-family: var(--sq-mono);
  background: rgba(255, 255, 255, 0.1);
  color: var(--sq-yellow);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}
#sphinx-quiz-app .highlight pre {
  background: #11161f;
  border: 1px solid var(--sq-border);
  border-radius: 8px;
  padding: clamp(0.6rem, 1.5vw, 1rem) clamp(0.8rem, 2vw, 1.4rem);
  margin: 0.5rem 0;
  overflow-x: auto;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  line-height: 1.5;
  text-align: left;
}

/* ------------------------------------------------------------- setup */

#sphinx-quiz-app .sq-setup-screen {
  justify-content: space-between;
  min-height: 100%;
}

#sphinx-quiz-app .sq-typed {
  font-family: var(--sq-mono);
  font-size: clamp(1.4rem, 4.5vw, 3rem);
  margin: clamp(1rem, 6vh, 3.5rem) 0 0;
  min-height: 1.4em;
  white-space: nowrap;
}
#sphinx-quiz-app .sq-typed::before {
  content: none;
}
#sphinx-quiz-app .sq-typed-prompt {
  color: var(--sq-yellow);
}
#sphinx-quiz-app .sq-typed-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  background: var(--sq-text);
  margin-left: 0.12em;
  vertical-align: text-bottom;
  animation: sq-blink 1s steps(1) infinite;
}
@keyframes sq-blink {
  50% { opacity: 0; }
}

#sphinx-quiz-app .sq-fan {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  margin: 1rem 0;
}
#sphinx-quiz-app .sq-fan-card {
  --card-color: var(--sq-blue);
  --card-rotate: 0deg;
  --card-lift: 0px;
  width: clamp(140px, 20vw, 260px);
  aspect-ratio: 5 / 7;
  margin: 0 clamp(-30px, -2.5vw, -14px);
  border-radius: 18px;
  border: 0;
  background: var(--card-color);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  box-sizing: border-box;
  transform: rotate(var(--card-rotate)) translateY(var(--card-lift));
  transform-origin: 50% 120%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: sq-card-deal 0.5s ease-out backwards;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}
@keyframes sq-card-deal {
  from {
    transform: rotate(-7deg) translateY(60vh);
    opacity: 0;
  }
}
#sphinx-quiz-app .sq-fan-card:hover,
#sphinx-quiz-app .sq-fan-card:focus-visible {
  transform: rotate(0deg) translateY(calc(var(--card-lift) - 26px)) scale(1.07);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
  z-index: 2;
}
#sphinx-quiz-app .sq-fan-deco {
  font-family: var(--sq-mono);
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 700;
  text-align: left;
}
#sphinx-quiz-app .sq-fan-name {
  font-family: var(--sq-mono);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 700;
  text-transform: capitalize;
  color: #fff;
  text-align: center;
  margin-bottom: 1.4rem;
}

#sphinx-quiz-app .sq-chips {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: clamp(1rem, 5vh, 2.5rem);
}
#sphinx-quiz-app .sq-chip {
  --chip-color: var(--sq-blue);
  font-family: var(--sq-mono);
  text-transform: capitalize;
  font-size: 0.95rem;
  color: var(--chip-color);
  background: transparent;
  border: 2px solid var(--chip-color);
  border-radius: 99px;
  padding: 0.4rem 1.1rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}
#sphinx-quiz-app .sq-chip:hover {
  transform: translateY(-2px);
}
#sphinx-quiz-app .sq-chip-active {
  background: var(--chip-color);
  color: #0d1319;
  font-weight: 700;
}

#sphinx-quiz-app .sq-corner {
  position: fixed;
  right: clamp(0.8rem, 2.5vw, 2rem);
  bottom: clamp(0.8rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}
#sphinx-quiz-app .sq-cycle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  color: var(--sq-muted);
  font-family: var(--sq-mono);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: 8px;
  transition: color 0.15s;
}
#sphinx-quiz-app .sq-cycle:hover {
  color: var(--sq-yellow);
}
#sphinx-quiz-app .sq-cycle-icon svg {
  width: 1.5em;
  height: 1.5em;
}
#sphinx-quiz-app .sq-cycle-tick .sq-cycle-value {
  animation: sq-tick 0.25s ease-out;
}
@keyframes sq-tick {
  from { transform: translateY(-8px); opacity: 0; }
}
#sphinx-quiz-app .sq-cycle-value {
  display: inline-block;
  min-width: 2.2em;
  text-align: left;
}

/* ---------------------------------------------------------- question */

/* Home link, styled like the cover title (static cursor; blinks on hover). */
#sphinx-quiz-app .sq-brand {
  position: fixed;
  top: 1rem;
  left: 1.4rem;
  font-family: var(--sq-mono);
  font-size: clamp(1rem, 1.9vw, 1.35rem);
  font-weight: 700;
  color: var(--sq-text);
  background: transparent;
  border: 0;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  z-index: 3;
}
.sq-lang {
  position: fixed;
  top: 1rem;
  right: 1.4rem;
  display: flex;
  gap: 0.5rem;
  z-index: 15; /* above the fixed #sphinx-quiz-app mount (z-index 10) */
}
.sq-lang .sq-flag {
  display: block;
  width: 30px;
  height: 20px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.sq-lang a.sq-flag {
  cursor: pointer;
}
.sq-lang a.sq-flag:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.sq-lang .sq-flag-active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--sq-text);
  cursor: default;
}
.sq-lang .sq-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

#sphinx-quiz-app .sq-cursor-static {
  animation: none;
}
#sphinx-quiz-app .sq-brand:hover .sq-cursor-static {
  animation: sq-blink 1s steps(1) infinite;
}

#sphinx-quiz-app .sq-question-screen {
  padding-top: 0;
  justify-content: flex-start;
}

#sphinx-quiz-app .sq-stage {
  position: fixed;
  top: 38vh;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  text-align: center;
  transition: top 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}
#sphinx-quiz-app .sq-stage.sq-docked {
  top: 3.4rem;
  transform: translate(-50%, -50%) scale(0.6);
}
/* Verdict entry: small, pinned to the top, growing downwards.  The
   jump to this state happens instantly (while faded out) so the
   verdict never travels from the old centered position offscreen. */
#sphinx-quiz-app .sq-stage.sq-verdict-enter {
  top: 1rem;
  transform: translate(-50%, 0) scale(0.45);
  transform-origin: 50% 0;
  transition: opacity 0.25s;
}
/* Verdict takes over the stage: full size, clear of the top edge. */
#sphinx-quiz-app .sq-stage.sq-stage-verdict {
  top: clamp(4.5rem, 12vh, 8rem);
  transform: translate(-50%, 0) scale(1);
  transform-origin: 50% 0;
}
#sphinx-quiz-app .sq-stage-word {
  font-family: var(--sq-mono);
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 700;
  animation: sq-pop-in 0.5s ease-out;
}
#sphinx-quiz-app .sq-stage-count {
  font-family: var(--sq-mono);
  font-size: clamp(1.2rem, 3.5vw, 2.2rem);
  color: var(--sq-muted);
  animation: sq-pop-in 0.5s ease-out 0.15s backwards;
}
@keyframes sq-pop-in {
  from { transform: scale(0.6); opacity: 0; }
}
#sphinx-quiz-app .sq-stage-swap {
  opacity: 0;
  transition: opacity 0.25s;
}

#sphinx-quiz-app .sq-verdict-icon svg {
  width: clamp(4.5rem, 11vw, 7rem);
  height: clamp(4.5rem, 11vw, 7rem);
  animation: sq-pop-in 0.4s ease-out;
}
#sphinx-quiz-app .sq-verdict-success .sq-verdict-icon,
#sphinx-quiz-app .sq-verdict-success .sq-verdict-title {
  color: #3fb950;
}
#sphinx-quiz-app .sq-verdict-failure .sq-verdict-icon,
#sphinx-quiz-app .sq-verdict-failure .sq-verdict-title {
  color: var(--sq-red);
}
#sphinx-quiz-app .sq-verdict-title {
  font-family: var(--sq-mono);
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  font-weight: 700;
  animation: sq-pop-in 0.4s ease-out 0.1s backwards;
}
#sphinx-quiz-app .sq-verdict-title p {
  display: inline;
  margin: 0;
}
#sphinx-quiz-app .sq-verdict-body {
  color: var(--sq-muted);
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  animation: sq-pop-in 0.4s ease-out 0.2s backwards;
}
#sphinx-quiz-app .sq-verdict-body p {
  margin: 0.2rem 0 0;
}

#sphinx-quiz-app .sq-question-content {
  width: min(920px, 100%);
  margin-top: clamp(7.5rem, 17vh, 10rem);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s, transform 0.5s;
  text-align: center;
  padding-bottom: 3.5rem;
}
#sphinx-quiz-app .sq-question-content.sq-revealed {
  opacity: 1;
  transform: none;
}

#sphinx-quiz-app .sq-question-title {
  font-size: clamp(1.6rem, 4vw, 2.9rem);
  font-weight: 700;
  margin: 0 0 1rem;
  transition: font-size 0.5s ease;
}
#sphinx-quiz-app .sq-question-title::before {
  content: none;
}
#sphinx-quiz-app .sq-question-title p {
  display: inline;
  margin: 0;
}
#sphinx-quiz-app .sq-question-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.2rem;
  overflow: hidden;
  max-height: 60vh;
  transition: max-height 0.5s ease, opacity 0.4s ease, margin 0.5s ease;
}
#sphinx-quiz-app .sq-question-body > * {
  max-width: 100%;
}
#sphinx-quiz-app .sq-multi-hint {
  font-family: var(--sq-mono);
  font-size: 0.85rem;
  color: var(--sq-yellow);
  margin: 0 0 1rem;
}

/* Post-answer: the title, body and dimmed cards go away; JS sits the
   block right below the measured verdict and caps its height.  Flex
   keeps the answers and the next button always visible: only the
   explanation scrolls. */
#sphinx-quiz-app .sq-post .sq-question-content {
  transition: margin-top 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#sphinx-quiz-app .sq-post .sq-question-body,
#sphinx-quiz-app .sq-post .sq-multi-hint {
  max-height: 0;
  opacity: 0;
  margin: 0;
}
#sphinx-quiz-app .sq-post .sq-options {
  flex: 0 0 auto;
}
#sphinx-quiz-app .sq-post .sq-feedback {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#sphinx-quiz-app .sq-post .sq-explanation {
  flex: 0 1 auto;
  min-height: 0;
  /* min-width 0 stops wide code blocks (min-content) from inflating
     the flex item past its container; the pre scrolls instead. */
  min-width: 0;
  max-width: min(760px, 100%);
  box-sizing: border-box;
  overflow-y: auto;
}
#sphinx-quiz-app .sq-explanation .highlight {
  overflow-x: auto;
}
#sphinx-quiz-app .sq-post .sq-feedback .sq-btn {
  flex: 0 0 auto;
  align-self: center;
  margin-bottom: 0.4rem;
}

/* Integrated scrollbar for the resolution block. */
#sphinx-quiz-app .sq-scroll {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sq-border) transparent;
}
#sphinx-quiz-app .sq-scroll::-webkit-scrollbar {
  width: 8px;
}
#sphinx-quiz-app .sq-scroll::-webkit-scrollbar-track {
  background: transparent;
}
#sphinx-quiz-app .sq-scroll::-webkit-scrollbar-thumb {
  background: var(--sq-border);
  border-radius: 99px;
}
#sphinx-quiz-app .sq-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--sq-muted);
}

#sphinx-quiz-app .sq-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: clamp(0.6rem, 1.5vw, 1rem);
  text-align: left;
}
#sphinx-quiz-app .sq-opt {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--sq-bg-soft);
  color: var(--sq-text);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: clamp(0.7rem, 1.6vw, 1.1rem);
  font-size: clamp(1rem, 1.9vw, 1.25rem);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s, opacity 0.4s, box-shadow 0.18s;
  animation: sq-opt-in 0.45s ease-out backwards;
  text-align: left;
}
@keyframes sq-opt-in {
  from { transform: translateY(30px) scale(0.95); opacity: 0; }
}
#sphinx-quiz-app .sq-revealed .sq-opt {
  animation-play-state: running;
}
#sphinx-quiz-app .sq-opt:not(:disabled):hover {
  transform: rotate(-1.6deg) scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
#sphinx-quiz-app .sq-opt-letter {
  flex: 0 0 auto;
  width: clamp(2.2rem, 4vw, 2.9rem);
  height: clamp(2.2rem, 4vw, 2.9rem);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sq-mono);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  color: #fff;
}
#sphinx-quiz-app .sq-opt-text p {
  margin: 0;
  display: inline;
}
#sphinx-quiz-app .sq-opt:disabled {
  cursor: default;
}
#sphinx-quiz-app .sq-opt-selected {
  border-color: var(--sq-yellow);
}
#sphinx-quiz-app .sq-opt-right {
  border-color: #3fb950;
  animation: sq-border-blink 1s steps(2, jump-none);
}
@keyframes sq-border-blink {
  0%, 50% { border-color: #3fb950; box-shadow: 0 0 18px rgba(63, 185, 80, 0.4); }
  25%, 75% { border-color: transparent; box-shadow: none; }
}
#sphinx-quiz-app .sq-opt-wrong {
  border-color: var(--sq-red);
}
#sphinx-quiz-app .sq-opt-missed {
  border-color: var(--sq-yellow);
}
#sphinx-quiz-app .sq-opt-dim {
  opacity: 0.35;
  filter: grayscale(1);
}
#sphinx-quiz-app .sq-opt-dim .sq-opt-letter {
  background: var(--sq-border) !important;
}
#sphinx-quiz-app .sq-gone {
  animation: sq-shrink-out 0.45s ease forwards;
}
@keyframes sq-shrink-out {
  to {
    opacity: 0;
    transform: scale(0.85);
    padding-top: 0;
    padding-bottom: 0;
    max-height: 0;
    margin: 0;
    border-width: 0;
  }
}

#sphinx-quiz-app .sq-submit {
  margin-top: 1.2rem;
}

#sphinx-quiz-app .sq-feedback {
  text-align: center;
}
#sphinx-quiz-app .sq-explanation {
  border-left: 3px solid var(--sq-blue);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 1.4rem auto 1rem;
  color: var(--sq-text);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  max-width: 760px;
  text-align: left;
}
#sphinx-quiz-app .sq-appear {
  animation: sq-pop-in 0.45s ease-out backwards;
}

/* Footer time bar: grows taller as time runs out. */
#sphinx-quiz-app .sq-footbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  transition: opacity 0.4s;
}
#sphinx-quiz-app .sq-footbar-fill {
  height: 100%;
  width: 100%;
  background: var(--sq-yellow);
  transition: width 0.1s linear, background 0.3s;
}
#sphinx-quiz-app .sq-footbar-fill.sq-footbar-low {
  background: var(--sq-red);
}
#sphinx-quiz-app .sq-footbar-label {
  position: fixed;
  right: 0.9rem;
  bottom: 1.4rem;
  font-family: var(--sq-mono);
  font-size: 0.85rem;
  color: var(--sq-muted);
  transition: opacity 0.4s;
}

/* ----------------------------------------------------------- results */

#sphinx-quiz-app .sq-results-screen {
  justify-content: center;
}
#sphinx-quiz-app .sq-results-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(240px, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  width: min(1100px, 100%);
  margin-top: 2rem;
}
@media (max-width: 760px) {
  #sphinx-quiz-app .sq-results-grid {
    grid-template-columns: 1fr;
  }
}

#sphinx-quiz-app .sq-results-top {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  margin-bottom: 1.6rem;
}
#sphinx-quiz-app .sq-results-info {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
#sphinx-quiz-app .sq-info-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--sq-mono);
  color: var(--sq-muted);
  font-size: 0.95rem;
}
#sphinx-quiz-app .sq-info-card {
  --card-color: var(--sq-blue);
  background: var(--card-color);
  color: #fff;
  font-family: var(--sq-mono);
  font-weight: 700;
  text-transform: capitalize;
  border-radius: 8px;
  padding: 0.35rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
#sphinx-quiz-app .sq-info-chip {
  cursor: default;
}
#sphinx-quiz-app .sq-info-timer svg {
  width: 1.5em;
  height: 1.5em;
}
#sphinx-quiz-app .sq-ring {
  position: relative;
  width: clamp(160px, 24vw, 220px);
  aspect-ratio: 1;
}
#sphinx-quiz-app .sq-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
#sphinx-quiz-app .sq-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 14;
}
#sphinx-quiz-app .sq-ring-fill {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}
#sphinx-quiz-app .sq-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--sq-mono);
}
#sphinx-quiz-app .sq-ring-score {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
}

#sphinx-quiz-app .sq-record {
  font-family: var(--sq-mono);
  font-size: 0.9rem;
  color: var(--sq-muted);
  margin: 0 0 1rem;
}
#sphinx-quiz-app .sq-record-new {
  color: var(--sq-yellow);
  font-weight: 700;
}

#sphinx-quiz-app .sq-breakdown {
  margin-bottom: 1.2rem;
}
#sphinx-quiz-app .sq-breakdown-title {
  font-family: var(--sq-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sq-muted);
  margin: 0 0 0.5rem;
}
#sphinx-quiz-app .sq-breakdown-title::before {
  content: none;
}
#sphinx-quiz-app .sq-breakdown-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 3.5rem;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
#sphinx-quiz-app .sq-breakdown-name {
  font-family: var(--sq-mono);
  font-size: 0.85rem;
  text-transform: capitalize;
}
#sphinx-quiz-app .sq-breakdown-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}
#sphinx-quiz-app .sq-breakdown-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--sq-blue);
}
#sphinx-quiz-app .sq-breakdown-count {
  font-family: var(--sq-mono);
  font-size: 0.8rem;
  color: var(--sq-muted);
  text-align: right;
}

#sphinx-quiz-app .sq-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: clamp(2rem, 6vh, 3.5rem);
}
#sphinx-quiz-app .sq-btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
#sphinx-quiz-app .sq-share-menu {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  background: var(--sq-bg-soft);
  border: 1px solid var(--sq-border);
  border-radius: 10px;
  overflow: hidden;
  animation: sq-pop-in 0.2s ease-out;
  z-index: 5;
}
#sphinx-quiz-app .sq-share-item {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--sq-text);
  padding: 0.7rem 1.2rem;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
#sphinx-quiz-app .sq-share-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

#sphinx-quiz-app .sq-results-right {
  text-align: center;
  animation: sq-pop-in 0.6s ease-out 0.4s backwards;
}
#sphinx-quiz-app .sq-podium-title {
  font-family: var(--sq-mono);
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  font-weight: 700;
  margin: 0 0 1.2rem;
}
#sphinx-quiz-app .sq-podium-title::before {
  content: none;
}
#sphinx-quiz-app .sq-podium-image {
  width: clamp(160px, 22vw, 260px);
  max-width: 100%;
}
#sphinx-quiz-app .sq-podium-text {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-style: italic;
  color: var(--sq-muted);
  max-width: 34ch;
  margin: 1rem auto 0;
}

/* Review modal. */
#sphinx-quiz-app .sq-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 15, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: sq-screen-in 0.25s ease-out;
}
#sphinx-quiz-app .sq-modal {
  background: var(--sq-bg);
  border: 1px solid var(--sq-border);
  border-radius: 16px;
  width: min(760px, calc(100vw - 2rem));
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: sq-pop-in 0.3s ease-out;
}
#sphinx-quiz-app .sq-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--sq-border);
}
#sphinx-quiz-app .sq-modal-title {
  margin: 0;
  font-family: var(--sq-mono);
  font-size: 1.1rem;
}
#sphinx-quiz-app .sq-modal-title::before {
  content: ">>> ";
  color: var(--sq-yellow);
}
#sphinx-quiz-app .sq-modal-close {
  background: transparent;
  border: 0;
  color: var(--sq-muted);
  cursor: pointer;
  padding: 0.3rem;
}
#sphinx-quiz-app .sq-modal-close:hover {
  color: var(--sq-text);
}
#sphinx-quiz-app .sq-modal-body {
  overflow-y: auto;
  padding: 1rem 1.4rem 1.4rem;
}
#sphinx-quiz-app .sq-modal-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#sphinx-quiz-app .sq-modal-item-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}
#sphinx-quiz-app .sq-modal-item-title p {
  display: inline;
  margin: 0;
}
#sphinx-quiz-app .sq-modal-item-title.sq-ok svg { color: #3fb950; }
#sphinx-quiz-app .sq-modal-item-title.sq-ko svg { color: var(--sq-red); }
#sphinx-quiz-app .sq-modal-choice {
  border-left: 3px solid var(--sq-border);
  padding: 0.2rem 0 0.2rem 0.9rem;
  margin: 0.3rem 0;
  font-size: 0.92rem;
}
#sphinx-quiz-app .sq-modal-choice p { margin: 0; display: inline; }
#sphinx-quiz-app .sq-modal-choice-right { border-color: #3fb950; }
#sphinx-quiz-app .sq-modal-choice-missed { border-color: var(--sq-yellow); }
#sphinx-quiz-app .sq-modal-choice-wrong {
  border-color: var(--sq-red);
  opacity: 0.8;
}
#sphinx-quiz-app .sq-modal .sq-explanation {
  margin: 0.6rem 0 0.2rem;
  font-size: 0.92rem;
}

#sphinx-quiz-app .sq-empty {
  color: var(--sq-muted);
  margin: 30vh 0 1rem;
}

/* Mobile: cards in a centered 3-2 wrap instead of the fan, corner
   selectors flow under the chips, smaller title and brand. */
@media (max-width: 640px) {
  #sphinx-quiz-app .sq-typed {
    font-size: 5.5vw;
    margin-top: 1.2rem;
  }
  #sphinx-quiz-app .sq-fan {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    gap: 0.7rem;
    width: 100%;
  }
  #sphinx-quiz-app .sq-fan-card {
    --card-rotate: 0deg;
    --card-lift: 0px;
    --card-tilt: 0deg;
    width: calc(33.33% - 0.7rem);
    margin: 0;
    padding: 0.7rem;
    border-radius: 12px;
    transform: rotate(var(--card-tilt));
  }
  /* Slight alternating tilts, like cards dropped on a table. */
  #sphinx-quiz-app .sq-fan-card:nth-child(odd) { --card-tilt: -2.4deg; }
  #sphinx-quiz-app .sq-fan-card:nth-child(even) { --card-tilt: 2deg; }
  #sphinx-quiz-app .sq-fan-card:nth-child(3n) { --card-tilt: -1.2deg; }
  #sphinx-quiz-app .sq-fan-card:nth-child(4n) { --card-tilt: 2.8deg; }
  #sphinx-quiz-app .sq-fan-card:hover,
  #sphinx-quiz-app .sq-fan-card:focus-visible {
    transform: rotate(var(--card-tilt)) translateY(-8px) scale(1.04);
  }
  #sphinx-quiz-app .sq-fan-name {
    margin-bottom: 0.4rem;
    font-size: 1rem;
  }
  #sphinx-quiz-app .sq-fan-deco {
    font-size: 1rem;
  }
  #sphinx-quiz-app .sq-chips {
    margin-bottom: 0;
  }
  #sphinx-quiz-app .sq-corner {
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 0.9rem 0 0.3rem;
  }
  #sphinx-quiz-app .sq-brand {
    font-size: 0.9rem;
    top: 0.7rem;
    left: 0.8rem;
  }
  #sphinx-quiz-app .sq-stage.sq-docked {
    top: 4.2rem;
  }
}

/* Short viewports: compact verdict so the resolution keeps room. */
@media (max-height: 700px) {
  #sphinx-quiz-app .sq-stage.sq-stage-verdict {
    top: 2.5rem;
  }
  #sphinx-quiz-app .sq-verdict-icon svg {
    width: 3rem;
    height: 3rem;
  }
  #sphinx-quiz-app .sq-verdict-title {
    font-size: clamp(1.5rem, 5vh, 2.2rem);
  }
  #sphinx-quiz-app .sq-verdict-body {
    font-size: 1rem;
  }
}

/* The quiz is a game: its animations are part of the experience, so
   the OS-level reduced-motion preference is deliberately not applied
   (it would strip the transitions entirely). */
