:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;

  --emerald: #059669;
  --emerald-dark: #047857;
  --emerald-soft: #d1fae5;
  --emerald-tint: #ecfdf5;

  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #dbeafe;
  --blue-tint: #eff6ff;

  --violet: #7c3aed;
  --violet-dark: #6d28d9;
  --violet-soft: #ede9fe;
  --violet-tint: #f5f3ff;

  --amber: #d97706;
  --amber-dark: #b45309;
  --amber-soft: #fef3c7;
  --amber-tint: #fffbeb;

  --rose: #dc2626;
  --rose-dark: #b91c1c;
  --rose-soft: #fee2e2;
  --rose-tint: #fef2f2;

  --teal: #0d9488;
  --teal-soft: #ccfbf1;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.09);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 8% 5%, rgba(5, 150, 105, 0.14), transparent 36%),
    radial-gradient(circle at 92% 8%, rgba(37, 99, 235, 0.13), transparent 36%),
    radial-gradient(circle at 50% 96%, rgba(124, 58, 237, 0.08), transparent 40%),
    var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =========================================================
   HEADER
   ========================================================= */
.app-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-back-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-back-portal:hover {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: var(--emerald-dark);
}

.btn-back-portal svg {
  width: 16px;
  height: 16px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.brand h1 {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.meb-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--text-main);
  font-weight: 800;
}

.stat-progress .progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-soft);
}

.stat-score {
  background: var(--amber-tint);
  border-color: #fde68a;
  color: var(--amber-dark);
}

.stat-score strong {
  color: var(--amber-dark);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-ghost {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-primary {
  background: var(--blue);
  color: #ffffff;
  padding: 10px 18px;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-secondary {
  background: var(--emerald-tint);
  color: var(--emerald-dark);
  border-color: #a7f3d0;
  padding: 10px 18px;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: var(--emerald-soft);
}

.btn-chip {
  padding: 5px 11px;
  font-size: 0.78rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}

.btn-chip:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-chip.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-color: #93c5fd;
}

/* =========================================================
   MODE NAVIGATION TABS
   ========================================================= */
.mode-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 13px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease, background 0.16s ease;
}

.mode-tab:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.mode-tab.active {
  border-color: var(--blue);
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
}

.tab-index {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.94rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mode-tab.active .tab-index {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.tab-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tab-copy strong {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-main);
}

.tab-copy small {
  font-size: 0.77rem;
  color: var(--text-muted);
}

/* =========================================================
   PANELS & SECTION CARDS
   ========================================================= */
.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kingdom-strip {
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.kingdom-strip-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--emerald-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kingdom-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.k-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.79rem;
  font-weight: 700;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 4px 0 4px;
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-main);
}

.section-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 820px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
}

.eyebrow-emerald {
  background: var(--emerald-soft);
  color: var(--emerald-dark);
}

.eyebrow-blue {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.eyebrow-violet {
  background: var(--violet-soft);
  color: var(--violet-dark);
}

.eyebrow-amber {
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.pill-counter {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--emerald-tint);
  color: var(--emerald-dark);
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}

.pill-blue {
  background: var(--blue-tint);
  color: var(--blue-dark);
  border-color: #bfdbfe;
}

.pill-emerald {
  background: var(--emerald-tint);
  color: var(--emerald-dark);
  border-color: #a7f3d0;
}

/* =========================================================
   TAB 1: 6 PHYLUM CARDS
   ========================================================= */
.phylum-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.phylum-card {
  position: relative;
  text-align: left;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px 11px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.phylum-card:hover {
  transform: translateY(-2px);
  border-color: var(--emerald);
  background: #ffffff;
}

.phylum-card.active {
  background: linear-gradient(155deg, #ffffff 0%, #ecfdf5 100%);
  border-color: var(--emerald);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.14);
}

.phylum-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.phylum-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--emerald-dark);
  background: var(--emerald-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.visited-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--emerald);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.phylum-card.visited .visited-check,
.vert-btn.visited .visited-check {
  opacity: 1;
  transform: scale(1);
}

.phylum-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.phylum-tagline {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* =========================================================
   LAB WORKSPACE (CANVAS + INSPECTOR)
   ========================================================= */
.lab-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}

.canvas-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.canvas-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-main);
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 4px var(--emerald-soft);
  flex-shrink: 0;
}

