:root {
  --detective-primary: #854d0e;
  --detective-dark: #451a03;
  --detective-accent: #d97706;
  --detective-bg: #fefce8;
  --parchment: #fdfbf7;
  --ink-color: #1e293b;
  --evidence-yellow: #fef08a;
  --evidence-border: #eab308;
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --border-radius: 18px;
  --font-reading: Georgia, 'Times New Roman', serif;
  --font-ui: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body.lasdetektiven-game-page {
  font-family: var(--font-ui);
  background: linear-gradient(180deg, #fefce8 0%, #fef3c7 40%, #f8fafc 100%);
  min-height: 100vh;
  color: var(--ink-color);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow-x: hidden;
}

/* Navbar */
.detective-navbar {
  background: linear-gradient(135deg, #451a03 0%, #78350f 50%, #92400e 100%);
  color: #ffffff;
  padding: 12px 0;
  box-shadow: 0 4px 15px rgba(69, 26, 3, 0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.detective-brand {
  color: #ffffff;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detective-brand:hover {
  color: #fef08a;
  text-decoration: none;
}

.detective-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hud-pill {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 6px 14px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Difficulty Selector Bar */
.level-nav-bar {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  padding: 10px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.diff-chip-btn {
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  border-radius: 25px;
  padding: 6px 18px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.diff-chip-btn:hover {
  border-color: #d97706;
  color: #b45309;
}

.diff-chip-btn.active {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  border-color: #92400e;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
}

/* Case Dossier Header */
.case-dossier-card {
  background: #ffffff;
  border-radius: var(--border-radius);
  border: 3px solid #e2e8f0;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  position: relative;
}

.case-dossier-header {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-bottom: 2px solid #f59e0b;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Reading Passage Container */
.reading-passage-box {
  background: var(--parchment);
  border: 2px solid #fde68a;
  border-radius: 16px;
  padding: 28px 24px;
  margin: 20px;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
}

.reading-passage-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  background: #f59e0b;
  border-radius: 16px 0 0 16px;
}

.case-story-title {
  font-family: var(--font-reading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #451a03;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Interactive Text & Sentence Highlighting */
.passage-text {
  font-family: var(--font-reading);
  font-size: 1.25rem;
  line-height: 1.85;
  color: #1e293b;
  margin-bottom: 0;
}

.clickable-sentence {
  display: inline;
  padding: 2px 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

/* When in evidence-hunting step */
.step-evidence-hunting .clickable-sentence {
  cursor: pointer;
  border-bottom: 2px dashed #d97706;
}

.step-evidence-hunting .clickable-sentence:hover {
  background: #fef08a;
  color: #78350f;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
}

/* Marked correctly as evidence */
.clickable-sentence.is-evidence-highlight {
  background: #fef08a !important;
  color: #713f12 !important;
  font-weight: 700;
  border-bottom: 3px solid #ca8a04 !important;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.6) !important;
}

.clickable-sentence.is-wrong-click {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-bottom: 2px solid #ef4444 !important;
  animation: sentenceShake 0.4s ease;
}

@keyframes sentenceShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Step Phase Banner */
.phase-banner {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  color: #1e40af;
  border-radius: 12px;
  padding: 12px 18px;
  margin: 0 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
}

.phase-banner.phase-evidence {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.phase-banner.phase-solved {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

/* Question & Answer Box */
.question-section {
  padding: 0 20px 20px;
}

.question-prompt-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Multiple Choice Grid */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .answers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.answer-option-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 14px 18px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  font-size: 1.05rem;
  font-weight: 600;
  color: #334155;
  outline: none;
}

.answer-option-btn:hover {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.15);
}

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

.option-badge-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #475569;
  flex-shrink: 0;
}

.answer-option-btn:hover .option-badge-letter {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.answer-option-btn.selected-correct {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
}

.answer-option-btn.selected-correct .option-badge-letter {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

.answer-option-btn.selected-wrong {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

.answer-option-btn.selected-wrong .option-badge-letter {
  background: #ef4444 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

/* Feedback & Explanation Card */
.evidence-explanation-card {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 16px;
  animation: fadeIn 0.3s ease;
}

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

.explanation-title {
  font-weight: 800;
  color: #0f172a;
  font-size: 1.05rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sidebar / Detective Notebook */
.detective-notebook {
  background: #ffffff;
  border-radius: var(--border-radius);
  border: 3px solid #e2e8f0;
  box-shadow: var(--card-shadow);
  padding: 20px;
}

.notebook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 16px;
}

.rank-badge-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  margin-bottom: 16px;
}

.rank-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #78350f;
  margin-top: 4px;
}

.case-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
}

.case-checklist-item.done {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

/* Next Case Action Button */
.btn-next-case {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-next-case:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.4);
}

/* Victory Modal */
.modal-detective {
  border-radius: 20px;
  border: 3px solid #f59e0b;
  overflow: hidden;
}

.modal-detective .modal-header {
  background: linear-gradient(135deg, #78350f 0%, #b45309 100%);
  color: #ffffff;
  border-bottom: none;
}
