/* =========================================================
   Królewski Quiz — oprawa wizualna
   ========================================================= */

:root {
  /* Karmazyn / bordo */
  --crimson-950: #2a050b;
  --crimson-900: #3d0710;
  --crimson-800: #4a0b14;
  --crimson-700: #6b111f;
  --crimson-600: #8c1a2c;
  --crimson-500: #a8243a;

  /* Złoto */
  --gold-100: #fff4c7;
  --gold-200: #fbe9a6;
  --gold-300: #f6dc8c;
  --gold-400: #e9c45a;
  --gold-500: #d4a73a;
  --gold-600: #b8891f;
  --gold-700: #8a6411;
  --gold-800: #6b4c0c;

  /* Pergamin */
  --parchment-50: #fdf8ea;
  --parchment-100: #f7edd3;
  --parchment-200: #eddcb2;
  --parchment-300: #dfc58f;

  /* Tusz / brąz */
  --ink-900: #2b1a0e;
  --ink-700: #4a3220;
  --ink-500: #75583c;

  /* Stany */
  --ok-700: #24683b;
  --ok-500: #3c8f55;
  --ok-100: #e2f1d4;
  --bad-700: #8e1d16;
  --bad-500: #c0392b;
  --bad-100: #f9ddd6;

  --gold-gradient: linear-gradient(180deg, var(--gold-200) 0%, var(--gold-400) 42%, var(--gold-600) 100%);
  --gold-text: linear-gradient(180deg, #fff6cf 0%, #f3d27a 45%, #c4952a 70%, #f0d382 100%);

  --font-display: "Cormorant Garamond", "Cormorant", Garamond, "EB Garamond", Georgia, "Times New Roman", serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-card: 22px;
  --radius-btn: 14px;
  --shadow-card: 0 1px 0 rgba(255, 240, 200, .5) inset, 0 18px 40px -12px rgba(20, 0, 4, .65), 0 4px 12px rgba(20, 0, 4, .35);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --gutter: 16px;
  --pad-top: max(env(safe-area-inset-top), 10px);
  --pad-bottom: max(env(safe-area-inset-bottom), 18px);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Tło: bordo z adamaszkiem ---------- */
html { background: var(--crimson-900); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-900);
  background-color: var(--crimson-800);
  background-image:
    radial-gradient(120% 80% at 50% 0%, rgba(168, 36, 58, .55) 0%, rgba(168, 36, 58, 0) 60%),
    radial-gradient(140% 100% at 50% 110%, rgba(20, 0, 4, .75) 0%, rgba(20, 0, 4, 0) 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23e9c45a' stroke-opacity='.10' stroke-width='1'%3E%3Cpath d='M36 14c5 6 5 12 0 22-5-10-5-16 0-22Z'/%3E%3Cpath d='M36 36c8-4 13-3 16 2-6 3-11 2-16-2ZM36 36c-8-4-13-3-16 2 6 3 11 2 16-2Z'/%3E%3Cpath d='M36 36v14'/%3E%3C/g%3E%3Cg fill='%23e9c45a' fill-opacity='.10'%3E%3Ccircle cx='0' cy='0' r='2'/%3E%3Ccircle cx='72' cy='0' r='2'/%3E%3Ccircle cx='0' cy='72' r='2'/%3E%3Ccircle cx='72' cy='72' r='2'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed, fixed, scroll;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Układ ---------- */
.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--pad-top) calc(var(--gutter) + env(safe-area-inset-right)) var(--pad-bottom) calc(var(--gutter) + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.app > main { flex: 1; display: flex; flex-direction: column; }

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0 14px;
  color: var(--gold-300);
}
.brand__crown { width: 26px; height: 20px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

.screen { display: none; flex: 1; flex-direction: column; }
.screen.is-active { display: flex; animation: screen-in .5s var(--ease-out) both; }
#screen-start, #screen-result { justify-content: center; }

/* ---------- Karta pergaminowa ---------- */
.card {
  position: relative;
  padding: 30px 22px 40px;
  border-radius: var(--radius-card);
  background-color: var(--parchment-100);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .28 0 0 0 0 .12 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 90% at 50% 40%, rgba(255, 252, 240, .85) 0%, rgba(255, 252, 240, 0) 65%),
    radial-gradient(60% 50% at 0% 0%, rgba(176, 128, 60, .28) 0%, rgba(176, 128, 60, 0) 70%),
    radial-gradient(60% 50% at 100% 100%, rgba(176, 128, 60, .30) 0%, rgba(176, 128, 60, 0) 70%),
    radial-gradient(50% 40% at 100% 0%, rgba(176, 128, 60, .18) 0%, rgba(176, 128, 60, 0) 70%),
    linear-gradient(180deg, var(--parchment-50) 0%, var(--parchment-100) 55%, var(--parchment-200) 100%);
  border: 1.5px solid var(--gold-600);
  box-shadow:
    0 0 0 4px var(--crimson-800),
    0 0 0 5.5px var(--gold-500),
    inset 0 0 0 5px rgba(253, 248, 234, .6),
    inset 0 0 0 6px rgba(184, 137, 31, .55),
    inset 0 0 40px rgba(150, 100, 40, .22),
    var(--shadow-card);
}

.corner {
  position: absolute;
  width: 28px;
  height: 28px;
  color: var(--gold-600);
  pointer-events: none;
  opacity: .9;
}
.corner--tl { top: 8px; left: 8px; }
.corner--tr { top: 8px; right: 8px; transform: scaleX(-1); }
.corner--bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.corner--br { bottom: 8px; right: 8px; transform: scale(-1, -1); }

.divider { width: 150px; height: 14px; margin: 14px auto; color: var(--gold-600); }

.eyebrow {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--crimson-600);
  text-align: center;
}

/* ---------- Ekran startowy ---------- */
.card--hero { text-align: center; padding: 34px 24px 40px; }

.hero-crown { position: relative; width: 104px; height: 82px; margin: 0 auto 14px; }
.hero-crown svg {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 6px rgba(107, 76, 12, .35));
  animation: crown-float 4.5s ease-in-out infinite;
}
.hero-crown__glow {
  position: absolute;
  inset: -18px -26px;
  background: radial-gradient(closest-side, rgba(246, 220, 140, .85), rgba(246, 220, 140, 0));
  animation: glow-pulse 4.5s ease-in-out infinite;
}

