/* Dark text override class */
.dark-text-override {
    color: #4A4A4A !important;
}

.dark-text-override * {
    color: #4A4A4A !important;
}

/* Case Card Progression System */
.case-card.locked {
    opacity: 0.6;
    background: var(--bg-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    position: relative;
}

.case-card.locked:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.case-card.locked .case-image {
    filter: grayscale(100%) brightness(0.7);
}

.case-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.case-lock-icon {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: var(--text-lg);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.case-status-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.case-status-badge.locked {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

.case-status-badge.completed {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.case-unlock-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.unlock-requirement,
.unlock-rank {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.unlock-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}

.unlock-value {
    font-size: var(--text-xs);
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.case-card.locked .case-card-title {
    color: var(--text-secondary);
}

.case-card.locked .case-number {
    color: var(--text-secondary);
}

/* Authentication Section */
.auth-section {
    display: flex;
    align-items: center;
    margin-left: var(--space-3);
}

.profile-avatar {
    cursor: pointer;
    padding: var(--space-2);
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.profile-avatar:hover {
    background: var(--surface-secondary);
    transform: scale(1.05);
}

.profile-avatar svg {
    display: block;
}

/* Auth Screen */
.auth-content {
    max-width: 500px;
    margin: 0 auto;
    padding: var(--space-4);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.auth-description {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.6;
    margin: 0;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-6);
}

.auth-tab {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--text-lg);
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.auth-tab.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    background: rgba(0, 150, 105, 0.1);
    font-weight: 600;
}

.auth-form {
    padding: var(--space-4) 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--space-3);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-primary);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-text {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
}

.auth-links {
    text-align: center;
    margin-top: var(--space-4);
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: var(--text-sm);
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Auth Alert Styling */
.alert {
    margin-top: var(--space-4);
    border-radius: var(--radius-md);
    padding: var(--space-3);
}

.alert-content {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.alert-content.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.alert-content.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.alert-icon {
    font-size: var(--text-lg);
}

.alert-text {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: 500;
}

/* Profile Logged In State */
.profile-logged-in {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
}

.profile-initial {
    line-height: 1;
}

/* Profile Menu Content */
.profile-menu-content {
    padding: var(--space-2);
}

.profile-info {
    text-align: center;
    margin-bottom: var(--space-4);
}

.profile-info h3 {
    margin: 0 0 var(--space-1) 0;
    color: var(--text-primary);
}

.profile-email {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.profile-actions {
    text-align: center;
}

/* Progress signup notice */
.signup-notice {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    text-align: center;
}

.signup-notice p {
    margin: 0;
    font-size: var(--text-base);
}

.signup-notice strong {
    font-weight: 600;
}

.signup-btn {
    margin-top: var(--space-3);
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 2px solid white !important;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.signup-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Stats Grid for About Modal */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin: var(--space-4) 0;
}

.stat-item {
    text-align: center;
    padding: var(--space-3);
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-1);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Mobile responsiveness for auth section */
@media (max-width: 768px) {
  .header-stats {
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-end;
  }
  
  .auth-section {
    margin-left: 0;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .auth-content {
    padding: var(--space-2);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

/* Evidence locking styles */
.evidence-locked {
    padding: var(--space-4) !important;
}

.locked-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: #3A3A3A;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 2px dashed var(--text-muted);
}

.lock-icon {
    font-size: var(--text-2xl);
    opacity: 0.7;
}

.lock-text {
    flex: 1;
}

.lock-text strong {
    color: var(--primary-dark);
    display: block;
    margin-bottom: var(--space-1);
}

.lock-text p {
    color: var(--text-secondary);
    margin: 0;
    font-size: var(--text-sm);
}

.unlock-evidence-btn {
    white-space: nowrap;
}

.unlock-evidence-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Character overlay styles */
.clickable-character {
    color: var(--accent-gold);
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition-base);
}

.clickable-character:hover {
    color: var(--accent-yellow);
    text-decoration: underline;
}

.character-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.character-overlay.show {
    opacity: 1;
}

.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    border-bottom: 2px solid var(--primary-light);
    background: var(--bg-body);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.overlay-header h2 {
    margin: 0;
    color: var(--primary-dark);
    font-family: var(--font-primary);
}

.overlay-close {
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.overlay-close:hover {
    background: var(--bg-body);
    color: var(--text-primary);
}

.overlay-body {
    padding: var(--space-6);
}

.character-overlay-content {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

.character-photo {
    flex-shrink: 0;
}

.photo-placeholder-large {
    width: 120px;
    height: 120px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 2px solid var(--primary-light);
}

.character-image {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary-light);
}

.character-info {
    flex: 1;
}

.character-info h2 {
    margin: 0 0 var(--space-3) 0;
    color: var(--primary-dark);
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: bold;
}

.character-info p {
    margin: var(--space-1) 0;
    line-height: var(--leading-normal);
}

.character-info p strong {
    color: var(--primary-dark);
}

/* Responsive overlay */
@media (max-width: 768px) {
    .character-overlay-content {
        flex-direction: column;
        text-align: center;
    }
    
    .photo-placeholder-large {
        width: 100px;
        height: 100px;
        font-size: 36px;
        margin: 0 auto;
    }
    
    .character-image {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
}

/* Help overlay styles */
.help-overlay-content {
    max-height: 60vh;
    overflow-y: auto;
}

.help-section {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-color);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h3 {
    color: var(--primary-dark);
    font-family: var(--font-primary);
    margin: 0 0 var(--space-2) 0;
    font-size: var(--text-lg);
}

.help-section p {
    margin: 0 0 var(--space-2) 0;
    line-height: var(--leading-relaxed);
}

.help-section ul {
    margin: 0;
    padding-left: var(--space-4);
    list-style-type: disc;
}

.help-section li {
    margin: var(--space-1) 0;
    line-height: var(--leading-relaxed);
}

.help-section kbd {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-primary);
}

/* Help overlay responsive */
@media (max-width: 768px) {
    .help-overlay-content {
        max-height: 70vh;
    }
    
    .help-section {
        margin-bottom: var(--space-3);
        padding-bottom: var(--space-2);
    }
}

/* Components CSS - Modern Whodunnit System */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 500;
  text-align: center;
  transition: all var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
  min-height: 44px; /* Accessibility */
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Button focus timeout */
.btn:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
  animation: removeFocus 1s forwards;
}

@keyframes removeFocus {
  0%, 70% {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
  }
  100% {
    outline: 2px solid transparent;
    outline-offset: 2px;
  }
}

.btn-primary {
  background: var(--primary-bg);
  color: var(--text-light);
  border: 2px solid var(--primary-dark);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #4A4A4A !important;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--primary-dark);
  border: none;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-bg);
}

.btn-large {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-lg);
}

.btn-sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  min-height: 32px;
}

/* Cards */
.feature-card,
.mode-card,
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.feature-card:hover,
.mode-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.feature-card.clickable {
  cursor: pointer;
  user-select: none;
}

.feature-card.clickable:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-bg);
}

/* Clickable header elements */
.header-title.clickable {
  cursor: pointer;
  transition: color var(--transition-base);
}

.header-title.clickable:hover {
  color: var(--primary-bg);
}

.stat-points.clickable {
  cursor: pointer;
  transition: all var(--transition-base);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  color: var(--text-primary);
}

#points-display {
    color: #1A1A1A !important;
}

#points-display * {
    color: #1A1A1A !important;
}

.stat-points.clickable:hover {
    color: #1A1A1A !important;
}

.stat-points.clickable:hover * {
    color: #1A1A1A !important;
}

/* Quiz styles */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-6);
}

