:root {
  --bg: #0b1020;
  --panel: #121835;
  --text: #e7ecff;
  --muted: #9aa7d7;
  --primary: #6c8cff;
  --success: #22c55e;
  --danger: #ef4444;
  --border: #22306b;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji';
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% 10%, #0f1530, #0b1020);
}

#app { min-height: 100%; display: flex; flex-direction: column; }

.app-header, .app-footer {
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.0));
}
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-header h1 { margin: 0; font-weight: 800; font-size: 22px; letter-spacing: .3px; }
.mode { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.mode select { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }

.quiz { width: min(920px, 94%); margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 16px; }

.stem { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: grid; gap: 10px; }
.stem-label { font-size: 13px; color: var(--muted); }
.stem-content { display: flex; align-items: center; justify-content: center; min-height: 180px; }
.stem-content img { max-width: 100%; max-height: 240px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: #0e1430; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option {
  background: linear-gradient(180deg, #1a2350, #12183a);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform .06s ease, border-color .2s ease, box-shadow .2s ease;
}
.option:hover { transform: translateY(-1px); border-color: #2f48a5; box-shadow: 0 6px 16px rgba(23, 40, 120, 0.35); }
.option:active { transform: translateY(0); }

.feedback { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: grid; gap: 12px; }
.result { font-weight: 600; }
.result.ok { color: var(--success); }
.result.no { color: var(--danger); }
.answer-card { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: center; }
.answer-card img { width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #0e1430; }
.answer-text { color: var(--muted); line-height: 1.6; }

.controls { display: flex; justify-content: space-between; margin-top: auto; position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(11,16,32,0), rgba(11,16,32,0.9)); padding-top: 8px; }
.next { background: var(--primary); color: white; border: none; border-radius: 12px; padding: 12px 16px; font-weight: 600; cursor: pointer; }

@media (max-width: 640px) {
  .app-header { padding: 12px 14px; }
  .app-header h1 { font-size: 18px; }
  .mode { gap: 6px; }
  .mode select { padding: 4px 8px; font-size: 13px; border-radius: 8px; }

  .quiz { gap: 10px; width: min(920px, 96%); }
  .stem { padding: 12px; }
  .stem-label { font-size: 12px; }
  .stem-content { min-height: 100px; }
  .stem-content img { max-height: 160px; }

  .options { gap: 8px; }
  .option { padding: 10px 12px; font-size: 14px; }
  .option img { width: 100%; max-height: 80px; object-fit: contain; display: block; }

  .feedback { padding: 12px; gap: 10px; }
  .answer-card { grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
  .answer-card img { max-height: 120px; }
  .answer-text { font-size: 14px; }

  .controls { justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .next { padding: 10px 12px; font-size: 14px; border-radius: 10px; }
}
