/* ============================================================
   CodeQuest: Novembro Azul | Tabelas & Divs
   Produção do Site: Prof. Esp. Leandro Gaudio Rosa
   Campanha de Conscientização da Saúde do Homem & Desenvolvimento Web
   Design Amigável, Tipografia Ampla, Editor Lado a Lado
   ============================================================ */

:root {
  --bg-darker: #070c18;
  --bg-main: #0c1427;
  --bg-card: #17233d;
  --bg-card-hover: #1f3054;
  --bg-editor: #080d1a;
  --border-color: #273859;
  --border-light: #3b5282;
  
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-glow: rgba(56, 189, 248, 0.25);
  
  --accent-purple: #a855f7;
  --accent-gold: #fbbf24;
  --accent-green: #34d399;
  --accent-red: #f87171;

  --text-main: #f8fafc;
  --text-body: #e2e8f0;
  --text-muted: #94a3b8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Fira Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   RESET & TIPOGRAFIA BASE (LETRAS MAIORES & LEITURA CONFORTÁVEL)
   ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px; /* Letras maiores e confortáveis */
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-darker);
  color: var(--text-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar Suave */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
  background: #273859;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3b5282;
}

/* ============================================================
   CABEÇALHO SUPERIOR (LIMPO & ELEGANTE)
   ============================================================ */
.app-header {
  background: rgba(12, 20, 39, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.brand-logo .blue-ribbon-icon {
  display: block;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.45));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.brand-logo:hover .blue-ribbon-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.8));
}

.brand-title-group h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.brand-author {
  font-size: 0.88rem;
  color: var(--primary);
  font-weight: 600;
}

.player-stats-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 7px 15px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.stat-chip.xp {
  color: var(--accent-gold);
  border-color: rgba(251, 191, 36, 0.35);
}

.stat-chip.rank {
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.35);
}

.progress-chip {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #202d4a;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.4s ease;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   BOTÕES AMIGÁVEIS E ROBUSTOS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  font-family: var(--font-sans);
  text-decoration: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.88rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1.05rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-accent {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
}

.btn-outline {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================================
   ÁREA SUPERIOR DO DESAFIO (ENUNCIADO LIMPO & EXPANSÍVEL)
   ============================================================ */
.mission-top-banner {
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 28px;
}

.mission-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.mission-tags-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tag-fase {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  background: #202d4a;
  padding: 5px 12px;
  border-radius: 6px;
}

.tag-theme {
  font-size: 0.9rem;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 5px 12px;
  border-radius: 6px;
  font-weight: 700;
}

.tag-xp {
  font-size: 0.9rem;
  color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 5px 12px;
  border-radius: 6px;
  font-weight: 800;
}

.mission-nav-arrows {
  display: flex;
  gap: 8px;
}

.mission-body-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.mission-info-text {
  flex: 1;
}

.mission-info-text h2 {
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 4px;
}

.mission-module-label {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mission-story-desc {
  font-size: 1.05rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-top: 4px;
  max-width: 780px;
}

.mission-cta-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Estilos do Modal 'O que você deve fazer' */
.tasks-modal-story-card {
  background: #17233d;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.tasks-modal-checklist-card {
  background: #111a2e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.tasks-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tasks-modal-list li {
  font-size: 1.05rem;
  color: #f1f5f9;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.12);
  transition: background 0.2s, border-color 0.2s;
}

.tasks-modal-list li:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
}

.tasks-modal-list .task-bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 900;
  flex-shrink: 0;
  margin-top: 2px;
}

.tasks-modal-list .task-text {
  flex: 1;
  min-width: 0;
  color: #f1f5f9;
  font-size: 1.02rem;
  line-height: 1.55;
  word-break: break-word;
}

.tasks-modal-list code {
  background: #172554;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: 600;
  word-break: break-word;
}

.tasks-modal-theory-card {
  background: #090e1c;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}

.tasks-modal-theory-card code {
  background: #1e293b;
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.95em;
  font-weight: 600;
}

/* Gaveta de Teoria Expansível */
.theory-accordion {
  margin-top: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #0f172a;
  overflow: hidden;
}

.theory-accordion-toggle {
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
}
.theory-accordion-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
}

.theory-accordion-content {
  display: none;
  padding: 14px 18px;
  border-top: 1px solid var(--border-color);
  font-size: 0.98rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.theory-accordion.open .theory-accordion-content {
  display: block;
}

.theory-accordion-content code {
  background: #1e293b;
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.95em;
  font-weight: 600;
}

/* ============================================================
   WORKBENCH LADO A LADO: EDITOR (ESQUERDA) & PREVIEW (DIREITA)
   ============================================================ */
.editor-preview-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: calc(100vh - 270px);
  min-height: 480px;
  overflow: hidden;
}

/* Coluna 1: Editor de Código */
.editor-pane {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-editor);
  height: 100%;
}

