:root {
  /* --- PALETA CYBERPUNK (Interface do Jogo) --- */
  --bg-deep: #050510;
  --bg-panel: rgba(13, 17, 28, 0.95);
  
  --neon-blue: #00f3ff;
  --neon-purple: #bc13fe;
  --neon-green: #0aff60;
  --neon-red: #ff2a2a;
  --neon-orange: #ffaa00;
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;

  --border-glow: 0 0 10px rgba(0, 243, 255, 0.2);
  
  /* Fontes */
  --font-hud: 'Orbitron', sans-serif; /* Para Pontos, Timer, Botões */
  --font-body: 'Inter', sans-serif;   /* Para textos gerais do jogo */
  --font-app: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* Para Email/Zap (Realismo) */
}

/* --- RESET & ESTRUTURA GLOBAL --- */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow: hidden; /* Trava o scroll da página inteira */
  display: flex;
  flex-direction: column;
  /* Grid de fundo sutil */
  background-image: 
    linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* --- UI CONTROLS (Botões de Som/Histórico) --- */
.ui-controls {
  position: absolute;
  top: 15px;
  left: 20px;
  display: flex;
  gap: 12px;
  z-index: 100;
}

.hud-btn {
  background: rgba(0, 20, 40, 0.9);
  border: 1px solid var(--neon-blue);
  color: var(--neon-blue);
  padding: 8px 16px;
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: all 0.2s ease;
  box-shadow: 0 0 5px rgba(0, 243, 255, 0.1);
}

.hud-btn:hover {
  background: var(--neon-blue);
  color: #000;
  box-shadow: 0 0 15px var(--neon-blue);
}

.hud-btn .icon { font-size: 1rem; }

/* --- LAYOUT PRINCIPAL (App Shell) --- */
.app-shell {
  width: 100%;
  height: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* --- HEADER / HUD (Topo) --- */
.top-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  height: 90px;
  flex-shrink: 0;
}

.hud-panel {
  flex: 1;
  max-width: 300px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
}

/* Bordas Coloridas por Painel */
.points-panel { border-bottom: 3px solid var(--neon-blue); }
.timer-panel { border-bottom: 3px solid var(--neon-red); }
.lives-panel { border-bottom: 3px solid var(--neon-green); }

.hud-label {
  font-family: var(--font-hud);
  font-size: 0.7rem;
  letter-spacing: 2px;
  margin-bottom: 4px;
  opacity: 0.8;
}

/* Display de Pontos */
.score-display {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hud-icon {
  width: 20px;
  height: 20px;
  color: inherit;
  stroke: currentColor;
}
.points-panel .hud-icon { color: var(--neon-blue); }

#score {
  font-family: var(--font-hud);
  font-size: 1.8rem;
  color: #fff;
  text-shadow: 0 0 10px var(--neon-blue);
}

.progress-track {
  width: 80%;
  height: 4px;
  background: #222;
  margin-top: 6px;
  border-radius: 2px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  background: var(--neon-orange);
  width: 0%;
  transition: width 0.3s ease;
}

/* Display de Timer */
#timer {
  font-family: var(--font-hud);
  font-size: 2.2rem;
  color: var(--neon-blue); /* Start with neutral blue color */
  text-shadow: 0 0 15px var(--neon-blue);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;
}

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

/* Timer warning state - last 5 seconds */
#timer.timer-warning {
  animation: timer-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Display de Vidas */
.lives-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lives-grid {
  display: flex;
  gap: 8px;
  margin-top: 5px;
  height: 24px;
  align-items: center;
}

/* Baterias (Geradas por JS) */
.battery {
  width: 20px;
  height: 32px;
  border: 1px solid #555;
  background: rgba(0,0,0,0.5);
  border-radius: 2px;
  position: relative;
  box-shadow: inset 0 0 2px #000;
}
/* Terminal da bateria */
.battery::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 3px;
  right: 3px;
  height: 3px;
  background: #555;
  border-radius: 1px 1px 0 0;
}
.battery.full {
  background: var(--neon-green);
  border-color: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
}
.battery.full::before { background: var(--neon-green); }
.battery.empty { opacity: 0.3; }

/* --- GAME AREA (Grid Principal) --- */
.game-area {
  flex: 1;
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 20px;
  min-height: 0;
}