.quiz-question-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-md);
}

.quiz-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.quiz-options {
  margin: var(--space-6) 0;
}

.quiz-option {
  display: block;
  width: 100%;
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  text-align: left;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  color: #1A1A1A !important;
}

.quiz-option:hover {
  border-color: var(--primary-light);
  background: var(--primary-light);
  color: var(--text-primary);
}

.quiz-option.selected {
  border-color: var(--primary-bg);
  background: var(--primary-bg);
  color: var(--text-light);
}

.quiz-option.correct {
  border-color: var(--success);
  background: var(--success);
  color: var(--text-light);
}

.quiz-option.incorrect {
  border-color: var(--error);
  background: var(--error);
  color: var(--text-light);
}

.quiz-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-top: var(--space-6);
}

.quiz-progress {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.progress-fill {
  height: 100%;
  background: var(--primary-bg);
  transition: width var(--transition-base);
  width: 0%;
}

.progress-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.feature-title,
.mode-title {
  font-size: var(--text-xl);
  font-weight: bold;
  color: var(--primary-dark);
  margin-bottom: var(--space-2);
}

.feature-text,
.mode-desc {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Suspect Cards */
.suspect-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 2px solid transparent;
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.suspect-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.suspect-card.matches-filter {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(184, 134, 11, 0.1) 100%);
}

.suspect-photo {
  flex-shrink: 0;
}

.photo-placeholder {
  width: 80px;
  height: 80px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-3xl);
  color: var(--primary-dark);
}

.photo-placeholder-large {
  width: 150px;
  height: 150px;
  font-size: var(--text-4xl);
}

.suspect-info {
  flex: 1;
}

