* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(76, 201, 240, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.12), transparent 28%),
    #060914;
  color: #f5f7ff;
  min-height: 100vh;
}

.hidden,
.screen.hidden {
  display: none !important;
}

.app {
  max-width: 1250px;
  margin: 0 auto;
  padding: 24px;
}

.top-bar,
.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.logo {
  margin: 0;
  font-size: 38px;
}

.tagline {
  margin: 4px 0 0;
  color: #b8c2df;
}

.stats {
  display: flex;
  gap: 14px;
  background: rgba(16, 26, 48, 0.95);
  border: 1px solid #30456f;
  padding: 14px 18px;
  border-radius: 18px;
  color: #ffd166;
  font-weight: bold;
}

button {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  background: linear-gradient(135deg, #4cc9f0, #4361ee);
  color: white;
  margin-top: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.nav-buttons button {
  margin-top: 0;
}

.secondary-button {
  background: #182943;
  border: 1px solid #3d5a86;
}

.compact-active {
  outline: 2px solid #ffd166;
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.22);
}

body.focus-mode {
  background:
    radial-gradient(circle at center, rgba(76, 201, 240, 0.12), transparent 45%),
    #050814;
}

body.focus-mode .game-dashboard,
body.focus-mode .investigation-grid,
body.focus-mode [data-panel="caseFile"] {
  opacity: 0.45;
}

body.focus-mode .layout {
  grid-template-columns: 1fr 1.2fr;
}

body.focus-mode .panel {
  box-shadow: 0 0 30px rgba(76, 201, 240, 0.18);
}

body.focus-mode .terminal-panel {
  border-color: #4cc9f0;
  box-shadow: 0 0 34px rgba(76, 201, 240, 0.25);
}

.focus-notice {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: rgba(16, 24, 39, 0.96);
  border: 1px solid #4cc9f0;
  color: white;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(76, 201, 240, 0.35);
  animation: focusNoticeIn 0.3s ease;
}

.mission-card,
.panel,
.win-screen,
.profile-box,
.mission-tile,
.status-panel,
.map-panel {
  background: rgba(12, 20, 38, 0.95);
  border: 1px solid #2d4169;
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.layout,
.investigation-grid,
.game-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.game-dashboard {
  margin-bottom: 24px;
}

.investigation-grid {
  margin-top: 24px;
}

.panel {
  min-height: 500px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.lead-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lead-action-row button {
  margin-top: 0;
}

.mode-box {
  background: #182943;
  border: 1px solid #3d5a86;
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 14px;
  color: #dce8ff;
}

.training-box {
  background: #111d34;
  border: 1px solid #34517d;
  border-left: 5px solid #4cc9f0;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 16px;
  color: #dce8ff;
  line-height: 1.5;
}

.objective-box {
  background: #101827;
  border: 1px solid #2c3d61;
  border-left: 5px solid #ffd166;
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.objective-box h3,
.mission-tile h3,
.status-panel h3,
.map-panel h3 {
  margin-top: 0;
}

.objective-box p,
.mission-card p,
.mission-tile p {
  color: #e4ebff;
  line-height: 1.5;
}

.hint-box {
  background: #201a35;
  border: 1px solid #7557c8;
  color: #ddd2ff;
  padding: 14px;
  border-radius: 14px;
  margin-top: 14px;
  line-height: 1.5;
}

textarea {
  width: 100%;
  height: 180px;
  resize: vertical;
  background: #050814;
  color: #9ef01a;
  border: 1px solid #34486f;
  border-radius: 16px;
  padding: 16px;
  font-size: 16px;
  font-family: Consolas, monospace;
  outline: none;
  line-height: 1.5;
}

textarea:focus {
  border-color: #4cc9f0;
  box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.12);
}

.result-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: #101827;
  border: 1px solid #2b3b5d;
  min-height: 100px;
  line-height: 1.5;
}

.success {
  border-color: #58d68d;
  color: #caffbf;
}

.error {
  border-color: #ff6b6b;
  color: #ffd6d6;
}

.partial {
  border-color: #ffd166;
  color: #fff2bf;
}

.table-title {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

th,
td {
  border: 1px solid #273858;
  padding: 10px;
  text-align: left;
}

th {
  background: #15213a;
  color: #4cc9f0;
}

td {
  background: #0c1324;
  color: #d9e2ff;
}

#queryResult {
  margin-top: 18px;
}

.clue-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.clue-list li {
  background: #101b31;
  border: 1px solid #263756;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  color: #8d99ae;
}

.clue-list li.current {
  color: #ffffff;
  border-color: #4cc9f0;
}

.clue-list li.unlocked {
  color: #ffffff;
  border-color: #ffd166;
  background: linear-gradient(135deg, #2a2140, #171f36);
  animation: cluePulse 0.8s ease;
}

.win-screen {
  margin-top: 24px;
  text-align: center;
  border-color: #58d68d;
  background:
    radial-gradient(circle at top, rgba(88, 214, 141, 0.18), transparent 40%),
    rgba(12, 20, 38, 0.98);
}

.win-screen h2 {
  color: #caffbf;
  font-size: 48px;
  margin-bottom: 8px;
}

.final-score {
  color: #ffd166;
  font-weight: bold;
  font-size: 22px;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.mission-tile.locked {
  opacity: 0.55;
}

.mission-tile:hover,
.suspect-card:hover,
.result-card:hover,
.evidence-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(76, 201, 240, 0.22);
}

.badge-row,
.difficulty-row,
.mission-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.badge,
.mission-pill {
  background: #17294a;
  border: 1px solid #385986;
  color: #dce8ff;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.difficulty-button {
  padding: 10px;
  font-size: 14px;
  margin-top: 0;
  flex: 1;
}

.difficulty-button.selected {
  outline: 3px solid #ffd166;
}

.profile-box {
  line-height: 1.7;
}

.profile-stat {
  background: #101827;
  border: 1px solid #2b3b5d;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.reward-list {
  display: grid;
  gap: 10px;
}

.reward-badge {
  background: #101827;
  border: 1px solid #2b3b5d;
  border-left: 5px solid #ffd166;
  padding: 12px;
  border-radius: 14px;
}

.reward-badge.locked {
  opacity: 0.45;
  border-left-color: #4cc9f0;
}

.xp-breakdown {
  background: #101827;
  border: 1px solid #2b3b5d;
  padding: 16px;
  border-radius: 14px;
  margin: 20px 0;
  text-align: left;
}

.timer-box {
  background: #2a1730;
  border: 1px solid #ff6b6b;
  color: #ffd6d6;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: bold;
  white-space: nowrap;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.status-grid div {
  background: #101827;
  border: 1px solid #2b3b5d;
  padding: 12px;
  border-radius: 14px;
}

.status-grid span {
  color: #9ba8c7;
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.status-grid strong {
  color: #ffd166;
}

.streak-level-2 {
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.26);
  border-color: #ffd166;
}

.streak-level-3 {
  animation: streakTerminalPulse 1s ease infinite;
  border-color: #4cc9f0;
}

.hot-streak-badge {
  margin-top: 12px;
  display: inline-block;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid #ffd166;
  color: #ffd166;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  animation: hotStreakPulse 1s ease infinite;
}

.map-locations {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.location-chip {
  background: #101827;
  border: 1px solid #30456f;
  border-radius: 14px;
  padding: 10px 12px;
  color: #dce8ff;
  transition: all 0.25s ease;
}

.location-chip.active {
  transform: scale(1.08);
  color: #ffd166;
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.1);
  animation: locationPulseLoop 1.2s infinite;
}

.map-active-burst {
  animation: mapBurst 1s ease, locationPulseLoop 1.2s infinite 1s;
}

.map-dimmed {
  opacity: 0.4;
}

.evidence-board {
  min-height: 180px;
  display: grid;
  gap: 12px;
}

.evidence-card {
  background: #101827;
  border: 1px solid #2b3b5d;
  border-left: 5px solid #ffd166;
  border-radius: 16px;
  padding: 14px;
}

.evidence-card.locked {
  opacity: 0.55;
  border-left-color: #4cc9f0;
}

.evidence-card.revealed {
  border-left-color: #58d68d;
  box-shadow: 0 0 18px rgba(88, 214, 141, 0.24);
}

.evidence-unlocked {
  animation: evidenceRevealDiscovery 0.55s ease;
}

.evidence-ring {
  position: relative;
  overflow: hidden;
}

.evidence-ring::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid rgba(0, 255, 200, 0.75);
  animation: evidenceRingPulse 0.75s ease;
  pointer-events: none;
}

.suspect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.suspect-card {
  background: #101827;
  border: 1px solid #2b3b5d;
  border-radius: 18px;
  padding: 14px;
  transition: all 0.25s ease;
}

.suspect-card:active {
  transform: scale(0.97);
}

.suspect-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #17294a;
  border-radius: 50%;
  font-size: 22px;
  margin-bottom: 10px;
}

.suspect-dimmed {
  opacity: 0.25;
  filter: blur(1.5px) grayscale(0.4);
  pointer-events: none;
  box-shadow: none;
}

.suspect-match-hidden {
  opacity: 0;
  transform: scale(0.9) translateY(10px);
}

.suspect-match {
  animation: revealSuspect 0.45s ease forwards;
}

.suspect-active {
  opacity: 1;
  border-color: #00ffc8;
  box-shadow: 0 0 18px rgba(0, 255, 200, 0.55);
}

.sql-feedback-panel {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #101827;
  border: 1px solid #2b3b5d;
  line-height: 1.5;
}

.feedback-title {
  display: flex;
  gap: 8px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #dce8ff;
}

#feedbackMessage {
  margin: 0;
}

.feedback-event-header,
.feedback-event-line,
.feedback-event-hint {
  display: block;
}

.feedback-event-header {
  font-size: 15px;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.feedback-event-line {
  color: #ffffff;
  font-weight: bold;
}

.feedback-event-hint {
  color: #dce8ff;
}

.feedback-issues {
  margin-top: 10px;
  color: #dce8ff;
}

.feedback-issues ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.feedback-issues li {
  margin-bottom: 3px;
}

.feedback-success {
  border-color: #58d68d;
  box-shadow: 0 0 24px rgba(88, 214, 141, 0.35);
  animation: feedbackSuccessPop 0.42s ease;
}

.feedback-warning {
  border-color: #ffd166;
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.28);
  animation: feedbackWarningPulse 0.6s ease;
}

.feedback-error {
  border-color: #ff6b6b;
  box-shadow: 0 0 22px rgba(255, 107, 107, 0.3);
}

.feedback-neutral {
  border-color: #2b3b5d;
}

.feedback-enter {
  animation: feedbackFadeIn 0.25s ease;
}

.feedback-shake {
  animation: feedbackErrorShake 0.35s ease;
}

.result-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.result-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: radial-gradient(circle at top left, rgba(76, 201, 240, 0.16), transparent 45%), #101827;
  border: 1px solid #3d5a86;
  border-left: 5px solid #4cc9f0;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 0 18px rgba(76, 201, 240, 0.16);
}

.result-card h3 {
  margin: 0 0 8px;
  color: #ffffff;
}

.result-card p {
  margin: 4px 0;
  color: #dce8ff;
  font-size: 14px;
}

.result-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: grid;
  place-items: center;
  background: #17294a;
  border: 1px solid #3d5a86;
  border-radius: 50%;
  font-size: 24px;
  box-shadow: 0 0 18px rgba(76, 201, 240, 0.18);
}

.result-card-enter {
  animation: resultCardEnter 0.35s ease;
}

#xp,
.xp-value {
  position: relative;
  display: inline-block;
}

.xp-pop {
  animation: xpPop 0.55s ease;
}

.floating-xp {
  position: absolute;
  margin-left: 8px;
  color: #58d68d;
  font-weight: 800;
  pointer-events: none;
  animation: floatingXp 0.9s ease forwards;
}

.terminal-success {
  animation: terminalSuccess 0.4s ease;
}

/* Collapsible Panels */