.frame-container {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Cantoneiras HUD */
.frame-container::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top: 2px solid var(--neon-blue);
  border-bottom: 2px solid var(--neon-blue);
  -webkit-mask: linear-gradient(90deg, black 30px, transparent 30px, transparent calc(100% - 30px), black calc(100% - 30px));
  mask: linear-gradient(90deg, black 30px, transparent 30px, transparent calc(100% - 30px), black calc(100% - 30px));
  pointer-events: none;
  z-index: 20;
}

/* --- PAINEL ESQUERDO (Monitor) --- */
.message-panel { border-left: 4px solid var(--neon-blue); }

.panel-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 243, 255, 0.05);
  flex-shrink: 0;
}

.panel-title {
  margin: 0;
  font-family: var(--font-hud);
  font-size: 1.1rem;
  color: var(--neon-blue);
  text-transform: uppercase;
}

.round-counter {
  font-family: var(--font-hud);
  color: #fff;
}

/* Container da "Tela" */
.screen-container {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #000;
  margin: 15px;
  border: 1px solid #333;
  overflow: hidden;
}

/* Scanlines (Reduzidas) */
.scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
}

/* Abas */
.tabs {
  background: #111;
  padding: 0 10px;
  border-bottom: 1px solid #333;
  display: flex;
}

.tab {
  background: #222;
  border: none;
  color: #666;
  padding: 10px 25px;
  font-family: var(--font-hud);
  font-size: 0.8rem;
  cursor: default;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  margin-right: 2px;
}
.tab.active {
  background: var(--neon-blue);
  color: #000;
  font-weight: 700;
}

/* Wrap da Mensagem */
.message-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #000;
  position: relative;
}

/* Garante quebra de linha em URLs longas */
.message-content, 
.email-body, 
.whatsapp-bubble {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Padding interno */
#message-content {
  padding: 20px;
  min-height: 100%;
}

/* --- PAINEL DIREITO (Controles & Feedback) --- */
.action-panel {
  border-right: 4px solid var(--neon-purple);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 100%; /* Ocupa altura total para flex funcionar */
  overflow: hidden;
}

.status-monitor {
  background: rgba(0,0,0,0.4);
  padding: 15px;
  border: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  flex-shrink: 0;
}

.status-line {
  height: 2px;
  background: var(--neon-blue);
  width: 100%;
  margin-bottom: 10px;
  box-shadow: 0 0 8px var(--neon-blue);
}

#status-label {
  margin: 0;
  font-family: var(--font-hud);
  color: var(--neon-blue);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* LOGICA DE POSICIONAMENTO DOS BOTÕES (Colados no Fundo) */
.actions, 
.feedback {
  flex: 1; /* Ocupa todo o espaço vertical */
  display: flex;
  flex-direction: column;
  min-height: 0; /* Permite scroll interno */
}

/* Alinhamento na fase de Classificação */
.actions.classification {
  justify-content: flex-end; 
}

/* Alinhamento na fase de Suspeita */
.actions.suspect {
  justify-content: space-between; 
}

/* Feedback com Scroll Interno */
.feedback h2 {
  margin-top: 0;
  flex-shrink: 0;
}

#feedback-text {
  flex: 1; /* Cresce para empurrar botão p/ baixo */
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 15px;
  max-height: none;
}

/* Botões de Ação Gerais */
.action-btn {
  width: 100%;
  padding: 18px;
  border: none;
  font-family: var(--font-hud);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  position: relative;
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
  transition: all 0.2s;
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* Espaçamento entre botões */
.classification .action-btn + .action-btn {
  margin-top: 15px;
}

.action-btn:hover {
  transform: translateX(3px);
  filter: brightness(1.2);
}

/* Cores dos Botões */
.action-btn.safe {
  background: rgba(10, 255, 96, 0.1);
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
}
.action-btn.safe:hover {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 20px var(--neon-green);
}

.action-btn.phish {
  background: rgba(255, 0, 60, 0.1);
  border: 1px solid var(--neon-red);
  color: var(--neon-red);
}
.action-btn.phish:hover {
  background: var(--neon-red);
  color: #000;
  box-shadow: 0 0 20px var(--neon-red);
}

.action-btn.primary {
  background: var(--neon-blue);
  color: #050510;
}
.action-btn.primary:hover {
  box-shadow: 0 0 20px var(--neon-blue);
}

.action-btn.secondary {
  background: transparent;
  border: 1px solid var(--neon-orange);
  color: var(--neon-orange);
}
.action-btn.secondary:hover {
  background: var(--neon-orange);
  color: #000;
}

/* Elementos Visuais do Feedback */
.instruction-box {
  background: rgba(255, 170, 0, 0.1);
  border: 1px solid var(--neon-orange);
  padding: 10px;
  text-align: center;
  flex-shrink: 0;
}
.instruction-box p {
  color: var(--neon-orange);
  font-weight: bold;
  margin: 0 0 5px 0;
}

.round-result {
  font-family: var(--font-hud);
  font-size: 1rem;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid;
}
.round-result.success { border-color: var(--neon-green); color: var(--neon-green); }
.round-result.error { border-color: var(--neon-red); color: var(--neon-red); }
.round-result.victory { border-color: var(--neon-blue); color: var(--neon-blue); }

.feedback-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  margin-bottom: 8px;
  border-left: 2px solid #555;
}