.title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -.005em;
  color: var(--crimson-700);
  text-wrap: balance;
  outline: none;
}

.subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--ink-700);
  text-wrap: balance;
}

.perks {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 18px;
  font-size: .82rem;
  color: var(--ink-500);
}
.perks li {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 235, .7);
  border: 1px solid rgba(184, 137, 31, .45);
  white-space: nowrap;
}
.perks strong { color: var(--crimson-700); font-weight: 700; }

.best {
  margin: 0 auto 18px;
  padding: 10px 14px;
  max-width: 320px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(246, 220, 140, .45), rgba(212, 167, 58, .28));
  border: 1px dashed var(--gold-600);
  font-size: .9rem;
  color: var(--ink-700);
}
.best strong { color: var(--crimson-700); }

/* ---------- Przyciski ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }

.btn--gold {
  color: var(--crimson-900);
  background: var(--gold-gradient);
  border: 1px solid var(--gold-700);
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 225, .9),
    inset 0 -2px 0 rgba(122, 85, 16, .35),
    0 4px 0 var(--gold-800),
    0 8px 16px -4px rgba(40, 5, 10, .55);
  text-shadow: 0 1px 0 rgba(255, 245, 210, .6);
}
.btn--gold::after {
  /* przesuwający się połysk */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: sheen 4.2s ease-in-out infinite 1.2s;
}
.btn--gold:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 225, .7),
    inset 0 -1px 0 rgba(122, 85, 16, .35),
    0 1px 0 var(--gold-800),
    0 3px 8px -2px rgba(40, 5, 10, .5);
  filter: brightness(.96);
}
.btn--big { min-height: 60px; font-size: 1.2rem; letter-spacing: .06em; text-transform: uppercase; }

