/* ==========================================================================
   MAIN DESIGN TOKENS & RESET — CRONONAUTAS DO NOVO MUNDO
   Estética: Fusão entre Painel Temporal Moderno e Pergaminho Histórico Colonial
   ========================================================================== */

:root {
  /* Cores Temáticas Históricas & Temporais */
  --bg-dark: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #182234;
  --bg-parchment: #fcf6e8;
  --bg-parchment-dark: #f0e6cf;
  --bg-parchment-border: #d4b982;
  
  /* Cores de Destaque */
  --gold-primary: #f59e0b;
  --gold-bright: #fbbf24;
  --gold-dark: #b45309;
  --gold-glow: rgba(245, 158, 11, 0.35);
  
  --cyan-temporal: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.35);
  
  --crimson-tordesilhas: #ef4444;
  --emerald-success: #10b981;
  --amber-warning: #f59e0b;
  --indigo-portugal: #2563eb;
  --vermilion-spain: #dc2626;

  /* Tipografia */
  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-title: 'Cinzel', serif;
  --font-handwriting: 'Caveat', cursive;
  --font-historic: 'MedievalSharp', cursive;

  /* Sombras & Efeitos */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px rgba(245, 158, 11, 0.3);
  --shadow-portal: 0 0 35px rgba(56, 189, 248, 0.4);

  /* Bordas e Raio */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  /* Transições */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset Básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: #f1f5f9;
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Telas e Gerenciador de Exibição */
.screen-view {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.screen-view.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.screen-view.active {
  display: flex !important;
  opacity: 1;
  animation: fadeIn 0.35s ease forwards;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   TELA DE TÍTULO & HERO
   ========================================================================== */

#screen-title {
  background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.title-hero-backdrop {
  width: 100%;
  max-width: 900px;
  padding: 2.5rem 1.5rem;
  z-index: 2;
}

.title-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2.5rem;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}

.agency-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1.1rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--cyan-temporal);
  border-radius: var(--radius-full);
  color: var(--cyan-temporal);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.agency-sparkle {
  color: var(--gold-bright);
  animation: pulse 1.5s infinite;
}

.game-main-title {
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 25px rgba(245, 158, 11, 0.5), 0 4px 10px rgba(0, 0, 0, 0.8);
  margin-bottom: -0.5rem;
}

.game-sub-title {
  font-family: var(--font-title);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--gold-bright);
  font-weight: 700;
  letter-spacing: 0.25em;
  border-bottom: 2px solid var(--gold-dark);
  padding-bottom: 0.75rem;
  width: 80%;
}

.game-tagline {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 680px;
  line-height: 1.6;
}

.title-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.bncc-tag {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.8);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Partículas no Fundo */
.temporal-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #f59e0b, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 40px 70px, #38bdf8, rgba(0,0,0,0)),
    radial-gradient(3px 3px at 80px 120px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 150px 200px, #f59e0b, rgba(0,0,0,0));
  background-size: 250px 250px;
  animation: floatParticles 30s linear infinite;
  opacity: 0.35;
}

@keyframes floatParticles {
  from { transform: translateY(0); }
  to { transform: translateY(-250px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.15); }
}
.developer-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.7rem 1.15rem;
  color: #fef3c7;
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.94), rgba(146, 64, 14, 0.94));
  border: 1.5px solid #fbbf24;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.42), 0 0 18px rgba(245, 158, 11, 0.22);
}

.developer-credit span {
  color: #fde68a;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.developer-credit strong {
  color: #fff;
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: 0.025em;
}

@media (max-width: 520px) {
  .developer-credit {
    flex-direction: column;
    gap: 0.2rem;
    border-radius: 16px;
  }
}

/* Avaliação, cronômetro e encerramento da expedição */
.hud-assessment-chip {
  display: grid;
  gap: 0.12rem;
  min-width: 108px;
  padding: 0.42rem 0.7rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  text-align: center;
}

