@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Playfair+Display:wght@700&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES — PALETTE NOIR
   ============================================================ */
:root {
  /* Backgrounds */
  --bg-primary: #08080d;
  --bg-secondary: #0f0f18;
  --bg-tertiary: #161625;

  /* Text */
  --text-primary: #e4e2ee;
  --text-secondary: #8b87a0;
  --text-muted: #56526a;

  /* Accents */
  --accent-gold: #d4a853;
  --accent-red: #e04040;
  --accent-green: #3dbd6e;
  --accent-blue: #3a8fd4;

  /* WhatsApp theme */
  --wa-bg: #0b141a;
  --wa-sent: #005c4b;
  --wa-received: #1e2d34;

  /* Spacing */
  --touch-min: 44px;

  /* Fonts */
  --font-ui: 'IBM Plex Mono', monospace;
  --font-display: 'Playfair Display', serif;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-med: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Thin custom scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Allow text selection in content areas */
.selectable,
.email-detail-body,
.photo-detail-desc,
.call-transcript,
.police-person-details,
.result-feedback,
.intro-text {
  user-select: text;
  -webkit-user-select: text;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.1rem;
}

p,
span,
li {
  font-family: var(--font-ui);
  line-height: 1.5;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

.text-gold {
  color: var(--accent-gold);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-red {
  color: var(--accent-red);
}

.text-green {
  color: var(--accent-green);
}

/* ============================================================
   LAYOUT — MOBILE-FIRST (max-width 480px)
   ============================================================ */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg-primary);
  overflow-x: hidden;
}

.screen {
  display: none;
  min-height: 100vh;
  padding-bottom: 70px;
  animation: fadeSlideIn 0.3s ease;
}

.screen.active {
  display: block;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden {
  display: none !important;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-sm {
  gap: 8px;
}

.gap-md {
  gap: 16px;
}

.p-content {
  padding: 16px;
}

.mt-sm {
  margin-top: 8px;
}

.mt-md {
  margin-top: 16px;
}

.mt-lg {
  margin-top: 24px;
}

.w-full {
  width: 100%;
}

.text-center {
  text-align: center;
}

.uppercase {
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================================
   GAME HEADER — STICKY TOP
   ============================================================ */
.game-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-tertiary);
}

.game-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.case-code {
  font-size: 0.7rem;
  color: var(--accent-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.case-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-top: 2px;
  line-height: 1.2;
}

.case-status {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
  padding-left: 8px;
}

.progress-bar {
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #e8c97a);
  border-radius: 2px;
  transition: width 0.8s ease;
  width: 0%;
}

.progress-text {
  display: block;
  text-align: right;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   NAVBAR — BOTTOM STICKY
   ============================================================ */
.navbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(15, 15, 24, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--bg-tertiary);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 4px 8px;
  cursor: pointer;
  position: relative;
  transition: opacity var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  color: var(--text-muted);
}

.nav-item:active {
  opacity: 0.7;
}

.nav-item.active {
  color: var(--accent-gold);
}

.nav-item.locked {
  opacity: 0.3;
  pointer-events: none;
  cursor: not-allowed;
}

.nav-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.nav-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-ui);
}

.nav-item.active .nav-label {
  color: var(--accent-gold);
}

.nav-badge {
  position: absolute;
  top: 0;
  right: 2px;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.55rem;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0 3px;
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-ui);
}

.nav-lock {
  font-size: 0.7rem;
  position: absolute;
  top: -2px;
  right: 0;
  color: var(--text-muted);
}

/* ============================================================
   NOTIFICATION BANNER — SLIDE DOWN FROM TOP
   ============================================================ */
.notification-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--accent-gold);
  padding: 12px 16px;
  z-index: 200;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.notification-banner.show {
  transform: translateX(-50%) translateY(0);
}

.notif-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notif-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.notif-content {
  flex: 1;
  overflow: hidden;
}

