:root {
  /* Default (Easy) - cerah & playful */
  --bg1: #a1c4fd;
  --bg2: #c2e9fb;
  --ink: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --primary: #2563eb;
  --ok: #16a34a;
  --bad: #dc2626;
}

/* Tema EASY */
body.easy {
  --bg1: #ffecd2;
  --bg2: #fcb69f;
  --ink: #1e293b;
  --muted: #64748b;
  --card: #ffffff;
  --primary: #f97316;
}

/* Tema MEDIUM */
body.medium {
  --bg1: #f8fafc;
  --bg2: #f8fafc;
  --ink: #0f172a;
  --muted: #94a3b8;
  --card: #ffffff;
  --primary: #475569;
}

/* Tema HARD */
body.hard {
  --bg1: #0f172a;
  --bg2: #1e293b;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --card: #1e293b;
  --primary: #6366f1;
}

* { box-sizing: border-box }
html, body { height: 100% }
body {
  margin: 0;
  font-family: Inter, system-ui, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  display: grid;
  place-items: center;
  padding: 16px;
  transition: background 0.4s ease, color 0.4s ease;
}

.card {
  width: min(900px, 92vw);
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(2,6,23,.15);
  animation: pop .35s ease;
  transition: background 0.4s ease;
}

.hidden { display: none !important }
.muted { color: var(--muted) }

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

.field { display: flex; flex-direction: column; gap: 6px }
input, select {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  outline: none;
}
input:focus, select:focus { border-color: #94a3b8 }

.btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}
.btn:disabled { opacity: .5; cursor: not-allowed }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.progress {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
.bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  transition: width .35s ease;
}

.q {
  min-height: 56px;
  margin: .25rem 0 1rem;
  animation: fadeUp .3s ease both;
}
.answers {
  display: grid;
  gap: 10px;
}
.answers .btn {
  text-align: left;
  width: 100%;
  background: #f8fafc;
  border-color: #e2e8f0;
  transition: transform .12s, background .2s, border-color .2s;
}
.answers .btn:hover { transform: translateY(-1px) }
.correct { background: #25f047 !important; border-color: #076e1c !important }
.wrong { background: #f92d2d !important; border-color: #800909 !important }

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

/* Animations */
@keyframes pop {
  from { transform: scale(.98); opacity: 0 }
  to { transform: scale(1); opacity: 1 }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px) }
  to { opacity: 1; transform: translateY(0) }
}

/* Responsive */
@media (max-width:640px) {
  .hud { grid-template-columns: repeat(2, 1fr) }
}
