:root {
  --bg: #fffaf1;
  --surface: #fffefb;
  --ink: #1c1915;
  --muted: #6a6258;
  --brand: #d96b1f;
  --brand-dark: #a9490f;
  --line: #efdcc9;
  --ok: #2b7f5b;
  --bad: #a7372f;
  --shadow: 0 20px 50px rgba(100, 55, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(242, 194, 126, 0.5), transparent 30%),
    radial-gradient(circle at 85% 35%, rgba(242, 143, 79, 0.35), transparent 28%),
    var(--bg);
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(10px);
}

.shape-a {
  width: 220px;
  height: 220px;
  background: rgba(217, 107, 31, 0.2);
  top: -60px;
  right: 6vw;
}

.shape-b {
  width: 260px;
  height: 260px;
  background: rgba(107, 172, 139, 0.18);
  bottom: -90px;
  left: 5vw;
}

.app-shell {
  width: min(980px, 92vw);
  margin: 28px auto 44px;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 18px;
  animation: rise 550ms ease-out;
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.84rem;
  margin: 0 0 10px;
}

h1,
h2,
h3 {
  font-family: 'Bitter', Georgia, serif;
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.9rem);
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-top: 16px;
  animation: rise 500ms ease-out;
}

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

label {
  display: grid;
  gap: 6px;
  font-weight: 500;
}

input {
  border: 1px solid #d7c3ae;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-actions {
  justify-content: flex-end;
}

.between {
  justify-content: space-between;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: transform 120ms ease, filter 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.btn.primary {
  background: linear-gradient(140deg, var(--brand), #ff8c42);
  color: white;
}

.btn.secondary {
  background: #efe0d2;
  color: var(--ink);
}

.btn.ghost {
  background: transparent;
  border: 1px solid #d7c3ae;
}

.hidden {
  display: none;
}

.muted {
  color: var(--muted);
  margin: 6px 0 14px;
}

.message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--brand-dark);
}

.set-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.folder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.folder-item {
  border: 1px solid #d7c3ae;
  border-radius: 999px;
  background: #fff;
  padding: 7px 12px;
  font: inherit;
  cursor: pointer;
}

.folder-item.active {
  background: #f9e2d0;
  border-color: #d96b1f;
}

.set-item {
  border: 1px solid #e9d7c6;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.set-item h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.question {
  border: 1px solid #eddcca;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  background: #fff;
  font-size: 1.25rem;
  color: var(--ink);
  box-shadow: 0 4px 6px rgba(100, 55, 20, 0.05);
}

.question > div:first-child {
  margin-bottom: 12px;
  line-height: 1.5;
}

.options {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  font-size: 1.2rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffaf4;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 1.2rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, outline 0.2s;
}

.option:hover {
  background: #fdf2e8;
}

.option.is-correct {
  background: #e9f7ef;
  outline: 1px solid #6bb58a;
}

.option.is-wrong {
  background: #fdebea;
  outline: 1px solid #d1736d;
}

.answer-status {
  min-height: 18px;
  margin: 8px 0 0;
  font-weight: 600;
}

.timer {
  margin: 0;
  border: 1px solid #efdcc9;
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 700;
  background: #fff;
}

.timer.danger {
  color: #a7372f;
  border-color: #d1736d;
}

.top-gap {
  margin-top: 14px;
}

.score {
  font-size: 1.2rem;
  color: var(--brand-dark);
  margin-top: 8px;
}

.result-list {
  max-height: 320px;
  overflow: auto;
  border: 1px solid #ecdbc9;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.result-item {
  border-bottom: 1px solid #f0e2d4;
  padding: 7px;
  font-size: 0.95rem;
}

.result-item:last-child {
  border-bottom: none;
}

.ok {
  color: var(--ok);
}

.bad {
  color: var(--bad);
}

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

@media (max-width: 680px) {
  .row {
    flex-wrap: wrap;
  }

  .btn {
    width: 100%;
  }

  .between {
    align-items: flex-start;
  }
}