.suspect-name {
  font-size: var(--text-lg);
  font-weight: bold;
  color: var(--primary-dark);
  margin-bottom: var(--space-1);
}

.suspect-details,
.suspect-features {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.suspect-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Results Grid */
.results-grid,
.suspects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-4);
}

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-8);
  font-style: italic;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color);
}

.results-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sort-select {
  padding: var(--space-1) var(--space-2);
  border: 2px solid var(--text-muted);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: var(--text-sm);
  min-width: 200px;
}

/* Forms */
.search-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.search-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.search-field-narrow {
  max-width: 200px;
  min-width: 150px;
}

.search-field label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.search-field input,
.search-field select {
  padding: var(--space-2);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  transition: all var(--transition-base);
}

.search-field input:focus,
.search-field select:focus {
  border-color: var(--primary-bg);
  outline: none;
  box-shadow: 0 0 0 3px rgba(152, 104, 48, 0.2);
}

.range-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.range-input input {
  flex: 1;
}

.operator-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.operator-input select {
  min-width: 70px;
  flex-shrink: 0;
}

/* Age operator - medium grey */
#search-age-operator {
  border-color: var(--text-muted);
}

/* Height operator - darker grey */
#search-height-operator {
  border-color: var(--text-muted);
}

.operator-input input {
  flex: 1;
}

.search-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-2);
}

/* Quick Filters */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.filter-label {
  margin-right: var(--space-2);
  color: var(--text-light);
  font-weight: 500;
}

.filter-tag {
  padding: var(--space-1) var(--space-3);
  background: var(--bg-card);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-base);
  cursor: pointer;
  color: var(--text-primary);
}

.filter-tag:hover {
  border-color: var(--primary-bg);
  background: var(--bg-card-hover);
}

.filter-tag.active {
  background: var(--accent-green);
  color: var(--text-light);
  border: 2px solid var(--primary-light);
  font-weight: 600;
}

/* Remove border from inactive gender filters only when one is selected */
.has-gender-selection .filter-tag[data-filter^="sex:"]:not(.active) {
  border: 2px solid transparent;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  padding: var(--space-4);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn var(--transition-slow);
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  font-size: var(--text-2xl);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.modal-close:hover {
  background: var(--bg-body);
  color: var(--primary-dark);
}

.modal-title {
  font-size: var(--text-2xl);
  font-weight: bold;
  color: var(--primary-dark);
  margin-bottom: var(--space-4);
}

.modal-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-6);
}

/* Suspect Detail */
.suspect-detail-content {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-6);
  margin: var(--space-4) 0;
}

.detail-list {
  list-style: none;
  space-y: var(--space-2);
}

.detail-list li {
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--bg-body);
}



/* Hints */
.hint-categories {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hint-category h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.hint-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hint-item {
  background: var(--bg-body);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hint-item.used {
  opacity: 0.8;
  background: var(--bg-card-hover);
}

.hint-used {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
}

/* Messages */
.message {
  position: fixed;
  top: var(--space-8);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  opacity: 0;
  transition: all var(--transition-base);
}

.message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.message-success {
  background: var(--success);
  color: white;
}

.message-error {
  background: var(--error);
  color: white;
}

.message-warning {
  background: var(--warning);
  color: white;
}

.message-info {
  background: var(--info);
  color: white;
}

/* Achievements */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.achievement {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  border: 2px solid var(--primary-light);
  transition: all var(--transition-base);
}

.achievement.earned {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(184, 134, 11, 0.1) 100%);
}

.achievement-icon {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-2);
}

.achievement h4 {
  font-size: var(--text-lg);
  font-weight: bold;
  color: var(--primary-dark);
  margin-bottom: var(--space-1);
}

.achievement p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.achievement-points {
  font-weight: bold;
  color: var(--accent-gold);
  margin-top: var(--space-2);
}

/* Case Status Table */
.case-status {
  margin-top: var(--space-8);
}

.case-status h3 {
  margin-bottom: var(--space-4);
  color: var(--primary-dark);
}