.scoring-summary {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scoring-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #555;
  font-size: 0.9rem;
  gap: 10px;
}

.scoring-row span {
  color: var(--text-muted);
  flex: 1;
}

.scoring-row strong {
  font-family: var(--font-hud);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  text-align: right;
  min-width: fit-content;
}

.scoring-row.positive {
  border-left-color: var(--neon-green);
}

.scoring-row.positive strong {
  color: var(--neon-green);
}

.scoring-row.negative {
  border-left-color: var(--neon-red);
}

.scoring-row.negative strong {
  color: var(--neon-red);
}

.scoring-row.total {
  border-left-width: 4px;
  font-weight: 600;
  margin-top: 4px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.scoring-row.total.positive {
  border-left-color: var(--neon-green);
}

.scoring-row.total.positive strong {
  color: var(--neon-green);
}

.scoring-row.total.negative {
  border-left-color: var(--neon-red);
}

.scoring-row.total.negative strong {
  color: var(--neon-red);
}

/* --- INTERAÇÃO COM ELEMENTOS SUSPEITOS --- */
.suspect {
  transition: all 0.2s;
  border-radius: 3px;
  padding: 0 2px;
  color: inherit;
  text-decoration: none;
}
.suspect.is-link {
  color: #0084ff;
  text-decoration: underline;
}

/* Links no WhatsApp light theme */
.whatsapp-bubble .suspect.is-link {
  color: #0084ff;
  text-decoration: underline;
}

/* Quando visível (fase de apontar erro) */
.suspect.visible {
  cursor: pointer;
  outline: 1px dashed rgba(255, 170, 0, 0.5); 
}
.suspect.visible:hover {
  background: rgba(255, 170, 0, 0.2);
}

/* Review phase: Both types use yellow/amber when selected */
.suspect.review-selected,
.false-positive.review-selected {
  background: rgba(255, 193, 7, 0.8) !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.6);
  font-weight: bold;
  outline: none;
  text-decoration: none !important;
}

/* False positive styling - same as suspect */
.false-positive {
  transition: all 0.2s;
  border-radius: 3px;
  padding: 0 2px;
  color: inherit;
  text-decoration: none;
}
.false-positive.is-link {
  color: #0084ff;
  text-decoration: underline;
}

/* Links no WhatsApp light theme */
.whatsapp-bubble .false-positive.is-link {
  color: #0084ff;
  text-decoration: underline;
}

/* Quando visível (fase de apontar erro) */
.false-positive.visible {
  cursor: pointer;
  outline: 1px dashed rgba(255, 170, 0, 0.5); 
}
.false-positive.visible:hover {
  background: rgba(255, 170, 0, 0.2);
}

/* Final states - applied after review confirmation */
.suspect.suspect-correct {
  background: var(--neon-green) !important;
  color: #000 !important;
  box-shadow: 0 0 10px var(--neon-green);
  font-weight: bold;
  outline: none;
  text-decoration: none !important;
}

.suspect.suspect-missed {
  background: rgba(10, 255, 96, 0.2) !important;
  outline: 1px dashed var(--neon-green);
  text-decoration: none !important;
}

.false-positive.false-positive-wrong {
  background: var(--neon-red) !important;
  color: #fff !important;
  box-shadow: 0 0 10px var(--neon-red);
  font-weight: bold;
  outline: none;
  text-decoration: none !important;
}

.false-positive.false-positive-avoided {
  background: rgba(255, 42, 42, 0.2) !important;
  outline: 1px dashed var(--neon-red);
  text-decoration: none !important;
}

/* --- 1. SIMULAÇÃO WHATSAPP (Light Mode) --- */
.whatsapp-card {
  background-image: url("https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png");
  font-family: var(--font-app);
  border-radius: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  color: #303030;
  font-size: 14px;
  object-fit: fill;
  border-radius: 8px;
  overflow: hidden;
}