.collapsible-panel {
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.collapsible-header h2,
.collapsible-header h3 {
  margin: 0;
}

.collapse-toggle {
  width: auto;
  min-width: 92px;
  margin-top: 0;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 999px;
  background: #182943;
  border: 1px solid #3d5a86;
}

.collapsible-content {
  max-height: 900px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.25s ease;
  margin-top: 14px;
}

.collapsible-panel.collapsed .collapsible-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.table-collapse-panel {
  margin-top: 24px;
}

/* Lesson Modal */

.lesson-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(5, 10, 20, 0.84);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.lesson-card {
  width: min(720px, 92vw);
  max-height: 82vh;
  overflow-y: auto;
  background: rgba(12, 20, 38, 0.98);
  border: 1px solid #4cc9f0;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 0 34px rgba(76, 201, 240, 0.25);
}

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

.lesson-header h2 {
  margin: 0;
}

.lesson-content {
  line-height: 1.65;
  color: #e4ebff;
}

.lesson-content code {
  display: block;
  background: #050814;
  color: #9ef01a;
  border: 1px solid #34486f;
  border-radius: 14px;
  padding: 14px;
  white-space: pre-wrap;
  margin: 12px 0;
}

/* Intro Overlay */

.mission-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: rgba(5, 10, 20, 0.93);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.mission-intro-card {
  width: min(700px, 92vw);
  background: radial-gradient(circle at top left, rgba(76, 201, 240, 0.15), transparent 40%), rgba(12, 20, 38, 0.98);
  border: 1px solid #4cc9f0;
  border-radius: 28px;
  padding: 34px;
  box-shadow: 0 0 44px rgba(76, 201, 240, 0.25);
}

.mission-intro-card h1 {
  margin-top: 0;
  font-size: 36px;
}

.intro-lines {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.intro-line {
  opacity: 0;
  transform: translateY(10px);
  color: #dce8ff;
  font-size: 18px;
  line-height: 1.5;
  animation: introLineIn 0.45s ease forwards;
}

.intro-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Reward Popup */

.reward-popup {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10001;
  display: grid;
  gap: 4px;
  background: rgba(16, 24, 39, 0.98);
  border: 1px solid #ffd166;
  border-left: 6px solid #ffd166;
  color: white;
  padding: 16px 18px;
  border-radius: 18px;
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.32);
  animation: rewardPopupIn 0.35s ease;
}

.reward-popup strong {
  color: #ffd166;
}

/* Victory Overlay */

.victory-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 10, 20, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
}

.victory-overlay.hidden {
  display: none !important;
}

.victory-live {
  animation: victoryOverlayIn 0.35s ease forwards;
}

.victory-main {
  text-align: center;
  animation: victoryMainPop 0.55s ease forwards;
}

.victory-main h1 {
  margin: 0;
  font-size: 56px;
  letter-spacing: 5px;
  color: #00ffc8;
  text-shadow: 0 0 28px rgba(0, 255, 200, 0.9);
}

.victory-main h2 {
  margin-top: 18px;
  font-size: 38px;
  color: white;
  opacity: 0;
  animation: victoryNameAppear 0.45s ease forwards;
  animation-delay: 0.55s;
}

.victory-results {
  margin-top: 34px;
  width: min(520px, 90vw);
  opacity: 0;
  transform: translateY(24px);
}

.victory-results.show {
  animation: victoryResultsIn 0.5s ease forwards;
}

.clean-results-card {
  padding: 24px;
  border-radius: 22px;
  border: 1px solid rgba(0, 255, 200, 0.45);
  background: rgba(10, 18, 32, 0.96);
  box-shadow: 0 0 34px rgba(0, 255, 200, 0.28);
}

.clean-results-card h3 {
  margin-top: 0;
}

.breakdown-toggle {
  margin-top: 14px;
  width: 100%;
}

.xp-breakdown-details {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(76, 201, 240, 0.25);
  background: rgba(16, 24, 39, 0.7);
}

.victory-button-row {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

/* Animations */

@keyframes focusNoticeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes introLineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rewardPopupIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hotStreakPulse {
  0% {
    box-shadow: 0 0 0 rgba(255, 209, 102, 0.2);
  }

  50% {
    box-shadow: 0 0 22px rgba(255, 209, 102, 0.55);
  }

  100% {
    box-shadow: 0 0 0 rgba(255, 209, 102, 0.2);
  }
}

@keyframes streakTerminalPulse {
  0% {
    box-shadow: 0 0 10px rgba(76, 201, 240, 0.16);
  }

  50% {
    box-shadow: 0 0 34px rgba(76, 201, 240, 0.4);
  }

  100% {
    box-shadow: 0 0 10px rgba(76, 201, 240, 0.16);
  }
}

@keyframes cluePulse {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 0 rgba(255, 209, 102, 0);
  }

  50% {
    transform: scale(1.01);
    box-shadow: 0 0 25px rgba(255, 209, 102, 0.22);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 209, 102, 0);
  }
}

@keyframes feedbackFadeIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes feedbackErrorShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@keyframes feedbackWarningPulse {
  0% {
    box-shadow: 0 0 0 rgba(255, 209, 102, 0);
  }

  50% {
    box-shadow: 0 0 28px rgba(255, 209, 102, 0.42);
  }

  100% {
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.24);
  }
}

@keyframes feedbackSuccessPop {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(88, 214, 141, 0);
  }

  50% {
    transform: scale(1.025);
    box-shadow: 0 0 32px rgba(88, 214, 141, 0.48);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes resultCardEnter {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes revealSuspect {
  0% {
    transform: scale(0.9) translateY(10px);
    opacity: 0;
    box-shadow: 0 0 0 rgba(0, 255, 200, 0);
  }

  50% {
    transform: scale(1.05) translateY(0);
    opacity: 1;
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.9);
  }

  100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 8px rgba(0, 255, 200, 0.5);
  }
}

@keyframes mapBurst {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 200, 0, 0.3);
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(255, 200, 0, 0.95);
  }

  100% {
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(255, 200, 0, 0.55);
  }
}

@keyframes locationPulseLoop {
  0% {
    box-shadow: 0 0 6px rgba(255, 200, 0, 0.45);
  }

  50% {
    box-shadow: 0 0 22px rgba(255, 200, 0, 0.95);
  }

  100% {
    box-shadow: 0 0 6px rgba(255, 200, 0, 0.45);
  }
}

@keyframes evidenceRevealDiscovery {
  0% {
    transform: translateX(-20px);
    opacity: 0;
    box-shadow: 0 0 0 rgba(0, 255, 200, 0);
  }

  70% {
    transform: translateX(5px);
    opacity: 1;
    box-shadow: 0 0 28px rgba(0, 255, 200, 0.55);
  }

  100% {
    transform: translateX(0);
    opacity: 1;
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.25);
  }
}

@keyframes evidenceRingPulse {
  0% {
    opacity: 1;
    transform: scale(0.92);
  }

  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

@keyframes xpPop {
  0% {
    transform: scale(1);
    text-shadow: none;
  }

  45% {
    transform: scale(1.22);
    text-shadow: 0 0 18px rgba(88, 214, 141, 0.8);
  }

  100% {
    transform: scale(1);
    text-shadow: none;
  }
}

@keyframes floatingXp {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.9);
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-24px) scale(1.05);
  }
}

@keyframes terminalSuccess {
  0% {
    box-shadow: 0 0 0 rgba(0, 255, 100, 0);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 24px rgba(0, 255, 100, 0.85);
    transform: scale(1.02);
  }

  100% {
    box-shadow: 0 0 8px rgba(0, 255, 100, 0.4);
    transform: scale(1);
  }
}

