:root {
  --void: #0a0e12;
  --midnight: #111820;
  --steel: #1a2332;
  --slate: #2a3847;
  --frost: #e8f4f2;
  --ice: #c5e5df;
  --signal: #00f6ff;
  --signal-dim: #00c7d3;
  --alert: #ff3366;
  --warning: #ffaa00;
  --grid: rgba(0, 246, 255, 0.08);
  --glow: rgba(0, 246, 255, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background: var(--void);
  color: var(--frost);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Tactical Grid Overlay */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Header */
.mission-header {
  position: sticky;
  top: 0;
  background: rgba(10, 14, 18, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--steel);
  z-index: 100;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Syne', sans-serif;
}

.truio-logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--signal);
  text-shadow: 0 0 20px var(--glow);
  letter-spacing: 0.1em;
}

.divider {
  color: var(--slate);
  font-weight: 300;
}

.section-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ice);
  letter-spacing: 0.15em;
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--midnight);
  border: 1px solid var(--steel);
  border-radius: 50px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  background: var(--signal);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px var(--signal);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.agent-callsign {
  font-weight: 700;
  font-size: 1rem;
  color: var(--frost);
  letter-spacing: 0.05em;
}

.agent-rank {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--steel);
  border-radius: 4px;
  color: var(--signal);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.1em;
}

/* Main Container */
.mission-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}

/* Stats Panel */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--midnight) 0%, var(--steel) 100%);
  border: 1px solid var(--slate);
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--signal), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--signal);
  box-shadow: 0 10px 40px rgba(0, 246, 255, 0.2);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--signal);
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(0, 246, 255, 0.3);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--ice);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Briefing Section */
.briefing-section {
  background: var(--midnight);
  border: 1px solid var(--steel);
  border-radius: 16px;
  padding: 3rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

.briefing-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 246, 255, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.briefing-header {
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.briefing-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--frost);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.briefing-subtitle {
  font-size: 0.95rem;
  color: var(--signal);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.briefing-content {
  position: relative;
  z-index: 1;
}

.briefing-content > p {
  font-size: 1.05rem;
  color: var(--ice);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.briefing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.briefing-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: rgba(26, 35, 50, 0.5);
  border: 1px solid var(--slate);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.briefing-item:hover {
  background: rgba(26, 35, 50, 0.8);
  border-color: var(--signal);
  transform: translateX(5px);
}

.briefing-icon {
  font-size: 2rem;
  filter: grayscale(1) brightness(1.5);
}

.briefing-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.briefing-text strong {
  font-size: 1.1rem;
  color: var(--frost);
  font-weight: 700;
}

.briefing-text span {
  font-size: 0.9rem;
  color: var(--ice);
  line-height: 1.6;
}

/* Mission Board */
.mission-board {
  margin-bottom: 3rem;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.board-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--frost);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mission-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  background: var(--midnight);
  border: 1px solid var(--steel);
  border-radius: 8px;
  color: var(--ice);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-btn:hover {
  background: var(--steel);
  border-color: var(--signal);
  color: var(--signal);
}

.filter-btn.active {
  background: var(--signal);
  color: var(--void);
  border-color: var(--signal);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.4);
}

/* Mission Grid */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.mission-card {
  background: var(--midnight);
  border: 1px solid var(--steel);
  border-radius: 16px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mission-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--signal);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mission-card:hover {
  transform: translateY(-5px);
  border-color: var(--signal);
  box-shadow: 0 15px 50px rgba(0, 246, 255, 0.2);
}

.mission-card:hover::before {
  opacity: 1;
}

.mission-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.mission-type {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: var(--steel);
  border-radius: 6px;
  color: var(--signal);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.mission-priority {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.mission-priority.high {
  background: rgba(255, 51, 102, 0.2);
  color: var(--alert);
  border: 1px solid var(--alert);
}

.mission-priority.medium {
  background: rgba(255, 170, 0, 0.2);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.mission-priority.low {
  background: rgba(0, 246, 255, 0.2);
  color: var(--signal);
  border: 1px solid var(--signal);
}

.mission-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--frost);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.mission-card-desc {
  font-size: 0.95rem;
  color: var(--ice);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.mission-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--steel);
}

.mission-reward {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--signal);
  font-weight: 700;
}

.mission-status {
  font-size: 0.8rem;
  color: var(--ice);
  opacity: 0.8;
}

/* Loading State */
.mission-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 1rem;
  border: 3px solid var(--steel);
  border-top-color: var(--signal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Active Missions Panel */
.active-missions-panel {
  margin-bottom: 3rem;
}

.active-missions-panel h2 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--frost);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.active-missions-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.active-mission-item {
  background: var(--midnight);
  border: 1px solid var(--signal);
  border-radius: 12px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.active-mission-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 246, 255, 0.05), transparent);
  pointer-events: none;
}

