/* ===================================================
   Igazmagyar Kvíz — CSS
   Magyar trikolór téma: #CE2939 | #FFFFFF | #477050
   =================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0A0A0F;
  --surface:  #111118;
  --surface2: #18181F;
  --border:   rgba(255,255,255,0.08);
  --text:     #F0F0F5;
  --muted:    rgba(240,240,245,0.45);

  --hu-red:   #CE2939;
  --hu-white: #FFFFFF;
  --hu-green: #477050;

  --stripe-red:   rgba(206,41,57,0.07);
  --stripe-white: rgba(255,255,255,0.04);
  --stripe-green: rgba(71,112,80,0.07);

  --progress-gradient: linear-gradient(90deg, #CE2939 0%, #e8e8e8 50%, #477050 100%);

  --party-color: #CE2939;
  --party-color-rgb: 206,41,57;

  --radius: 14px;
  --transition: cubic-bezier(.16,1,.3,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Háttér trikolór csíkok ───────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--stripe-red)   0%   33.3%,
    var(--stripe-white) 33.3% 66.6%,
    var(--stripe-green) 66.6% 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Vissza gomb ──────────────────────────────────── */
.back {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.back:hover { color: var(--text); }

/* ── Hero ─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 56vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 70px;
  overflow: hidden;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-bg::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 160%;
  background: radial-gradient(ellipse, rgba(206,41,57,0.18) 0%, transparent 65%);
  animation: pulse-red 5s ease-in-out infinite alternate;
}
.hero-bg::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 60%;
  height: 160%;
  background: radial-gradient(ellipse, rgba(71,112,80,0.15) 0%, transparent 65%);
  animation: pulse-green 5s ease-in-out infinite alternate-reverse;
}

@keyframes pulse-red   { from { opacity:.7; transform:scale(1);    } to { opacity:1;  transform:scale(1.08); } }
@keyframes pulse-green { from { opacity:.6; transform:scale(1.05); } to { opacity:1;  transform:scale(1);    } }

.hero > * { position: relative; z-index: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(206,41,57,0.35);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 22px;
  letter-spacing: 0.04em;
}
.badge-dot {
  width: 6px; height: 6px;
  background: var(--hu-red);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.hero h1 {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}
.hero h1 .accent {
  background: linear-gradient(135deg, #CE2939 0%, #e8e8e8 50%, #477050 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--muted);
  max-width: 480px;
  line-height: 1.6;
}

/* ── Trikolór elválasztó ──────────────────────────── */
.tricolor-divider {
  display: flex;
  height: 3px;
  width: 60px;
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 40px;
}
.tricolor-divider span { flex: 1; }
.tricolor-divider span:nth-child(1) { background: var(--hu-red); }
.tricolor-divider span:nth-child(2) { background: var(--hu-white); }
.tricolor-divider span:nth-child(3) { background: var(--hu-green); }

/* ── Main ─────────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 100px;
}

/* ── Progress bar ─────────────────────────────────── */
.progress-wrap {
  margin-bottom: 28px;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.progress-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.progress-type {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
}
.progress-type.meme  { border-color: rgba(206,41,57,0.4); color: rgba(206,41,57,0.8); }
.progress-type.serious { border-color: rgba(71,112,80,0.4); color: rgba(71,112,80,0.9); }

.progress-bar-outer {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  background: var(--progress-gradient);
  border-radius: 2px;
  transition: width 0.5s var(--transition);
}

/* ── Kérdés kártya ────────────────────────────────── */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px 28px;
  margin-bottom: 20px;
}

.question-number {
  font-size: 0.78rem;
  color: var(--hu-red);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 24px;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  line-height: 1.4;
}
.option-btn:hover {
  border-color: rgba(206,41,57,0.5);
  background: rgba(206,41,57,0.07);
  transform: translateX(4px);
}
.option-btn.selected {
  border-color: var(--hu-red);
  background: rgba(206,41,57,0.12);
  box-shadow: 0 0 0 2px rgba(206,41,57,0.22);
}
.option-btn.selected:hover { transform: translateX(4px); }

/* ── Nav gombok ───────────────────────────────────── */
.quiz-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, opacity 0.15s, background 0.2s;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--hu-red);
  color: #fff;
  margin-left: auto;
}
.btn--primary:hover { opacity: 0.88; }

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn--ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.btn--ghost:disabled { opacity: 0.3; cursor: default; pointer-events: none; }

.btn--submit {
  background: linear-gradient(135deg, var(--hu-red), #9b1020);
  color: #fff;
  margin-left: auto;
  font-size: 0.95rem;
  padding: 13px 26px;
  box-shadow: 0 4px 20px rgba(206,41,57,0.3);
}
.btn--submit:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Kérdés slide animáció ────────────────────────── */
@keyframes slideInRight {
  from { opacity:0; transform:translateX(28px); }
  to   { opacity:1; transform:translateX(0);    }
}
@keyframes slideInLeft {
  from { opacity:0; transform:translateX(-28px); }
  to   { opacity:1; transform:translateX(0);     }
}
.slide-in-right { animation: slideInRight 0.25s var(--transition) both; }
.slide-in-left  { animation: slideInLeft  0.25s var(--transition) both; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* ── Eredmény szekció ─────────────────────────────── */
.result-wrapper {
  animation: fadeInUp 0.5s var(--transition) both;
}
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(24px); }
  to   { opacity:1; transform:translateY(0);    }
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px;
  margin-bottom: 16px;
  text-align: center;
}

/* Magyar-ság kártya */
.result-card--magyarsag {
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #CE2939, #e8e8e8, #477050) 1;
}

.magyarsag-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
}

.score-number {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(4rem, 12vw, 6.5rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #CE2939 0%, #e8e8e8 50%, #477050 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.score-percent {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--muted);
}

.category-badge {
  display: inline-block;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--text);
  margin-bottom: 10px;
}

.category-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto;
}

/* Párt kártya — accent JS-ből injektálva */
.result-card--party {
  border-color: var(--party-color);
  box-shadow: 0 0 32px rgba(var(--party-color-rgb), 0.12);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.party-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px;
}

.party-emoji {
  font-size: 2.5rem;
  margin-bottom: 8px;
  display: block;
}

.party-name {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--party-color);
  transition: color 0.5s ease;
  margin-bottom: 10px;
}

.party-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* Log export */
.log-actions {
  text-align: center;
  margin-bottom: 16px;
}
.btn--small {
  padding: 9px 18px;
  font-size: 0.82rem;
}
.log-hint {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}
.log-hint code {
  background: rgba(255,255,255,0.07);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
}

.try-again {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

/* ── Footer ───────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 28px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}
footer a {
  color: var(--muted);
  text-decoration: none;
}
footer a:hover { color: var(--text); }

/* ── Reszponzív ───────────────────────────────────── */
@media (max-width: 540px) {
  .question-card { padding: 22px 16px 20px; }
  .result-card { padding: 26px 18px; }
  .quiz-nav { flex-wrap: wrap; }
  .btn--primary, .btn--submit { margin-left: 0; width: 100%; text-align: center; }
  .btn--ghost { width: 100%; text-align: center; }
}