@keyframes victoryOverlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes victoryMainPop {
  0% {
    transform: scale(0.88);
    opacity: 0;
  }

  55% {
    transform: scale(1.08);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

@keyframes victoryNameAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes victoryResultsIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */

@media (max-width: 900px) {
  .layout,
  .top-bar,
  .nav-buttons,
  .investigation-grid,
  .game-dashboard,
  .hero-card {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats {
    justify-content: space-between;
  }

  .lead-action-row,
  .intro-button-row {
    grid-template-columns: 1fr;
  }

  .victory-main h1 {
    font-size: 38px;
  }

  .victory-main h2 {
    font-size: 28px;
  }
}

/* Settings Menu */

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(5, 10, 20, 0.72);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.settings-card {
  width: min(420px, 92vw);
  background: rgba(12, 20, 38, 0.98);
  border: 1px solid #3d5a86;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 0 34px rgba(76, 201, 240, 0.22);
}

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

.settings-header h2 {
  margin: 0;
}

.settings-card button {
  margin-top: 12px;
}

.settings-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.danger-button {
  background: linear-gradient(135deg, #ff6b6b, #b33939);
  color: white;
}

.danger-card {
  border-color: #ff6b6b;
  box-shadow: 0 0 34px rgba(255, 107, 107, 0.22);
}

/* =========================
   MULTI TABLE DATABASE VIEW
========================= */

.database-table-block {
  margin-bottom: 20px;
}

.database-table-block h3 {
  margin-bottom: 6px;
  color: #4cc9f0;
}

.database-table-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.database-table-block th,
.database-table-block td {
  border: 1px solid #2b3b5d;
  padding: 6px;
  text-align: left;
}

/* =========================
   DECISION SYSTEM (FINAL STEP)
========================= */

.decision-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.decision-card {
  background: #101827;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid #4cc9f0;
  width: 420px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.decision-card h2 {
  margin-bottom: 10px;
}

.decision-options {
  margin: 20px 0;
}

.decision-option {
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #2b3b5d;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.decision-option:hover {
  background: rgba(76, 201, 240, 0.1);
}

.decision-option.selected {
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.15);
}

/* =========================
   EVIDENCE UPGRADE FEEL
========================= */

.evidence-card {
  transition: 0.3s ease;
}

.evidence-card.revealed {
  border-color: #4cc9f0;
  background: rgba(76, 201, 240, 0.05);
}

.evidence-unlocked {
  animation: pulseGlow 0.8s ease;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0px #4cc9f0; }
  50% { box-shadow: 0 0 12px #4cc9f0; }
  100% { box-shadow: 0 0 0px #4cc9f0; }
}

/* =========================
   SUSPECT HIGHLIGHTING
========================= */

.suspect-card {
  transition: 0.25s ease;
}

.suspect-active {
  border: 1px solid #4cc9f0;
  transform: scale(1.03);
}

.suspect-dimmed {
  opacity: 0.3;
}

/* =========================
   TERMINAL FEEDBACK BOOST
========================= */

.terminal-success {
  animation: successFlash 0.4s ease;
}

@keyframes successFlash {
  0% { box-shadow: 0 0 0px #00ff99; }
  50% { box-shadow: 0 0 15px #00ff99; }
  100% { box-shadow: 0 0 0px #00ff99; }
}

/* =========================
   FADE IN
========================= */

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================
   DISCOVERY SYSTEM UPGRADE
========================= */

.discovery-grid {
  margin-top: 18px;
}

.discovered-facts-list {
  margin: 0;
  padding-left: 20px;
}

.discovered-facts-list li {
  margin-bottom: 10px;
  line-height: 1.45;
}

.case-timeline-list {
  display: grid;
  gap: 10px;
}

.case-timeline-entry {
  padding: 12px;
  border-left: 4px solid #4cc9f0;
  background: rgba(8, 16, 33, 0.86);
  border-radius: 12px;
  line-height: 1.45;
}

.case-timeline-entry strong {
  color: #ffd166;
}

.evidence-card.clickable-evidence {
  cursor: pointer;
}

.evidence-card.clickable-evidence:hover {
  transform: scale(1.02);
  border-color: #4cc9f0;
  box-shadow: 0 0 24px rgba(76, 201, 240, 0.28);
}

.evidence-detail-card,
.discovery-moment-card {
  border-color: #4cc9f0;
  box-shadow: 0 0 44px rgba(76, 201, 240, 0.24);
}

.evidence-detail-section {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(8, 16, 33, 0.72);
  border: 1px solid rgba(76, 201, 240, 0.18);
}

.evidence-detail-section h3 {
  margin-top: 0;
  color: #ffd166;
}

.evidence-related-clues {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 209, 102, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.18);
}

.discovery-moment-card {
  text-align: center;
  max-width: 680px;
}

.discovery-moment-card h2 {
  color: #ffd166;
}

.discovery-moment-card p {
  font-size: 1.08rem;
  line-height: 1.65;
}

.suspect-evidence-tags {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.suspect-evidence-tags div {
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.investigation-finding {
  padding: 14px;
  margin: 12px 0;
  border-radius: 16px;
  background: rgba(76, 201, 240, 0.09);
  border: 1px solid rgba(76, 201, 240, 0.24);
}

.investigation-finding strong {
  color: #ffd166;
}


/* =========================
   LEARN MODE + FULL UPDATE PATCH
========================= */

.learn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.learn-filter.selected {
  background: #ffd166;
  color: #111827;
}

.learn-mode-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.learn-lesson-card {
  background: rgba(12, 20, 38, 0.96);
  border: 1px solid #2d4169;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.learn-lesson-card.learn-completed {
  border-color: #58d68d;
  box-shadow: 0 0 24px rgba(88, 214, 141, 0.18);
}

.learn-lesson-top,
.learn-button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.learn-practice-input {
  width: 100%;
  min-height: 110px;
  background: #050814;
  color: #9ef01a;
  border: 1px solid #34486f;
  border-radius: 14px;
  padding: 12px;
  margin-top: 8px;
}

.learn-lesson-card pre {
  background: #050814;
  color: #9ef01a;
  border: 1px solid #34486f;
  border-radius: 14px;
  padding: 14px;
  white-space: pre-wrap;
}

.learn-practice-feedback {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #0b1222;
  border: 1px solid #34486f;
}

.learn-practice-feedback.success {
  border-color: #58d68d;
}

.learn-practice-feedback.warn {
  border-color: #ffd166;
}


/* =========================
   SQL VISUALIZER
========================= */

.sql-visualizer-panel {
  margin-top: 16px;
  background: #0b1222;
  border: 1px solid #34486f;
  border-radius: 18px;
  padding: 14px;
}

.sql-visualizer {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.visual-step {
  background: #081021;
  border: 1px solid #26395f;
  border-radius: 14px;
  padding: 12px;
}

.visual-step strong {
  color: #ffd166;
}

.visual-step p {
  margin: 6px 0 0;
  color: #dce8ff;
}

.visual-step.warning {
  border-color: #ffd166;
}

.visual-step.result {
  border-color: #58d68d;
}


/* =========================
   SQL DATABASE TRACE VIEW
   Add-only V5 feature: shows what SQL did to the database.
========================= */

.query-inspector-panel {
  margin-top: 16px;
  background: #0b1222;
  border: 1px solid #34486f;
  border-radius: 18px;
  padding: 14px;
}

.query-inspector {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.inspector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.inspector-grid div,
.inspector-section,
.inspector-join-note,
.inspector-warning,
.inspector-empty {
  background: #081021;
  border: 1px solid #26395f;
  border-radius: 14px;
  padding: 12px;
}

.inspector-grid span {
  display: block;
  color: #9ba8c7;
  font-size: 12px;
  margin-bottom: 6px;
}

.inspector-grid strong,
.inspector-section h4 {
  color: #ffd166;
}

.inspector-section h4 {
  margin: 0 0 8px;
}

.inspector-section ul {
  margin: 0;
  padding-left: 20px;
}

.inspector-records {
  display: grid;
  gap: 8px;
}

.inspector-record {
  display: grid;
  gap: 4px;
  background: rgba(76, 201, 240, 0.08);
  border: 1px solid rgba(76, 201, 240, 0.22);
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
}

.inspector-no-rows {
  color: #ffd166;
  margin: 0;
}

.table-trace-note {
  margin: 4px 0 8px;
  color: #ffd166;
  font-size: 12px;
}

.database-row-scanned td {
  background: rgba(255, 209, 102, 0.05);
}

.database-row-matched td {
  background: rgba(88, 214, 141, 0.16);
  border-color: rgba(88, 214, 141, 0.55);
  color: #f4fff8;
  box-shadow: inset 0 0 0 1px rgba(88, 214, 141, 0.12);
}

.database-row-matched {
  animation: databaseRowMatched 0.65s ease;
}

@keyframes databaseRowMatched {
  0% {
    transform: scale(0.99);
    box-shadow: 0 0 0 rgba(88, 214, 141, 0);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 0 0 18px rgba(88, 214, 141, 0.35);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(88, 214, 141, 0);
  }
}

@media (max-width: 900px) {
  .inspector-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================
   SQL MASTERY PATH LEARN MODE
   Add-only course layout. Keeps Story Mode untouched.
========================= */

.learn-progress-panel {
  background: rgba(12, 20, 38, 0.96);
  border: 1px solid #2d4169;
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.learn-progress-panel h2 {
  margin: 0 0 8px;
  color: #ffffff;
}

.learn-progress-panel p {
  color: #dce8ff;
  line-height: 1.5;
  margin: 0 0 14px;
}

.learn-progress-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.learn-progress-stats span,
.section-progress-pill {
  background: #17294a;
  border: 1px solid #385986;
  color: #dce8ff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.learn-progress-bar,
.section-progress-bar {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #050814;
  border: 1px solid #34486f;
}

.learn-progress-bar div,
.section-progress-bar div {
  height: 100%;
  background: linear-gradient(135deg, #4cc9f0, #58d68d);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.learn-course-path {
  display: grid;
  gap: 24px;
}

.learn-section-card {
  background: rgba(12, 20, 38, 0.95);
  border: 1px solid #2d4169;
  border-radius: 26px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

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

.learn-section-kicker {
  display: inline-block;
  color: #ffd166;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 6px;
}

.learn-section-header h3 {
  margin: 0 0 8px;
  font-size: 26px;
}

.learn-section-header p {
  margin: 0;
  color: #dce8ff;
  line-height: 1.5;
}

.learn-section-lessons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.course-lesson-card {
  display: flex;
  flex-direction: column;
  min-height: 285px;
  border-left: 5px solid #4cc9f0;
}

.course-lesson-card.learn-completed {
  border-left-color: #58d68d;
}

.lesson-card-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.lesson-number {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.4);
  color: #ffd166;
  font-weight: 900;
}

.difficulty-badge {
  border-color: #7557c8;
  background: #201a35;
}

.lesson-meta-grid {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(5, 8, 20, 0.55);
  border: 1px solid rgba(76, 201, 240, 0.12);
  font-size: 14px;
  color: #dce8ff;
}

.course-lesson-card p {
  color: #dce8ff;
  line-height: 1.5;
  flex: 1;
}

.course-lesson-card button {
  margin-top: auto;
}

.learn-detail-card {
  width: min(820px, 94vw);
}

.learn-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.learn-detail-section {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(8, 16, 33, 0.76);
  border: 1px solid rgba(76, 201, 240, 0.18);
}

.learn-detail-section h3 {
  margin-top: 0;
  color: #ffd166;
}

.learn-detail-section p,
.learn-detail-section li {
  line-height: 1.55;
  color: #e4ebff;
}

.learn-detail-section pre {
  background: #050814;
  color: #9ef01a;
  border: 1px solid #34486f;
  border-radius: 14px;
  padding: 14px;
  white-space: pre-wrap;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .learn-section-header {
    flex-direction: column;
  }

  .learn-section-lessons {
    grid-template-columns: 1fr;
  }
}

/* Course view should stack sections vertically instead of using the old card pile grid. */
.learn-mode-box {
  display: block;
}

/* =========================
   COLLAPSIBLE SQL MASTERY CHECKPOINTS
========================= */

.learn-toolbar {
  display: none !important;
}

.collapsible-course-path {
  display: grid;
  gap: 16px;
}

.learn-section-card.collapsed .learn-section-lessons,
.learn-section-card.collapsed .checkpoint-card {
  display: none;
}

.compact-section-header {
  align-items: center;
}

.section-title-block {
  flex: 1;
}

.section-status-block {
  min-width: 240px;
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.section-toggle-button {
  width: 100%;
  margin-top: 0;
}

.checkpoint-pill {
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  border: 1px solid #3d5a86;
  background: rgba(24, 41, 67, 0.75);
  color: #dce8ff;
}

.checkpoint-pill.passed {
  color: #caffbf;
  border-color: #58d68d;
  background: rgba(88, 214, 141, 0.1);
}

.checkpoint-pill.not-passed {
  color: #fff2bf;
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.08);
}

.checkpoint-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.08), rgba(76, 201, 240, 0.08)), #101827;
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-left: 5px solid #ffd166;
}

.checkpoint-card.checkpoint-passed {
  border-left-color: #58d68d;
  border-color: rgba(88, 214, 141, 0.35);
}

.checkpoint-modal-card {
  width: min(860px, 94vw);
}

.checkpoint-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.checkpoint-status-row span {
  padding: 8px 10px;
  border-radius: 999px;
  background: #17294a;
  border: 1px solid #385986;
  color: #dce8ff;
  font-weight: 800;
  font-size: 13px;
}

.checkpoint-question-card h3 {
  color: #ffffff;
  line-height: 1.45;
}

.checkpoint-results-card {
  padding: 18px;
  border-radius: 18px;
  margin-bottom: 18px;
  border: 1px solid #2b3b5d;
  background: rgba(8, 16, 33, 0.78);
}

.checkpoint-results-card.passed {
  border-color: #58d68d;
  box-shadow: 0 0 24px rgba(88, 214, 141, 0.18);
}

.checkpoint-results-card.failed {
  border-color: #ff6b6b;
  box-shadow: 0 0 24px rgba(255, 107, 107, 0.14);
}

.mastery-dashboard-panel .learn-progress-stats {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

@media (max-width: 900px) {
  .compact-section-header {
    align-items: stretch;
  }

  .section-status-block {
    min-width: 0;
  }
}

/* =========================
   REAL SQL PIPELINE VISUALIZER
   Add-only upgrade: shows table shrinkage step by step.
========================= */

.sql-pipeline {
  display: grid;
  gap: 10px;
}

.pipeline-node {
  background: radial-gradient(circle at top left, rgba(76, 201, 240, 0.1), transparent 44%), #081021;
  border: 1px solid #26395f;
  border-radius: 16px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  animation: pipelineNodeIn 0.28s ease both;
}

.pipeline-node::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #4cc9f0;
  opacity: 0.9;
}

.pipeline-start::before {
  background: #4cc9f0;
}

.pipeline-join::before {
  background: #b388ff;
}

.pipeline-select::before {
  background: #ffd166;
}

.pipeline-result::before {
  background: #58d68d;
}

.pipeline-warning::before {
  background: #ff6b6b;
}

.pipeline-label {
  display: inline-block;
  color: #9ef01a;
  font-family: Consolas, monospace;
  font-weight: 800;
  margin-bottom: 6px;
}

.pipeline-node strong {
  display: block;
  color: #ffd166;
  font-size: 18px;
  margin-bottom: 6px;
}

.pipeline-node p {
  color: #dce8ff;
  margin: 6px 0;
  line-height: 1.45;
}

.pipeline-node code {
  color: #9ef01a;
  background: rgba(5, 8, 20, 0.85);
  border: 1px solid #34486f;
  border-radius: 8px;
  padding: 2px 6px;
}

.pipeline-arrow {
  text-align: center;
  color: #4cc9f0;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 0 16px rgba(76, 201, 240, 0.6);
}

.pipeline-row-sample {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.pipeline-mini-row {
  display: grid;
  gap: 3px;
  background: rgba(76, 201, 240, 0.08);
  border: 1px solid rgba(76, 201, 240, 0.2);
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
}

.pipeline-mini-row strong {
  font-size: 13px;
  margin-bottom: 2px;
  color: #ffffff;
}

.pipeline-mini-row span {
  color: #dce8ff;
}

.pipeline-row-sample em,
.pipeline-empty {
  color: #ffd166;
  font-size: 12px;
  margin: 0;
}

.pipeline-no-filter {
  border-color: #ffd166;
}

.pipeline-result {
  border-color: #58d68d;
  box-shadow: 0 0 20px rgba(88, 214, 141, 0.18);
}

@keyframes pipelineNodeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   OPTION A CHECKPOINT LOCKING
========================= */

.checkpoint-card.checkpoint-locked {
  opacity: 0.78;
  border-left-color: #7d8aa8;
  border-color: rgba(125, 138, 168, 0.35);
  background: linear-gradient(135deg, rgba(125, 138, 168, 0.08), rgba(76, 201, 240, 0.04)), #101827;
}

.checkpoint-lock-note {
  color: #b8c2df;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(125, 138, 168, 0.1);
  border: 1px solid rgba(125, 138, 168, 0.22);
}

.checkpoint-card.checkpoint-locked button:disabled {
  background: #26344f;
  color: #9ba8c7;
  opacity: 0.7;
}

/* =========================
   AHA MOMENT SYSTEM
========================= */

.aha-toast {
  position: fixed;
  right: 24px;
  top: 92px;
  z-index: 10050;
  width: min(430px, calc(100vw - 48px));
  padding: 18px;
  border-radius: 22px;
  background: rgba(7, 12, 24, 0.97);
  border: 1px solid rgba(76, 201, 240, 0.45);
  box-shadow: 0 0 38px rgba(76, 201, 240, 0.25);
  animation: ahaToastIn 0.32s ease forwards;
  overflow: hidden;
}

.aha-toast::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-120%);
  animation: ahaScan 1.4s ease forwards;
  pointer-events: none;
}

.aha-toast-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffd166;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.aha-toast-header span {
  font-size: 1.4rem;
}

.aha-toast-lines {
  display: grid;
  gap: 8px;
}

.aha-toast-lines p {
  margin: 0;
  color: #f5f7ff;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  animation: ahaLineIn 0.34s ease forwards;
}

.aha-toast-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.09);
  color: #9ba8c7;
  font-size: 0.88rem;
}

.aha-toast.aha-impossible,
.aha-toast.aha-timeline {
  border-color: rgba(255, 107, 107, 0.7);
  box-shadow: 0 0 42px rgba(255, 107, 107, 0.26);
}

.aha-toast.aha-contradiction,
.aha-toast.aha-cross {
  border-color: rgba(255, 209, 102, 0.72);
  box-shadow: 0 0 42px rgba(255, 209, 102, 0.24);
}

.aha-toast.aha-expansion,
.aha-toast.aha-named {
  border-color: rgba(0, 255, 200, 0.52);
  box-shadow: 0 0 42px rgba(0, 255, 200, 0.2);
}

.aha-toast-out {
  animation: ahaToastOut 0.42s ease forwards;
}

.aha-screen-flash::after,
.aha-screen-glitch::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10020;
  pointer-events: none;
  opacity: 0;
}

.aha-screen-flash::after {
  background: radial-gradient(circle at center, rgba(76, 201, 240, 0.18), transparent 55%);
  animation: ahaScreenFlash 0.75s ease;
}

.aha-screen-glitch::after {
  background:
    repeating-linear-gradient(0deg, rgba(255, 107, 107, 0.08), rgba(255, 107, 107, 0.08) 2px, transparent 2px, transparent 7px),
    radial-gradient(circle at center, rgba(255, 107, 107, 0.14), transparent 58%);
  animation: ahaScreenGlitch 0.85s steps(6);
}

.aha-terminal-pulse {
  animation: ahaTerminalPulse 0.8s ease;
}

.aha-timeline-shake {
  animation: ahaTimelineShake 0.42s ease;
}

.aha-evidence-glow {
  animation: ahaEvidenceGlow 0.95s ease;
}

@keyframes ahaToastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes ahaToastOut {
  to { opacity: 0; transform: translateX(24px) scale(0.97); }
}

@keyframes ahaLineIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ahaScan {
  to { transform: translateX(120%); }
}

@keyframes ahaScreenFlash {
  0% { opacity: 0; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes ahaScreenGlitch {
  0% { opacity: 0; transform: translateX(0); }
  20% { opacity: 1; transform: translateX(-2px); }
  40% { opacity: 0.65; transform: translateX(3px); }
  60% { opacity: 0.9; transform: translateX(-1px); }
  100% { opacity: 0; transform: translateX(0); }
}

@keyframes ahaTerminalPulse {
  0% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); transform: scale(1); }
  45% { box-shadow: 0 0 34px rgba(255, 209, 102, 0.4); transform: scale(1.012); }
  100% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); transform: scale(1); }
}

@keyframes ahaTimelineShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes ahaEvidenceGlow {
  0% { box-shadow: 0 0 0 rgba(0, 255, 200, 0); }
  45% { box-shadow: 0 0 36px rgba(0, 255, 200, 0.34); }
  100% { box-shadow: 0 0 0 rgba(0, 255, 200, 0); }
}

@media (max-width: 700px) {
  .aha-toast {
    left: 16px;
    right: 16px;
    top: 78px;
    width: auto;
  }
}

/* =========================
   OPTIONAL LEARN → STORY READINESS
========================= */

.mission-readiness {
  margin: 16px 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(8, 16, 33, 0.72);
  border: 1px solid rgba(76, 201, 240, 0.22);
  line-height: 1.45;
}

.mission-readiness.ready {
  border-color: rgba(88, 214, 141, 0.6);
  box-shadow: 0 0 18px rgba(88, 214, 141, 0.12);
}

.mission-readiness.recommended {
  border-color: rgba(255, 209, 102, 0.65);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.12);
}

.mission-readiness.early {
  border-color: rgba(255, 107, 107, 0.55);
  box-shadow: 0 0 18px rgba(255, 107, 107, 0.1);
}

.readiness-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  color: #dce8ff;
}

.readiness-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(76, 201, 240, 0.14);
  border: 1px solid rgba(76, 201, 240, 0.35);
  color: #ffffff;
  font-size: 0.85rem;
}

.mission-readiness.ready .readiness-badge {
  background: rgba(88, 214, 141, 0.16);
  border-color: rgba(88, 214, 141, 0.45);
}

.mission-readiness.recommended .readiness-badge {
  background: rgba(255, 209, 102, 0.16);
  border-color: rgba(255, 209, 102, 0.45);
}

.mission-readiness.early .readiness-badge {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.4);
}

.readiness-bar {
  height: 9px;
  margin: 10px 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.readiness-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #4cc9f0, #58d68d);
  transition: width 0.3s ease;
}

.mission-readiness.recommended .readiness-bar span {
  background: linear-gradient(135deg, #ffd166, #4cc9f0);
}

.mission-readiness.early .readiness-bar span {
  background: linear-gradient(135deg, #ff6b6b, #ffd166);
}

.readiness-missing ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.readiness-missing li {
  margin-bottom: 4px;
  color: #dce8ff;
}

.readiness-complete {
  color: #caffbf;
  font-weight: 700;
}


.readiness-toggle {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.readiness-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  animation: readinessDetailsIn 0.22s ease;
}

.mission-readiness:not(.readiness-open) {
  padding-bottom: 12px;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.readiness-learn-button {
  margin-top: 10px;
}

.readiness-note {
  margin: 10px 0 0;
  color: #9ba8c7;
  font-size: 0.92rem;
}

/* =========================
   PORTFOLIO MODE
========================= */

.portfolio-hero-actions {
  min-width: 240px;
}

.portfolio-box {
  display: grid;
  gap: 18px;
}

.portfolio-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.portfolio-stat-card,
.portfolio-name-card,
.portfolio-report-item,
.portfolio-howto {
  background: rgba(12, 20, 38, 0.95);
  border: 1px solid #2d4169;
  border-radius: 20px;
  padding: 18px;
}

.portfolio-stat-card {
  display: grid;
  gap: 8px;
}

.portfolio-stat-card span {
  color: #ffd166;
  font-size: 28px;
  font-weight: 900;
}

.portfolio-name-value {
  margin: 8px 0 4px;
  font-size: 20px;
  font-weight: 800;
  color: #f5f7ff;
}

.portfolio-name-note {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

.portfolio-report-list {
  display: grid;
  gap: 12px;
}

.portfolio-report-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.portfolio-report-item p {
  margin: 6px 0 0;
  color: #b8c2df;
}

.portfolio-report-item button {
  width: auto;
  min-width: 150px;
  margin-top: 0;
}

.portfolio-report-card {
  width: min(920px, 94vw);
}

.portfolio-report-content {
  background: #050814;
  border: 1px solid #34486f;
  border-radius: 16px;
  padding: 16px;
  max-height: 55vh;
  overflow: auto;
}

.portfolio-report-content pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: Consolas, monospace;
  color: #e4ebff;
  line-height: 1.5;
}

.portfolio-verify-card {
  width: min(640px, 94vw);
}

.portfolio-verify-intro {
  color: #b8c2df;
  margin: 4px 0 12px;
  font-size: 14px;
}

.portfolio-verify-input {
  width: 100%;
  min-height: 220px;
  background: #050814;
  color: #e4ebff;
  border: 1px solid #34486f;
  border-radius: 14px;
  padding: 12px;
  font-family: Consolas, monospace;
  font-size: 13px;
  margin-bottom: 12px;
  resize: vertical;
}

.portfolio-verify-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #34486f;
}

.portfolio-verify-result p {
  margin: 6px 0 0;
  color: #dce8ff;
}

.portfolio-verify-neutral {
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

.portfolio-verify-match {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.portfolio-verify-mismatch {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.portfolio-verify-codes code {
  background: rgba(5, 8, 20, 0.6);
  padding: 2px 6px;
  border-radius: 6px;
  color: #e4ebff;
}

.portfolio-export-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.portfolio-export-row button {
  margin-top: 0;
  font-size: 14px;
  padding: 12px;
}

@media (max-width: 900px) {
  .portfolio-name-card,
  .portfolio-report-item,
  .portfolio-export-row {
    grid-template-columns: 1fr;
  }

  .portfolio-report-item button,
  .portfolio-name-card button {
    width: 100%;
  }
}

/* =========================
   LANGUAGE SETTINGS RESTORE
========================= */

.settings-field {
  margin: 12px 0;
}

.language-setting-row label {
  display: block;
  margin-bottom: 8px;
  color: #dce8ff;
  font-weight: 800;
}

.language-select {
  width: 100%;
  border: 1px solid #3d5a86;
  border-radius: 14px;
  background: #101827;
  color: #f5f7ff;
  padding: 12px;
  font-size: 15px;
  outline: none;
}

.language-select:focus {
  border-color: #4cc9f0;
  box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.12);
}

.rtl-language {
  direction: rtl;
}

/* =========================
   ACCOUNTS
========================= */

.account-card {
  width: min(420px, 92vw);
}

.account-modal-intro {
  color: #b8c2df;
  margin: 0 0 14px;
  font-size: 14px;
}

.account-signup-note {
  color: #8391ad;
  margin: 4px 0 14px;
  font-size: 12px;
  line-height: 1.5;
}

.settings-field label {
  display: block;
  margin-bottom: 6px;
  color: #dce8ff;
  font-weight: 700;
  font-size: 13px;
}

.settings-field input[type="email"],
.settings-field input[type="password"],
.settings-field input[type="text"] {
  width: 100%;
  border: 1px solid #3d5a86;
  border-radius: 12px;
  background: #101827;
  color: #f5f7ff;
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.settings-field input:focus {
  border-color: #4cc9f0;
  box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.12);
}

.account-google-button {
  width: 100%;
  background: #f5f7ff;
  color: #1f2937;
  font-weight: 700;
}

.account-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #6b7c9c;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.account-divider::before,
.account-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #2d3f5f;
}

.account-form-error {
  color: #fca5a5;
  font-size: 13px;
  margin: 10px 0 0;
}

.account-form-notice {
  color: #86efac;
  font-size: 13px;
  margin: 10px 0 0;
}

.account-email-display {
  font-weight: 800;
  font-size: 16px;
  color: #f5f7ff;
  margin: 0 0 14px;
}

.account-sync-status {
  color: #86efac;
  font-size: 13px;
  margin: 0;
}

.rtl-language table,
.rtl-language textarea,
.rtl-language pre,
.rtl-language code {
  direction: ltr;
  text-align: left;
}


/* =========================
   SKILL IDENTITY SYSTEM
========================= */

.skill-identity-card {
  background: radial-gradient(circle at top left, rgba(255, 209, 102, 0.16), transparent 42%), #101827;
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-left: 6px solid #ffd166;
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 0 28px rgba(255, 209, 102, 0.12);
}

.skill-identity-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.skill-identity-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 209, 102, 0.13);
  border: 1px solid rgba(255, 209, 102, 0.34);
  font-size: 26px;
}

.skill-identity-label {
  margin: 0 0 4px;
  color: #ffd166;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.skill-identity-card h3 {
  margin: 0;
  font-size: 1.55rem;
}

.skill-identity-card p {
  color: #e4ebff;
  line-height: 1.5;
}

.skill-identity-meter,
.mini-meter {
  width: 100%;
  height: 12px;
  background: #050814;
  border: 1px solid #30456f;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}

.skill-identity-meter div,
.mini-meter div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd166, #4cc9f0);
}

.skill-identity-small {
  font-size: 0.94rem;
  margin: 8px 0;
}

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

.skill-identity-mini {
  background: rgba(5, 8, 20, 0.7);
  border: 1px solid #2b3b5d;
  border-radius: 16px;
  padding: 12px;
}

.skill-identity-mini strong,
.skill-identity-mini span {
  display: block;
}

.skill-identity-mini span {
  color: #ffd166;
  font-weight: 900;
  margin-top: 4px;
}

/* =========================
   EVIDENCE SYSTEM UPGRADE
========================= */

.evidence-board-intro {
  padding: 14px;
  border-radius: 16px;
  background: rgba(76, 201, 240, 0.08);
  border: 1px solid rgba(76, 201, 240, 0.2);
  margin-bottom: 14px;
}

.evidence-board-intro p {
  margin: 6px 0 0;
  color: #dce8ff;
}

.evidence-category-block {
  margin-bottom: 18px;
}

.evidence-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(8, 16, 33, 0.88);
  border: 1px solid rgba(76, 201, 240, 0.2);
  margin-bottom: 10px;
}

.evidence-category-header span {
  color: #ffd166;
  font-weight: 900;
}

.evidence-category-header small {
  color: #b8c2df;
}

.evidence-category-grid {
  display: grid;
  gap: 12px;
}

.evidence-card-topline,
.connection-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.evidence-category-chip,
.evidence-mark-pill,
.evidence-card-links span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(76, 201, 240, 0.12);
  border: 1px solid rgba(76, 201, 240, 0.25);
  color: #dce8ff;
}

.evidence-mark-pill.mark-suspicious {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.45);
  color: #ffd6d6;
}

.evidence-mark-pill.mark-relevant {
  background: rgba(255, 209, 102, 0.14);
  border-color: rgba(255, 209, 102, 0.45);
  color: #fff2bf;
}

.evidence-mark-pill.mark-confirmed {
  background: rgba(88, 214, 141, 0.14);
  border-color: rgba(88, 214, 141, 0.45);
  color: #caffbf;
}

.evidence-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.evidence-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.evidence-action-btn {
  width: auto;
  margin-top: 0;
  padding: 8px 9px;
  border-radius: 12px;
  font-size: 12px;
  background: #182943;
  border: 1px solid #3d5a86;
}

.use-evidence-btn.active,
.selected-for-deduction {
  border-color: #ffd166 !important;
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.24) !important;
}