.active-mission-item:hover {
  transform: translateX(5px);
  box-shadow: 0 10px 40px rgba(0, 246, 255, 0.3);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 18, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--midnight);
  border: 2px solid var(--signal);
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.4s ease;
  box-shadow: 0 20px 80px rgba(0, 246, 255, 0.3);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 50%;
  color: var(--frost);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close:hover {
  background: var(--alert);
  border-color: var(--alert);
  transform: rotate(90deg);
}

.mission-detail-header {
  padding: 3rem;
  border-bottom: 1px solid var(--steel);
  position: relative;
}

.mission-classification {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.4rem 1rem;
  background: var(--alert);
  color: var(--void);
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.mission-detail-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--frost);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.mission-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.mission-id {
  color: var(--signal);
  font-weight: 700;
}

.mission-difficulty {
  color: var(--warning);
  font-weight: 700;
}

.mission-detail-body {
  padding: 3rem;
}

.mission-detail-body h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--signal);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mission-objective,
.mission-criteria,
.mission-intel,
.mission-rewards {
  margin-bottom: 2.5rem;
}

.mission-objective p {
  color: var(--ice);
  font-size: 1.05rem;
  line-height: 1.8;
}

.mission-criteria ul {
  list-style: none;
  padding: 0;
}

.mission-criteria li {
  padding: 1rem;
  background: var(--steel);
  border-left: 3px solid var(--signal);
  margin-bottom: 0.75rem;
  border-radius: 6px;
  color: var(--ice);
}

.mission-criteria li::before {
  content: '→';
  color: var(--signal);
  margin-right: 0.75rem;
  font-weight: 700;
}

.mission-intel {
  padding: 1.5rem;
  background: rgba(26, 35, 50, 0.5);
  border: 1px solid var(--steel);
  border-radius: 12px;
  color: var(--ice);
  line-height: 1.8;
}

.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}

.reward-item {
  text-align: center;
  padding: 1.5rem;
  background: var(--steel);
  border-radius: 12px;
  border: 1px solid var(--slate);
}

.reward-value {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--signal);
  margin-bottom: 0.5rem;
}

.reward-label {
  display: block;
  font-size: 0.85rem;
  color: var(--ice);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mission-detail-footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--steel);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-analyzer {
  padding: 1rem 2rem;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: var(--signal);
  color: var(--void);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.4);
}

.btn-primary:hover {
  background: var(--signal-dim);
  transform: translateY(-2px);
  box-shadow: 0 5px 30px rgba(0, 246, 255, 0.6);
}

.btn-primary:disabled {
  background: var(--steel);
  color: var(--slate);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--frost);
  border: 1px solid var(--steel);
}

.btn-secondary:hover {
  background: var(--steel);
  border-color: var(--signal);
  color: var(--signal);
}

.btn-analyzer {
  background: var(--steel);
  color: var(--signal);
  border: 1px solid var(--signal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
  margin-bottom: 1rem;
}

.btn-analyzer:hover {
  background: var(--signal);
  color: var(--void);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.4);
}

/* Active Mission View */
.active-mission-view {
  max-width: 900px;
}

.active-mission-header {
  padding: 3rem;
  border-bottom: 1px solid var(--steel);
  position: relative;
}

.mission-status-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.4rem 1rem;
  background: rgba(0, 246, 255, 0.2);
  color: var(--signal);
  border: 1px solid var(--signal);
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.active-mission-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--frost);
  margin-bottom: 1rem;
}

.mission-timer {
  color: var(--signal);
  font-weight: 700;
  font-size: 1.1rem;
}

.active-mission-body {
  padding: 3rem;
}

.mission-progress {
  margin-bottom: 3rem;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--steel);
  border-radius: 20px;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid var(--slate);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--signal), var(--signal-dim));
  transition: width 0.5s ease;
  box-shadow: 0 0 15px var(--glow);
}

.progress-stats {
  text-align: center;
  color: var(--ice);
  font-size: 1rem;
  font-weight: 600;
}

/* Form Styles */
.submission-section {
  margin-bottom: 3rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--frost);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 8px;
  color: var(--frost);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(0, 246, 255, 0.1);
}

