:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --primary: #22d3ee;
  --accent: #a78bfa;
  --danger: #f87171;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); }

.app-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #1f2937; position: sticky; top: 0; background: rgba(15,23,42,0.9); backdrop-filter: blur(6px); z-index: 10; }
.app-header h1 { margin: 0; font-size: 18px; font-weight: 600; }
.tab { background: transparent; color: var(--text); border: 1px solid #334155; padding: 8px 12px; border-radius: 8px; margin-left: 8px; cursor: pointer; }
.tab.active { border-color: var(--primary); color: var(--primary); }

.container { max-width: 900px; margin: 0 auto; padding: 16px; }
.hidden { display: none; }
.loader { padding: 24px; text-align: center; color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.progress { color: var(--muted); }
.controls button { margin-left: 8px; }
button { background: #0b1220; color: var(--text); border: 1px solid #334155; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.danger { border-color: var(--danger); color: var(--danger); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid #1f2937; padding: 16px; border-radius: 12px; }
.question-title { font-weight: 600; margin-bottom: 8px; }
.question-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.options { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }

.option { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid #1f2937; border-radius: 8px; background: #0b1220; }
.option.correct { border-color: #16a34a; background: rgba(22,163,74,0.1); }
.option.incorrect { border-color: var(--danger); background: rgba(248,113,113,0.1); }
.option input { margin-top: 4px; }
.option-label { font-weight: 600; margin-right: 6px; color: var(--accent); }

.answer-panel { margin-top: 12px; padding: 12px; border: 1px dashed #334155; border-radius: 8px; }
.answer-panel .title { color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.answer-panel .discussion { color: var(--muted); }
.discussion-entry { border: 1px solid #1f2937; border-radius: 8px; padding: 10px; background: #0b1220; margin-top: 10px; }
.discussion-entry .entry-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.discussion-entry .user { color: #60a5fa; font-weight: 600; }
.discussion-entry .meta { color: var(--muted); font-size: 12px; }
.pill { border: 1px solid #334155; color: var(--accent); padding: 2px 6px; border-radius: 999px; font-size: 12px; }
.discussion-entry p { margin: 6px 0; line-height: 1.5; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin: 12px 0; }
.grid button { padding: 8px 0; font-size: 12px; }
.grid button.active { border-color: var(--primary); color: var(--primary); }

.test-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.timer { font-weight: 700; color: var(--primary); }

.result { margin-top: 16px; }
.result h3 { margin: 0 0 8px 0; }
.result .wrong-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid #1f2937; }

.footer { text-align: center; padding: 16px; color: var(--muted); border-top: 1px solid #1f2937; margin-top: 16px; }

@media (max-width: 600px) {
  .controls { display: flex; gap: 8px; }
}