.notif-app {
  font-size: 0.7rem;
  color: var(--accent-gold);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.notif-title {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-body {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   INCOMING CALL OVERLAY — FULLSCREEN
   ============================================================ */
.call-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #0a1628 0%, #061020 100%);
  z-index: 300;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.call-overlay.show {
  display: flex;
}

.call-emoji {
  font-size: 5rem;
  animation: callPulse 2s ease-in-out infinite;
  line-height: 1;
}

.call-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: var(--font-ui);
}

.call-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-top: 10px;
  color: var(--text-primary);
}

.call-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.call-actions {
  display: flex;
  gap: 64px;
  margin-top: 64px;
  align-items: center;
}

.call-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.call-btn:active {
  transform: scale(0.92);
}

.call-btn-answer {
  background: var(--accent-green);
  color: #fff;
  box-shadow: 0 0 20px rgba(61, 189, 110, 0.4);
}

.call-btn-decline {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 20px rgba(224, 64, 64, 0.4);
}

.call-btn-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
  font-family: var(--font-ui);
}

.call-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================================================
   STORY SELECTION SCREEN
   ============================================================ */
.story-select {
  padding: 24px 16px;
  min-height: 100vh;
  background: var(--bg-primary);
}

.story-select-header {
  text-align: center;
  padding: 40px 0 32px;
}

.app-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.title-zero {
  color: var(--accent-gold);
}

.app-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.story-select-logo {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.story-select h1 {
  text-align: center;
  margin-bottom: 8px;
}

.story-select-tagline {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.story-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.story-card {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform 0.1s;
  position: relative;
  overflow: hidden;
}

.story-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.story-card:active {
  transform: scale(0.98);
  border-color: var(--accent-gold);
}

.story-card:active::before {
  opacity: 1;
}

.story-card-emoji {
  font-size: 2rem;
  margin-bottom: 10px;
}

.story-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.story-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

.story-card-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.story-card-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.story-card-tag.difficulty-medium {
  color: var(--accent-gold);
}

.story-card-tag.difficulty-hard {
  color: var(--accent-red);
}

/* ============================================================
   INTRO SCREEN
   ============================================================ */
.intro-screen {
  padding: 32px 20px;
  text-align: center;
  background: var(--bg-primary);
  min-height: 100vh;
  padding-bottom: 80px;
}

.intro-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}

.intro-case-code {
  font-size: 0.7rem;
  color: var(--accent-gold);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.intro-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 8px;
  line-height: 1.2;
}

.intro-divider {
  width: 40px;
  height: 1px;
  background: var(--accent-gold);
  margin: 16px auto;
  opacity: 0.5;
}

.intro-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: left;
  margin-top: 20px;
  white-space: pre-line;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding: 14px 40px;
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  min-height: var(--touch-min);
  transition: opacity var(--transition-fast), transform 0.1s;
}

.btn-start:active {
  opacity: 0.85;
  transform: scale(0.97);
}

/* ============================================================
   WHATSAPP STYLE — CHAT LIST
   ============================================================ */
.wa-list {
  background: var(--wa-bg);
  min-height: 100%;
}

.wa-list-header {
  padding: 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wa-list-title {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.wa-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  min-height: var(--touch-min);
  transition: background var(--transition-fast);
}

.wa-chat-item:active {
  background: rgba(255, 255, 255, 0.04);
}

.wa-avatar {
  font-size: 2rem;
  width: 44px;
  height: 44px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
}

.wa-chat-info {
  flex: 1;
  overflow: hidden;
}

.wa-chat-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.wa-chat-preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.wa-chat-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.wa-unread-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   WHATSAPP STYLE — MESSAGE THREAD
   ============================================================ */
.wa-thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.wa-back {
  color: var(--accent-blue);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 8px 0;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

.wa-thread-avatar {
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  flex-shrink: 0;
}

.wa-thread-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.wa-thread-status {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.wa-messages {
  background: var(--wa-bg);
  padding: 12px 16px;
  min-height: calc(100vh - 120px);
}

.wa-date-wrapper {
  text-align: center;
  margin: 12px 0;
}

.wa-date-label {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 12px;
  border-radius: 6px;
}

.wa-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 0.8rem;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.wa-bubble-sent {
  background: var(--wa-sent);
  margin-left: auto;
  border-bottom-right-radius: 2px;
}

.wa-bubble-received {
  background: var(--wa-received);
  margin-right: auto;
  border-bottom-left-radius: 2px;
}

.wa-bubble-sender {
  font-size: 0.65rem;
  color: var(--accent-gold);
  margin-bottom: 3px;
  font-weight: 500;
}

.wa-bubble-text {
  color: var(--text-primary);
}

.wa-bubble-time {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 3px;
}

.wa-bubble-check {
  display: inline-block;
  margin-left: 3px;
  color: var(--accent-blue);
  font-size: 0.6rem;
}

/* ============================================================
   EMAIL STYLE — INBOX
   ============================================================ */
.email-list {
  padding: 0;
  background: var(--bg-primary);
}

.email-list-header {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--bg-tertiary);
}

.email-list-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.email-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-tertiary);
  cursor: pointer;
  min-height: var(--touch-min);
  transition: background var(--transition-fast);
}

