:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; color: #f1f5f9; background: #0f172a; }
button { font: inherit; }
button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
[hidden] { display: none !important; }

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 100% 0, #1e293b 0%, #0f172a 100%);
  content: "";
}

.quiz-shell {
  width: min(calc(100% - 32px), 672px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
  margin: 0 auto;
  padding: 24px 0;
}

.ambient { position: fixed; z-index: 0; border-radius: 999px; filter: blur(120px); opacity: .14; pointer-events: none; }
.ambient-one { top: -115px; left: calc(50% - 350px); width: 360px; height: 360px; background: var(--primary); }
.ambient-two { right: calc(50% - 355px); bottom: -145px; width: 360px; height: 360px; background: var(--primary); opacity: .1; }

.intro-screen { display: flex; flex-direction: column; align-items: center; text-align: center; animation: screen-in .45s ease both; }
.intro-screen.screen-exit { animation: screen-out .22s ease both; }
.intro-cover { width: 100%; aspect-ratio: 16 / 9; position: relative; overflow: hidden; margin-bottom: 25px; border: 1px solid rgb(255 255 255 / 8%); border-radius: 28px; background: linear-gradient(145deg, var(--cover-start), var(--cover-end)); box-shadow: 0 20px 50px rgb(0 0 0 / 50%); }
.cover-glow { position: absolute; width: 65%; aspect-ratio: 1; top: -45%; left: 17%; border-radius: 50%; background: var(--primary); filter: blur(55px); opacity: .3; }
.cover-lines { position: absolute; inset: 0; opacity: .35; background-image: linear-gradient(125deg, transparent 0 37%, rgb(255 255 255 / 8%) 37.2% 37.5%, transparent 37.7%), linear-gradient(35deg, transparent 0 63%, rgb(255 255 255 / 5%) 63.2% 63.5%, transparent 63.7%); }
.cover-badge { position: absolute; top: 16px; right: 18px; display: flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid rgb(255 255 255 / 13%); border-radius: 999px; color: rgb(255 255 255 / 88%); background: rgb(15 23 42 / 48%); font-size: 10px; font-weight: 800; letter-spacing: .12em; backdrop-filter: blur(10px); }
.cover-dot { width: 7px; height: 7px; display: block; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px var(--primary); }
.cover-emblem { width: clamp(76px, 17vw, 120px); aspect-ratio: 1; display: grid; place-items: center; position: absolute; top: 50%; left: 50%; overflow: hidden; border: 1px solid rgb(255 255 255 / 30%); border-radius: 30%; color: #fff; background: rgb(255 255 255 / 9%); box-shadow: 0 15px 40px rgb(0 0 0 / 25%), inset 0 1px rgb(255 255 255 / 25%); transform: translate(-50%, -52%) rotate(-6deg); backdrop-filter: blur(6px); }
.cover-emblem img { width: 62%; height: 62%; object-fit: contain; border-radius: 20%; }
.cover-emblem::before, .cover-emblem::after { position: absolute; border: 1px solid var(--primary); content: ""; opacity: .5; }
.cover-emblem::before { inset: -17px; border-radius: 35%; transform: rotate(20deg); }
.cover-emblem::after { inset: -31px; border-radius: 40%; transform: rotate(-22deg); opacity: .2; }
.cover-stars { position: absolute; right: 0; bottom: 16px; left: 0; color: var(--primary); font-size: 17px; letter-spacing: .12em; opacity: .8; }
.intro-copy { width: 100%; padding-inline: 8px; }
.intro-copy h1 { margin: 0 0 22px; color: #fff; font-size: clamp(30px, 7vw, 48px); font-weight: 900; letter-spacing: -.05em; line-height: 1.05; }
.intro-copy h1 span { color: var(--primary); text-shadow: 0 0 22px color-mix(in srgb, var(--primary) 35%, transparent); }
.stats-row { width: min(100%, 430px); display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); justify-content: center; gap: 10px; margin: 0 auto 24px; }
.stat-chip { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgb(255 255 255 / 10%); border-radius: 999px; background: rgb(255 255 255 / 5%); box-shadow: 0 7px 18px rgb(0 0 0 / 16%); backdrop-filter: blur(14px); }
.stat-chip > strong { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 10%); border-radius: 50%; color: #fff; background: rgb(15 23 42 / 75%); font-size: 16px; }
.stat-chip span { color: #cbd5e1; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.reward-stat { gap: 7px; padding-right: 11px; }
.reward-stat img { width: 25px; height: 25px; flex: 0 0 25px; object-fit: contain; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--primary) 45%, transparent)); }
.reward-stat > span { min-width: 0; overflow: hidden; color: #cbd5e1; font-size: 10px; font-weight: 800; letter-spacing: 0; line-height: 1; text-align: left; text-transform: none; text-overflow: clip; white-space: nowrap; }
.reward-stat strong { color: var(--primary); font-size: clamp(10px, 2.8vw, 13px); font-weight: 900; letter-spacing: 0; white-space: nowrap; text-transform: none; }
.start-button { width: min(100%, 340px); min-height: 62px; display: inline-flex; align-items: center; justify-content: center; gap: 11px; position: relative; overflow: hidden; border: 0; border-radius: 22px; color: var(--button-text); background: var(--primary); box-shadow: 0 15px 40px color-mix(in srgb, var(--primary) 50%, transparent); cursor: pointer; font-size: 18px; font-weight: 900; letter-spacing: .04em; transition: transform .25s ease, filter .25s ease; }
.start-button:hover { filter: brightness(1.1); transform: translateY(-3px); }
.start-icon { position: relative; z-index: 1; font-size: 19px; }
.start-button > span:not(.button-shine) { position: relative; z-index: 1; }
.button-shine { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 18%, rgb(255 255 255 / 22%) 48%, transparent 78%); transform: translateX(-110%); transition: transform .65s ease; }
.start-button:hover .button-shine { transform: translateX(110%); }