.analyzer-results {
  padding: 1.5rem;
  background: var(--steel);
  border: 1px solid var(--signal);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.result-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.score-value {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  color: var(--signal);
}

.score-value.high-risk {
  color: var(--alert);
}

.score-value.medium-risk {
  color: var(--warning);
}

.score-value.low-risk {
  color: var(--signal);
}

.result-details {
  color: var(--ice);
  font-size: 0.9rem;
  line-height: 1.6;
}

.submitted-targets {
  margin-bottom: 2rem;
}

.targets-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.target-item {
  padding: 1.5rem;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-left: 3px solid var(--signal);
  border-radius: 8px;
}

.target-url {
  font-weight: 700;
  color: var(--signal);
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.target-score {
  color: var(--warning);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.target-notes {
  color: var(--ice);
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  color: var(--slate);
  padding: 2rem;
  font-style: italic;
}

/* Footer */
.mission-footer {
  max-width: 1400px;
  margin: 4rem auto 2rem;
  padding: 2rem;
  border-top: 1px solid var(--steel);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.guide-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--signal) 0%, var(--signal-dim) 100%);
  color: var(--void);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.3);
  letter-spacing: 0.5px;
}

.guide-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 246, 255, 0.5);
}

.guide-button svg {
  flex-shrink: 0;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--signal);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.footer-link:hover {
  color: var(--frost);
  transform: translateX(-5px);
}

.footer-link svg {
  flex-shrink: 0;
}

.footer-info {
  display: flex;
  gap: 1rem;
  color: var(--slate);
  font-size: 0.9rem;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .mission-container {
    padding: 2rem 1rem;
  }
  
  .mission-header {
    padding: 1rem;
  }
  
  /* Header responsive - stack and center */
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .brand {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }
  
  .divider {
    display: none;
  }
  
  .section-name {
    font-size: 0.9rem;
  }
  
  .agent-status {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }
  
  .truio-header-logo {
    margin-right: 0;
    max-width: 140px;
  }
  
  .mission-grid {
    grid-template-columns: 1fr;
  }
  
  .board-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .briefing-section,
  .mission-detail-header,
  .mission-detail-body,
  .active-mission-header,
  .active-mission-body {
    padding: 2rem 1.5rem;
  }
  
  .briefing-header h1 {
    font-size: 1.5rem;
  }
  
  .modal-content {
    margin: 1rem;
  }

  .footer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .guide-button,
  .footer-link {
    justify-content: center;
    text-align: center;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--midnight);
}

::-webkit-scrollbar-thumb {
  background: var(--steel);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--signal);
}

/* Truio Logo Styling */
.truio-header-logo {
  height: 35px;
  width: auto;
  margin-right: 12px;
  filter: drop-shadow(0 0 10px rgba(0, 246, 255, 0.3));
}

.modal-logo-header {
  text-align: center;
  padding: 1.5rem 2rem 0;
}

.modal-logo {
  height: 50px;
  width: auto;
  filter: drop-shadow(0 0 15px rgba(0, 246, 255, 0.4));
}

.analyzer-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--steel);
}

.analyzer-logo {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(0, 246, 255, 0.3));
}

.analyzer-header h3 {
  margin: 0;
  color: var(--signal);
  font-size: 1.4rem;
}

/* Tactical Brief Button */
.btn-tactical-brief {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: 2px solid var(--signal);
  color: var(--signal);
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
}

.btn-tactical-brief:hover {
  background: var(--signal);
  color: var(--void);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.5);
}

.btn-tactical-brief svg {
  flex-shrink: 0;
}

/* Tactical Brief Modal */
.tactical-brief {
  max-width: 700px;
  background: var(--midnight);
  border: 2px solid var(--signal);
}

.tactical-brief-header {
  text-align: center;
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--steel);
}

.tactical-brief-header svg {
  stroke: var(--signal);
  margin-bottom: 1rem;
}

.tactical-brief-header h2 {
  font-size: 2rem;
  color: var(--signal);
  margin: 0.5rem 0;
  font-family: 'Syne', sans-serif;
  letter-spacing: 2px;
}

.brief-subtitle {
  color: var(--ice);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.tactical-brief-body {
  padding: 2rem;
}

.tactical-brief-body h3 {
  color: var(--signal);
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
  font-family: 'Syne', sans-serif;
  letter-spacing: 1px;
}

.tactical-brief-body h3:first-child {
  margin-top: 0;
}

.tactical-brief-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tactical-brief-body li {
  padding: 0.75rem 0 0.75rem 1.5rem;
  position: relative;
  color: var(--frost);
  line-height: 1.5;
  border-left: 2px solid var(--steel);
  margin-left: 0.5rem;
  margin-bottom: 0.5rem;
}

.tactical-brief-body li::before {
  content: '▸';
  position: absolute;
  left: 0.5rem;
  color: var(--signal);
}

/* Enhanced Image Input */
.image-input-wrapper {
  margin-top: 0.5rem;
}

.btn-image-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--steel);
  border: 1px solid var(--slate);
  color: var(--frost);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-image-upload:hover {
  background: var(--slate);
  border-color: var(--signal);
  color: var(--signal);
}