.btn--ghost {
  color: var(--crimson-700);
  background: rgba(255, 250, 235, .55);
  border: 1.5px solid var(--gold-600);
  box-shadow: 0 3px 0 rgba(138, 100, 17, .45);
}
.btn--ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(138, 100, 17, .45); background: rgba(237, 220, 178, .8); }

.btn:focus-visible, .answer:focus-visible {
  outline: 3px solid var(--crimson-500);
  outline-offset: 3px;
}

@media (hover: hover) {
  .btn--gold:hover { filter: brightness(1.05) saturate(1.05); }
  .btn--ghost:hover { background: rgba(255, 250, 235, .85); }
  .answer:not(:disabled):hover { border-color: var(--gold-600); background: #fffbef; }
}

/* ---------- Pasek u góry quizu ---------- */
.quiz-top { padding: 0 2px 16px; color: var(--parchment-100); }
.quiz-top__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

.counter {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--parchment-100);
}
.counter strong { font-size: 1.6rem; color: var(--gold-300); }
.counter__sep { margin: 0 2px; opacity: .6; }

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 9px;
  border-radius: 999px;
  background: rgba(20, 0, 4, .35);
  border: 1px solid rgba(233, 196, 90, .5);
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--gold-200);
}
.score-pill svg { width: 20px; height: 16px; }
.score-pill.is-bumped { animation: bump .5s var(--ease-spring); }

.progress { position: relative; height: 30px; --p: 0; }
.progress__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(20, 0, 4, .55);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6), 0 0 0 1px rgba(233, 196, 90, .45), 0 1px 0 rgba(255, 230, 170, .12);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: calc(14px + (100% - 28px) * var(--p));
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-700), var(--gold-400) 30%, var(--gold-100) 50%, var(--gold-400) 70%, var(--gold-600));
  background-size: 220% 100%;
  box-shadow: 0 0 10px rgba(246, 220, 140, .65);
  animation: shimmer 3s linear infinite;
  transition: width .7s var(--ease-out);
}
.progress__crown {
  position: absolute;
  top: 50%;
  left: calc(14px + (100% - 28px) * var(--p));
  width: 30px;
  height: 24px;
  transform: translate(-50%, -62%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)) drop-shadow(0 0 6px rgba(246, 220, 140, .55));
  transition: left .7s var(--ease-out);
}

/* ---------- Karta pytania ---------- */
.card--question { padding: 28px 18px 38px; }
.card--question.is-entering { animation: card-in .55s var(--ease-out) both; }

.question {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 6.4vw, 1.75rem);
  line-height: 1.18;
  color: var(--ink-900);
  text-align: center;
  text-wrap: balance;
  padding: 2px 6px 18px;
  outline: none;
}

.answers { display: grid; gap: 10px; }

.answer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px 10px 10px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-900);
  background: linear-gradient(180deg, #fffaf0 0%, #f8eed6 100%);
  border: 1.5px solid rgba(138, 100, 17, .42);
  border-radius: var(--radius-btn);
  box-shadow: 0 3px 0 rgba(138, 100, 17, .32), 0 6px 12px -6px rgba(60, 20, 10, .25);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform .12s ease, box-shadow .12s ease, background-color .25s, border-color .25s, opacity .35s;
}
.answer.is-entering { animation: answer-in .45s var(--ease-out) both; }
.answer:not(:disabled):active {
  transform: translateY(3px) scale(.99);
  box-shadow: 0 0 0 rgba(138, 100, 17, .32), 0 2px 6px -3px rgba(60, 20, 10, .3);
  background: linear-gradient(180deg, #f6e8c6 0%, #efdcb0 100%);
}
.answer:disabled { cursor: default; }

.answer__letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--crimson-800);
  background: var(--gold-gradient);
  border: 1px solid var(--gold-700);
  box-shadow: inset 0 1px 0 rgba(255, 250, 225, .85), 0 1px 2px rgba(60, 30, 0, .3);
  transition: background .3s, color .3s, transform .4s var(--ease-spring);
}
.answer__text { flex: 1; }