.pane-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px 0 16px;
  background: #0b1120;
  border-bottom: 1px solid var(--border-color);
}

/* Abas do Editor de Código (index.html e style.css) */
.editor-tabs-group {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.editor-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #080d1a;
  border: 1px solid var(--border-color);
  border-bottom: none;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.editor-tab:hover {
  background: #152037;
  color: #ffffff;
}

.editor-tab.active {
  background: var(--bg-editor);
  color: var(--primary);
  border-color: var(--border-light);
  border-top: 3px solid var(--primary);
  box-shadow: 0 -2px 10px rgba(56, 189, 248, 0.15);
}

.tab-badge-edit {
  font-size: 0.7rem;
  background: #f59e0b;
  color: #0b1120;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.pane-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
}

.editor-controls {
  display: flex;
  gap: 8px;
}

.code-wrapper {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.line-numbers {
  width: 52px;
  padding: 16px 8px;
  background: #060913;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 16px; /* Letras maiores no código */
  text-align: right;
  line-height: 25px;
  user-select: none;
  overflow: hidden;
  border-right: 1px solid #1a2744;
}

.code-textarea {
  flex: 1;
  background: transparent;
  color: #f8fafc;
  border: none;
  outline: none;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 16px; /* Letras confortáveis e legíveis */
  line-height: 25px;
  resize: none;
  white-space: pre;
  tab-size: 2;
  overflow-y: auto;
}

.editor-footer-bar {
  padding: 12px 20px;
  background: #0b1120;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Coluna 2: Resultado em Tempo Real & Validação */
.preview-pane {
  display: flex;
  flex-direction: column;
  background: #090e1c;
  height: 100%;
}

.preview-badge-live {
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 3px 10px;
  border-radius: 20px;
}

.preview-iframe-wrapper {
  flex: 1;
  background: #0f172a;
  position: relative;
  overflow: hidden;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Painel de Validação e Teste */
.test-panel {
  border-top: 1px solid var(--border-color);
  background: var(--bg-main);
  padding: 14px 20px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.test-result-box {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 1rem;
  line-height: 1.5;
  transition: all 0.3s ease;
}

.test-result-box.idle {
  background: #17233d;
  border: 1px solid var(--border-color);
  color: #94a3b8;
}

.test-result-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #10b981;
  color: #d1fae5;
}

.test-result-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid #ef4444;
  color: #fee2e2;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.result-header strong {
  font-size: 1.1rem;
}

.result-icon {
  font-size: 1.3rem;
}

.success-actions {
  margin-top: 10px;
}

.error-tip {
  margin-top: 6px;
  font-size: 0.9rem;
  color: #fde047;
}

/* ============================================================
   RODAPÉ
   ============================================================ */
.app-footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border-color);
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-author {
  color: var(--primary);
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  font-weight: 600;
}
.footer-link:hover {
  color: var(--text-main);
}

/* ============================================================
   MODAIS COM DESIGN ESPAÇOSO
   ============================================================ */
.modal-container {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-container.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 15, 0.88);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  border-radius: var(--radius-lg);
  max-width: 920px;
  width: 92%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  padding: 18px 26px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover {
  color: white;
}

.modal-body {
  padding: 26px;
  overflow-y: auto;
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 26px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Grade de Fases no Mapa */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.map-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.map-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  background: var(--bg-card-hover);
}
.map-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}
.map-card.status-completed {
  border-color: rgba(52, 211, 153, 0.5);
}

.map-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.map-badge {
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
}

.map-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.3;
}

.map-module-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.map-xp {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-gold);
}

/* ============================================================
   TELA DE CONCLUSÃO / COMPROVANTE PARA O PROFESSOR
   ============================================================ */
.submission-card {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
  font-family: var(--font-sans);
  border-top: 8px solid #2563eb;
}

.submission-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 18px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.submission-header h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: #0f172a;
}

.submission-badge-ok {
  background: #dcfce7;
  color: #15803d;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.submission-student-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: #1e3a8a;
  margin-bottom: 12px;
}