.live-dot-rose {
  background: var(--rose);
  box-shadow: 0 0 0 4px var(--rose-soft);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.reptile-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.canvas-frame {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
}

.canvas-frame canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 660 / 360;
}

.canvas-frame-vert canvas {
  aspect-ratio: 680 / 370;
}

.canvas-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 13px;
  line-height: 1.48;
}

.blood-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 8px 12px;
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.swatch {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  display: inline-block;
}

.swatch-oxy {
  background: #dc2626;
}

.swatch-deoxy {
  background: #2563eb;
}

.swatch-mixed {
  background: #7c3aed;
}

/* =========================================================
   INSPECTOR CARD
   ========================================================= */
.inspector-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.inspector-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vert-head-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.inspector-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald-dark);
}

.badge-blue {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.thermo-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.thermo-cold {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.thermo-warm {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.inspector-card h3 {
  margin: 2px 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.inspector-sub {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}

.inspector-lead {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
}

.prop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.prop-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prop-item.prop-full {
  grid-column: 1 / -1;
}

.prop-label {
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.prop-val {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.38;
}

.exclusive-box {
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 12px;
  padding: 11px 13px;
}

.exclusive-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--violet-dark);
  margin-bottom: 6px;
}

.exclusive-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trap-box {
  background: var(--amber-tint);
  border: 1.5px solid #fcd34d;
  border-radius: 12px;
  padding: 11px 13px;
}

.trap-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--amber-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.trap-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.trap-box p {
  margin: 0;
  font-size: 0.84rem;
  color: #78350f;
  line-height: 1.45;
  font-weight: 600;
}

/* =========================================================
   TAB 2: VERTEBRATE CLASS SELECTOR BAR
   ========================================================= */
.vert-selector-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.vert-btn {
  text-align: left;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 11px 13px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.vert-btn:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  background: #ffffff;
}

.vert-btn.active {
  background: linear-gradient(155deg, #ffffff 0%, #eff6ff 100%);
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.vert-btn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.vert-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--blue-dark);
  background: var(--blue-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.vert-btn-name {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-main);
}

.vert-btn-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* =========================================================
   TABLES
   ========================================================= */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 13px;
}

.bio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: #ffffff;
}

.bio-table th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 800;
  text-align: left;
  padding: 11px 13px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

.bio-table td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.bio-table td strong {
  color: var(--text-main);
}

.bio-table tbody tr:last-child td {
  border-bottom: none;
}

.bio-table tbody tr:hover td {
  background: #f8fafc;
}

.tag-cold,
.tag-warm {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.tag-cold {
  background: #e0f2fe;
  color: #0369a1;
}

.tag-warm {
  background: #ffedd5;
  color: #c2410c;
}

/* =========================================================
   TAB 3: SUBTABS, GAME & MEB QUIZ
   ========================================================= */
.subtab-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.subtab-header h2 {
  margin: 4px 0 0;
  font-size: 1.22rem;
  font-weight: 800;
}

.subtab-bar {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  flex-wrap: wrap;
}

.subtab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.subtab-btn.active {
  background: #ffffff;
  color: var(--blue-dark);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

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

.game-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.specimen-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: 16px;
  padding: 20px 22px;
  text-align: center;
}

.specimen-tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--blue-dark);
  background: #ffffff;
  border: 1px solid #bfdbfe;
  padding: 3px 11px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.specimen-name {
  margin: 0 0 8px;
  font-size: 1.48rem;
  font-weight: 800;
  color: var(--text-main);
}

.specimen-clue {
  margin: 0 auto;
  max-width: 680px;
  font-size: 0.96rem;
  color: var(--text-muted);
}

.bucket-instruction {
  margin: 0;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.buckets-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.bucket-btn {
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 15px 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.bucket-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.bucket-btn:disabled {
  cursor: default;
  opacity: 0.88;
}

.bucket-invertebrate:hover:not(:disabled) {
  border-color: var(--emerald);
  background: var(--emerald-tint);
}

.bucket-cold:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue-tint);
}

.bucket-bird:hover:not(:disabled) {
  border-color: var(--amber);
  background: var(--amber-tint);
}

.bucket-mammal:hover:not(:disabled) {
  border-color: var(--violet);
  background: var(--violet-tint);
}

.bucket-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
}

.bucket-btn small {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.bucket-btn.is-correct,
.quiz-opt.is-correct {
  border-color: var(--emerald) !important;
  background: var(--emerald-tint) !important;
  color: var(--emerald-dark) !important;
}

.bucket-btn.is-wrong,
.quiz-opt.is-wrong {
  border-color: var(--rose) !important;
  background: var(--rose-tint) !important;
  color: var(--rose-dark) !important;
}

.feedback-banner {
  border-radius: 14px;
  padding: 15px 18px;
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.feedback-banner.ok {
  background: var(--emerald-tint);
  border-color: #6ee7b7;
}

.feedback-banner.err {
  background: var(--rose-tint);
  border-color: #fca5a5;
}

.feedback-head {
  font-size: 0.96rem;
  font-weight: 800;
}

.feedback-banner.ok .feedback-head {
  color: var(--emerald-dark);
}

.feedback-banner.err .feedback-head {
  color: var(--rose-dark);
}

.feedback-body {
  margin: 0;
  font-size: 0.89rem;
  color: var(--text-main);
  line-height: 1.5;
}

.summary-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 16px;
  padding: 26px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.summary-badge {
  background: var(--emerald);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.summary-badge-blue {
  background: var(--blue);
}

.summary-card h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
}

.summary-card p {
  margin: 0;
  max-width: 580px;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.summary-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

/* QUIZ STYLES */
.quiz-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.quiz-dot {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quiz-dot.current {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.quiz-dot.done-ok {
  border-color: var(--emerald);
  background: var(--emerald);
  color: #ffffff;
}

.quiz-dot.done-err {
  border-color: var(--rose);
  background: var(--rose);
  color: #ffffff;
}

.quiz-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
}

.quiz-topic-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--violet-dark);
  background: var(--violet-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.quiz-question {
  margin: 0 0 16px;
  font-size: 1.07rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.48;
}

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

.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}

.quiz-opt:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue-tint);
  transform: translateY(-1px);
}

.quiz-opt:disabled {
  cursor: default;
}

.opt-letter {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-opt.is-correct .opt-letter {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #ffffff;
}

.quiz-opt.is-wrong .opt-letter {
  background: var(--rose);
  border-color: var(--rose);
  color: #ffffff;
}

/* =========================================================
   FOOTER
   ========================================================= */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 6px 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* =========================================================
   RESPONSIVE (SMARTBOARD / TABLET / MOBILE)
   ========================================================= */
@media (max-width: 1100px) {
  .phylum-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lab-workspace {
    grid-template-columns: 1fr;
  }
  .buckets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .mode-nav {
    grid-template-columns: 1fr;
  }
  .vert-selector-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quiz-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .app-shell {
    padding: 10px 12px 24px;
  }
  .section-card {
    padding: 15px 14px;
  }
  .phylum-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vert-selector-bar {
    grid-template-columns: 1fr;
  }
  .prop-grid {
    grid-template-columns: 1fr;
  }
  .buckets-grid {
    grid-template-columns: 1fr;
  }
}