.hud-assessment-chip small { color: #94a3b8; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; }
.hud-assessment-chip strong { color: #f8fafc; font-variant-numeric: tabular-nums; }
.hud-assessment-chip.urgent { border-color: #f59e0b; background: rgba(120, 53, 15, 0.72); }
.hud-assessment-chip.overtime { border-color: #f97316; background: rgba(124, 45, 18, 0.78); }

.expedition-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.85rem;
  padding: 0.75rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.58);
}

.expedition-guidance { display: grid; gap: 0.2rem; flex: 1; }
.expedition-guidance strong { color: #fbbf24; }
.expedition-guidance span { color: #cbd5e1; font-size: 0.82rem; line-height: 1.4; }
.finish-expedition-btn { border-color: #34d399; color: #ecfdf5; background: linear-gradient(135deg, #065f46, #047857); }
.finish-expedition-btn:disabled { border-color: #475569; background: #1e293b; color: #94a3b8; cursor: not-allowed; }

.mission-status-line { width: 100%; color: #cbd5e1; font-size: 0.8rem; font-weight: 800; text-align: center; }
.mission-status-line.status-completed { color: #86efac; }
.mission-status-line.status-deferred { color: #fcd34d; }

.final-result-screen { min-height: 100vh; padding: 2rem 1rem; place-items: center; background: radial-gradient(circle at top, #1e3a5f, #070b18 72%); }
.final-result-screen.active { display: grid; }
.final-result-card { width: min(900px, 96vw); padding: clamp(1.25rem, 3vw, 2.5rem); border: 2px solid #d6a640; border-radius: 24px; background: linear-gradient(160deg, #17233a, #0c1425); box-shadow: 0 28px 80px rgba(0,0,0,.55); color: #e2e8f0; text-align: center; }
.final-result-kicker { color: #fbbf24; font-weight: 900; letter-spacing: .14em; }
.final-student-line { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin: .75rem 0 1.25rem; color: #cbd5e1; }
.final-score-display { display: grid; gap: .35rem; padding: 1.25rem; border-radius: 18px; background: linear-gradient(135deg, #713f12, #92400e); }
.final-score-display span { font-weight: 800; letter-spacing: .08em; }
.final-score-display strong { color: #fff7d6; font-size: clamp(2.3rem, 7vw, 4.8rem); line-height: 1; }
.final-score-breakdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: .65rem; margin: 1rem 0; }
.final-score-breakdown div, .final-learning-summary div { display: grid; gap: .3rem; padding: .85rem; border: 1px solid #334155; border-radius: 12px; background: rgba(15,23,42,.65); }
.final-score-breakdown span, .final-learning-summary span { color: #aebbd0; font-size: .78rem; }
.final-score-breakdown strong { color: #f8fafc; }
.final-learning-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: .65rem; }
.final-learning-summary strong { color: #fbbf24; font-size: 1.45rem; }
.final-result-lock { margin: 1rem 0; color: #94a3b8; font-size: .82rem; }
.final-result-actions, .finish-confirmation-actions { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; }
.finish-confirmation-dialog { width: min(620px, 94vw); padding: 1.5rem; }
.finish-confirmation-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin: 1rem 0 1.25rem; }
.finish-confirmation-summary div { display: flex; justify-content: space-between; gap: .75rem; padding: .75rem; border-radius: 10px; background: #111c31; }

@media (max-width: 900px) {
  .hud-assessment-chip { min-width: 88px; padding: .35rem; }
  .expedition-controls { align-items: stretch; flex-direction: column; }
  .final-score-breakdown { grid-template-columns: repeat(2, 1fr); }
  .final-learning-summary { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  body * { visibility: hidden !important; }
  #screen-final-result, #screen-final-result * { visibility: visible !important; }
  #screen-final-result { position: absolute; inset: 0; padding: 0; background: white; }
  .final-result-card { width: 100%; border-color: #333; box-shadow: none; color: #111; background: white; }
  .final-result-actions { display: none; }
}
