:root {
  --bg: #14121a;
  --bg-2: #1c1924;
  --surface: #221f2c;
  --surface-2: #2b2738;
  --line: #3a3549;
  --text: #f4efe6;
  --muted: #a59eb5;
  --accent: #f2b84b;
  --accent-ink: #1d1608;
  --good: #5fcf8f;
  --good-bg: #183526;
  --bad: #ef6f6c;
  --bad-bg: #3a1c1f;
  --radius: 18px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1000px 600px at 15% -10%, #2a2340 0%, transparent 60%),
    radial-gradient(800px 500px at 110% 110%, #2e2219 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.app {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 16px 56px;
}

/* ---------- képernyők ---------- */
.screen { display: none; }
.screen.is-active { display: block; animation: rise .35s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- gombok ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  font-weight: 700;
  transition: transform .12s ease, background .2s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #f7c869; }
.btn-primary:disabled { opacity: .4; }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--line); }
.btn-big { width: 100%; padding: 17px; font-size: 18px; margin-top: 8px; }
.btn kbd {
  font-family: var(--sans);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .15);
}
.btn-ghost {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  flex: none;
}
.btn-ghost:hover { color: var(--text); background: var(--surface); }

/* ---------- kezdőképernyő ---------- */
.hero { text-align: center; padding: 24px 0 32px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.logo {
  margin: 0;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(64px, 14vw, 120px);
  line-height: .95;
  letter-spacing: -.03em;
}
.logo span { color: var(--accent); }
.lead { max-width: 460px; margin: 18px auto 0; color: var(--muted); font-size: 18px; }

.panel {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
}
.field { margin-bottom: 24px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  transition: all .15s ease;
}
.chip::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--c);
  opacity: .35;
  transition: opacity .15s;
}
.chip small { font-size: 12px; opacity: .7; }
.chip[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
}
.chip[aria-pressed="true"]::before { opacity: 1; }

.segmented {
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.segmented button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
}
.segmented button[aria-checked="true"] { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }

.hint { min-height: 1.5em; margin: 10px 0 0; text-align: center; color: var(--bad); font-size: 14px; }
.best { text-align: center; color: var(--muted); font-size: 14px; margin: 20px 0 0; }
.best b { color: var(--accent); }

/* ---------- kérdés képernyő ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.progress {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .4s ease; }
.counter { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score {
  min-width: 64px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score.bump { animation: bump .4s ease; }
@keyframes bump { 50% { transform: scale(1.15); color: var(--accent); } }

.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7);
}
.card.no-media { grid-template-columns: 1fr; max-width: 680px; margin: 0 auto; }
.card.no-media .media { display: none; }

.media {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 320px;
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}
.media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  object-position: 50% 25%;
}
/* festmény, filmkocka: ne vágjuk le */
.media.fit-contain img { object-fit: contain; object-position: center; height: auto; max-height: 520px; }
/* logó: világos háttér, levegővel */
.media.fit-logo { background: #f4efe6; padding: 40px; }
.media.fit-logo img { object-fit: contain; object-position: center; width: 100%; height: 260px; max-height: 260px; }

.quote {
  margin: 0;
  padding: 40px 32px;
  text-align: center;
}
.quote::before {
  content: "“";
  display: block;
  font-family: var(--serif);
  font-size: 120px;
  line-height: .6;
  height: 50px;
  color: var(--accent);
}
.quote p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.25;
}

.qa { display: flex; flex-direction: column; justify-content: center; }
.q-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent);
}
.streak { font-size: 13px; font-weight: 700; color: var(--accent); }

.q-text {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
}

.timer {
  height: 4px;
  margin-bottom: 20px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.timer[hidden] { display: none; }
.timer-fill { height: 100%; width: 100%; background: var(--good); transform-origin: left; }
.timer-fill.warn { background: var(--accent); }
.timer-fill.danger { background: var(--bad); }

.answers { display: grid; gap: 10px; }
.answer {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
  text-align: left;
  font-size: 17px;
  font-weight: 500;
  transition: border-color .15s, background .15s, transform .12s;
}
.answer:not(:disabled):hover { border-color: var(--accent); background: var(--surface-2); transform: translateX(3px); }
.answer .key {
  flex: none;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.answer .mark { margin-left: auto; font-weight: 700; }
.answer.is-correct { border-color: var(--good); background: var(--good-bg); }
.answer.is-correct .key { background: var(--good); color: #0c2015; }
.answer.is-wrong { border-color: var(--bad); background: var(--bad-bg); animation: shake .35s ease; }
.answer.is-wrong .key { background: var(--bad); color: #2b0c0c; }
.answer.is-dim { opacity: .45; }
@keyframes shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.feedback {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  animation: rise .3s ease both;
}
.feedback[hidden] { display: none; }
.feedback-title { margin: 0; font-weight: 700; font-size: 18px; }
.feedback-title.good { color: var(--good); }
.feedback-title.bad { color: var(--bad); }
.feedback-info { margin: 4px 0 16px; color: var(--muted); }
.feedback-info:empty { display: none; }
.feedback-credit { margin: 0 0 16px; color: var(--muted); font-size: 12px; opacity: .8; }
.feedback-credit:empty { display: none; }
.feedback-credit a { color: inherit; }
.feedback .btn { margin-top: 12px; }
.feedback-info:not(:empty) + .btn { margin-top: 0; }

/* ---------- eredmény ---------- */
.result-head { text-align: center; padding: 16px 0 36px; }
.result-title {
  margin: 0 0 28px;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(44px, 8vw, 72px);
  line-height: 1;
  letter-spacing: -.02em;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
}
.stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.stat-num { font-family: var(--serif); font-weight: 800; font-size: 34px; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.review-title {
  max-width: 720px;
  margin: 0 auto 12px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.review { list-style: none; max-width: 720px; margin: 0 auto; padding: 0; display: grid; gap: 8px; }
.review li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.review .r-icon {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-weight: 700; font-size: 14px;
}
.review .ok .r-icon { background: var(--good-bg); color: var(--good); }
.review .ko .r-icon { background: var(--bad-bg); color: var(--bad); }
.review .r-q { margin: 0; font-weight: 500; }
.review .r-a { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.review .r-a b { color: var(--text); font-weight: 500; }
.review .r-a s { color: var(--bad); }

/* ---------- mobil ---------- */
@media (max-width: 820px) {
  .app { padding-top: 20px; }
  .card { grid-template-columns: 1fr; gap: 20px; padding: 16px; }
  .media { min-height: 0; }
  .media img { max-height: 46vh; }
  .quote { padding: 28px 16px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .panel { padding: 20px; }
}
@media (max-width: 420px) {
  .stat-num { font-size: 26px; }
  .counter { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