/* poprawna: zielono‑złota */
.answer.is-correct {
  background: linear-gradient(135deg, #e6f3d6 0%, #f4e7b4 100%);
  border-color: var(--ok-500);
  box-shadow: 0 0 0 3px rgba(233, 196, 90, .75), 0 0 22px rgba(233, 196, 90, .55), 0 3px 0 var(--ok-700);
  animation: correct-pop .55s var(--ease-spring);
}
.answer.is-correct .answer__letter {
  color: #fff;
  background: linear-gradient(180deg, #57b06f, var(--ok-700));
  border-color: var(--ok-700);
  transform: rotate(360deg);
}
/* błędna: czerwona + potrząśnięcie */
.answer.is-wrong {
  background: linear-gradient(180deg, #fbe4de 0%, var(--bad-100) 100%);
  border-color: var(--bad-500);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .25), 0 3px 0 var(--bad-700);
  animation: shake .5s ease;
}
.answer.is-wrong .answer__letter {
  color: #fff;
  background: linear-gradient(180deg, #d9544a, var(--bad-700));
  border-color: var(--bad-700);
}
.answer.is-dimmed { opacity: .5; filter: saturate(.6); }

/* ---------- Informacja zwrotna + ciekawostka ---------- */
.feedback { margin-top: 18px; animation: rise-in .5s var(--ease-out) both; }

.verdict {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}
.verdict.is-ok { color: var(--ok-700); }
.verdict.is-bad { color: var(--bad-700); }
.verdict small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-700);
}

.fact {
  position: relative;
  margin: 16px 0 18px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background:
    radial-gradient(80% 70% at 15% 10%, rgba(255, 252, 240, .9), rgba(255, 252, 240, 0)),
    linear-gradient(180deg, #f3e3bb, #e8d19f);
  border: 1.5px solid var(--gold-600);
  box-shadow: inset 0 0 0 3px rgba(253, 248, 234, .55), inset 0 0 18px rgba(150, 100, 40, .25), 0 6px 14px -6px rgba(60, 20, 10, .35);
}
.fact::before {
  /* ogonek dymka */
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  background: #f2e1b8;
  border-left: 1.5px solid var(--gold-600);
  border-top: 1.5px solid var(--gold-600);
  transform: rotate(45deg);
  border-top-left-radius: 3px;
}
.fact__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--crimson-600);
}
.fact__label svg { width: 16px; height: 16px; }
.fact__text { font-size: 1rem; line-height: 1.55; color: var(--ink-700); }

/* ---------- Ekran wyniku ---------- */
.card--result { text-align: center; padding: 30px 22px 40px; }

.result-lead {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.12;
  color: var(--ink-900);
  text-wrap: balance;
  outline: none;
}
.result-you {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 4.2rem;
  line-height: 1;
  letter-spacing: .02em;
  margin: 6px 0 4px;
  color: var(--crimson-700);
  background: linear-gradient(180deg, var(--crimson-500), var(--crimson-800));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(184, 137, 31, .55));
  animation: pop-in .7s var(--ease-spring) .25s both;
}