.quiz-screen { animation: screen-in .38s ease both; }
.screen-enter { animation: screen-in .38s ease both; }
.results-screen { animation: screen-in .38s ease both; }
.results-card { width: min(100%, 620px); padding: 38px 32px; border: 1px solid rgb(255 255 255 / 10%); border-radius: 28px; background: rgb(255 255 255 / 6%); box-shadow: 0 25px 50px rgb(0 0 0 / 25%); backdrop-filter: blur(16px); text-align: center; }
.results-emblem { width: 82px; height: 82px; display: grid; place-items: center; margin: 0 auto 22px; border: 1px solid color-mix(in srgb, var(--primary) 50%, transparent); border-radius: 50%; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); box-shadow: 0 0 30px color-mix(in srgb, var(--primary) 25%, transparent); font-size: 38px; }
.results-emblem img { width: 42px; height: 42px; object-fit: contain; }
.results-card h1 { margin: 0 0 8px; font-size: clamp(29px, 6vw, 45px); }
.results-copy { margin: 0 0 27px; color: #94a3b8; font-size: 15px; }
.results-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 23px; }
.result-stat { padding: 15px 10px; border: 1px solid rgb(255 255 255 / 7%); border-radius: 16px; background: rgb(15 23 42 / 48%); }
.result-stat > span { display: block; margin-bottom: 7px; color: #94a3b8; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.result-stat > strong { display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--primary); font-size: 28px; }
.result-stat i { color: #64748b; font-size: 17px; font-style: normal; }
.earned-reward img { width: 22px; height: 22px; object-fit: contain; }
.redirect-note { margin: 0 0 16px; color: #94a3b8; font-size: 11px; }
.continue-button { min-height: 56px; width: 100%; border-radius: 17px; font-size: 15px; }
.quiz-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.counter-chip, .reward-chip, .score-chip { display: flex; align-items: center; border: 1px solid rgb(255 255 255 / 10%); background: rgb(255 255 255 / 6%); box-shadow: 0 8px 24px rgb(0 0 0 / 17%); backdrop-filter: blur(13px); }
.counter-chip { gap: 8px; padding: 7px 13px; border-radius: 999px; }
.counter-chip strong { color: #fff; font-size: 17px; }
.counter-chip > span:last-child { color: #94a3b8; font-size: 15px; font-weight: 800; }
.counter-chip i { color: rgb(255 255 255 / 18%); font-style: normal; }
.counter-label { color: #94a3b8; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.counter-short { display: none; }
.header-pills { display: flex; align-items: center; gap: 8px; }
.reward-chip { gap: 5px; padding: 7px 11px; border-color: rgb(34 197 94 / 20%); border-radius: 999px; color: #4ade80; background: rgb(34 197 94 / 10%); font-size: 12px; font-weight: 900; }
.header-reward-icon { width: 13px; height: 13px; object-fit: contain; }
.score-chip { gap: 6px; padding: 8px 13px; border-color: color-mix(in srgb, var(--primary) 35%, transparent); border-radius: 999px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); font-size: 16px; font-weight: 900; }
.coin-icon { width: 15px; height: 15px; display: inline-flex; flex: 0 0 15px; align-items: center; justify-content: center; font-size: 14px; }
.coin-icon img { width: 100%; height: 100%; object-fit: contain; }
.progress-track { height: 8px; overflow: hidden; margin-bottom: 18px; border: 1px solid rgb(255 255 255 / 6%); border-radius: 999px; background: rgb(30 41 59 / 70%); }
.progress-track span { width: 8.333%; height: 100%; display: block; border-radius: inherit; background: var(--primary); box-shadow: 0 0 16px color-mix(in srgb, var(--primary) 55%, transparent); transition: width .3s ease; }
.question-card { min-height: 175px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; margin-bottom: 16px; padding: 29px 74px 28px 20px; border: 1px solid rgb(255 255 255 / 10%); border-radius: 24px; background: rgb(255 255 255 / 6%); box-shadow: 0 20px 25px -5px rgb(0 0 0 / 10%), 0 8px 10px -6px rgb(0 0 0 / 10%); backdrop-filter: blur(16px); text-align: center; }
.question-card-sheen { position: absolute; inset: 0; background: linear-gradient(180deg, rgb(255 255 255 / 6%), transparent); pointer-events: none; }
.question-kicker { position: relative; z-index: 1; margin: 5px 0 7px; color: #94a3b8; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.question-card h2 { position: relative; z-index: 1; max-width: 560px; margin: 0; color: #f8fafc; font-size: clamp(21px, 4vw, 31px); font-weight: 900; letter-spacing: -.035em; line-height: 1.18; }
.question-enter { animation: question-in .3s ease both; }
.timer-ring { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; position: absolute; z-index: 2; top: 13px; right: 16px; color: #f8fafc; }
.timer-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; }
.timer-ring circle { fill: none; stroke-width: 4; }
.timer-back { stroke: #334155; }
.timer-progress { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .2s linear, stroke .2s ease; }
.timer-ring strong { position: relative; font-size: 17px; }
.timer-ring.timer-warning { color: #fca5a5; }
.timer-ring.timer-warning .timer-progress { stroke: #ef4444; }
.answer-list { display: grid; gap: 10px; }
.answer-button { min-height: 59px; display: flex; align-items: center; gap: 13px; padding: 12px 17px; border: 1px solid rgb(255 255 255 / 10%); border-radius: 12px; color: #e2e8f0; background: rgb(255 255 255 / 5%); cursor: pointer; font-size: 15px; font-weight: 600; text-align: left; transition: transform .2s ease, border-color .2s ease, background .2s ease, opacity .2s ease; backdrop-filter: blur(12px); }
.answer-button:hover:not(:disabled) { border-color: rgb(255 255 255 / 22%); background: rgb(255 255 255 / 10%); transform: translateY(-2px); }
.answer-button:disabled { cursor: default; }
.answer-button.selected { border-color: var(--primary); color: #fff; background: color-mix(in srgb, var(--primary) 13%, transparent); box-shadow: 0 0 16px color-mix(in srgb, var(--primary) 20%, transparent); }
.answer-button.correct { border-color: rgb(34 197 94 / 55%); color: #bbf7d0; background: rgb(34 197 94 / 13%); }
.answer-button.incorrect { border-color: rgb(239 68 68 / 55%); color: #fecaca; background: rgb(239 68 68 / 13%); }
.answer-button:not(.selected):disabled { opacity: .48; transform: scale(.99); }
.answer-letter { width: 29px; height: 29px; display: grid; flex: 0 0 29px; place-items: center; border: 1px solid rgb(255 255 255 / 13%); border-radius: 9px; color: #94a3b8; font-size: 11px; font-weight: 900; }
.answer-button.selected:not(.incorrect) .answer-letter { border-color: var(--primary); color: var(--button-text); background: var(--primary); }
.answer-button.correct .answer-letter { border-color: #22c55e; color: #052e16; background: #4ade80; }
.answer-button.incorrect .answer-letter { border-color: #ef4444; color: #fff; background: #ef4444; }
.answer-text { line-height: 1.35; }
.answer-mark { margin-left: auto; color: #64748b; font-size: 17px; }

@keyframes screen-in { from { opacity: 0; transform: translateY(13px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes screen-out { to { opacity: 0; transform: translateY(-8px) scale(.985); } }
@keyframes question-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  .quiz-shell { width: min(calc(100% - 24px), 520px); min-height: 100vh; padding-block: 16px; }
  .intro-cover { margin-bottom: 20px; border-radius: 22px; }
  .cover-badge { top: 11px; right: 12px; padding: 6px 9px; font-size: 8px; }
  .intro-copy h1 { margin-bottom: 18px; font-size: clamp(29px, 9vw, 42px); }
  .stat-chip { gap: 7px; padding: 6px 8px; }
  .stat-chip > strong { width: 33px; height: 33px; font-size: 14px; }
  .stat-chip > span { min-width: 0; font-size: 8px; letter-spacing: .04em; }
  .reward-stat { gap: 5px; padding-right: 7px; }
  .reward-stat img { width: 23px; height: 23px; flex-basis: 23px; }
  .reward-stat > span { font-size: 8px; }
  .reward-stat strong { font-size: clamp(9px, 3vw, 11px); }
  .start-button { min-height: 57px; border-radius: 18px; font-size: 16px; }
  .counter-label { display: none; }
  .counter-short { display: inline; }
  .counter-chip { gap: 6px; padding: 6px 11px; }
  .question-card { min-height: 157px; padding-right: 65px; border-radius: 19px; }
  .question-card h2 { font-size: clamp(19px, 6vw, 27px); }
  .timer-ring { top: 9px; right: 10px; transform: scale(.82); transform-origin: top right; }
  .answer-button { min-height: 55px; padding: 11px 13px; font-size: 14px; }
  .results-card { padding: 30px 18px; border-radius: 21px; }
  .results-emblem { width: 68px; height: 68px; margin-bottom: 17px; font-size: 30px; }
  .results-emblem img { width: 36px; height: 36px; }
  .results-copy { font-size: 13px; }
  .result-stat > strong { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
