:root {
  /* Academic Medic palette (from your image) */
  --bg: #123d2b;            /* deep green page background */
  --surface: #0f3325;       /* darker panels / sections */
  --card: #143f2d;          /* card background */
  --ink: #ffffff;           /* primary text on dark */
  --muted: rgba(255, 255, 255, 0.6);
  --accent: #d6a447;        /* gold accent from banner */
  --accent-soft: rgba(214, 164, 71, 0.08);
  --radius: 1.25rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #19503a 0%, #123d2b 60%, #0c2c20 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ====== TOP BAR / BRAND ====== */
.topbar {
  background: rgba(12, 44, 32, 0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(214, 164, 71, 0.25);
  padding: 1.25rem 1.5rem 1rem;
}

.topbar .brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.brand-logo {
  width: 90px;
  height: 90px;
  border-radius: 0.5rem;
  object-fit: contain;
}


.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* ====== APP WRAPPER ====== */
.app {
  width: min(900px, 100%);
  margin: 1.5rem auto;
  padding: 0 1rem 2.5rem;
  flex: 1;
}

/* ====== MODES / FILTERS / UNITS ====== */
.modes {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.mode-btn {
  border: 1px solid rgba(214, 164, 71, 0.4);
  background: rgba(12, 44, 32, 0.35);
  color: #ffffff;
  border-radius: 9999px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.15s ease;
}

.mode-btn:hover {
  background: rgba(214, 164, 71, 0.12);
}

.mode-btn.active {
  background: var(--accent);
  color: #0c2c20;
  border-color: transparent;
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  border: 1px solid rgba(214, 164, 71, 0.25);
  background: rgba(12, 44, 32, 0.25);
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: #fff;
  transition: 0.15s ease;
}

.filter-btn:hover {
  background: rgba(214, 164, 71, 0.15);
}

.filter-btn.active {
  background: #ffffff;
  color: #123d2b;
  border-color: rgba(255, 255, 255, 0.15);
}

.units {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.units-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.unit-btn {
  border: 1px solid rgba(214, 164, 71, 0.25);
  background: rgba(12, 44, 32, 0.15);
  border-radius: 0.5rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  cursor: pointer;
  color: #fff;
  transition: 0.15s ease;
}

.unit-btn:hover {
  background: rgba(214, 164, 71, 0.15);
}

.unit-btn.active {
  background: #ffffff;
  color: #123d2b;
  border-color: rgba(255, 255, 255, 0.15);
}

.unit-clear {
  background: rgba(214, 164, 71, 0.12);
  color: #fff;
}

/* ====== PANELS / CARDS ====== */
.panel {
  background: transparent;
  display: none;
}

.panel.visible {
  display: block;
}

.card {
  background: radial-gradient(circle at top, rgba(20, 63, 45, 0.9), rgba(12, 44, 32, 0.9));
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem 1.25rem;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(214, 164, 71, 0.12);
}

.label {
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

#word,
#mc-word {
  font-size: clamp(1.75rem, 4vw, 2.3rem);
  margin: 0;
  color: #ffffff;
}

.pos,
#mc-pos {
  margin-top: 0.25rem;
  color: var(--accent);
  font-weight: 600;
}

.hidden {
  display: none;
}

#definition-box {
  margin-top: 1.25rem;
  background: rgba(12, 44, 32, 0.3);
  border: 1px solid rgba(214, 164, 71, 0.1);
  border-radius: 0.85rem;
  padding: 1.1rem 1rem 1rem;
}

#definition-box h3,
#definition-box h4 {
  margin: 0;
  font-size: 0.85rem;
  color: #ffffff;
}

#definition-box p {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.meta,
#mc-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

/* ====== CONTROLS ====== */
.controls {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.controls button {
  border: none;
  background: var(--accent);
  color: #0c2c20;
  padding: 0.5rem 1rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: 0.12s ease;
}

.controls button:hover {
  filter: brightness(0.95);
}

#shuffle-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ====== MULTIPLE CHOICE ====== */
.mc-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.mc-option-btn {
  text-align: left;
  background: rgba(12, 44, 32, 0.35);
  border: 1px solid rgba(214, 164, 71, 0.08);
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: #fff;
  transition: 0.12s ease;
}

.mc-option-btn:hover {
  background: rgba(214, 164, 71, 0.12);
}

.mc-option-btn.correct {
  background: rgba(34, 197, 94, 0.28);
  border: 1px solid rgba(34, 197, 94, 0.6);
}

.mc-option-btn.incorrect {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.6);
}

.mc-feedback {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #fff;
}

/* ====== EMAIL SIGNUP ====== */
.email-signup {
  background: rgba(12, 44, 32, 0.6);
  border-top: 1px solid rgba(214, 164, 71, 0.12);
  padding: 1.75rem 1rem 2rem;
  text-align: center;
}

.email-signup h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #ffffff;
}

.email-signup p {
  margin-top: 0.4rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.email-signup iframe {
  border-radius: 1rem !important;
}

/* ====== MOBILE JOIN LINK ====== */
.join-link-mobile {
  display: none;
  text-align: center;
  font-size: 0.8rem;
  margin: 1rem 0 0.25rem;
  color: rgba(255, 255, 255, 0.75);
}

.join-link-mobile a {
  color: var(--accent);
  text-decoration: underline;
}

/* ====== FOOTER ====== */
.footer {
  text-align: center;
  padding: 1rem 1rem 1.5rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 640px) {
  .topbar .brand {
    flex-wrap: wrap;
  }

  .brand-logo {
    width: 60px;
    height: 60px;
  }

  .join-link-mobile {
    display: block;
  }

  .modes {
    flex-direction: column;
    align-items: flex-start;
  }

  .app {
    padding-inline: 0.75rem;
  }
}
