/* ============ Quizowisko — styles ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-1: #1a1030;
  --bg-2: #241545;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-solid: #2b1c4e;
  --line: rgba(255, 255, 255, 0.14);
  --text: #f3eefc;
  --dim: #b6a8d6;
  --accent: #ffd166;
  --good: #43d17c;
  --bad: #ff5d73;
  --radius: 20px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* blobs */
.bg-blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; filter: blur(70px); opacity: 0.5; }
.bg-blobs i { position: absolute; border-radius: 50%; }
.bg-blobs i:nth-child(1) { width: 380px; height: 380px; background: #7b2cbf; top: -120px; right: -80px; }
.bg-blobs i:nth-child(2) { width: 300px; height: 300px; background: #e63946; bottom: 10%; left: -120px; }
.bg-blobs i:nth-child(3) { width: 260px; height: 260px; background: #2a9d8f; top: 40%; right: -100px; }

.wrap { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: clamp(18px, 4vw, 44px); }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: clamp(6px, 3vh, 30px); }
.kicker {
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 6px 16px; border-radius: 999px;
  font-weight: 500; font-size: 0.82rem;
  backdrop-filter: blur(6px);
}
.hero h1 {
  margin-top: 18px;
  font-size: clamp(2rem, 6.4vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
  background: linear-gradient(90deg, #ffd166, #ff5d73, #7b2cbf, #4cc9f0);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { margin: 14px auto 0; max-width: 560px; color: var(--dim); font-size: clamp(0.98rem, 2.3vw, 1.12rem); line-height: 1.6; }

/* ---------- quiz grid ---------- */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: clamp(28px, 5vh, 46px);
}
.quiz-tile {
  display: flex; flex-direction: column; gap: 8px;
  /* pełnokryjące tło — blob pod kafelkiem nie może zjeść kontrastu drobnego tekstu */
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-top: 4px solid var(--qc, var(--accent));
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s ease, background 0.18s ease;
}
.quiz-tile:hover { transform: translateY(-4px); background: #382863; }
.qt-emoji { font-size: 2rem; }
.qt-title { font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.qt-desc { color: var(--dim); font-size: 0.88rem; line-height: 1.5; }
.qt-meta { margin-top: auto; padding-top: 10px; font-size: 0.78rem; color: var(--dim); font-weight: 700; }

/* ---------- why ---------- */
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: clamp(34px, 6vh, 56px); }
.why-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; display: flex; gap: 12px; align-items: flex-start;
  backdrop-filter: blur(8px);
}
.why-card span { font-size: 1.5rem; }
.why-card p { color: var(--dim); font-size: 0.9rem; line-height: 1.5; }
.why-card strong { color: var(--text); }

/* ---------- quiz view ---------- */
.quiz-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.linklike {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.9rem; color: var(--dim);
  padding: 6px 0;
}
.linklike:hover { color: var(--text); }
.progress-wrap { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 200px; }
.q-progress { flex: 1; height: 10px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.q-progress-fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), #ff5d73);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.q-counter { font-weight: 700; font-size: 0.9rem; color: var(--dim); font-variant-numeric: tabular-nums; }

.quiz-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  padding: clamp(20px, 4vw, 34px);
}
.quiz-name { font-size: 0.85rem; font-weight: 700; color: var(--accent); margin-bottom: 12px; }
.q-text { font-size: clamp(1.25rem, 3.4vw, 1.7rem); font-weight: 700; line-height: 1.35; margin-bottom: 22px; }

.answers { display: grid; gap: 10px; }
.answer {
  font-family: inherit; font-size: 1rem; font-weight: 500;
  text-align: left;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.answer:hover:not(.disabled) { background: rgba(255, 255, 255, 0.14); transform: translateX(4px); }
.answer.disabled { cursor: default; opacity: 0.75; }
.answer.correct { background: #43d17c26; border-color: var(--good); color: #d9ffe8; opacity: 1; font-weight: 700; }
.answer.correct::after { content: ' ✓'; color: var(--good); }
.answer.wrong { background: #ff5d7326; border-color: var(--bad); color: #ffdbe1; opacity: 1; }
.answer.wrong::after { content: ' ✗'; color: var(--bad); }
.answer.picked-good { box-shadow: 0 0 0 3px #43d17c44; }

.explain-box {
  margin-top: 18px;
  background: rgba(255, 209, 102, 0.09);
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 14px;
  padding: 16px 18px;
}
.explain-box p { color: #ffe9b8; font-size: 0.95rem; line-height: 1.6; }

.btn {
  font-family: inherit; font-weight: 700; font-size: 1rem;
  border: none; border-radius: 999px; cursor: pointer;
  padding: 12px 26px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.next {
  margin-top: 14px;
  background: var(--accent); color: #241545;
  box-shadow: 0 8px 24px rgba(255, 209, 102, 0.3);
}
.btn.next:hover { transform: translateY(-1px); }

/* ---------- result ---------- */
.result-card {
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  padding: clamp(28px, 5vw, 44px);
}
.result-emoji { font-size: 3.4rem; display: block; }
.result-card h2 {
  font-size: clamp(2.8rem, 9vw, 4.4rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--accent), #ff5d73);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 8px 0 4px;
}
.result-title { font-size: 1.3rem; font-weight: 700; }
.result-desc { color: var(--dim); margin-top: 10px; line-height: 1.6; max-width: 480px; margin-left: auto; margin-right: auto; }
.result-best { margin-top: 12px; font-size: 0.9rem; color: var(--accent); font-weight: 700; }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn.share { background: var(--accent); color: #241545; box-shadow: 0 8px 24px rgba(255, 209, 102, 0.3); }
.btn.ghost { background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.16); }

.more { margin-top: 26px; text-align: center; }
.more h3 { color: var(--dim); font-size: 1rem; margin-bottom: 14px; }
.mini-tile {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--qc, var(--accent));
  color: var(--text); text-decoration: none;
  border-radius: 12px; padding: 10px 16px; margin: 5px;
  font-weight: 500; font-size: 0.92rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.mini-tile:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.12); }

/* ---------- footer / toast ---------- */
.footer { margin-top: clamp(40px, 7vh, 70px); text-align: center; padding-bottom: 30px; }
.footer .muted { color: #8d81b5; font-size: 0.85rem; }

.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--accent); color: #241545;
  padding: 13px 26px; border-radius: 999px;
  font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 50;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ==== dodatki SEO/a11y ==== */
.noscript-note { background: #fff3cd; color: #5a4500; padding: 12px 16px; border-radius: 10px; margin: 16px auto; max-width: 720px; font-size: 0.95rem; }
.more-tools { margin-top: 14px; font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.more-tools a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.more-tools a:hover { opacity: 0.75; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto !important; }
}