.use-evidence-btn.active {
  background: rgba(255, 209, 102, 0.2);
  color: #fff2bf;
}

.evidence-connection-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: radial-gradient(circle at top left, rgba(255, 209, 102, 0.10), transparent 48%), #101827;
  border: 1px solid rgba(255, 209, 102, 0.25);
}

.connection-header span {
  color: #ffd166;
  font-size: 13px;
}

.connection-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(8, 16, 33, 0.72);
  border: 1px solid rgba(76, 201, 240, 0.18);
  margin-top: 10px;
}

.connection-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #dce8ff;
}

.evidence-connections.empty {
  padding: 12px;
  color: #b8c2df;
}

.final-deduction-instruction {
  color: #ffd166;
  margin-top: 0;
}

.final-selected-evidence {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 209, 102, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.2);
}

.final-selected-evidence ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

@media (max-width: 900px) {
  .evidence-actions {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================
   AHA MODAL LOCK FIX
   Keeps contradiction/AHA story moments open until Continue is pressed.
========================= */

.aha-modal-card {
  position: relative;
  overflow: hidden;
  border-width: 1px;
  box-shadow: 0 0 48px rgba(76, 201, 240, 0.3);
}

.aha-modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-120%);
  animation: ahaScan 1.4s ease forwards;
  pointer-events: none;
}

