@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  --ink: #1d1a17;
  --muted: #6b5f55;
  --paper: #f9f4ef;
  --accent: #ec6a5a;
  --accent-dark: #d24f40;
  --sea: #2e7d73;
  --card: rgba(255, 255, 255, 0.86);
  --shadow: 0 20px 50px rgba(35, 24, 14, 0.18);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(140deg, #f9efe2 0%, #fae5e0 38%, #dbe8e2 100%);
  position: relative;
  overflow-x: hidden;
}

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.9;
  mix-blend-mode: multiply;
}

.orb-one {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(236, 106, 90, 0.55), rgba(236, 106, 90, 0));
  top: -80px;
  left: -60px;
  animation: float 16s ease-in-out infinite;
}

.orb-two {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(46, 125, 115, 0.55), rgba(46, 125, 115, 0));
  bottom: -80px;
  right: -40px;
  animation: float 18s ease-in-out infinite reverse;
}

.orb-three {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(246, 205, 139, 0.6), rgba(246, 205, 139, 0));
  top: 40vh;
  right: 10vw;
  animation: float 14s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(18px);
  }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin: 0 auto;
  padding: 40px 20px 48px;
  display: grid;
  gap: 24px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  backdrop-filter: blur(6px);
  animation: pop 0.6s ease;
}

@keyframes pop {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode {
  border: 1px solid rgba(57, 44, 36, 0.2);
  background: #fffdf9;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mode.active {
  background: rgba(236, 106, 90, 0.15);
  border-color: rgba(236, 106, 90, 0.4);
  box-shadow: 0 6px 12px rgba(210, 79, 64, 0.15);
  transform: translateY(-1px);
}

.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h2 {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  margin: 6px 0 0;
  font-family: "Fraunces", "Georgia", serif;
}

.progress {
  font-size: 0.9rem;
  padding: 6px 12px;
  background: rgba(237, 225, 214, 0.7);
  border-radius: 999px;
  color: var(--muted);
}

.fields {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.field input {
  border: 1px solid rgba(57, 44, 36, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  background: #fffdf9;
}

.field input:focus {
  outline: none;
  border-color: rgba(46, 125, 115, 0.6);
  box-shadow: 0 0 0 3px rgba(46, 125, 115, 0.15);
}

.field input.correct {
  border-color: rgba(46, 125, 115, 0.7);
  box-shadow: 0 0 0 3px rgba(46, 125, 115, 0.15);
}

.field input.incorrect {
  border-color: rgba(210, 79, 64, 0.7);
  box-shadow: 0 0 0 3px rgba(210, 79, 64, 0.12);
}

.hidden {
  display: none;
}

.toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toggle {
  border: 1px solid rgba(57, 44, 36, 0.2);
  background: #fff7f0;
  padding: 12px 0;
  border-radius: 14px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.toggle.active {
  background: rgba(46, 125, 115, 0.15);
  border-color: rgba(46, 125, 115, 0.55);
  box-shadow: 0 8px 16px rgba(46, 125, 115, 0.15);
  transform: translateY(-1px);
}

.toggle.incorrect {
  background: rgba(210, 79, 64, 0.18);
  border-color: rgba(210, 79, 64, 0.5);
}

.toggle.correct {
  background: rgba(46, 125, 115, 0.22);
  border-color: rgba(46, 125, 115, 0.7);
}

.feedback {
  min-height: 36px;
  font-size: 0.95rem;
  color: var(--muted);
}

.primary {
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.actions {
  display: grid;
  gap: 10px;
}

.ghost {
  border: 1px solid rgba(57, 44, 36, 0.2);
  border-radius: 999px;
  padding: 12px 18px;
  background: #fff7f0;
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ghost:hover {
  background: #fff1e8;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(57, 44, 36, 0.12);
}

.primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(210, 79, 64, 0.25);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stats div {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 12px 24px rgba(43, 30, 18, 0.08);
}

.stats p {
  margin: 4px 0 0;
  font-size: 1.1rem;
  font-weight: 600;
}

@media (max-width: 520px) {
  .app {
    padding: 32px 16px 40px;
  }

  .card {
    padding: 20px;
  }

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

  .stats div {
    padding: 12px 8px;
  }
}
