:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: #020617;
  --panel-soft: rgba(15, 23, 42, 0.9);
  --accent: #3b82f6;
  --accent-soft: #1d4ed8;
  --accent-faint: #93c5fd;
  --correct: #16a34a;
  --incorrect: #dc2626;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --border-soft: rgba(148, 163, 184, 0.14);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
}

button,
select {
  font: inherit;
}

.app-shell {
  width: 100%;
  max-width: 880px;
  background: linear-gradient(145deg, #020617, #020617);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 20px 20px 24px;
  box-shadow: var(--shadow);
}

.mode-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

#mode-select {
  width: min(100%, 320px);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(75, 85, 99, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  font-size: 13px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.app-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-title h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.app-title span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, #1d4ed8, #020617 55%);
  border: 1px solid rgba(37, 99, 235, 0.45);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.85);
}

.meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.meta-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-chip,
.meta-item {
  font-size: 12px;
}

.meta-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(75, 85, 99, 0.7);
  color: #d1d5db;
  background: rgba(15, 23, 42, 0.75);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.8);
}

.home-panel {
  display: grid;
  gap: 14px;
}

.home-card,
.question-card,
.info-panel,
.explanation {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: radial-gradient(circle at top left, #0f172a, #020617 55%);
}

.home-card {
  padding: 16px;
}

.home-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--accent-faint);
}

.home-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.section-tile {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 12px;
}

.section-tile h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--accent-faint);
}

.section-tile p {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.question-card {
  padding: 16px 14px;
  margin-bottom: 16px;
}

.question-tag {
  font-size: 11px;
  color: var(--accent-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.question-text {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.55;
}

.question-section {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.choice-btn {
  width: 100%;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  background: radial-gradient(circle at top left, #020617, #020617 65%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.08s ease;
}

.choice-btn:hover {
  border-color: rgba(59, 130, 246, 0.75);
  transform: translateY(-1px);
}

.choice-btn.disabled {
  pointer-events: none;
}

.choice-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.choice-label {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.choice-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}

.choice-btn.selected.correct,
.choice-btn.reveal-correct {
  border-color: rgba(34, 197, 94, 0.9);
  background: radial-gradient(circle at top left, rgba(22, 101, 52, 0.95), #020617 70%);
}

.choice-btn.selected.incorrect {
  border-color: rgba(248, 113, 113, 0.9);
  background: radial-gradient(circle at top left, rgba(127, 29, 29, 0.95), #020617 70%);
}

.explanation {
  padding: 12px 14px;
  margin-bottom: 14px;
}

.explanation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.explanation-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.explanation-pill {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.explanation-body,
.explanation-note {
  margin: 0;
  line-height: 1.6;
}

.explanation-body {
  font-size: 14px;
  margin-bottom: 6px;
}

.explanation-note {
  font-size: 13px;
  color: var(--muted);
}

.info-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.info-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.info-block {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 12px;
}

.info-block h3,
.study-note-block h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-faint);
}

.info-purpose {
  margin: 0;
  line-height: 1.6;
  font-size: 14px;
}

.info-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.info-list li,
.study-note-block li {
  font-size: 14px;
  line-height: 1.6;
}

.info-study-notes {
  display: grid;
  gap: 12px;
}

.study-note-block {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.58);
}

.study-note-block ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.score-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.score-summary strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.btn-primary {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #e5e7eb;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.45);
}

.btn-primary[disabled] {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.hidden {
  display: none !important;
}

.study-note-block {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(75, 85, 99, 0.45);
}

.study-note-block h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #93c5fd;
  margin-bottom: 8px;
}

.study-note-block ul {
  margin: 0 0 8px 18px;
}

.study-note-block li {
  margin-bottom: 6px;
}

.signs-intro {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.sign-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.sign-card {
  border: 1px solid rgba(75, 85, 99, 0.6);
  border-radius: 12px;
  background: radial-gradient(circle at top left, #0f172a, #020617 68%);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sign-art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.sign-svg {
  width: 96px;
  height: 96px;
}

.sign-copy h3 {
  margin: 0 0 4px;
  font-size: 13px;
  color: #e5e7eb;
  letter-spacing: normal;
  text-transform: none;
}

.sign-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #93c5fd;
  margin-bottom: 6px;
}

.sign-copy p {
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
}

@media (max-width: 640px) {
  .sign-gallery {
    grid-template-columns: 1fr;
  }

  .sign-art {
    min-height: 116px;
  }
}

.sign-group {
  margin-top: 14px;
}

.sign-group-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #bfdbfe;
  margin-bottom: 8px;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px 14px 18px;
  }

  .app-header,
  .meta-bar,
  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .mode-bar {
    justify-content: stretch;
  }

  #mode-select {
    width: 100%;
  }

  .choice-btn {
    align-items: flex-start;
  }
}