.submission-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.submission-meta-item strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}

.submission-meta-item span {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.submission-modules-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.submission-modules-list li {
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}

.submission-signature-zone {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px dashed #cbd5e1;
  padding-top: 18px;
}

.submission-signature-zone strong {
  color: #0f172a;
  font-size: 1.05rem;
}

.submission-signature-zone span {
  color: #64748b;
  font-size: 0.85rem;
  display: block;
}

/* ============================================================
   BANNER EASTER EGG (IDDQD)
   ============================================================ */
.iddqd-unlock-banner {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, #0f172a, #17233d);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 18px 30px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 30px rgba(251, 191, 36, 0.35);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 5000;
  opacity: 0;
  animation: iddqdSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.iddqd-unlock-banner .icon {
  font-size: 2.5rem;
}

.iddqd-unlock-banner .text-group h3 {
  font-size: 1.2rem;
  color: var(--accent-gold);
  font-weight: 900;
}

.iddqd-unlock-banner .text-group p {
  font-size: 0.95rem;
  color: #ffffff;
}

/* Conquistas (Badges) */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  transition: all 0.3s ease;
}

.badge-card.unlocked {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(180deg, #17233d, #121c32);
}

.badge-card.locked {
  opacity: 0.45;
  filter: grayscale(0.8);
}

.badge-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.badge-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.badge-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.badge-state-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-gold);
}

/* ============================================================
   CERTIFICADO OFICIAL DA CAMPANHA NOVEMBRO AZUL
   ============================================================ */
.certificate-paper {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.cert-border-outer {
  border: 4px solid #1e3a8a;
  padding: 6px;
  border-radius: 10px;
}

.cert-border-inner {
  border: 2px dashed #3b82f6;
  padding: 30px 36px;
  border-radius: 6px;
  background: radial-gradient(circle at center, #ffffff 0%, #f0f7ff 100%);
}

.cert-header {
  text-align: center;
  margin-bottom: 24px;
}

.cert-logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.cert-logo-badge svg {
  filter: drop-shadow(0 4px 8px rgba(37, 99, 235, 0.3));
}

.cert-school {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #1d4ed8;
  margin-bottom: 6px;
}

.cert-title {
  font-size: 2.1rem;
  font-weight: 900;
  color: #0c1a30;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.cert-subtitle {
  font-size: 0.95rem;
  font-weight: 700;
  color: #475569;
}

.cert-body {
  text-align: center;
  margin-bottom: 24px;
}

.cert-intro {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 8px;
}

.cert-student-name {
  font-size: 1.9rem;
  font-weight: 900;
  color: #1d4ed8;
  border-bottom: 2px solid #93c5fd;
  display: inline-block;
  padding: 0 24px 6px;
  margin-bottom: 14px;
}

.cert-desc {
  font-size: 0.98rem;
  color: #334155;
  line-height: 1.6;
  max-width: 760px;
  margin: 0 auto;
}

.cert-stats-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}

.cert-stat-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 8px 18px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.cert-stat-badge .stat-lbl {
  color: #64748b;
  font-weight: 600;
}

.cert-stat-badge .stat-val {
  color: #1d4ed8;
  font-weight: 800;
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #e2e8f0;
  padding-top: 20px;
}

.cert-seal {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px double #d97706;
  background: radial-gradient(circle, #fef3c7, #fde68a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.2);
}

.cert-seal .seal-inner {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 900;
  color: #92400e;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}

.cert-signature-block {
  text-align: center;
}

.cert-signature-block .signature-line {
  width: 220px;
  height: 1px;
  background: #334155;
  margin: 0 auto 6px;
}

.cert-signature-block .sig-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
}

.cert-signature-block .sig-role {
  font-size: 0.8rem;
  color: #64748b;
}

.cert-meta {
  text-align: right;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.5;
}

/* ============================================================
   ESTILOS DE IMPRESSÃO (COMPROVANTE & CERTIFICADO)
   ============================================================ */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-submission, #printable-submission *,
  #printable-certificate, #printable-certificate * {
    visibility: visible;
  }
  #printable-submission, #printable-certificate {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 30px;
    box-shadow: none;
    border: none;
    background: white !important;
    color: black !important;
  }
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */
@media (max-width: 1024px) {
  .mission-body-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .editor-preview-split {
    grid-template-columns: 1fr;
    height: auto;
  }
  .editor-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    height: 400px;
  }
  .preview-pane {
    height: 480px;
  }
}
