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

  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-soft: #e0f2fe;
  --teal: #0d9488;
  --teal-soft: #ccfbf1;
  --emerald: #059669;
  --emerald-soft: #d1fae5;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --rose: #dc2626;
  --rose-soft: #fee2e2;
  --indigo: #4f46e5;
  --indigo-soft: #e0e7ff;

  --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% 6%, rgba(13, 148, 136, 0.14), transparent 36%),
    radial-gradient(circle at 92% 10%, rgba(37, 99, 235, 0.13), transparent 36%),
    var(--bg-page);
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

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

/* 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(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

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

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

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

.brand h1 {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.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: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--text-main);
  font-size: 0.92rem;
}

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

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

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 15px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s ease, background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

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

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.btn-icon-only {
  padding: 8px 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1, #0f766e);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.34);
}

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: #bae6fd;
}

.btn-soft:hover:not(:disabled) {
  background: #bae6fd;
}

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

.btn-ghost:hover:not(:disabled) {
  background: #e2e8f0;
}

/* Mode Nav */
.mode-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

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

.mode-tab:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.mode-tab.is-active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.14);
}

.mode-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

.mode-badge--clinic {
  background: #fee2e2;
  color: #b91c1c;
}

.mode-badge--match {
  background: #d1fae5;
  color: #047857;
}

.mode-badge--quiz {
  background: #fef3c7;
  color: #b45309;
}

.mode-badge--atlas {
  background: #e0e7ff;
  color: #4338ca;
}

.mode-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.mode-copy small {
  font-size: 0.77rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shared Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}

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

.card-top-bar h2 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
}

.panel-desc {
  margin: 3px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

.progress-bar-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0284c7, #10b981);
  transition: width 0.3s ease;
}

/* ========================================================================== */
/* MOD 1: MİNERAL KLİNİĞİ                                                     */
/* ========================================================================== */
.clinic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.92fr);
  gap: 16px;
  align-items: start;
}

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

.case-category-tag {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f766e;
  background: #ccfbf1;
  padding: 4px 10px;
  border-radius: 999px;
}

.clinic-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.patient-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 62%, #0f766e 100%);
  color: #ffffff;
  border-radius: 15px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.patient-avatar {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  flex-shrink: 0;
}

.patient-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7dd3fc;
  margin-bottom: 3px;
}

.patient-meta h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: #ffffff;
}

.patient-story {
  margin: 5px 0 0;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.clues-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.clue-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px 14px;
}

.clue-box--symptom {
  border-left: 4px solid var(--rose);
}

.clue-box--role {
  border-left: 4px solid var(--primary);
}

.clue-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.clue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-red {
  background: var(--rose);
}

.dot-blue {
  background: var(--primary);
}

.clue-box p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-main);
  font-weight: 500;
}

.hint-reveal {
  background: var(--amber-soft);
  border: 1px solid #fcd34d;
  color: #78350f;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.87rem;
  margin-bottom: 12px;
}

.diagnosis-dropzone {
  border: 2px dashed #94a3b8;
  background: #f8fafc;
  border-radius: 14px;
  padding: 16px 18px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.diagnosis-dropzone.is-dragover {
  border-color: var(--primary);
  background: #e0f2fe;
  transform: scale(1.01);
}

.diagnosis-dropzone.is-wrong {
  border-color: var(--rose);
  background: #fef2f2;
  animation: shake 0.36s ease;
}

.dropzone-prompt {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.dropzone-prompt strong {
  display: block;
  font-size: 0.95rem;
}

.dropzone-prompt p {
  margin: 2px 0 0;
  font-size: 0.83rem;
  color: var(--text-muted);
}

/* Clinic Feedback */
.clinic-feedback {
  margin-top: 14px;
  border-radius: 15px;
  border: 1px solid #a7f3d0;
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 42%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeSlideIn 0.25s ease;
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feedback-badge {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--emerald);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(5, 150, 105, 0.25);
}

.feedback-header h3 {
  margin: 0;
  font-size: 1.06rem;
  color: #065f46;
}

.feedback-header p {
  margin: 2px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.feedback-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mini-detail {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
}

.mini-detail span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.mini-detail p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-main);
}

/* Bonus Prescription Box */
.bonus-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
}

.bonus-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  margin-bottom: 10px;
}

.bonus-pill {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.74rem;
  font-weight: 800;
}

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

.bonus-opt-btn {
  appearance: none;
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 11px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.bonus-opt-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f0f9ff;
  transform: translateY(-1px);
}