.email-item:active {
  background: var(--bg-tertiary);
}

.email-item.unread {
  background: rgba(212, 168, 83, 0.04);
}

.email-item.unread .email-from {
  color: var(--text-primary);
  font-weight: 600;
}

.email-star {
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.email-star.starred {
  color: var(--accent-gold);
}

.email-info {
  flex: 1;
  overflow: hidden;
}

.email-from {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.email-subject {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   EMAIL STYLE — DETAIL
   ============================================================ */
.email-detail {
  padding: 20px 16px;
  background: var(--bg-primary);
  min-height: 100%;
}

.email-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-blue);
  font-size: 0.8rem;
  cursor: pointer;
  margin-bottom: 16px;
  min-height: var(--touch-min);
}

.email-detail-header {
  border-bottom: 1px solid var(--bg-tertiary);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.email-detail-subject {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.email-detail-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.email-detail-meta strong {
  color: var(--text-secondary);
}

.email-detail-body {
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-line;
}

/* ============================================================
   PHOTOS STYLE — GRID
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px;
  background: var(--bg-primary);
}

.photo-card {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s, border-color var(--transition-fast);
}

.photo-card:active {
  transform: scale(0.97);
  border-color: var(--accent-gold);
}

.photo-thumb {
  position: relative;
  overflow: hidden;
}

.photo-emoji {
  font-size: 2.5rem;
  text-align: center;
  padding: 24px 0;
  background: var(--bg-tertiary);
  display: block;
  line-height: 1;
}

.photo-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.photo-card-title {
  font-size: 0.7rem;
  padding: 8px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.photo-card-num {
  font-size: 0.6rem;
  color: var(--text-muted);
  padding: 0 8px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   PHOTOS STYLE — DETAIL
   ============================================================ */
.photo-detail {
  padding: 20px 16px;
  background: var(--bg-primary);
  min-height: 100%;
}

.photo-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-blue);
  font-size: 0.8rem;
  cursor: pointer;
  margin-bottom: 16px;
  min-height: var(--touch-min);
}

.photo-detail-emoji {
  font-size: 5rem;
  text-align: center;
  padding: 40px 0;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 8px;
  display: block;
  line-height: 1;
}

.photo-detail-img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.photo-detail-tag {
  font-size: 0.65rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 16px;
}

.photo-detail-title {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 6px;
  color: var(--text-primary);
}

.photo-detail-forensic {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--accent-red);
  background: rgba(224, 64, 64, 0.1);
  border: 1px solid rgba(224, 64, 64, 0.2);
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.photo-detail-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-top: 14px;
  white-space: pre-line;
}

/* ============================================================
   CALL LOG STYLE
   ============================================================ */
.calls-list {
  padding: 0;
  background: var(--bg-primary);
}

.calls-list-header {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--bg-tertiary);
}

.calls-list-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.call-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-tertiary);
  cursor: pointer;
  min-height: var(--touch-min);
  transition: background var(--transition-fast);
}

.call-item:active {
  background: var(--bg-tertiary);
}

.call-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.call-item-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.call-item-info {
  flex: 1;
  overflow: hidden;
}

.call-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.call-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.call-item-type {
  font-size: 0.65rem;
  flex-shrink: 0;
}

.call-item-type.incoming {
  color: var(--accent-green);
}

.call-item-type.outgoing {
  color: var(--accent-blue);
}

.call-item-type.missed {
  color: var(--accent-red);
}

.call-expand-icon {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform var(--transition-med);
  flex-shrink: 0;
}

.call-item.expanded .call-expand-icon {
  transform: rotate(180deg);
}

.call-transcript {
  display: none;
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-line;
  border-left: 2px solid var(--accent-gold);
}

