:root {
  --bg: #fff7ed;
  --bg-2: #fef3c7;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --text: #2b1d15;
  --muted: #7c5f4f;
  --blue: #7c3aed;
  --blue-dark: #5b21b6;
  --green: #16a34a;
  --red: #dc2626;
  --purple: #9333ea;
  --coffee: #92400e;
  --cream: #fffbeb;
  --border: rgba(146, 64, 14, 0.16);
  --highlight: #dcfce7;
  --wrong: #fee2e2;
  --shadow: 0 24px 70px rgba(92, 53, 23, 0.16);
  --soft-shadow: 0 12px 28px rgba(92, 53, 23, 0.10);
}

body.dark {
  --bg: #0f172a;
  --bg-2: #1e1b4b;
  --card: rgba(17, 24, 39, 0.84);
  --card-solid: #111827;
  --text: #f9fafb;
  --muted: #cbd5e1;
  --blue: #a78bfa;
  --blue-dark: #8b5cf6;
  --green: #4ade80;
  --red: #fb7185;
  --purple: #c084fc;
  --coffee: #fbbf24;
  --cream: #172033;
  --border: rgba(255, 255, 255, 0.12);
  --highlight: rgba(22, 163, 74, 0.22);
  --wrong: rgba(220, 38, 38, 0.22);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --soft-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.35), transparent 32rem),
    radial-gradient(circle at top right, rgba(236, 72, 153, 0.18), transparent 30rem),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(146, 64, 14, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.page-shell {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 54px 18px 42px;
  text-align: center;
  color: white;
  background:
    linear-gradient(135deg, rgba(88, 28, 135, 0.95), rgba(146, 64, 14, 0.92)),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.22), transparent 24rem);
  border-bottom-left-radius: 34px;
  border-bottom-right-radius: 34px;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "☕ 🐨 📚";
  position: absolute;
  right: 5%;
  bottom: -12px;
  font-size: clamp(58px, 9vw, 130px);
  opacity: 0.11;
  transform: rotate(-8deg);
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.coffee-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fffbeb;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
}

.hero h1 {
    margin: 0 auto;
    text-align: center;
    font-size: clamp(32px, 4vw, 58px);
    width: 100%;
}
.hero p {
  margin: 0 auto;
  max-width: 680px;
  color: rgba(255,255,255,0.88);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.6;
}

.hero-pills {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-pills span {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  color: white;
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.dark-toggle {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 5;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  border-radius: 999px;
  padding: 11px 15px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

main {
  max-width: 1180px;
  margin: -24px auto 0;
  padding: 0 16px 24px;
}

.dashboard-card {
  position: sticky;
  top: 12px;
  z-index: 10;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(18px);
  margin-bottom: 24px;
}

.controls {
  display: grid;
  grid-template-columns: 1.45fr 220px 190px auto auto;
  gap: 12px;
  margin-bottom: 14px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0 14px;
  min-height: 52px;
}

.input-wrap input {
  border: 0;
  padding-left: 0;
  width: 100%;
  background: transparent;
}

input, select, button {
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  font-size: 15px;
  font-family: inherit;
}

input, select {
  background: var(--card-solid);
  color: var(--text);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16);
}

button {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: white;
  cursor: pointer;
  font-weight: 800;
  border: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  box-shadow: 0 10px 18px rgba(124, 58, 237, 0.22);
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

.secondary-btn {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.danger-btn {
  background: linear-gradient(135deg, #f97316, #dc2626);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--blue);
}

.stat-green::before { background: var(--green); }
.stat-purple::before { background: var(--purple); }
.stat-red::before { background: var(--red); }

.stats strong {
  display: block;
  font-size: 30px;
  color: var(--text);
  letter-spacing: -0.04em;
}

.stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.questions-grid {
  display: grid;
  gap: 16px;
}

.question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.question-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(124, 58, 237, 0.26);
}

.topic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 7px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.topic::before {
  content: "✦";
}

body.dark .topic {
  color: #ddd6fe;
  background: rgba(167, 139, 250, 0.16);
}

.question-card h3 {
  margin: 8px 0 16px;
  line-height: 1.42;
  font-size: clamp(18px, 2vw, 23px);
  letter-spacing: -0.025em;
}

.choice {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card-solid);
  color: var(--text);
  border: 1px solid var(--border);
  margin: 10px 0;
  padding: 14px 16px;
  border-radius: 18px;
  font-weight: 650;
  box-shadow: none;
  position: relative;
}

.choice:hover:not(:disabled) {
  transform: translateX(3px);
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.12);
}

.choice.correct {
  background: var(--highlight);
  border-color: var(--green);
  color: var(--text);
  font-weight: 900;
}

.choice.wrong {
  background: var(--wrong);
  border-color: var(--red);
  color: var(--text);
  font-weight: 900;
}

.explanation {
  display: none;
  margin-top: 16px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-left: 6px solid var(--blue);
  padding: 15px;
  border-radius: 18px;
  color: var(--text);
  line-height: 1.6;
}

.explanation.show { display: block; }

.flashcard {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flash-answer {
  display: none;
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: var(--highlight);
  border: 1px solid var(--green);
  font-weight: 800;
  line-height: 1.55;
}

.flash-answer.show { display: block; }

.empty {
  text-align: center;
  color: var(--muted);
  background: var(--card);
  padding: 34px;
  border-radius: 26px;
  border: 1px solid var(--border);
  box-shadow: var(--soft-shadow);
  font-weight: 700;
}

footer {
  text-align: center;
  padding: 24px 20px 92px;
  color: var(--muted);
  font-weight: 700;
}

.chatgpt-bubble {
  position: fixed;
  left: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, #7c3aed, #92400e);
  color: white;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(88, 28, 135, 0.30);
  z-index: 9999;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.chatgpt-bubble:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 24px 50px rgba(88, 28, 135, 0.36);
}

@media (max-width: 980px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .input-wrap {
    grid-column: 1 / -1;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-card {
    position: relative;
    top: 0;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 26px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }

  .dark-toggle {
    position: static;
    margin-bottom: 16px;
  }

  main {
    margin-top: -18px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .question-card {
    border-radius: 22px;
    padding: 18px;
  }

  .chatgpt-bubble strong {
    display: none;
  }
}

.hero-koala {
  position: absolute;
  left: 45px;
  top: 30px;
  width: clamp(120px, 12vw, 240px);
  height: auto;
  z-index: 5;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,.25));
}
@media (max-width: 768px) {
  .hero-koala {
    width: 90px;
    left: 15px;
    top: 15px;
  }
}