.aha-modal-card.aha-impossible,
.aha-modal-card.aha-timeline {
  border-color: rgba(255, 107, 107, 0.85);
  box-shadow: 0 0 52px rgba(255, 107, 107, 0.28);
}

.aha-modal-card.aha-contradiction,
.aha-modal-card.aha-cross {
  border-color: rgba(255, 209, 102, 0.85);
  box-shadow: 0 0 52px rgba(255, 209, 102, 0.24);
}

.aha-modal-card.aha-expansion,
.aha-modal-card.aha-named {
  border-color: rgba(76, 201, 240, 0.85);
  box-shadow: 0 0 52px rgba(76, 201, 240, 0.28);
}

.aha-modal-kicker,
.aha-modal-line,
.aha-modal-footer {
  display: block;
}

.aha-modal-kicker {
  margin-bottom: 16px;
  color: #58d68d;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.88rem;
}

.aha-modal-line {
  margin: 10px 0;
  color: #f5f7ff;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(8px);
  animation: ahaLineIn 0.34s ease forwards;
}

.aha-modal-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #b8c2df;
  font-size: 0.95rem;
}

.aha-toast-continue {
  margin-top: 16px;
}

/* =========================
   PORTFOLIO MODE POLISH
========================= */

.portfolio-polish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 18px 0;
}

.portfolio-action-stack {
  display: grid;
  gap: 10px;
}

.portfolio-action-stack button,
.portfolio-view-tabs button,
.portfolio-export-row button {
  margin-top: 0;
}

.portfolio-report-preview {
  color: #b8c2df;
  margin-top: 6px;
}

.portfolio-view-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.portfolio-professional-report {
  background: #f8fafc;
  color: #111827;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.portfolio-professional-report section,
.portfolio-report-cover {
  padding: 22px;
  border-bottom: 1px solid #dbe3ef;
}

.portfolio-professional-report section:last-child {
  border-bottom: 0;
}

.portfolio-report-kicker {
  margin: 0 0 6px;
  color: #2563eb;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.portfolio-report-cover h1 {
  margin: 0 0 8px;
  color: #0f172a;
}

.portfolio-report-cover p,
.portfolio-professional-report p,
.portfolio-professional-report li {
  color: #334155;
}

.portfolio-report-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.portfolio-report-meta span {
  display: block;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px;
}

.portfolio-report-meta strong {
  display: block;
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.portfolio-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

.portfolio-chip-row span {
  display: inline-block;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.portfolio-callout {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 5px solid #3b82f6;
  border-radius: 12px;
  padding: 14px;
  color: #1e3a8a;
}

.portfolio-report-verification-note {
  margin: 4px 22px 22px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
  font-size: 12px;
  color: #64748b;
}

.portfolio-query-block {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.portfolio-query-block h3 {
  margin-top: 0;
  color: #0f172a;
}

.portfolio-query-block pre,
.portfolio-report-content pre {
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #dbe3ef;
  border-left: 3px solid #2563eb;
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
}

.portfolio-export-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

/* =========================
   VISUAL INVESTIGATION MAP UPGRADE
========================= */

.investigation-map-world {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(76, 201, 240, 0.10), transparent 40%),
    rgba(5, 10, 20, 0.62);
  border: 1px solid rgba(76, 201, 240, 0.18);
  overflow: hidden;
}

.map-route-line {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(76, 201, 240, 0.22), transparent);
  pointer-events: none;
}

.map-location-node {
  position: relative;
  z-index: 1;
  min-height: 106px;
  display: grid;
  gap: 5px;
  place-items: center;
  margin-top: 0;
  padding: 14px 10px;
  border-radius: 18px;
  background: rgba(16, 24, 39, 0.92);
  border: 1px solid rgba(61, 90, 134, 0.9);
  color: #e4ebff;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.02);
}

.map-location-node:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: #4cc9f0;
  box-shadow: 0 0 20px rgba(76, 201, 240, 0.22);
}

.map-node-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(76, 201, 240, 0.12);
  border: 1px solid rgba(76, 201, 240, 0.24);
  font-size: 22px;
}

.map-node-title {
  font-weight: 900;
  font-size: 13px;
  text-align: center;
}

.map-node-meta {
  color: #9ba8c7;
  font-size: 11px;
  text-align: center;
}

.map-location-node.active {
  color: #ffffff;
  border-color: #ffd166;
  background:
    radial-gradient(circle at top, rgba(255, 209, 102, 0.18), transparent 55%),
    rgba(20, 25, 42, 0.96);
  box-shadow: 0 0 26px rgba(255, 209, 102, 0.30);
}

.map-location-node.active .map-node-icon {
  border-color: #ffd166;
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.28);
}

.map-node-locked {
  opacity: 0.54;
}

.map-story-trace {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(8, 16, 33, 0.82);
  border: 1px solid rgba(76, 201, 240, 0.22);
  color: #dce8ff;
  line-height: 1.45;
}

.map-story-trace strong {
  color: #ffd166;
}

.map-signal-success .map-location-node.active {
  animation: mapNodePulse 1.2s ease infinite;
}

.map-signal-partial .map-location-node.active {
  border-color: #ffd166;
  animation: mapNodePartial 0.95s ease infinite;
}

.map-signal-alert .map-location-node.active,
.map-signal-glitch .map-location-node.active {
  border-color: #ff6b6b;
  box-shadow: 0 0 28px rgba(255, 107, 107, 0.34);
}

.map-signal-alert .map-location-node.active {
  animation: mapNodeAlert 0.72s ease infinite;
}

.map-signal-glitch .map-location-node.active {
  animation: mapNodeGlitch 0.36s steps(2, end) infinite;
}

.map-signal-spread .map-location-node.active {
  animation: mapNodeSpread 1s ease infinite;
}

.map-panel-aha-pulse {
  animation: mapPanelAhaPulse 0.8s ease;
}

@keyframes mapNodePulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.025); }
}

@keyframes mapNodePartial {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 209, 102, 0.18); }
  50% { box-shadow: 0 0 26px rgba(255, 209, 102, 0.38); }
}

@keyframes mapNodeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

@keyframes mapNodeGlitch {
  0% { transform: translate(0, 0); filter: hue-rotate(0deg); }
  25% { transform: translate(-2px, 1px); filter: hue-rotate(20deg); }
  50% { transform: translate(2px, -1px); filter: hue-rotate(-20deg); }
  75% { transform: translate(-1px, -1px); filter: hue-rotate(10deg); }
  100% { transform: translate(0, 0); filter: hue-rotate(0deg); }
}

@keyframes mapNodeSpread {
  0% { box-shadow: 0 0 0 rgba(76, 201, 240, 0.15); }
  50% { box-shadow: 0 0 30px rgba(76, 201, 240, 0.42); }
  100% { box-shadow: 0 0 0 rgba(76, 201, 240, 0.15); }
}

@keyframes mapPanelAhaPulse {
  0% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); }
  50% { box-shadow: 0 0 34px rgba(255, 209, 102, 0.32); }
  100% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); }
}

/* =========================
   ADAPTIVE DIFFICULTY + SMART HINT ENGINE
========================= */
.adaptive-profile-card {
  border-left: 5px solid #9b5cff;
  background:
    radial-gradient(circle at top left, rgba(155, 92, 255, 0.14), transparent 38%),
    #101827;
}

.adaptive-profile-card p {
  margin: 8px 0;
  color: #dce8ff;
}

.adaptive-meter-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.adaptive-meter-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 0.92rem;
}

.adaptive-meter-row span {
  color: #dce8ff;
  font-weight: 700;
}

.adaptive-meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(155, 92, 255, 0.24);
}

.adaptive-meter div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4cc9f0, #9b5cff, #ffd166);
  transition: width 0.35s ease;
}


/* =========================
   PLAY MODE SYSTEM
========================= */
.mode-row {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px;
}

.mode-button::before {
  margin-right: 4px;
}

.mode-button[data-difficulty="training"]::before { content: "🟢"; }
.mode-button[data-difficulty="adaptive"]::before { content: "🔵"; }
.mode-button[data-difficulty="challenge"]::before { content: "🔴"; }

/* =========================
   CHALLENGE MODE TIMER + SCORING POLISH
========================= */

.challenge-timer {
  border-color: #ff6b6b;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.22), rgba(255, 209, 102, 0.12));
  color: #fff2bf;
  box-shadow: 0 0 22px rgba(255, 107, 107, 0.28);
  animation: challengeTimerPulse 1.4s ease-in-out infinite;
}