.whatsapp-header {
  background: #f0f2f5;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e4e6eb;
}

.chat-tags{
  padding: 10px 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: #667781;
}

.chat-tag {
  background: rgba(0, 0, 0, 0.05);
  color: #667781;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-time {
  font-size: 0.75rem;
  color: #667781;
}

.contact-block { display: flex; align-items: center; gap: 12px; }
.contact-avatar {
  width: 40px; height: 40px;
  background: #dfe5e7; border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  font-weight: bold; color: #54656f; font-size: 16px;
}
.contact-name { font-weight: 500; font-size: 16px; color: #111b21; }
.contact-status { font-size: 12px; color: #667781; margin-top: 2px; }

.whatsapp-messages {
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}

.whatsapp-bubble {
  padding: 6px 7px 8px 9px;
  border-radius: 7.5px;
  font-size: 16px; line-height: 22px;
  max-width: 80%; position: relative;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

.whatsapp-bubble.other {
  background: #ffffff; color: #111b21;
  align-self: flex-start; border-top-left-radius: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.whatsapp-bubble.other::before {
  content: ""; position: absolute; top: 0; left: -8px;
  width: 0; height: 0;
  border-top: 0px solid transparent;
  border-right: 12px solid #ffffff;
  border-bottom: 12px solid transparent;
}

.whatsapp-bubble.me {
  background: #d9fdd3; color: #111b21;
  align-self: flex-end; border-top-right-radius: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.whatsapp-bubble.me::before {
  content: ""; position: absolute; top: 0; right: -8px;
  width: 0; height: 0;
  border-top: 0px solid transparent;
  border-left: 12px solid #d9fdd3;
  border-bottom: 12px solid transparent;
}

/* --- 2. SIMULAÇÃO EMAIL (Estilo Gmail/Outlook Dark) --- */
.email-card {
  background: #1e1e1e;
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  color: #e8eaed;
  height: 100%;
  display: flex; flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #444;
}

.email-subject {
  font-size: 1.25rem;
  font-weight: 400; color: #fff;
  padding: 20px; line-height: 1.4;
  position: relative;
}
.email-subject::after {
  content: ""; position: absolute; bottom: 0; left: 0;
  width: 100%; height: 1px; background: #333;
}

.email-top {
  padding: 20px 20px 15px 20px;
  display: flex; align-items: center; gap: 15px;
  border-bottom: 1px solid #333;
}

.email-avatar {
  width: 48px; height: 48px; min-width: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 1.2rem; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  background-color: #555;
}

.email-from {
  flex: 1; display: flex; flex-direction: column;
  gap: 2px; overflow: hidden;
}

.sender-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sender-name { font-weight: 700; font-size: 0.95rem; color: #fff; }
.email-time { font-size: 0.75rem; color: #9aa0a6; margin-left: auto; }
.sender-address { font-size: 0.8rem; color: #9aa0a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-meta { font-size: 0.75rem; color: #9aa0a6; display: flex; align-items: center; gap: 6px; }

.email-actions { display: flex; gap: 8px; }
.email-action {
  background: transparent; border: 1px solid rgba(255,255,255,0.2);
  color: #e8eaed; width: 32px; height: 32px;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s; font-size: 1.1rem;
}
.email-action:hover { background: rgba(255,255,255,0.1); }

.email-body {
  padding: 20px;
  font-size: 1.1rem; line-height: 1.7;
  color: #e8eaed; flex: 1; overflow-y: auto;
}

/* Email body HTML elements styling */
.email-body h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 20px 0 15px 0;
  color: #e8eaed;
}

.email-body h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 15px 0 10px 0;
  color: #e8eaed;
}

.email-body ul,
.email-body ol {
  margin: 15px 0;
  padding-left: 25px;
  line-height: 1.8;
}

.email-body li {
  margin-bottom: 8px;
}

.email-body hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 25px 0;
}

.email-body strong {
  font-weight: 600;
  color: #e8eaed;
}

.email-body em {
  font-style: italic;
  color: #94a3b8;
}

.email-tags {
  padding: 0 20px; margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.email-tag {
  background: #333; color: #9aa0a6;
  font-size: 0.7rem; padding: 2px 6px;
  border-radius: 4px; border: 1px solid #444;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.email-attachments {
  padding: 0 20px 20px;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.attachment-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(138, 180, 248, 0.08);
  border: 1px solid #5f6368; border-radius: 18px;
  padding: 8px 16px; font-size: 0.85rem;
  color: #8ab4f8; cursor: pointer; transition: background 0.2s;
}
.attachment-chip:hover { background: rgba(138, 180, 248, 0.15); }

/* Attachment chips with suspect/false-positive classes */
.attachment-chip.suspect.visible,
.attachment-chip.false-positive.visible {
  outline: 1px dashed rgba(255, 170, 0, 0.5);
  cursor: pointer;
}
.attachment-chip.suspect.visible:hover,
.attachment-chip.false-positive.visible:hover {
  background: rgba(255, 170, 0, 0.2);
}

/* Review phase: Both types use yellow/amber when selected */
.attachment-chip.suspect.review-selected,
.attachment-chip.false-positive.review-selected {
  background: rgba(255, 193, 7, 0.8) !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.6);
  font-weight: bold;
  border-color: rgba(255, 193, 7, 0.8);
}

/* Final states - applied after review confirmation */
.attachment-chip.suspect.suspect-correct {
  background: var(--neon-green) !important;
  color: #000 !important;
  box-shadow: 0 0 10px var(--neon-green);
  font-weight: bold;
  border-color: var(--neon-green);
}

.attachment-chip.suspect.suspect-missed {
  background: rgba(10, 255, 96, 0.2) !important;
  outline: 1px dashed var(--neon-green);
  border-color: rgba(10, 255, 96, 0.3);
}

.attachment-chip.false-positive.false-positive-wrong {
  background: var(--neon-red) !important;
  color: #fff !important;
  box-shadow: 0 0 10px var(--neon-red);
  font-weight: bold;
  border-color: var(--neon-red);
}

.attachment-chip.false-positive.false-positive-avoided {
  background: rgba(255, 42, 42, 0.2) !important;
  outline: 1px dashed var(--neon-red);
  border-color: rgba(255, 42, 42, 0.3);
}

.email-body a, .suspect.is-link, .false-positive.is-link {
  color: #8ab4f8; text-decoration: none;
}
.email-body a:hover, .suspect.is-link:hover, .false-positive.is-link:hover { text-decoration: underline; }

/* --- MODAIS E OVERLAYS --- */
.history-modal, .tutorial-overlay, .endgame-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 9999;
  display: flex; justify-content: center; align-items: center;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  overscroll-behavior: contain;
}

.hidden { display: none !important; }

.history-overlay, .endgame-overlay {
  position: absolute; inset: 0;
  z-index: -1; pointer-events: none;
}

.hud-modal {
  position: relative;
  z-index: 10000;
  background: #0a0f18;
  border: 2px solid var(--neon-blue);
  width: min(500px, 90vw);
  max-width: calc(100vw - 40px);
  max-height: 90vh;
  padding: 30px;
  box-sizing: border-box;
  box-shadow: 0 0 50px rgba(0, 243, 255, 0.15);
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  display: flex; flex-direction: column; gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
}

.hud-modal h2, .hud-modal h3 {
  font-family: var(--font-hud);
  color: var(--neon-blue); margin: 0;
  text-align: center; text-transform: uppercase; letter-spacing: 2px;
}
.hud-modal p {
  line-height: 1.6; color: #ccc; text-align: center;
}

.modal-summary {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 10px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--neon-blue);
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.modal-stats {
  list-style: none;
  padding: 0;
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.modal-stats li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--neon-orange);
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  gap: 10px;
}

.modal-stats li span {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.modal-stats li strong {
  color: var(--neon-blue);
  font-family: var(--font-hud);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  text-align: right;
  min-width: fit-content;
}

.modal-actions {
  display: flex; 
  flex-direction: column;
  gap: 15px;
  justify-content: center; margin-top: 10px;
}

/* --- LEADERBOARD SUMMARY --- */
.leaderboard-summary {
  margin-bottom: 20px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.summary-card {
  position: relative;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--neon-blue);
  border-radius: 4px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.summary-card:hover {
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
  transform: translateY(-2px);
}

.summary-card.best-score {
  border-left-color: var(--neon-orange);
}

.summary-card.best-score:hover {
  border-color: var(--neon-orange);
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.2);
}

.summary-card.best-accuracy {
  border-left-color: var(--neon-green);
}

.summary-card.best-accuracy:hover {
  border-color: var(--neon-green);
  box-shadow: 0 0 15px rgba(10, 255, 96, 0.2);
}

.summary-card.streak.positive {
  border-left-color: var(--neon-green);
}

.summary-card.streak.negative {
  border-left-color: var(--neon-red);
}

.summary-card.streak.neutral {
  border-left-color: var(--text-muted);
}

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

.summary-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-hud);
  color: var(--neon-blue);
  line-height: 1;
}

.summary-card.best-score .summary-value {
  color: var(--neon-orange);
}

.summary-card.best-accuracy .summary-value {
  color: var(--neon-green);
}

.summary-card.streak.positive .summary-value {
  color: var(--neon-green);
}

.summary-card.streak.negative .summary-value {
  color: var(--neon-red);
}

.summary-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.5rem;
  opacity: 0.3;
}

/* --- LEADERBOARD CARDS --- */
.history-list {
  list-style: none; 
  padding: 0; 
  margin: 0;
  max-height: 400px; 
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-list li.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.leaderboard-card {
  display: flex;
  gap: 15px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
}

.leaderboard-card:hover {
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
  transform: translateX(4px);
}

.leaderboard-card.is-best-score {
  border: 2px solid var(--neon-orange);
  box-shadow: 0 0 25px rgba(255, 170, 0, 0.3);
  background: rgba(255, 170, 0, 0.05);
}

.leaderboard-card.is-best-accuracy {
  border-left: 4px solid var(--neon-green);
}

.leaderboard-card.outcome-won {
  border-left: 3px solid var(--neon-green);
}

.leaderboard-card.outcome-lost {
  border-left: 3px solid var(--neon-red);
}

.card-rank {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-hud);
  color: var(--neon-blue);
  background: rgba(0, 243, 255, 0.1);
  border-radius: 4px;
}

.leaderboard-card.is-best-score .card-rank {
  background: rgba(255, 170, 0, 0.2);
  color: var(--neon-orange);
}

.card-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}

