/* ---------------------------------------------------------------
   Kosovo-Quiz — design tokens
   Background: deep night-indigo (not black) with a plum undertone.
   Accents: amber (brand/primary), mint (correct), coral (wrong).
   Display face: Fraunces (editorial, has real character for a
   history quiz). Body/UI face: Inter (very legible on small screens).
   Signature element: the "timeline strip" under the header — a
   thin gradient line from 1389 to 2025, echoing the subject matter
   of the whole app.
------------------------------------------------------------------ */

:root {
  --bg: #150E28;
  --bg-panel: #1E1640;
  --bg-panel-2: #251A4D;
  --line: rgba(244, 241, 232, 0.10);

  --text: #F5F1E8;
  --text-muted: #B7ADD9;

  --amber: #F4B740;
  --amber-strong: #FFCB63;
  --mint: #33D6A6;
  --mint-strong: #5EE9C0;
  --coral: #FF6B5B;
  --coral-strong: #FF8C7F;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-soft: 0 20px 50px rgba(6, 3, 20, 0.45);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(120% 140% at 50% -10%, #241A4C 0%, #150E28 55%, #100A20 100%);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 18px 24px;
}

/* ---------- header ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.brand-mark {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 10px rgba(244, 183, 64, 0.55));
}

.stats {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

.stat-correct strong { color: var(--mint-strong); }
.stat-wrong strong { color: var(--coral-strong); }

/* ---------- signature: timeline strip ---------- */

.timeline-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 2px 6px;
}

.tl-year {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.tl-line {
  position: relative;
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(244,183,64,0.15), var(--amber) 45%, var(--mint) 100%);
  overflow: hidden;
}

.tl-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  width: 40%;
  animation: shimmer 3.6s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { transform: translateX(-120%); }
  60%  { transform: translateX(280%); }
  100% { transform: translateX(280%); }
}

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

.quiz {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 18px 0;
}

.card {
  width: 100%;
  background: linear-gradient(160deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 22px 26px;
  box-shadow: var(--shadow-soft);
}

.card.enter {
  animation: rise 0.42s cubic-bezier(.2,.8,.25,1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(244, 183, 64, 0.12);
  border: 1px solid rgba(244, 183, 64, 0.35);
  color: var(--amber-strong);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.question {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  line-height: 1.28;
  margin: 0 0 26px;
  color: var(--text);
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-btn {
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(245, 241, 232, 0.05);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 17px 20px;
  min-height: 58px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.answer-btn:active {
  transform: scale(0.985);
}

.answer-btn:not(:disabled):hover {
  border-color: rgba(244, 183, 64, 0.55);
  background: rgba(244, 183, 64, 0.08);
}

.answer-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn.is-correct {
  background: rgba(51, 214, 166, 0.16);
  border-color: var(--mint);
  color: var(--mint-strong);
  box-shadow: 0 0 0 3px rgba(51, 214, 166, 0.15);
}

.answer-btn.is-wrong {
  background: rgba(255, 107, 91, 0.14);
  border-color: var(--coral);
  color: var(--coral-strong);
  animation: shake 0.34s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.skip-link {
  display: block;
  margin: 20px auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 8px;
}

.skip-link:hover { color: var(--text); }

/* ---------- footer ---------- */

.footer {
  text-align: center;
  padding-top: 6px;
}

.reset-link {
  background: none;
  border: none;
  color: rgba(183, 173, 217, 0.55);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 8px;
}

.reset-link:hover { color: var(--text-muted); }

/* ---------- explanation bottom sheet ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 5, 18, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  max-width: 560px;
  margin: 0 auto;
  background: linear-gradient(165deg, #24184D, #180F36);
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  padding: 12px 24px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px rgba(6, 3, 20, 0.55);
  transform: translateY(105%);
  transition: transform 0.32s cubic-bezier(.2,.8,.2,1);
}

.sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 4px;
  background: rgba(245, 241, 232, 0.25);
  margin: 6px auto 16px;
}

.sheet-eyebrow {
  margin: 0 0 8px;
  color: var(--mint-strong);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.sheet-text {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}

.sheet-source {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(183, 173, 217, 0.4);
}

.sheet-source:hover { color: var(--amber-strong); border-color: var(--amber-strong); }

.next-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--amber), var(--amber-strong));
  color: #241605;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 17px 20px;
  min-height: 58px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 24px rgba(244, 183, 64, 0.25);
}

.next-btn:active {
  transform: scale(0.985);
}

.next-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .card.enter,
  .answer-btn.is-wrong,
  .tl-shimmer {
    animation: none !important;
  }
  .sheet,
  .sheet-backdrop,
  .answer-btn {
    transition: none !important;
  }
}

/* ---------- small phones ---------- */

@media (max-width: 360px) {
  .card { padding: 24px 16px 20px; }
  .question { font-size: 1.25rem; }
}