.timer-warning {
  color: #ffffff;
  border-color: #ff3b3b;
  box-shadow: 0 0 30px rgba(255, 59, 59, 0.55);
  animation: challengeWarningPulse 0.7s ease-in-out infinite;
}

.challenge-best-line {
  color: #ffd166;
  font-weight: 700;
}

.mode-button[data-difficulty="challenge"].selected {
  border-color: #ff6b6b;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.35);
}

@keyframes challengeTimerPulse {
  0% { transform: scale(1); box-shadow: 0 0 12px rgba(255, 107, 107, 0.22); }
  50% { transform: scale(1.025); box-shadow: 0 0 26px rgba(255, 107, 107, 0.42); }
  100% { transform: scale(1); box-shadow: 0 0 12px rgba(255, 107, 107, 0.22); }
}

@keyframes challengeWarningPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}


/* =========================
   POLISH PACK: FINAL UX PASS
   Non-destructive visual cleanup.
========================= */
:root {
  --questify-soft-border: rgba(76, 201, 240, 0.22);
  --questify-panel-glow: rgba(76, 201, 240, 0.16);
  --questify-warning-glow: rgba(255, 209, 102, 0.24);
  --questify-success-glow: rgba(88, 214, 141, 0.24);
}

.polish-pack .screen {
  opacity: 1;
}

.polish-pack .screen-live {
  animation: polishScreenIn 0.22s ease both;
}

.nav-active {
  outline: 2px solid rgba(255, 209, 102, 0.75);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.16);
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
.decision-option:focus-visible,
.evidence-card:focus-visible {
  outline: 3px solid rgba(255, 209, 102, 0.9);
  outline-offset: 3px;
}

.button-pressed {
  animation: polishButtonPress 0.2s ease;
}

.polish-pack .mission-card,
.polish-pack .panel,
.polish-pack .status-panel,
.polish-pack .map-panel,
.polish-pack .profile-box,
.polish-pack .mission-tile {
  backdrop-filter: blur(8px);
}

.polish-pack .lesson-card,
.polish-pack .settings-card,
.polish-pack .decision-card {
  width: min(780px, calc(100vw - 32px));
  max-height: min(84vh, 820px);
  overflow-y: auto;
}

.polish-pack .decision-card {
  max-width: 620px;
}

.polish-pack .lesson-modal,
.polish-pack .settings-modal,
.polish-pack .decision-overlay,
.polish-pack .mission-intro-overlay {
  padding: 18px;
}

.polish-pack .feedback-success,
.polish-pack .evidence-card.revealed,
.polish-pack .learn-lesson-card.learn-completed {
  box-shadow: 0 0 22px var(--questify-success-glow);
}

.polish-pack .feedback-warning,
.polish-pack .timer-warning,
.polish-pack .challenge-timer-warning {
  box-shadow: 0 0 22px var(--questify-warning-glow);
}

.polish-empty-state {
  color: #9ba8c7;
  border: 1px dashed rgba(76, 201, 240, 0.2);
  background: rgba(8, 16, 33, 0.42);
  border-radius: 14px;
  padding: 14px;
  line-height: 1.45;
}

.table-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  scrollbar-width: thin;
}

.table-scroll-wrap table {
  min-width: 520px;
}

.polish-pack .sql-visualizer-panel,
.polish-pack .database-trace-panel,
.polish-pack .pipeline-visualizer,
.polish-pack .portfolio-card,
.polish-pack .readiness-card,
.polish-pack .case-connections-panel {
  border-color: var(--questify-soft-border);
}

.polish-pack .visual-step,
.polish-pack .pipeline-step,
.polish-pack .trace-step {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.polish-pack .visual-step:hover,
.polish-pack .pipeline-step:hover,
.polish-pack .trace-step:hover {
  transform: translateY(-1px);
  border-color: rgba(76, 201, 240, 0.55);
  box-shadow: 0 0 18px var(--questify-panel-glow);
}

.polish-pack .reward-popup,
.polish-pack .focus-notice {
  max-width: calc(100vw - 32px);
}

.polish-build-badge {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12000;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(12, 20, 38, 0.96);
  border: 1px solid rgba(76, 201, 240, 0.4);
  color: #dce8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 0 24px rgba(76, 201, 240, 0.2);
  animation: polishBadgeIn 0.28s ease both;
  pointer-events: none;
}

.polish-build-badge.fade-out {
  animation: polishBadgeOut 0.45s ease both;
}

.portfolio-report-content,
.lesson-content,
.evidence-detail-section,
.discovery-moment-card p {
  overflow-wrap: anywhere;
}

.portfolio-export-row,
.settings-button-row,
.victory-button-row,
.learn-button-row {
  align-items: stretch;
}

.portfolio-export-row button,
.settings-button-row button,
.victory-button-row button,
.learn-button-row button {
  min-height: 44px;
}

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

@keyframes polishButtonPress {
  0% { transform: scale(1); }
  50% { transform: scale(0.975); }
  100% { transform: scale(1); }
}

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

@keyframes polishBadgeOut {
  to { opacity: 0; transform: translateY(10px); }
}

@media (max-width: 760px) {
  .app {
    padding: 14px;
  }

  .logo {
    font-size: 30px;
  }

  .stats,
  .status-grid,
  .portfolio-export-row,
  .settings-button-row,
  .victory-button-row,
  .learn-button-row,
  .mission-pill-row {
    grid-template-columns: 1fr !important;
    display: grid;
  }

  .nav-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .nav-buttons button {
    font-size: 14px;
    padding: 12px 10px;
  }

  .mission-card,
  .panel,
  .profile-box,
  .mission-tile,
  .status-panel,
  .map-panel {
    padding: 16px;
    border-radius: 18px;
  }

  textarea {
    min-height: 150px;
    font-size: 14px;
  }

  .decision-card,
  .lesson-card,
  .settings-card {
    padding: 18px;
    border-radius: 18px;
  }
}

@media (max-width: 480px) {
  .nav-buttons {
    grid-template-columns: 1fr;
  }

  .top-bar,
  .hero-card {
    gap: 10px;
  }

  .logo {
    font-size: 26px;
  }

  button {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  body {
    background: white !important;
    color: #111 !important;
  }

  .top-bar,
  .nav-buttons,
  .settings-modal,
  .reward-popup,
  .polish-build-badge,
  button {
    display: none !important;
  }

  .portfolio-report-content,
  .lesson-card,
  .mission-card,
  .panel {
    color: #111 !important;
    background: white !important;
    box-shadow: none !important;
    border-color: #ddd !important;
  }
}


/* =========================
   V2 STORYLINE UI — PHANTOM ACCESS CASE
========================= */
.storyline-header-card {
  grid-column: 1 / -1;
  border-color: rgba(255, 209, 102, 0.65);
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.14), transparent 38%),
    radial-gradient(circle at bottom right, rgba(76, 201, 240, 0.13), transparent 34%),
    rgba(12, 20, 38, 0.98);
  box-shadow: 0 0 34px rgba(255, 209, 102, 0.16);
}

.storyline-title-wrap h2,
.storyline-header-card h2 {
  color: #ffd166;
  font-size: clamp(28px, 4vw, 42px);
  margin: 6px 0 8px;
}

.storyline-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: #06101f;
  background: linear-gradient(135deg, #ffd166, #4cc9f0);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.storyline-header-card p {
  color: #e4ebff;
  max-width: 850px;
}

.storyline-progress-row,
.storyline-mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.storyline-arc-note {
  margin-bottom: 0;
  color: #b8c2df;
  font-size: 0.95rem;
}

.storyline-mini-row .mission-pill {
  border-color: rgba(255, 209, 102, 0.55);
  color: #ffd166;
  background: rgba(255, 209, 102, 0.08);
}

.intro-storyline-label {
  display: inline-block;
  color: #06101f;
  background: linear-gradient(135deg, #ffd166, #4cc9f0);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

#introTitle small {
  display: block;
  margin-top: 10px;
  color: #dce8ff;
  font-size: 0.48em;
  font-weight: 700;
  letter-spacing: 0;
}

.portfolio-report-kicker {
  color: #ffd166;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
}


/* =========================
   QUESTIFY V2.1 REAL EVIDENCE BOARD WORKSPACE
   SQL-backed evidence cards + right-side detail panel
========================= */

.evidence-workspace-section {
  margin-top: 24px;
}

.evidence-board-subtitle {
  margin: 6px 0 0;
  color: #b8c2df;
  font-size: 0.95rem;
}

.evidence-workspace {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
  gap: 18px;
  align-items: stretch;
}

.evidence-board-zones {
  min-height: 520px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.evidence-zone {
  background: rgba(8, 16, 33, 0.82);
  border: 1px solid rgba(76, 201, 240, 0.18);
  border-radius: 20px;
  padding: 14px;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

.evidence-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top left, rgba(76, 201, 240, 0.08), transparent 45%);
}

.evidence-zone-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.evidence-zone-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #ffd166;
}

.evidence-zone-count {
  color: #9ba8c7;
  font-size: 0.8rem;
  background: #101827;
  border: 1px solid #26395f;
  border-radius: 999px;
  padding: 4px 8px;
}

.evidence-zone-content {
  position: relative;
  display: grid;
  gap: 10px;
}

.evidence-empty-zone {
  color: #8d99ae;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px;
  font-size: 0.9rem;
}

.evidence-card.board-card {
  position: relative;
  border-left-width: 5px;
  cursor: pointer;
  opacity: 0.38;
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.evidence-card.board-card.active-evidence {
  opacity: 1;
  border-color: #00ffc8;
  border-left-color: #00ffc8;
  box-shadow: 0 0 22px rgba(0, 255, 200, 0.35);
  animation: evidenceActivePulse 0.65s ease;
}

.evidence-card.board-card.dimmed-evidence {
  opacity: 0.28;
  filter: grayscale(0.25);
}

.evidence-card.board-card.linked-evidence::after {
  content: "linked";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.68rem;
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.4);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255, 209, 102, 0.08);
}

.evidence-card.board-card:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(76, 201, 240, 0.28);
}

.evidence-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 48px;
}

.evidence-type-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #17294a;
  border: 1px solid #3d5a86;
}

.evidence-card.board-card strong {
  color: #ffffff;
}

.evidence-card-meta,
.evidence-card-hint {
  margin-top: 8px;
  color: #dce8ff;
  font-size: 0.86rem;
  line-height: 1.35;
}

.evidence-card-hint {
  color: #ffd166;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}

.evidence-card.board-card:hover .evidence-card-hint {
  opacity: 1;
  max-height: 50px;
}

.evidence-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.evidence-chip {
  font-size: 0.72rem;
  color: #dce8ff;
  background: #17294a;
  border: 1px solid #385986;
  border-radius: 999px;
  padding: 4px 7px;
}

.evidence-detail-side-panel {
  background: rgba(8, 16, 33, 0.92);
  border: 1px solid rgba(76, 201, 240, 0.22);
  border-radius: 20px;
  padding: 18px;
  min-height: 520px;
  position: sticky;
  top: 18px;
  align-self: start;
}

.evidence-detail-side-panel h3 {
  margin: 0 0 12px;
  color: #ffd166;
}

.evidence-detail-content {
  color: #e4ebff;
  line-height: 1.55;
}

.evidence-detail-content pre {
  background: #050814;
  color: #9ef01a;
  border: 1px solid #34486f;
  border-radius: 14px;
  padding: 12px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.evidence-detail-section.side-detail-section {
  margin-bottom: 12px;
  padding: 12px;
}

.evidence-connection-strip {
  grid-column: 1 / -1;
  background: rgba(255, 209, 102, 0.07);
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: 18px;
  padding: 12px 14px;
}

.evidence-connection-strip strong {
  color: #ffd166;
}

.evidence-connection-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #dce8ff;
}

@keyframes evidenceActivePulse {
  0% { transform: scale(0.98); box-shadow: 0 0 0 rgba(0, 255, 200, 0); }
  55% { transform: scale(1.015); box-shadow: 0 0 28px rgba(0, 255, 200, 0.55); }
  100% { transform: scale(1); }
}

@media (max-width: 1000px) {
  .evidence-workspace {
    grid-template-columns: 1fr;
  }
  .evidence-detail-side-panel {
    position: relative;
    top: 0;
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .evidence-board-zones {
    grid-template-columns: 1fr;
  }
}


/* =========================
   QUESTIFY V2.2 SMART EVIDENCE MERGE
   Auto zones, card types, hover hints, selected relationships
========================= */

.evidence-card.board-card.evidence-type-person {
  border-left-color: #00ffc8;
}

.evidence-card.board-card.evidence-type-event,
.evidence-card.board-card.evidence-type-timeline {
  border-left-color: #ffd166;
}

.evidence-card.board-card.evidence-type-document {
  border-left-color: #ff6b6b;
}

.evidence-card.board-card.evidence-type-data,
.evidence-card.board-card.evidence-type-financial {
  border-left-color: #4dabf7;
}

.evidence-card.board-card.linked-evidence,
.evidence-card.board-card.selected-related {
  opacity: 1 !important;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.5);
}

.evidence-detail-side-panel {
  position: sticky;
  top: 18px;
  align-self: start;
}

.evidence-connection-strip {
  grid-column: 1 / -1;
  background: rgba(255, 209, 102, 0.07);
  border: 1px solid rgba(255, 209, 102, 0.22);
  border-radius: 18px;
  padding: 14px;
}

.evidence-connection-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #dce8ff;
}