.emblem {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 8px auto 12px;
  display: grid;
  place-items: center;
}
.emblem__rays {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(233, 196, 90, .5) 0deg 7deg, rgba(233, 196, 90, 0) 7deg 18deg);
  -webkit-mask: radial-gradient(closest-side, #000 55%, transparent 100%);
  mask: radial-gradient(closest-side, #000 55%, transparent 100%);
  animation: spin 30s linear infinite;
}
.emblem__medal {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin-top: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--crimson-600) 0 52%, transparent 53%),
    radial-gradient(circle at 50% 50%, var(--gold-700) 0 55%, transparent 56%),
    conic-gradient(from 200deg, var(--gold-200), var(--gold-600), var(--gold-300), var(--gold-700), var(--gold-200), var(--gold-500), var(--gold-200));
  box-shadow:
    inset 0 0 0 3px rgba(255, 245, 210, .6),
    inset 0 0 0 6px rgba(138, 100, 17, .5),
    0 10px 22px -8px rgba(60, 10, 15, .7),
    0 0 0 2px var(--gold-700);
  animation: medal-in .9s var(--ease-spring) .35s both;
}
.emblem__medal::after {
  /* wewnętrzny błysk */
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), transparent 55%);
  pointer-events: none;
}
.emblem__symbol {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45));
}
.emblem__crown {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 66px;
  height: 52px;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 4px rgba(60, 10, 15, .45));
  animation: crown-drop .8s var(--ease-spring) .6s both;
}

.result-like {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink-700);
}
.result-ruler {
  margin-top: 2px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 8.5vw, 2.3rem);
  line-height: 1.05;
  color: var(--crimson-700);
  text-wrap: balance;
}
.card--result .divider { margin: 10px auto 12px; }
.result-desc {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-700);
  text-wrap: pretty;
  max-width: 34ch;
  margin: 0 auto;
}

.result-score {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 18px auto 0;
  padding: 10px 26px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--crimson-700), var(--crimson-900));
  border: 1.5px solid var(--gold-500);
  box-shadow: inset 0 0 0 3px rgba(233, 196, 90, .25), 0 6px 14px -6px rgba(40, 5, 10, .7);
  color: var(--gold-200);
}
.result-score__label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-300);
  opacity: .85;
}
.result-score__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1.05;
  font-variant-numeric: lining-nums tabular-nums;
}
.result-score__value strong {
  font-size: 2.7rem;
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.record {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--crimson-800);
  background: var(--gold-gradient);
  border: 1px solid var(--gold-700);
  animation: pop-in .6s var(--ease-spring) 1.1s both;
}

.actions { display: grid; gap: 12px; margin-top: 22px; }

/* ---------- Konfetti + toast ---------- */
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--pad-bottom) + 12px);
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--gold-100);
  background: rgba(42, 5, 11, .94);
  border: 1px solid var(--gold-600);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity .3s ease, transform .3s var(--ease-out);
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animacje ---------- */
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes answer-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-7px) rotate(-.6deg); }
  30% { transform: translateX(6px) rotate(.5deg); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
@keyframes correct-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
@keyframes shimmer { from { background-position: 110% 0; } to { background-position: -110% 0; } }
@keyframes sheen {
  0% { transform: translateX(-120%); }
  35%, 100% { transform: translateX(120%); }
}
@keyframes crown-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
@keyframes glow-pulse {
  0%, 100% { opacity: .55; transform: scale(.95); }
  50% { opacity: 1; transform: scale(1.05); }
}
@keyframes pop-in {
  0% { opacity: 0; transform: scale(.4); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes medal-in {
  0% { opacity: 0; transform: scale(.3) rotate(-90deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes crown-drop {
  0% { opacity: 0; transform: translate(-50%, -40px) rotate(-12deg); }
  100% { opacity: 1; transform: translate(-50%, 0) rotate(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Szersze ekrany ---------- */
@media (min-width: 520px) {
  .app { padding-top: 28px; padding-bottom: 32px; }
  .card { padding-left: 30px; padding-right: 30px; }
  .card--question { padding-left: 26px; padding-right: 26px; }
}

@media (min-height: 760px) and (min-width: 520px) {
  #screen-quiz { justify-content: center; }
}

/* niskie ekrany (małe telefony) */
@media (max-height: 640px) {
  .hero-crown { width: 84px; height: 66px; margin-bottom: 8px; }
  .perks { margin: 14px 0 12px; }
  .emblem { width: 140px; height: 140px; }
  .emblem__medal { width: 108px; height: 108px; }
  .emblem__symbol { font-size: 2.6rem; }
}

/* ---------- Ograniczony ruch ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .btn--gold::after { display: none; }
  .emblem__rays { animation: none; }
}
