:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1e2433;
  --card: #1a2035;
  --border: #2d3448;
  --text: #e8ecf4;
  --text2: #8892aa;
  --text3: #5a6480;
  --primary: #f59e0b;
  --primary-glow: rgba(245, 158, 11, 0.22);
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.18);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.18);
  --blue: #3b82f6;
  --purple: #a855f7;
  --radius: 14px;
  --radius-sm: 8px;
  --font-head: 'Sora', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.tb-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tb-back:hover {
  background: var(--card);
  border-color: var(--primary);
}

.tb-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
}

.tb-logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--primary), #ef4444);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tb-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.main {
  flex: 1;
  padding: 16px;
  padding-bottom: 32px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.main.hidden {
  display: none;
}

.hero {
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 10px;
}

.hero-sub {
  margin: 0;
  color: var(--text2);
  font-size: 0.95rem;
}

.hero-actions {
  margin: 16px 0 0;
}

.btn-tetelek {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  color: #0a0a0a;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-tetelek:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.subject-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.subject-tab {
  flex: 1;
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  background: transparent;
  color: var(--text2);
  transition: background 0.15s, color 0.15s;
}

.subject-tab.active {
  background: var(--primary);
  color: #0a0a0a;
}

.section-heading {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .topic-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

.topic-card {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--card);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  color: inherit;
  font: inherit;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--primary));
}

.topic-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, var(--primary)) 55%, var(--border));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.topic-card__title {
  display: block;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

.topic-card__title--full {
  font-size: 0.8rem;
  color: var(--text);
}

.topic-card__meta {
  font-size: 0.72rem;
  color: var(--text2);
  font-weight: 600;
}

.topic-head {
  margin-bottom: 12px;
}

.topic-title {
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 3.2vw, 1.35rem);
  font-weight: 800;
  margin: 0;
  line-height: 1.35;
}

.topic-title--full {
  color: var(--text);
}

.topic-hint {
  font-size: 0.88rem;
  color: var(--text2);
  margin: 0 0 18px;
}

.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 10px;
  overflow: hidden;
}

.accordion__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: none;
  background: var(--bg2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.accordion__head:hover {
  background: var(--bg3);
}

.accordion__chev {
  color: var(--primary);
  font-weight: 800;
  width: 1.2rem;
}

.accordion__title {
  flex: 1;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
}

.accordion__badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text2);
  background: var(--bg3);
  padding: 4px 8px;
  border-radius: 999px;
}

.accordion__body {
  padding: 0 16px 16px;
}

.learn.prose {
  font-size: 0.92rem;
  color: var(--text);
  padding-top: 14px;
}

.learn.prose p {
  margin: 0 0 12px;
}

.learn.prose ul {
  margin: 0 0 12px 1.1rem;
  padding: 0;
}

.learn.prose li {
  margin-bottom: 6px;
}

/* Vázlat: rövid magyarázat → tananyag-szöveg (több pár egymás után) */
.study-pair {
  margin-bottom: 18px;
}

.study-pair:last-child {
  margin-bottom: 0;
}

.ex-note {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.ex-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple);
  margin-bottom: 6px;
}

.ex-note__p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.ex-text {
  border-left: 3px solid var(--primary);
  padding: 4px 0 4px 12px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text2);
}

.ex-text p,
.ex-text ul {
  margin: 0 0 10px;
}

.ex-text p:last-child,
.ex-text ul:last-child {
  margin-bottom: 0;
}

.ex-text ul {
  padding-left: 1.1rem;
  color: var(--text);
}

.quiz-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.quiz-block__title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.q-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.q-card__n {
  margin: 0 0 6px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
}

.q-card__prompt {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 0.95rem;
}

.q-card__opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.opt-btn:hover:not(:disabled) {
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.08);
}

.opt-btn:disabled {
  cursor: default;
}

.opt-btn--correct {
  border-color: var(--green) !important;
  background: var(--green-glow) !important;
}

.opt-btn--wrong {
  border-color: var(--red) !important;
  background: var(--red-glow) !important;
}

.opt-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--bg3);
}

.opt-text {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}

.q-card__fb {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  line-height: 1.55;
}

.q-card__fb--ok {
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: var(--green-glow);
  color: #bbf7d0;
}

.q-card__fb--bad {
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: var(--red-glow);
  color: #fecaca;
}

.fb-explain {
  display: block;
  margin-top: 8px;
  color: var(--text);
}

.fb-tip {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #fde68a;
}

.exam-launch {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn-exam {
  width: 100%;
  max-width: 420px;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  color: #0a0a0a;
  background: linear-gradient(135deg, var(--primary), #f97316);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-exam:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-exam:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.exam-launch__sub {
  margin: 10px 0 0;
  font-size: 0.86rem;
  color: var(--text2);
}

#topic-exam.hidden {
  display: none;
}

#topic-learn.hidden {
  display: none;
}

.exam-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.5;
}

.btn-exam-done {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-exam-done:hover {
  border-color: var(--primary);
  color: var(--primary);
}

code {
  font-size: 0.85em;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
}


.btn-tetelek{

    background: white;
    padding: 0.5rem;
    border-radius: 1rem;
    text-decoration: none;
    color: orange;
}