.evidence-connection-list em {
  color: #ffd166;
}


/* =========================
   V2.3 CONTRADICTION ENGINE + INVESTIGATION LOG
========================= */
.evidence-card.board-card.conflict-evidence {
  border-color: #ff4d6d !important;
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.72), inset 0 0 0 1px rgba(255, 77, 109, 0.35);
  opacity: 1 !important;
}

.evidence-card.board-card.conflict-evidence::before {
  content: "⚠";
  position: absolute;
  top: 8px;
  right: 10px;
  color: #ffb3c1;
  font-weight: 900;
}

.evidence-card.board-card.cluster-evidence {
  outline: 1px solid rgba(255, 209, 102, 0.65);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.34);
}

.evidence-card.board-card.related-selected {
  opacity: 1 !important;
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.55);
}

.investigation-log-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(76, 201, 240, 0.22);
}

.investigation-log-panel h3 {
  margin: 0 0 10px;
  color: #ffd166;
}

.investigation-log-panel ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.investigation-log-panel li {
  color: #dce8ff;
  line-height: 1.45;
}

.investigation-log-panel li.warning-log {
  color: #ffccd5;
}

.investigation-log-panel li.cluster-log {
  color: #fff1bf;
}

.evidence-contradiction-panel,
.evidence-cluster-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(8, 16, 33, 0.76);
  border: 1px solid rgba(76, 201, 240, 0.2);
}

.evidence-contradiction-panel {
  border-color: rgba(255, 77, 109, 0.45);
}

.evidence-cluster-panel {
  border-color: rgba(255, 209, 102, 0.42);
}

.evidence-contradiction-panel strong,
.evidence-cluster-panel strong {
  color: #ffd166;
}

.evidence-contradiction-panel ul,
.evidence-cluster-panel ul {
  margin: 8px 0 0;
  padding-left: 18px;
}


/* =========================
   V2.4 IMMERSION SYSTEM - COMPLETE REAL MERGE
   Adds board reactions without replacing the real Questify app.
========================= */
.evidence-card.board-card.new-evidence-card {
  animation: questifyEvidencePopIn 0.42s ease both;
}

.evidence-card.board-card.active-evidence {
  transform: scale(1.015);
}

.evidence-card.board-card.focused-evidence-card {
  opacity: 1 !important;
  transform: scale(1.025);
  box-shadow: 0 0 24px rgba(0, 255, 200, 0.42), 0 0 42px rgba(255, 209, 102, 0.14);
  z-index: 2;
}

.evidence-card.board-card.unfocused-evidence-card:not(.selected-related):not(.linked-evidence):not(.conflict-evidence) {
  opacity: 0.22;
  filter: grayscale(0.45);
}

.evidence-card.board-card.conflict-evidence {
  animation: questifyConflictShake 0.34s ease, questifyConflictPulse 1.2s ease infinite;
}

.questify-system-message {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20000;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(8, 16, 33, 0.96);
  border: 1px solid rgba(76, 201, 240, 0.45);
  color: #f5f7ff;
  box-shadow: 0 0 30px rgba(76, 201, 240, 0.24);
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.questify-system-message.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.questify-system-message.warning {
  border-color: rgba(255, 77, 109, 0.7);
  box-shadow: 0 0 32px rgba(255, 77, 109, 0.34);
}

.questify-system-message.cluster {
  border-color: rgba(255, 209, 102, 0.7);
  box-shadow: 0 0 32px rgba(255, 209, 102, 0.28);
}

body.questify-tension-low .terminal-panel,
body.questify-tension-low .evidence-detail-side-panel {
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.12);
}

body.questify-tension-medium {
  background:
    radial-gradient(circle at top left, rgba(255, 77, 109, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(76, 201, 240, 0.12), transparent 26%),
    #060914;
}

body.questify-tension-high .top-bar {
  animation: questifyTensionGlow 1.4s ease infinite;
}

@keyframes questifyEvidencePopIn {
  0% { opacity: 0; transform: scale(0.76) translateY(8px); }
  65% { opacity: 1; transform: scale(1.055) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes questifyConflictShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

@keyframes questifyConflictPulse {
  0% { box-shadow: 0 0 12px rgba(255, 77, 109, 0.42); }
  50% { box-shadow: 0 0 26px rgba(255, 77, 109, 0.78); }
  100% { box-shadow: 0 0 12px rgba(255, 77, 109, 0.42); }
}

@keyframes questifyTensionGlow {
  0% { filter: drop-shadow(0 0 0 rgba(255, 77, 109, 0)); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 77, 109, 0.34)); }
  100% { filter: drop-shadow(0 0 0 rgba(255, 77, 109, 0)); }
}

@media (max-width: 760px) {
  .questify-system-message {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}


/* =========================
   QUESTIFY V2.5 CINEMATIC MODE
   Fully merged cinematic layer for mission intros, AHA moments, and scene transitions.
========================= */

.mission-intro-overlay.cinematic-mode {
  background:
    radial-gradient(circle at 20% 20%, rgba(76, 201, 240, 0.14), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(255, 209, 102, 0.12), transparent 26%),
    rgba(2, 6, 16, 0.96);
}

.mission-intro-overlay.cinematic-mode::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.035) 0,
    rgba(255,255,255,0.035) 1px,
    transparent 1px,
    transparent 6px
  );
  opacity: 0.25;
  pointer-events: none;
  animation: cinematicScanlines 8s linear infinite;
}

.mission-intro-overlay.cinematic-mode .mission-intro-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(0, 255, 200, 0.72);
  box-shadow:
    0 0 56px rgba(0, 255, 200, 0.18),
    inset 0 0 28px rgba(76, 201, 240, 0.08);
}

.mission-intro-overlay.cinematic-mode .mission-intro-card::after,
.cinematic-discovery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-125%);
  animation: cinematicSweep 1.8s ease forwards;
  pointer-events: none;
}

.cinematic-status {
  color: #00ffc8;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 12px 0 6px;
  opacity: 0.85;
}

.cinematic-type-line {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  min-height: 1.45em;
}

.cinematic-type-line::after {
  content: "▌";
  display: inline-block;
  margin-left: 2px;
  color: #00ffc8;
  animation: cinematicCursor 0.8s step-end infinite;
}

.cinematic-type-line.typed-complete::after {
  content: "";
}

.cinematic-fade-out .app {
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.cinematic-fade-in .app {
  animation: cinematicFadeIn 0.5s ease both;
}

.cinematic-system-pulse {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 10050;
  max-width: min(620px, 92vw);
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.96);
  border: 1px solid rgba(0, 255, 200, 0.62);
  color: #dffcf7;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 0 34px rgba(0, 255, 200, 0.22);
  animation: cinematicPulseIn 0.28s ease, cinematicPulseOut 0.35s ease 2.05s forwards;
}

.cinematic-discovery-card {
  position: relative;
  overflow: hidden;
  animation: cinematicDiscoveryIn 0.32s ease both;
}

.cinematic-discovery-card .aha-modal-line {
  animation-duration: 0.42s;
}

#startInvestigationButton.hidden {
  display: none !important;
}

@keyframes cinematicScanlines {
  from { background-position-y: 0; }
  to { background-position-y: 160px; }
}

@keyframes cinematicSweep {
  to { transform: translateX(125%); }
}

@keyframes cinematicCursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes cinematicFadeIn {
  from { opacity: 0; transform: scale(0.99) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes cinematicPulseIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes cinematicPulseOut {
  to { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.98); }
}

@keyframes cinematicDiscoveryIn {
  from { opacity: 0; transform: scale(0.965) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* =========================
   V6 SQL → Evidence Insight Layer
========================= */
.case-insight-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(76, 201, 240, 0.1), rgba(255, 209, 102, 0.06)),
    #0d172b;
  border: 1px solid #34517d;
  border-left: 5px solid #4cc9f0;
  box-shadow: 0 0 22px rgba(76, 201, 240, 0.08);
}

.case-insight-content {
  margin-top: 10px;
  color: #dce8ff;
  line-height: 1.55;
}

.case-insight-content p {
  margin: 10px 0;
  color: #f5f7ff;
}

.case-insight-content ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.case-insight-content li {
  margin-bottom: 7px;
  color: #c8d6f5;
}

.case-insight-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(5, 8, 20, 0.45);
  border: 1px solid rgba(76, 201, 240, 0.22);
}

.case-insight-summary strong {
  color: #ffd166;
}

.case-insight-summary span {
  color: #b8c2df;
}

/* =========================
   QUESTIFY V2.1 REAL UI RESTRUCTURE PATCH
========================= */
.questify-mode-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: -8px 0 24px;
}

.questify-mode-button {
  margin-top: 0;
  background: #121f36;
  border: 1px solid #31486f;
  color: #dce8ff;
}

.questify-mode-button.active,
.questify-tab-button.active {
  background: linear-gradient(135deg, #4cc9f0, #4361ee);
  border-color: #7ddcff;
  box-shadow: 0 0 22px rgba(76, 201, 240, 0.22);
}

.questify-focused-mode-root {
  margin-top: 18px;
}

.questify-focused-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.questify-investigation-left,
.questify-investigation-right,
.questify-data-left,
.questify-data-right {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.questify-investigation-grid .evidence-workspace-section {
  margin: 0;
}

.questify-investigation-grid .evidence-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
}

.questify-investigation-right .terminal-panel,
.questify-data-right .terminal-panel {
  min-height: auto;
  position: sticky;
  top: 18px;
}

.questify-data-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.questify-mode-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.questify-mode-heading h2,
.questify-mode-heading p {
  margin: 0;
}

.questify-back-button {
  width: auto;
  min-width: 190px;
  margin-top: 0;
}

.questify-terminal-tabs,
.questify-tools-tabs {
  margin-top: 16px;
}

.questify-tab-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.questify-tools-tabs .questify-tab-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.questify-tab-button {
  margin-top: 0;
  padding: 11px 10px;
  font-size: 14px;
  background: #111d34;
  border: 1px solid #31486f;
  color: #dce8ff;
}

.questify-tab-pane {
  animation: questifyTabIn 0.18s ease;
}

.questify-tab-pane > .sql-feedback-panel,
.questify-tab-pane > .sql-visualizer-panel,
.questify-tab-pane > .query-inspector-panel,
.questify-tab-pane > .case-insight-panel,
.questify-tab-pane > .result-box {
  margin-top: 0;
}

.questify-legacy-shell {
  display: none !important;
}

.questify-compact-status {
  padding: 16px;
}

.questify-compact-status .status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.questify-map-trigger-panel {
  cursor: pointer;
  border-color: #4cc9f0;
}

.questify-map-trigger-panel::after {
  content: "Click map to open Data View";
  display: block;
  margin-top: 10px;
  color: #8fdfff;
  font-size: 13px;
  font-weight: 800;
}

[data-questify-mode-pane].hidden {
  display: none !important;
}

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

@media (max-width: 980px) {
  .questify-focused-grid,
  .questify-data-grid {
    grid-template-columns: 1fr;
  }

  .questify-investigation-right .terminal-panel,
  .questify-data-right .terminal-panel {
    position: static;
  }

  .questify-mode-switcher,
  .questify-tab-row,
  .questify-tools-tabs .questify-tab-row {
    grid-template-columns: 1fr;
  }

  .questify-mode-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .questify-back-button {
    width: 100%;
  }
}

/* =========================
   SQL STORYLINE 2: GHOST PAYROLL CASE
========================= */
.storyline-grouped-mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.storyline-header-card {
  grid-column: 1 / -1;
}

.storyline-2-header-card {
  border-color: rgba(255, 209, 102, 0.65);
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.12), transparent 35%),
    rgba(12, 20, 38, 0.96);
}