.bonus-opt-btn.is-correct {
  border-color: var(--emerald);
  background: #d1fae5;
  color: #065f46;
}

.bonus-opt-btn.is-wrong {
  border-color: var(--rose);
  background: #fee2e2;
  color: #991b1b;
}

.bonus-result {
  margin: 8px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
}

/* Periodic Mineral Tray */
.tray-hint {
  margin: -4px 0 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.mineral-tray {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.element-tile {
  appearance: none;
  position: relative;
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: 13px;
  padding: 10px 8px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
}

.element-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 4px;
  border-radius: 0 0 6px 6px;
  background: var(--tile-accent, var(--primary));
}

.element-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--tile-accent, var(--primary));
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.element-tile:active:not(:disabled) {
  transform: scale(0.96);
}

.element-tile .el-num {
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-soft);
}

.element-tile .el-sym {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.15;
  color: var(--tile-accent, var(--text-main));
  margin-top: 4px;
}

.element-tile .el-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

.element-tile.is-solved {
  background: #f0fdf4;
  border-color: #86efac;
  opacity: 0.76;
}

.element-tile.is-solved::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 7px;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--emerald);
}

.element-tile.is-wrong-flash {
  background: #fef2f2;
  border-color: var(--rose);
  animation: shake 0.34s ease;
}

.element-tile.is-correct-flash {
  background: #d1fae5;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.tray-legend {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.77rem;
  color: var(--text-soft);
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.dot-done {
  background: #22c55e;
}

.dot-wrong {
  background: #ef4444;
}

/* ========================================================================== */
/* MOD 2: EŞLEŞTİRME MASASI                                                   */
/* ========================================================================== */
.match-top {
  align-items: flex-start;
}

.match-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pills {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 4px;
  flex-wrap: wrap;
}

.pill-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.pill-btn.is-active {
  background: var(--primary);
  color: #ffffff;
}

.match-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.match-progress-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.match-toast {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}

.match-toast.is-good {
  color: #047857;
}

.match-toast.is-bad {
  color: #b91c1c;
}

.match-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
  gap: 18px;
  align-items: start;
}

.column-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-card {
  appearance: none;
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: 13px;
  padding: 13px 15px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.match-card:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #f8fafc;
}

.match-card.is-selected {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
  transform: translateX(3px);
}

.match-card.is-matched {
  border-color: #34d399;
  background: #ecfdf5;
  cursor: default;
}

.match-card.is-wrong {
  border-color: var(--rose);
  background: #fef2f2;
  animation: shake 0.35s ease;
}

.match-sym-badge {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--tile-accent, var(--primary));
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 900;
  flex-shrink: 0;
}

.match-card-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
}

.match-card-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.match-clue-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-clue-tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
}

.tag-role {
  background: #dbeafe;
  color: #1d4ed8;
}

.tag-foods {
  background: #d1fae5;
  color: #047857;
}

.tag-deficiency {
  background: #fee2e2;
  color: #b91c1c;
}

.match-clue-text {
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--text-main);
}

.match-matched-chip {
  margin-left: auto;
  background: #10b981;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

.match-round-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.round-complete-banner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.round-icon {
  font-size: 1.6rem;
}

.round-complete-banner strong {
  display: block;
  font-size: 1rem;
  color: #065f46;
}

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

/* ========================================================================== */
/* MOD 3: HIZLI BİLGİ YARIŞMASI                                               */
/* ========================================================================== */
.quiz-shell {
  padding: 24px;
}

.quiz-start-view {
  max-width: 780px;
  margin: 8px auto;
  text-align: center;
}

.quiz-hero-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.quiz-start-view h2 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 800;
}

.quiz-intro {
  margin: 0 auto 22px;
  max-width: 600px;
  font-size: 0.94rem;
  color: var(--text-muted);
}

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

.quiz-mode-option {
  appearance: none;
  text-align: left;
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.quiz-mode-option:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: #f0f9ff;
  box-shadow: var(--shadow-md);
}

.qmo-icon {
  font-size: 1.8rem;
}

.quiz-mode-option strong {
  font-size: 1.08rem;
  color: var(--text-main);
}

.quiz-mode-option p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  flex: 1;
}

.qmo-cta {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-top: 6px;
}

.quiz-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.quiz-topic-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--indigo-soft);
  color: var(--indigo);
}

.quiz-hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-timer {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}

.quiz-timer.is-urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.quiz-mini-score {
  font-size: 0.86rem;
  color: var(--text-muted);
}

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