.case-status-table {
  background: #D5D5D5; /* Darker gray instead of white */
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.case-status-header {
  display: grid;
  grid-template-columns: 80px 1fr 140px;
  gap: var(--space-3);
  padding: var(--space-3);
  background: #C0A882; /* Tan/beige header */
  color: #2D2D2D;
  font-weight: bold;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.case-status-row {
  display: grid;
  grid-template-columns: 80px 1fr 140px;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid #CCCCCC;
  transition: background-color var(--transition-base);
  background: #E5E5E5 !important; /* Medium gray background */
  color: #1A1A1A !important;
}

.case-status-row:hover {
  background: #DADADA !important; /* Darker gray on hover */
}

.case-status-cell {
  display: flex;
  justify-content: center;
  align-items: center;
}

.case-status-row:last-child {
  border-bottom: none;
}

.case-number {
  font-weight: bold;
  color: #1A1A1A !important; /* Force dark text */
}

.case-title {
  color: #1A1A1A !important; /* Force dark text */
}

.case-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: bold !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  min-width: 100px !important;
  height: 28px !important;
  border: 2px solid transparent !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.case-status-completed {
  background: #16A34A !important; /* Strong green */
  color: white !important;
  border-color: #15803D !important;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.4) !important;
}

.case-status-failed {
  background: #DC2626 !important; /* Strong red */
  color: white !important;
  border-color: #B91C1C !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4) !important;
}

.case-status-pending {
  background: #6B7280 !important; /* Medium gray */
  color: white !important;
  border-color: #4B5563 !important;
  box-shadow: 0 2px 6px rgba(107, 114, 128, 0.4) !important;
}

/* Progress Stats */
.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card {
  text-align: center;
}

.stat-card h3 {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.stat-large {
  font-size: var(--text-4xl);
  font-weight: bold;
  color: var(--primary-dark);
}

/* Responsive Components */
@media (max-width: 640px) {
  .results-grid,
  .suspects-grid {
    grid-template-columns: 1fr;
  }
  
  .search-row {
    grid-template-columns: 1fr;
  }
  
  .suspect-detail-content {
    grid-template-columns: 1fr;
  }
  
  .detail-photo {
    text-align: center;
    margin-bottom: var(--space-4);
  }
  
  .modal-content {
    padding: var(--space-4);
  }
  
  .achievement-grid {
    grid-template-columns: repeat(2, 1fr);
  }
} 

/* Suspect Card Styles */
.suspect-card {
    background: var(--bg-body);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: all var(--transition-base);
}

.suspect-card:hover {
    border-color: var(--primary-bg);
    box-shadow: var(--shadow-md);
}

.suspect-card.matches-filter {
    border-color: var(--primary-dark);
    background: rgba(152, 104, 48, 0.1);
}

.suspect-photo {
    position: relative;
    margin-bottom: var(--space-3);
}

.suspect-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 2px solid var(--primary-light);
}

.photo-placeholder {
    width: 100%;
    height: 120px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--text-muted);
}

.suspect-info {
    margin-bottom: var(--space-3);
}

.suspect-name {
    margin: 0 0 var(--space-2) 0;
    color: var(--primary-dark);
    font-family: var(--font-primary);
}

.suspect-details,
.suspect-features {
    margin: var(--space-1) 0;
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.suspect-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: space-between;
}

.suspect-actions .btn {
    flex: 1;
} 

.search-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border: 2px solid var(--primary-light);
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--primary-light);
} 

/* Intro Animation Styles */
.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.intro-overlay.active {
  opacity: 1;
  visibility: visible;
}

.intro-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  height: 80%;
  max-height: 600px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary-light);
  overflow: hidden;
}

.intro-skip {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: rgba(0, 0, 0, 0.7);
  color: var(--text-light);
  border: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  z-index: 10;
  transition: background var(--transition-base);
}

.intro-skip:hover {
  background: rgba(0, 0, 0, 0.9);
}

.intro-scene {
  width: 100%;
  height: calc(100% - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.intro-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--bg-secondary);
}

.intro-progress-bar {
  height: 100%;
  background: var(--accent-gold);
  width: 0%;
  transition: width 0.3s ease;
}

/* Animation Scene Elements */
.intro-case-image {
  width: 600px;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
  opacity: 0;
  transform: scale(0.8);
  animation: fadeInScale 1s ease forwards;
}

.intro-character {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-4) 0;
  opacity: 0;
  transform: translateX(-50px);
  animation: slideInLeft 0.8s ease forwards;
}

.intro-character.from-right {
  transform: translateX(50px);
  animation: slideInRight 0.8s ease forwards;
}

.intro-character-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--primary-light);
}

.intro-dialogue {
  background: var(--bg-card);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  max-width: 400px;
  margin: var(--space-2) 0;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 0.5s;
}

.intro-dialogue.holmes {
  border-left-color: rgba(0, 0, 0, 0.7);
}

.intro-dialogue.watson {
  border-left-color: var(--primary-dark);
}

.intro-dialogue.witness {
  border-left-color: var(--text-secondary);
}

.intro-search-demo {
  background: var(--bg-card);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-4) 0;
  max-width: 500px;
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.8s ease forwards;
}

.intro-search-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0;
  padding: var(--space-2);
  background: var(--bg-body);
  border-radius: var(--radius-md);
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.intro-search-field:nth-child(1) { animation-delay: 0.2s; }
.intro-search-field:nth-child(2) { animation-delay: 0.4s; }
.intro-search-field:nth-child(3) { animation-delay: 0.6s; }