.storyline-2-tile {
  border-color: rgba(255, 209, 102, 0.32);
}

.storyline-mini-row,
.storyline-progress-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.storyline-kicker {
  display: inline-block;
  color: #ffd166;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 6px;
}

.storyline-arc-note {
  color: #dce8ff;
  margin-bottom: 0;
}

/* =========================
   STORYLINE GROUPED MISSION SELECT FIX
========================= */
.storyline-header-card {
  grid-column: 1 / -1;
  margin-top: 10px;
  border-color: rgba(76, 201, 240, 0.45);
  background:
    radial-gradient(circle at top left, rgba(76, 201, 240, 0.16), transparent 38%),
    rgba(12, 20, 38, 0.97);
}

.storyline-2-header-card {
  margin-top: 34px;
  border-color: rgba(255, 209, 102, 0.45);
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.14), transparent 38%),
    rgba(12, 20, 38, 0.97);
}

.storyline-kicker {
  display: inline-block;
  color: #ffd166;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 6px;
}

.storyline-title-wrap h2 {
  margin: 0 0 8px;
}

.storyline-progress-row,
.storyline-mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.storyline-arc-note {
  color: #dce8ff;
  margin-bottom: 0;
}

/* =========================
   CONCEPT TRACKING FIX UI
========================= */
.storyline-concept-progress {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(8, 16, 33, 0.72);
  border: 1px solid rgba(76, 201, 240, 0.22);
}

.storyline-concept-progress p {
  margin: 8px 0 0;
  color: #dce8ff;
  line-height: 1.45;
}

.mission-readiness .readiness-missing ul,
.mission-readiness .readiness-prep-list ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.mission-readiness .readiness-missing li,
.mission-readiness .readiness-prep-list li {
  margin-bottom: 4px;
}

.readiness-learned,
.readiness-prep-list,
.readiness-missing {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(5, 8, 20, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dce8ff;
}

.readiness-badge.ready,
.mission-readiness.ready .readiness-badge {
  color: #caffbf;
  border-color: #58d68d;
  background: rgba(88, 214, 141, 0.12);
}

.readiness-badge.recommended,
.mission-readiness.recommended .readiness-badge {
  color: #fff2bf;
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
}

.readiness-badge.early,
.mission-readiness.early .readiness-badge {
  color: #ffd6d6;
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.12);
}

.lesson-recommended-pulse {
  animation: lessonRecommendedPulse 1.8s ease;
  border-color: #ffd166 !important;
}

@keyframes lessonRecommendedPulse {
  0% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); transform: scale(1); }
  45% { box-shadow: 0 0 28px rgba(255, 209, 102, 0.45); transform: scale(1.015); }
  100% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); transform: scale(1); }
}

/* =========================
   SKILL MASTERY SYSTEM
========================= */
.readiness-lesson-ref {
  display: block;
  color: #9fb3d9;
  font-size: 12px;
  margin-top: 2px;
}

.mission-readiness.early {
  border-color: #ff6b6b;
}

.mission-readiness.early .readiness-badge {
  border-color: #ff6b6b;
  color: #ffd6d6;
}

.mission-readiness.recommended {
  border-color: #ffd166;
}

.mission-readiness.ready {
  border-color: #58d68d;
}

.skill-mastery-profile-panel h3 {
  margin-top: 0;
  color: #ffd166;
}

.skill-category-block {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(5, 8, 20, 0.35);
  border: 1px solid rgba(76, 201, 240, 0.15);
}

.skill-category-block h4 {
  margin: 0 0 12px;
  color: #4cc9f0;
}

.skill-mastery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.skill-mastery-card {
  padding: 12px;
  border-radius: 16px;
  background: #081021;
  border: 1px solid #26395f;
}

.skill-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.skill-card-top span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(76, 201, 240, 0.12);
  border: 1px solid rgba(76, 201, 240, 0.3);
  font-size: 12px;
  color: #dce8ff;
}

.skill-score-bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #101827;
  border: 1px solid #26395f;
  margin-bottom: 8px;
}

.skill-score-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(135deg, #4cc9f0, #58d68d);
  border-radius: inherit;
}

.skill-mastery-card p {
  margin: 4px 0;
  color: #dce8ff;
  font-size: 13px;
}

.skill-unseen {
  opacity: 0.7;
}

.skill-started {
  border-color: rgba(255, 209, 102, 0.45);
}

.skill-practiced,
.skill-proficient,
.skill-mastered {
  border-color: rgba(88, 214, 141, 0.45);
}


/* =========================
   ACHIEVEMENTS + BADGES PROFILE UI
========================= */
.achievement-profile-panel {
  border-left: 5px solid #ffd166;
}

.achievement-profile-panel h3 {
  margin-top: 0;
  color: #ffd166;
}

.badge-category-block {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(8, 16, 33, 0.72);
  border: 1px solid rgba(76, 201, 240, 0.16);
}

.badge-category-block h4 {
  margin: 0 0 12px;
  color: #4cc9f0;
}

.achievement-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.achievement-badge-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  background: #101827;
  border: 1px solid #2b3b5d;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.achievement-badge-card.earned {
  border-color: #ffd166;
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.22);
}

.achievement-badge-card.locked {
  opacity: 0.58;
}

.achievement-badge-card:hover {
  transform: translateY(-2px);
}

.achievement-badge-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #17294a;
  border: 1px solid #385986;
  font-size: 20px;
}

.achievement-badge-card strong {
  display: block;
  color: #ffffff;
  margin-bottom: 5px;
}

.achievement-badge-card p {
  margin: 0 0 6px;
  color: #dce8ff;
  font-size: 13px;
  line-height: 1.4;
}

.achievement-badge-card span,
.badge-hidden-note {
  color: #9ba8c7;
  font-size: 12px;
}


/* =========================
   LEGENDARY BADGE PROFILE UI
========================= */
.legendary-badge-profile-panel {
  border-color: rgba(255, 209, 102, 0.45);
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.12), transparent 35%),
    rgba(12, 20, 38, 0.96);
}

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

.legendary-badge-header h3 {
  margin: 0 0 6px;
  color: #ffd166;
}

.legendary-badge-header p,
.legendary-hidden-note {
  margin: 0;
  color: #dce8ff;
  line-height: 1.5;
}

.legendary-badge-header strong {
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.38);
  color: #ffd166;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.legendary-badge-category {
  margin-top: 20px;
}

.legendary-badge-category h4 {
  margin: 0 0 12px;
  color: #ffffff;
}

.legendary-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
}

.legendary-badge-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 15px;
  border-radius: 18px;
  background: rgba(8, 16, 33, 0.82);
  border: 1px solid rgba(76, 201, 240, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.legendary-badge-card:hover {
  transform: translateY(-2px);
}

.legendary-badge-card.earned {
  border-color: rgba(255, 209, 102, 0.72);
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.18);
}

.legendary-badge-card.locked {
  opacity: 0.72;
}

.legendary-badge-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.34);
  font-size: 20px;
}

.legendary-badge-body {
  flex: 1;
  min-width: 0;
}

.legendary-badge-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.legendary-badge-title-row strong {
  color: #ffd166;
}

.legendary-badge-title-row span {
  font-size: 12px;
  color: #9ba8c7;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px 8px;
}

.legendary-badge-card.earned .legendary-badge-title-row span {
  color: #caffbf;
  border-color: rgba(88, 214, 141, 0.35);
  background: rgba(88, 214, 141, 0.1);
}

.legendary-badge-card p {
  margin: 8px 0;
  color: #dce8ff;
  line-height: 1.45;
  font-size: 14px;
}

.legendary-badge-card small {
  display: block;
  margin-top: 7px;
  color: #9ba8c7;
}

.legendary-badge-progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #050814;
  border: 1px solid rgba(76, 201, 240, 0.2);
}

.legendary-badge-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #4cc9f0, #ffd166);
  transition: width 0.35s ease;
}

.legendary-badge-card.earned .legendary-badge-progress-bar span {
  background: linear-gradient(135deg, #58d68d, #ffd166);
}

.legendary-badge-unlock-popup {
  animation: legendaryBadgePopup 0.45s ease;
  border-color: #ffd166 !important;
  box-shadow: 0 0 38px rgba(255, 209, 102, 0.45) !important;
}

@keyframes legendaryBadgePopup {
  0% { transform: translateY(16px) scale(0.92); opacity: 0; }
  60% { transform: translateY(-3px) scale(1.04); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* =========================
   LEGENDARY BADGE UNLOCK POPUP
========================= */

.badge-unlock-popup {
  position: fixed;
  top: 22px;
  right: 22px;
  width: min(380px, calc(100vw - 32px));
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.22), transparent 45%),
    linear-gradient(135deg, #16233f, #08111f);
  border: 2px solid #ffd166;
  border-radius: 20px;
  padding: 16px;
  box-shadow:
    0 0 35px rgba(255, 209, 102, 0.35),
    0 18px 55px rgba(0, 0, 0, 0.45);
  transform: translateY(-18px) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 99999;
}

.badge-unlock-popup.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.badge-unlock-popup.super {
  border-color: #caffbf;
  box-shadow:
    0 0 42px rgba(202, 255, 191, 0.38),
    0 18px 55px rgba(0, 0, 0, 0.45);
}

.badge-unlock-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-unlock-icon {
  font-size: 38px;
  animation: badgePulseGlow 1.4s infinite;
}

.badge-unlock-text {
  display: grid;
  gap: 3px;
}

.badge-unlock-kicker {
  color: #ffd166;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.badge-unlock-text strong {
  color: #ffffff;
  font-size: 18px;
  line-height: 1.15;
}

.badge-unlock-text small {
  color: #dce8ff;
  font-size: 13px;
  line-height: 1.35;
}

@keyframes badgePulseGlow {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(255, 209, 102, 0.8));
  }

  50% {
    transform: scale(1.12);
    filter: drop-shadow(0 0 18px rgba(255, 209, 102, 1));
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(255, 209, 102, 0.8));
  }
}

/* =========================
   LATEST PORTFOLIO REPORT
========================= */

.portfolio-latest-report {
  border-color: rgba(76, 201, 240, 0.48);
  background:
    radial-gradient(circle at top left, rgba(76, 201, 240, 0.14), transparent 38%),
    rgba(12, 20, 38, 0.95);
}

.portfolio-empty-report {
  border-style: dashed;
  color: #dce8ff;
}

.portfolio-latest-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.portfolio-latest-header h3 {
  margin: 0 0 6px;
}

.portfolio-saved-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: rgba(88, 214, 141, 0.12);
  border: 1px solid rgba(88, 214, 141, 0.48);
  color: #caffbf;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.portfolio-latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.portfolio-latest-grid div {
  background: #101827;
  border: 1px solid #2b3b5d;
  border-radius: 14px;
  padding: 12px;
}

.portfolio-latest-grid strong {
  display: block;
  color: #9ba8c7;
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.portfolio-latest-grid span {
  color: #ffd166;
  font-size: 1.35rem;
  font-weight: 900;
}

@media (max-width: 700px) {
  .portfolio-latest-header {
    flex-direction: column;
  }

  .portfolio-saved-pill {
    white-space: normal;
  }
}

/* =========================================================
   QUESTIFY ACTIVE TAB INDICATOR
========================================================= */
.nav-buttons button.active,
.nav-buttons button.nav-active,
.nav-buttons button[aria-current="page"] {
  background: linear-gradient(135deg, #4cc9f0, #4361ee);
  border: 1px solid #7ddcff;
  box-shadow: 0 0 22px rgba(76, 201, 240, 0.35);
  color: white;
}

.nav-buttons button:not(.active):not(.nav-active):not([aria-current="page"]) {
  background: #182943;
  border: 1px solid #3d5a86;
}
