:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --brand: #22c55e;
  --brand-2: #06b6d4;
  --wrong: #ef4444;
  --right: #22c55e;
  --warn: #f59e0b;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 50% -10%, #1f2a44 0%, #0b1224 50%, var(--bg) 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 18px;
}

.app {
  width: min(860px, 100%);
  max-width: 100%;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

header {
  padding: 18px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.12), rgba(6, 182, 212, 0.12));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-home {
  flex-wrap: wrap;
}

.header-quiz {
  flex-wrap: wrap;
}

.title {
  font-weight: 800;
  letter-spacing: 0.3px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 1.05rem;
}

.header-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.badge {
  background: rgba(6, 182, 212, 0.15);
  color: #a7f3d0;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
}

.progress {
  width: 180px;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress > div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.35s ease;
}

main {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.view {
  display: none;
}

.view-active {
  display: block;
}

.assignment-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 20px;
}

.assignment-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
}

.assignment-card:hover {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 20px 45px rgba(6, 182, 212, 0.12);
}

.assignment-header {
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(224, 242, 254, 0.85);
  font-weight: 600;
  font-size: 0.85rem;
}

.assignment-title {
  margin: 0;
  font-size: 1.25rem;
}

.assignment-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.question {
  font-size: 1.25rem;
  line-height: 1.45;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.options {
  display: grid;
  gap: 12px;
}

.btn,
.primary {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s transform, 0.2s background, 0.2s border;
}

.primary {
  text-align: center;
  border: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #062a23;
  font-weight: 800;
}

.btn:hover,
.primary:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.btn[disabled],
.primary[disabled] {
  opacity: 0.8;
  cursor: not-allowed;
  transform: none;
}

.btn.correct {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.12);
}

.btn.wrong {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(239, 68, 68, 0.12);
}

.feedback {
  padding: 14px 16px;
  border-radius: 14px;
  display: none;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.feedback.show {
  display: flex;
}

.feedback.ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.feedback.no {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

footer {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a5b4fc;
  font-weight: 700;
  font-size: 0.8rem;
}

.end h2 {
  margin: 0 0 8px 0;
}

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

.link {
  background: transparent;
  border: 0;
  color: #5eead4;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

@media (max-width: 640px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .progress {
    width: 100%;
  }

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

  .question {
    font-size: 1.1rem;
  }
}