.intro-suspect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.intro-suspect-card {
  background: var(--bg-card);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  text-align: center;
  transition: all var(--transition-base);
  opacity: 1;
  transform: scale(1);
}

.intro-suspect-card.eliminated {
  opacity: 0.3;
  transform: scale(0.8);
  filter: grayscale(100%);
}

.intro-suspect-card.selected {
  border-color: var(--accent-green);
  background: rgba(46, 125, 50, 0.1);
  transform: scale(1.05);
}

.intro-suspect-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto var(--space-2);
}

.intro-text {
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin: var(--space-3) 0;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.intro-text.large {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--primary-dark);
}

.intro-typewriter {
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: typewriter 2s steps(40) forwards;
}

/* Animation Keyframes */
@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes fadeInScale {
  to { 
    opacity: 1; 
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  to { 
    opacity: 1; 
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  to { 
    opacity: 1; 
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  to { 
    opacity: 1; 
    transform: translateY(0);
  }
}

@keyframes typewriter {
  to { width: 100%; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Netflix-style Background Grid */
.netflix-background-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: repeat(auto-fill, 120px);
  grid-template-rows: repeat(auto-fill, 120px);
  gap: 2px;
  background: #000;
  z-index: -1;
  overflow: hidden;
}

.grid-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.grid-thumbnail:nth-child(odd) {
  opacity: 0.4;
}

.grid-thumbnail:nth-child(3n) {
  opacity: 0.8;
} 

/* Enhanced Intro Animation Styles */
.intro-character.enhanced {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-6);
}

.intro-character-image-large {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-light);
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

.intro-dialogue.enhanced {
  background: rgba(var(--primary-dark-rgb), 0.9);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  flex: 1;
  border: 2px solid var(--primary-light);
}

.character-name {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: var(--space-3);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.dialogue-text {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.dialogue-hint {
  font-size: var(--text-base);
  color: var(--primary-light);
  font-style: italic;
  padding: var(--space-2) var(--space-4);
  background: rgba(var(--primary-light-rgb), 0.1);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-light);
}

.witness-details {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.clue {
  background: rgba(var(--primary-light-rgb), 0.2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary-light);
  border: 1px solid var(--primary-light);
}

.query-preview {
  background: #1a1a1a;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
  border: 1px solid #333;
}

.query-preview code {
  color: #4CAF50;
  font-family: 'Courier New', monospace;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  display: block;
  overflow-wrap: break-word;
}

.intro-character.from-right.enhanced {
  flex-direction: row-reverse;
}

/* Responsive adjustments for enhanced intro */
@media (max-width: 768px) {
  .intro-character.enhanced {
    flex-direction: column;
    text-align: center;
    gap: var(--space-4);
  }
  
  .intro-character.from-right.enhanced {
    flex-direction: column;
  }
  
  .intro-character-image-large {
    width: 150px;
    height: 150px;
  }
  
  .witness-details {
    justify-content: center;
  }
} 

/* Vintage Index Card Stack */
.filing-cabinet-header {
  text-align: center;
  margin-bottom: var(--space-8);
  padding: var(--space-4);
  background: linear-gradient(145deg, #2c1810, #3d2317);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-md);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.cabinet-title {
  font-family: 'Courier New', monospace;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: 2px;
  margin: 0 0 var(--space-2) 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.cabinet-label {
  font-family: 'Courier New', monospace;
  font-size: var(--text-sm);
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* COMPLETE FAN LAYOUT OVERHAUL */
.index-card-stack {
  position: relative;
  width: 100%;
  height: 400px;
  margin: 0 auto;
  overflow: visible;
}

.index-card {
  position: absolute;
  width: 450px; /* More rectangular - wider */
  height: 280px; /* More rectangular - shorter */
  /* Brown manila envelope background */
  background: #D4B896;
  background-image: 
    /* Larger, fewer paper smudges and aging marks */
    radial-gradient(ellipse 60px 80px at 15% 75%, rgba(181, 149, 106, 0.25) 0%, rgba(181, 149, 106, 0.1) 30%, transparent 60%),
    radial-gradient(ellipse 70px 50px at 85% 25%, rgba(196, 165, 123, 0.2) 0%, rgba(196, 165, 123, 0.08) 25%, transparent 55%),
    radial-gradient(ellipse 50px 70px at 40% 10%, rgba(181, 149, 106, 0.15) 0%, rgba(181, 149, 106, 0.05) 20%, transparent 50%),
    /* Very subtle paper grain */
    linear-gradient(90deg, rgba(196, 165, 123, 0.05) 50%, transparent 50%);
  background-size: 
    100% 100%, 100% 100%, 100% 100%,
    3px 3px;
  border: 1px solid #B5956A;
  border-radius: 8px;
  box-shadow: 
    0 8px 16px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(232, 213, 179, 0.8),
    inset 0 -1px 0 rgba(181, 149, 106, 0.4),
    inset 1px 0 0 rgba(232, 213, 179, 0.3),
    inset -1px 0 0 rgba(181, 149, 106, 0.2);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-family: 'Courier New', monospace;
  opacity: 1;
  backdrop-filter: none;
}

/* LEFT TO RIGHT LAYOUT - Proper progression: Rookie → Detective → Senior → Inspector → Chief → Random → All Cases */
/* ROOKIE DETECTIVE - Leftmost */
.card-top {
  left: 50px;
  top: 80px;
  transform: rotate(-8deg);
  z-index: 7;
}

/* DETECTIVE */
.card-top-lower {
  left: 170px;
  top: 60px;
  transform: rotate(-5deg);
  z-index: 6;
}

/* SENIOR DETECTIVE */
.card-middle-upper {
  left: 290px;
  top: 45px;
  transform: rotate(-2deg);
  z-index: 5;
}

/* INSPECTOR - Center, highest */
.card-middle {
  left: 410px;
  top: 35px;
  transform: rotate(0deg);
  z-index: 4;
}

/* CHIEF INSPECTOR */
.card-middle-lower {
  left: 530px;
  top: 45px;
  transform: rotate(2deg);
  z-index: 3;
}

/* RANDOM CASE */
.card-bottom {
  left: 650px;
  top: 60px;
  transform: rotate(5deg);
  z-index: 2;
}

/* ALL CASES - Rightmost */
.card-bottom-far {
  left: 770px;
  top: 80px;
  transform: rotate(8deg);
  z-index: 1;
}

/* Enhanced hover effect - maintains position, more rectangular */
.card-top:hover {
  transform: rotate(-8deg) scale(1.05);
  z-index: 100;
}

.card-top-lower:hover {
  transform: rotate(-5deg) scale(1.05);
  z-index: 100;
}

.card-middle-upper:hover {
  transform: rotate(-2deg) scale(1.05);
  z-index: 100;
}

.card-middle:hover {
  transform: rotate(0deg) scale(1.05);
  z-index: 100;
}

.card-middle-lower:hover {
  transform: rotate(2deg) scale(1.05);
  z-index: 100;
}

.card-bottom:hover {
  transform: rotate(5deg) scale(1.05);
  z-index: 100;
}

.card-bottom-far:hover {
  transform: rotate(8deg) scale(1.05);
  z-index: 100;
}

/* Locked vintage card styles */
.index-card.locked {
  opacity: 1;
  filter: grayscale(60%) contrast(0.8);
  cursor: not-allowed;
  background: #B5956A;
  background-image: 
    /* Darker, more muted aging marks for locked state */
    radial-gradient(ellipse 60px 80px at 15% 75%, rgba(150, 120, 85, 0.3) 0%, rgba(150, 120, 85, 0.15) 30%, transparent 60%),
    radial-gradient(ellipse 70px 50px at 85% 25%, rgba(140, 110, 75, 0.25) 0%, rgba(140, 110, 75, 0.1) 25%, transparent 55%),
    radial-gradient(ellipse 50px 70px at 45% 15%, rgba(135, 105, 70, 0.2) 0%, rgba(135, 105, 70, 0.08) 35%, transparent 50%),
    /* Crosshatch pattern overlay for locked appearance */
    repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(120, 90, 60, 0.1) 2px, rgba(120, 90, 60, 0.1) 4px),
    repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(120, 90, 60, 0.1) 2px, rgba(120, 90, 60, 0.1) 4px);
}

.index-card.locked:hover {
  transform: translateZ(50px) translateY(-10px) rotate(0deg) scale(1.05) !important;
  box-shadow: 
    0 20px 40px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.7);
  z-index: 99 !important;
  filter: grayscale(40%) contrast(0.9) brightness(1.05);
}

.index-card.locked .index-card-btn {
  background: #8B7355;
  color: #D4C4A0;
  cursor: not-allowed;
  opacity: 1;
}

.index-card.locked .index-card-btn:hover {
  background: #8B7355;
  transform: none;
}

.index-card.locked .case-title,
.index-card.locked .case-desc {
  color: #8B7355;
}

/* Lock icon for vintage cards */
.card-lock-icon {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  color: #B8860B;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  z-index: 20;
  animation: lockFloat 2s ease-in-out infinite;
  background: rgba(139, 69, 19, 0.9);
  padding: 8px;
  border-radius: 50%;
  border: 2px solid #8B4513;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

@keyframes lockFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}

/* Lock stamp for vintage cards */
.lock-stamp {
  position: absolute;
  bottom: 45px;
  right: 25px;
  background: #DC143C;
  color: #FFFFFF;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  border-radius: 2px;
  border: 2px solid #8B0000;
  transform: rotate(-12deg);
  z-index: 15;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
  letter-spacing: 1px;
  animation: lockPulse 1.5s ease-in-out infinite;
}

@keyframes lockPulse {
  0%, 100% { 
    opacity: 1; 
    transform: rotate(-12deg) scale(1);
  }
  50% { 
    opacity: 0.8; 
    transform: rotate(-12deg) scale(1.05);
  }
}



/* Card header with tab */
.card-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid #B5956A;
  background: #C4A57B;
  background-image: linear-gradient(to bottom, rgba(232, 213, 179, 0.4) 0%, rgba(181, 149, 106, 0.2) 100%);
}

.card-tab {
  background: #E8D5B3;
  padding: var(--space-1) var(--space-3);
  border-radius: 4px 4px 0 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1px;
  color: #5c4a3a;
  text-shadow: 1px 1px 1px rgba(232, 213, 179, 0.8);
  border: 1px solid #B5956A;
  border-bottom: none;
  box-shadow: inset 0 1px 0 rgba(255, 245, 230, 0.6);
}

.hole-punch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ccc;
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.2),
    0 1px 2px rgba(0,0,0,0.1);
}

/* Card content */
.card-content {
  position: relative;
  height: 240px;
  padding: var(--space-4);
  display: flex;
  align-items: flex-start;
}

.red-margin-line {
  position: absolute;
  left: 60px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #ff6b6b;
  opacity: 0.6;
}

.card-text {
  margin-left: 80px;
  width: calc(100% - 100px);
}

.case-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: #2c1810;
  margin-bottom: var(--space-3);
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.2;
}

.case-desc {
  font-size: var(--text-base);
  color: #5c4a3a;
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

.case-stamp {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  background: rgba(220, 53, 69, 0.1);
  border: 2px solid #dc3545;
  border-radius: 4px;
  color: #dc3545;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 1px;
  transform: rotate(-8deg);
  text-transform: uppercase;
  margin-top: var(--space-2);
}

.case-stamp::before {
  content: "★ ";
}

/* Different stamp colors */
.card-bottom .case-stamp {
  border-color: #6610f2;
  color: #6610f2;
  background: rgba(102, 16, 242, 0.1);
}

.card-middle .case-stamp {
  border-color: #fd7e14;
  color: #fd7e14;
  background: rgba(253, 126, 20, 0.1);
}

/* Index card button */
.index-card-btn {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  background: var(--primary-dark);
  color: var(--text-primary);
  border: 2px solid var(--primary-light);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.index-card-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 
    0 4px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Filing cabinet footer */
.filing-cabinet-footer {
  text-align: center;
  margin-top: var(--space-6);
  padding: var(--space-3);
  border-top: 1px solid var(--primary-light);
  opacity: 0.7;
}

.cabinet-info {
  font-family: 'Courier New', monospace;
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .index-card-stack {
    height: 320px;
    max-width: 400px;
  }
  
  .index-card {
    height: 280px;
  }
  
  .card-content {
    height: 190px;
    padding: var(--space-3);
  }
  
  .card-text {
    margin-left: 60px;
    width: calc(100% - 80px);
  }
  
  .red-margin-line {
    left: 45px;
  }
  
  .case-title {
    font-size: var(--text-base);
  }
  
  .case-desc {
    font-size: var(--text-sm);
  }
} 

/* Dynamic Preview Box */
.case-preview-box {
  width: 100%;
  max-width: 900px;
  margin: var(--space-6) auto var(--space-4) auto;
  background: #2c1810;
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: 
    0 8px 16px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(232, 213, 179, 0.2);
  opacity: 0.9;
  transition: all 0.3s ease;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(196, 165, 123, 0.05) 2px,
      rgba(196, 165, 123, 0.05) 4px
    );
}

.preview-content {
  text-align: center;
  font-family: 'Courier New', monospace;
}

.preview-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.preview-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.preview-case-number {
  font-size: var(--text-lg);
  color: var(--primary-light);
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.preview-title {
  font-size: var(--text-xl);
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--space-3);
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.preview-requirements {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.preview-lock {
  color: #B8860B;
  font-size: var(--text-base);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.preview-requires {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.preview-rank {
  font-size: var(--text-base);
  color: var(--primary-light);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.preview-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.8;
  margin: 0;
}

/* Preview box states for different cards */
.case-preview-box.rookie .preview-lock {
  display: none;
}

.case-preview-box.locked .preview-requirements {
  background: rgba(220, 53, 69, 0.2);
  border-color: #dc3545;
}

.case-preview-box.unlocked .preview-requirements {
  background: rgba(40, 167, 69, 0.2);
  border-color: #28a745;
}

.case-preview-box.unlocked .preview-lock {
  color: #28a745;
}

/* Hover effects */
.case-preview-box:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 
    0 12px 24px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(232, 213, 179, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .case-preview-box {
    margin: var(--space-4) auto var(--space-3) auto;
    padding: var(--space-3);
  }
  
  .preview-header {
    flex-direction: column;
    gap: var(--space-1);
  }
  
  .preview-title {
    font-size: var(--text-lg);
  }
  
  .preview-requirements {
    flex-wrap: wrap;
    gap: var(--space-1);
  }
} 

/* Enhanced Game Completion Styles */
.game-complete-enhanced {
  text-align: center;
  padding: var(--space-6);
  max-width: 600px;
  margin: 0 auto;
}

.game-complete-enhanced h2 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: var(--space-3);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-complete-enhanced h3 {
  color: var(--accent-color);
  font-size: 1.5rem;
  margin-bottom: var(--space-5);
}

.completion-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.performance-badge {
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  color: white;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin: var(--space-5) 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.performance-badge h4 {
  margin-bottom: var(--space-2);
  font-size: 1.3rem;
}

.performance-badge p {
  margin: var(--space-2) 0;
}

.badge-description {
  font-style: italic;
  opacity: 0.9;
}

.whats-next {
  margin: var(--space-5) 0 var(--space-4) 0;
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.whats-next h4 {
  color: var(--primary-color);
  margin-bottom: var(--space-2);
}

.completion-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.completion-actions .btn {
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  font-size: 0.95rem;
}

.btn-accent {
  background: var(--accent-color);
  color: white;
  border: 2px solid var(--accent-color);
}

.btn-accent:hover {
  background: transparent;
  color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-info {
  background: var(--info-color);
  color: white;
  border: 2px solid var(--info-color);
}

.btn-info:hover {
  background: transparent;
  color: var(--info-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Responsive adjustments for completion screen */
@media (max-width: 768px) {
  .game-complete-enhanced h2 {
    font-size: 2rem;
  }
  
  .completion-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .completion-actions {
    grid-template-columns: 1fr;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .completion-stats {
    grid-template-columns: 1fr;
  }
  
  .game-complete-enhanced {
    padding: var(--space-4);
  }
}

/* Educational links within messages */
.message a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
  transition: opacity var(--transition-base);
}

.message a:hover {
  opacity: 0.8;
  text-decoration: none;
}

.message-error a {
  color: #ADD8E6; /* Light blue for error messages */
}

.message-info a {
  color: #E6F3FF; /* Very light blue for info messages */
}

/* Progress Screen Case Status Table - High Specificity Override */
#progress-screen .case-status-table {
  background: #D5D5D5 !important;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

#progress-screen .case-status-header {
  display: grid !important;
  grid-template-columns: 80px 1fr 140px !important;
  gap: var(--space-3);
  padding: var(--space-3);
  background: #C0A882 !important;
  color: #2D2D2D !important;
  font-weight: bold;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#progress-screen .case-status-row {
  display: grid !important;
  grid-template-columns: 80px 1fr 140px !important;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid #CCCCCC;
  transition: background-color var(--transition-base);
  background: #E5E5E5 !important;
  color: #1A1A1A !important;
}

#progress-screen .case-status-row:hover {
  background: #DADADA !important;
}

#progress-screen .case-status-cell {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#progress-screen .case-number {
  font-weight: bold;
  color: #1A1A1A !important;
}

#progress-screen .case-title {
  color: #1A1A1A !important;
}

#progress-screen .case-status-badge {
  /* Reset conflicting properties from early definition */
  position: static !important;
  top: auto !important;
  left: auto !important;
  z-index: auto !important;
  
  /* Core layout properties */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: bold !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  min-width: 100px !important;
  height: 28px !important;
  border: 2px solid transparent !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

#progress-screen .case-status-completed {
  background: #16A34A !important;
  color: white !important;
  border-color: #15803D !important;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.4) !important;
}

#progress-screen .case-status-failed {
  background: #DC2626 !important;
  color: white !important;
  border-color: #B91C1C !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4) !important;
}

#progress-screen .case-status-pending {
  background: #6B7280 !important;
  color: white !important;
  border-color: #4B5563 !important;
  box-shadow: 0 2px 6px rgba(107, 114, 128, 0.4) !important;
}

/* Final styles for case status table */
#progress-screen .case-status-table {
  background: #D5D5D5 !important;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color) !important;
}