.btn-remove-image {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--alert);
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-remove-image:hover {
  background: #ff5577;
}

#imagePreview {
  margin-top: 1rem;
  text-align: center;
}

#previewImg {
  display: block;
  margin: 0 auto;
  border: 2px solid var(--signal);
}

/* Forensic Mode Select */
.forensic-select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 8px;
  color: var(--frost);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.forensic-select:hover {
  border-color: var(--signal);
}

.forensic-select:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 2px rgba(0, 246, 255, 0.1);
}

.forensic-select option {
  background: var(--midnight);
  color: var(--frost);
  padding: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .truio-header-logo {
    height: 28px;
  }
  
  .modal-logo {
    height: 40px;
  }
  
  .analyzer-logo {
    height: 32px;
  }
  
  .btn-tactical-brief {
    width: 100%;
    justify-content: center;
  }
}

/* Image Upload Menu Modal (like main app) */
.menuModal {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 10px;
  background: var(--midnight);
  border: 2px solid var(--signal);
  border-radius: 12px;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 0 0 30px rgba(0, 246, 255, 0.4);
}

.menuModal button {
  display: block;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--steel);
  color: var(--frost);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menuModal button:last-child {
  border-bottom: none;
}

.menuModal button:hover {
  background: var(--steel);
  color: var(--signal);
  padding-left: 24px;
}

#thumbnailContainer,
#thumbnailContainerPwa {
  cursor: pointer;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}

#thumbnailContainer:hover,
#thumbnailContainerPwa:hover {
  border-color: var(--signal);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.2);
}

.defaultThumb {
  color: var(--ice);
}

.defaultThumb svg {
  stroke: var(--signal);
}

.defaultThumb p {
  margin: 10px 0 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
/* ============================================================
   COMPACT STATS PANEL - MOBILE OPTIMIZED
   ============================================================ */
.stats-panel-compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.stat-card-compact {
  background: linear-gradient(135deg, var(--midnight) 0%, var(--steel) 100%);
  border: 1px solid var(--slate);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-card-compact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--signal);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card-compact:hover {
  border-color: var(--signal);
  box-shadow: 0 4px 20px rgba(0, 246, 255, 0.2);
}

.stat-card-compact:hover::before {
  opacity: 1;
}

.stat-label-compact {
  font-size: 0.9rem;
  color: var(--ice);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value-compact {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--signal);
  text-shadow: 0 0 15px rgba(0, 246, 255, 0.3);
}

/* Tablet and larger */
@media (min-width: 768px) {
  .stats-panel-compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .stats-panel-compact {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
}

/* ============================================================
   TAB NAVIGATION
   ============================================================ */
.tab-navigation {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--steel);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--ice);
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1rem 1.5rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.tab-btn::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--signal);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tab-btn:hover {
  color: var(--signal);
}

.tab-btn.active {
  color: var(--signal);
}

.tab-btn.active::before {
  transform: scaleX(1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================================
   TRAINING MODULES SECTION
   ============================================================ */
.training-games-section {
  margin-bottom: 3rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--signal);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--ice);
  opacity: 0.8;
}

.training-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .training-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .training-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   TRAINING CARDS
   ============================================================ */
.training-card {
  background: linear-gradient(135deg, var(--midnight) 0%, var(--steel) 100%);
  border: 1px solid var(--slate);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.training-card:hover {
  transform: translateY(-4px);
  border-color: var(--signal);
  box-shadow: 0 10px 40px rgba(0, 246, 255, 0.2);
}

.training-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.training-card.locked:hover {
  transform: none;
  border-color: var(--slate);
  box-shadow: none;
}

.training-card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--slate);
}

.training-difficulty {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.training-difficulty.easy {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.training-difficulty.moderate {
  background: rgba(255, 170, 0, 0.15);
  color: var(--warning);
  border: 1px solid rgba(255, 170, 0, 0.3);
}

.training-difficulty.hard {
  background: rgba(255, 51, 102, 0.15);
  color: var(--alert);
  border: 1px solid rgba(255, 51, 102, 0.3);
}

.training-card-header h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--frost);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.training-card-body {
  padding: 1.5rem;
  min-height: 180px;
  position: relative;
}

.training-card-body p {
  color: var(--ice);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.training-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.training-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.training-stat-label {
  font-size: 0.85rem;
  color: var(--ice);
  opacity: 0.8;
}

.training-stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--signal);
}

.locked-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--slate);
}

.locked-badge span {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.training-card-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--slate);
}

.btn-training-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--signal);
  color: var(--void);
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-training-play:hover {
  background: var(--signal-dim);
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.4);
}

.btn-training-play svg {
  width: 16px;
  height: 16px;
}

/* ============================================================