.quiz-question-card h3 {
  margin: 0 0 18px;
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--text-main);
}

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

.quiz-opt-btn {
  appearance: none;
  background: #ffffff;
  border: 2px solid var(--border-strong);
  border-radius: 13px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.12s ease;
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f0f9ff;
  transform: translateY(-1px);
}

.quiz-opt-letter {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

.quiz-opt-btn.is-correct {
  border-color: var(--emerald);
  background: #d1fae5;
  color: #065f46;
}

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

.quiz-opt-btn.is-wrong {
  border-color: var(--rose);
  background: #fee2e2;
  color: #991b1b;
}

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

.quiz-explain-box {
  margin-top: 14px;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.quiz-explain-box.is-correct {
  background: #ecfdf5;
  border-color: #86efac;
}

.quiz-explain-box.is-wrong {
  background: #fef2f2;
  border-color: #fca5a5;
}

.explain-content strong {
  display: block;
  font-size: 0.95rem;
}

.explain-content p {
  margin: 3px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Summary Views (Clinic & Quiz) */
.summary-view {
  text-align: center;
  padding: 12px 8px;
}

.summary-medal {
  font-size: 3rem;
  margin-bottom: 6px;
}

.summary-view h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.summary-desc {
  margin: 0 auto 18px;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.summary-stats-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.summary-stat {
  min-width: 140px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
}

.summary-stat strong {
  display: block;
  font-size: 1.35rem;
  color: var(--primary-dark);
}

.summary-stat span {
  font-size: 0.78rem;
  color: var(--text-soft);
  font-weight: 600;
}

.review-list {
  text-align: left;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.review-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--emerald);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.review-item.is-missed {
  border-left-color: var(--rose);
  background: #fff7f7;
}

.review-item strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.86rem;
}

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

/* ========================================================================== */
/* MOD 4: MİNERAL REHBERİ (ATLAS)                                             */
/* ========================================================================== */
.atlas-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.38fr);
  gap: 16px;
  align-items: start;
}

.atlas-filters {
  margin-bottom: 14px;
  width: 100%;
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.atlas-tile {
  appearance: none;
  position: relative;
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  border-radius: 13px;
  padding: 11px 8px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease;
}

.atlas-tile:hover {
  transform: translateY(-2px);
  border-color: var(--tile-accent, var(--primary));
}

.atlas-tile.is-selected {
  background: #ffffff;
  border-color: var(--tile-accent, var(--primary));
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.09);
}

.atlas-tile .el-num {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-soft);
}

.atlas-tile .el-sym {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--tile-accent, var(--primary));
  line-height: 1.15;
  margin-top: 3px;
}

.atlas-tile .el-name {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--text-main);
}

.atlas-tile.is-mastered::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 7px;
  font-size: 0.74rem;
  font-weight: 900;
  color: var(--emerald);
}

.atlas-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.atlas-symbol-tile {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  background: var(--tile-accent, var(--primary));
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.tile-atomic {
  position: absolute;
  top: 6px;
  left: 9px;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.88;
}

.tile-sym {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.tile-name {
  font-size: 0.74rem;
  font-weight: 700;
  margin-top: 3px;
  opacity: 0.94;
}

.atlas-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.atlas-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #e0f2fe;
}

.atlas-tag--soft {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
}

.atlas-hero-copy h2 {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 800;
}

.atlas-hero-copy p {
  margin: 5px 0 0;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.atlas-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.atlas-section {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px 15px;
}

.atlas-section--role {
  border-left: 4px solid var(--primary);
}

.atlas-section--foods {
  border-left: 4px solid var(--emerald);
}

.atlas-section--deficiency {
  border-left: 4px solid var(--rose);
}

.atlas-section h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.atlas-section ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.88rem;
  color: var(--text-main);
}

.food-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.food-chip {
  background: #ffffff;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.exam-tip-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.86rem;
  color: #78350f;
}

.exam-tip-box p {
  margin: 4px 0 0;
}

.atlas-footer-nav {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 1040px) {
  .mode-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clinic-layout,
  .atlas-layout {
    grid-template-columns: 1fr;
  }

  .mineral-tray,
  .atlas-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px 12px 24px;
  }

  .mode-nav,
  .clues-grid,
  .feedback-details-grid,
  .bonus-options,
  .match-board,
  .quiz-mode-cards,
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }

  .mineral-tray,
  .atlas-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .patient-banner,
  .atlas-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