.card-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  position: relative;
}

.score-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-hud);
  color: var(--neon-blue);
  line-height: 1;
}

.leaderboard-card.is-best-score .score-value {
  color: var(--neon-orange);
  text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

.score-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.best-badge {
  position: absolute;
  top: -8px;
  right: -60px;
  font-size: 0.65rem;
  padding: 2px 8px;
  background: var(--neon-orange);
  color: #000;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

.card-trend {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.card-trend.trend-up {
  color: var(--neon-green);
  background: rgba(10, 255, 96, 0.1);
}

.card-trend.trend-down {
  color: var(--neon-red);
  background: rgba(255, 42, 42, 0.1);
}

.card-trend.trend-neutral {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.1);
}

.card-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 80px;
}

.accuracy-bar {
  flex: 1;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.accuracy-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
  border-radius: 10px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(10, 255, 96, 0.3);
}

.accuracy-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

.metric-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--neon-blue);
  font-family: var(--font-hud);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-outcome {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 3px;
}

.card-outcome.outcome-won {
  color: var(--neon-green);
  background: rgba(10, 255, 96, 0.1);
}

.card-outcome.outcome-lost {
  color: var(--neon-red);
  background: rgba(255, 42, 42, 0.1);
}

.card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive adjustments for leaderboard */
@media (max-width: 900px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .leaderboard-card {
    flex-direction: column;
  }
  
  .card-rank {
    width: 100%;
    height: auto;
    padding: 8px;
  }
  
  .card-header {
    flex-direction: column;
  }
  
  .best-badge {
    position: static;
    margin-left: 8px;
  }
}

.tutorial-list {
  text-align: left; line-height: 1.8; color: #ccc;
  background: rgba(255, 255, 255, 0.03);
  padding: 15px 20px; border-radius: 4px;
  border-left: 3px solid var(--neon-orange);
}
.tutorial-list li { margin-bottom: 8px; }
.tutorial-list strong { color: var(--neon-orange); }

/* --- CUSTOM SCROLLBAR --- */
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: #111; }
.custom-scroll::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: var(--neon-blue); }

/* --- ANIMAÇÕES --- */
@keyframes glitch-skew {
  0% { transform: skew(0deg); }
  20% { transform: skew(-2deg); }
  40% { transform: skew(2deg); }
  60% { transform: skew(-1deg); }
  80% { transform: skew(1deg); }
  100% { transform: skew(0deg); }
}
.glitch-text:hover {
  animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
  color: var(--neon-red);
}

/* --- RESPONSIVO --- */
@media (max-width: 900px) {
  .app-shell { height: auto; overflow-y: auto; }
  .game-area { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .top-bar { height: auto; flex-wrap: wrap; }
  .hud-panel { min-width: 45%; margin-bottom: 10px; }
  .message-panel { height: 60vh; }
  .action-panel { height: 50vh; }
}