.call-item.expanded .call-transcript {
  display: block;
  animation: fadeSlideIn 0.25s ease;
}

/* ============================================================
   POLICE PORTAL STYLE
   ============================================================ */
.police-portal {
  background: var(--bg-primary);
  min-height: 100%;
}

.police-portal-header {
  padding: 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--bg-tertiary);
}

.police-portal-badge {
  font-size: 0.65rem;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.police-portal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
}

.police-tabs {
  display: flex;
  border-bottom: 1px solid var(--bg-tertiary);
  background: var(--bg-secondary);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.police-tabs::-webkit-scrollbar {
  display: none;
}

.police-tab {
  flex: 1;
  flex-shrink: 0;
  text-align: center;
  padding: 12px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  min-height: var(--touch-min);
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.police-tab.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.police-tab-content {
  display: none;
}

.police-tab-content.active {
  display: block;
  animation: fadeSlideIn 0.25s ease;
}

.police-person {
  padding: 16px;
  border-bottom: 1px solid var(--bg-tertiary);
}

.police-person-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.police-person-avatar {
  font-size: 2.2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  flex-shrink: 0;
}

.police-person-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.police-person-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.police-person-status {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

.police-person-status.suspect {
  background: rgba(224, 64, 64, 0.15);
  color: var(--accent-red);
}

.police-person-status.witness {
  background: rgba(58, 143, 212, 0.15);
  color: var(--accent-blue);
}

.police-person-status.victim {
  background: rgba(212, 168, 83, 0.15);
  color: var(--accent-gold);
}

.police-person-details {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.police-person-field {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.police-person-field-key {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 80px;
}

.police-evidence-section {
  padding: 12px 16px 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid var(--bg-tertiary);
}

.police-evidence-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-tertiary);
  transition: background var(--transition-fast);
}

.police-evidence-item:active {
  background: var(--bg-tertiary);
}

.police-evidence-key {
  font-size: 0.7rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.police-evidence-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   SOLVE SCREEN
   ============================================================ */
.solve-screen {
  padding: 24px 16px;
  background: var(--bg-primary);
  min-height: 100%;
}

.solve-screen h2 {
  margin-bottom: 6px;
}

.solve-clue-count {
  font-size: 0.8rem;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.solve-instructions {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 2px solid var(--accent-gold);
}

.solve-textarea {
  width: 100%;
  min-height: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 8px;
  padding: 14px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  resize: vertical;
  line-height: 1.7;
  transition: border-color var(--transition-fast);
}

.solve-textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.solve-textarea::placeholder {
  color: var(--text-muted);
}

.solve-char-count {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 6px;
}

.btn-solve {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  min-height: var(--touch-min);
  transition: opacity var(--transition-fast), transform 0.1s;
}

.btn-solve:active {
  opacity: 0.85;
  transform: scale(0.99);
}

.btn-solve:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   RESULT SCREEN
   ============================================================ */
.result-screen {
  padding: 32px 20px;
  text-align: center;
  background: var(--bg-primary);
  min-height: 100vh;
  padding-bottom: 80px;
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.result-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.result-score {
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--accent-gold);
  line-height: 1;
  margin: 8px 0 16px;
}

.result-score-suffix {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.result-grade {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.result-divider {
  width: 40px;
  height: 1px;
  background: var(--bg-tertiary);
  margin: 20px auto;
}

.result-feedback {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: left;
  margin-top: 8px;
  white-space: pre-line;
}

.result-stats {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 8px;
  padding: 16px;
  margin-top: 24px;
  text-align: left;
}

.result-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg-tertiary);
  font-size: 0.75rem;
}

.result-stat-row:last-child {
  border-bottom: none;
}

.result-stat-key {
  color: var(--text-muted);
}

.result-stat-val {
  color: var(--text-primary);
  font-weight: 500;
}

.btn-restart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding: 14px 40px;
  background: transparent;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  min-height: var(--touch-min);
  letter-spacing: 1px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-restart:active {
  background: rgba(212, 168, 83, 0.1);
}

/* ============================================================
   LOCKED ELEMENTS
   ============================================================ */
.locked {
  opacity: 0.15;
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.locked-text {
  color: transparent;
  text-shadow: 0 0 8px rgba(228, 226, 238, 0.3);
}

/* Placeholder redacted text using block characters */
.locked-placeholder::before {
  content: '██████ ████ ███████ ██ ████ ███';
  color: var(--text-muted);
  letter-spacing: 2px;
  font-size: 0.8rem;
}

.locked-placeholder-short::before {
  content: '████████';
  color: var(--text-muted);
  letter-spacing: 2px;
  font-size: 0.8rem;
}

.unlocking {
  animation: unlockReveal 0.6s ease forwards;
}

/* Lock indicator badge on list items */
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================================
   CONTENT AREA & TAB SYSTEM
   ============================================================ */
.content-area {
  padding-bottom: 70px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

/* ============================================================
   LOADING & SPINNER
   ============================================================ */
.loading {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.loading-text {
  margin-top: 12px;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--bg-tertiary);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
   GENERIC BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  min-height: var(--touch-min);
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: opacity var(--transition-fast), transform 0.1s;
}

.btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-weight: 600;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--bg-tertiary);
}

.btn-danger {
  background: var(--accent-red);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.btn-full {
  width: 100%;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--bg-tertiary);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.section-divider {
  height: 1px;
  background: var(--bg-tertiary);
  margin: 8px 0;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   SUBVIEW HEADERS (WA chat, email detail, photo detail)
   ============================================================ */
.subview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--bg-tertiary);
}

.back-btn {
  font-size: 0.8rem;
  color: var(--accent-gold);
  cursor: pointer;
  white-space: nowrap;
}

.subview-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================================
   RESULT EXTRAS (emoji alias, keywords, score variants)
   ============================================================ */
.result-emoji {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.result-keywords {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.score-high {
  color: var(--accent-green);
}

.score-medium {
  color: var(--accent-gold);
}

.score-low {
  color: var(--accent-red);
}

/* ============================================================
   CLUE UNLOCK TOAST (supplementary to notification banner)
   ============================================================ */
.clue-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-secondary);
  border: 1px solid var(--accent-green);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.75rem;
  color: var(--accent-green);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 150;
}

.clue-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   KEYFRAMES — ANIMATIONS
   ============================================================ */
@keyframes badgePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes callPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes unlockReveal {
  0% {
    opacity: 0.15;
    filter: blur(2px);
  }
  50% {
    opacity: 0.6;
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 168, 83, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(212, 168, 83, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ============================================================
   CALL PULSE RING (surrounding ring animation)
   ============================================================ */
.call-pulse-ring {
  position: relative;
  display: inline-block;
}

.call-pulse-ring::before,
.call-pulse-ring::after {
  content: '';
  position: absolute;
  inset: -16px;
  border: 2px solid rgba(61, 189, 110, 0.3);
  border-radius: 50%;
  animation: callRingExpand 2s ease-out infinite;
}

.call-pulse-ring::after {
  animation-delay: 1s;
}

@keyframes callRingExpand {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ============================================================
   SCREEN TRANSITIONS
   ============================================================ */
.screen-enter {
  animation: fadeSlideIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.screen-exit {
  animation: fadeSlideOut 0.25s ease forwards;
}

@keyframes fadeSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ============================================================
   PROGRESS BAR — STEPPED VARIANT
   ============================================================ */
.progress-steps {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  margin-top: 6px;
}

.progress-step {
  flex: 1;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  transition: background 0.4s ease;
}

.progress-step.done {
  background: var(--accent-gold);
}

.progress-step.current {
  background: linear-gradient(90deg, var(--accent-gold) 60%, var(--bg-tertiary));
}

/* ============================================================
   MISC INTERACTIVE STATES
   ============================================================ */
.tappable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--transition-fast);
}

.tappable:active {
  opacity: 0.7;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 10px;
  padding: 16px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

/* Status dot indicators */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.status-dot.online {
  background: var(--accent-green);
}

.status-dot.offline {
  background: var(--text-muted);
}

.status-dot.busy {
  background: var(--accent-red);
}

/* ============================================================
   SAFE AREA SUPPORT (iPhone notch / home indicator)
   ============================================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  .navbar {
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }

  .call-overlay {
    padding-bottom: env(safe-area-inset-bottom, 40px);
  }
}

/* ============================================================
   REDUCED MOTION — ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
