/* ==========================================================================
   MAPA ESPACIAL TEMPORAL DAS AMÉRICAS — CRONONAUTAS DO NOVO MUNDO
   ========================================================================== */

#screen-time-map {
  padding-top: 68px; /* Espaço para o HUD fixo */
  min-height: 100vh;
  background: #090e1a;
  display: flex;
  flex-direction: column;
}

.map-view-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Painel Superior do Cronoscópio */
.chronoscope-panel {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chronoscope-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portal-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan-temporal);
  letter-spacing: 0.1em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-temporal);
  box-shadow: 0 0 8px var(--cyan-temporal);
}

.status-dot.pulsing {
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}

.chronoscope-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: #fff;
}

.chronoscope-instruction {
  font-size: 0.9rem;
  color: #cbd5e1;
}

.map-filters-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-flag {
  width: 1.4rem;
  height: .95rem;
  display: inline-block;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.filter-btn:hover {
  border-color: var(--gold-bright);
  color: #fff;
}

.filter-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

/* Container do Mapa SVG + Camada HTML */
.interactive-map-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 680px;
  background: #0f172a;
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(15, 23, 42, 0.8);
}

.map-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.historical-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Linha de Tordesilhas no SVG */
.tordesilhas-label {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  fill: var(--gold-bright);
  letter-spacing: 0.1em;
}

.side-label {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-ui);
}

.side-label.spanish-side {
  fill: #fca5a5;
  text-anchor: end;
}

.side-label.portuguese-side {
  fill: #93c5fd;
  text-anchor: start;
}

/* Territórios no SVG */
.land-territory {
  transition: fill 0.3s ease, filter 0.3s ease;
  cursor: pointer;
}

.land-territory.portuguese {
  fill: #1e3a8a;
  stroke: #3b82f6;
  stroke-width: 1.5;
}

.land-territory.spanish {
  fill: #881337;
  stroke: #f43f5e;
  stroke-width: 1.5;
}

.land-territory.neutral {
  fill: #334155;
  stroke: #64748b;
  stroke-width: 1;
}

.land-territory:hover {
  filter: brightness(1.25);
}

/* Camada de Marcadores HTML sobre o Mapa */
.map-hotspots-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mission-map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  z-index: 10;
  transition: transform var(--transition-fast);
}

.mission-map-pin:hover {
  transform: translate(-50%, -55%) scale(1.1);
  z-index: 20;
}

.pin-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: #1e293b;
  border: 2.5px solid var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), var(--shadow-gold);
  position: relative;
  animation: pinBounce 2.5s infinite ease-in-out;
}

.pin-icon-wrap.pulse-glow {
  box-shadow: 0 0 20px var(--gold-bright);
}

.pin-label-pill {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--gold-bright);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.pin-completed-check {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--emerald-success);
  color: #fff;
  font-size: 0.65rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

@keyframes pinBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* --------------------------------------------------------------------------
   Modal Centralizado de Detalhes da Missão (Com Backdrop)
   -------------------------------------------------------------------------- */
.mission-preview-modal-dialog {
  max-width: 540px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  border: 2.5px solid var(--gold-bright);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(245, 158, 11, 0.45);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.preview-card-inner {
  padding: 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-close-preview {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-close-preview:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
}

.mission-preview-badge {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mission-preview-badge.portuguese {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
  border: 1.5px solid #3b82f6;
}

.mission-preview-badge.spanish {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1.5px solid #ef4444;
}

.preview-mission-title {
  font-family: var(--font-title);
  font-size: 1.45rem;
  color: #fff;
  line-height: 1.3;
}

.preview-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--gold-bright);
  font-weight: 700;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-synopsis {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.preview-objectives {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.preview-objectives h4 {
  font-size: 0.9rem;
  color: var(--gold-bright);
  margin-bottom: 0.5rem;
  font-family: var(--font-title);
}

.preview-objectives ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.preview-objectives li::before {
  content: "✦ ";
  color: var(--cyan-temporal);
  font-weight: bold;
}

.preview-footer {
  margin-top: 0.75rem;
}

.preview-footer button {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   Seletor Rápido de Missões (Cards no Rodapé)
   -------------------------------------------------------------------------- */
.mission-quick-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  width: 100%;
}

.mission-select-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.mission-select-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-bright);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), var(--shadow-gold);
  background: rgba(30, 41, 59, 0.95);
}

.mission-select-card.completed {
  border-color: rgba(16, 185, 129, 0.6);
}

.select-card-icon {
  font-size: 1.7rem;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: #1e293b;
  border: 1.5px solid var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.select-card-info h4 {
  font-family: var(--font-title);
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 2px;
}

.select-card-info span {
  font-size: 0.78rem;
  color: var(--gold-bright);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* --------------------------------------------------------------------------
   Botão de Dossiê e Modal de Disclaimers Históricos
   -------------------------------------------------------------------------- */
.dossier-btn {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: var(--gold-bright) !important;
  color: var(--gold-bright) !important;
  font-weight: 800;
}

.dossier-btn:hover {
  background: rgba(245, 158, 11, 0.3) !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.disclaimer-dialog {
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  border: 2.5px solid var(--gold-bright);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(245, 158, 11, 0.45);
}
.mission-map-pin.status-completed .pin-icon-wrap,
.mission-select-card.status-completed { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.15); }
.mission-map-pin.status-deferred .pin-icon-wrap,
.mission-select-card.status-deferred { border-color: #eab308; filter: saturate(.72); }
.mission-map-pin.status-in_progress .pin-icon-wrap,
.mission-select-card.status-in_progress { border-color: #38bdf8; box-shadow: 0 0 0 2px rgba(56,189,248,.18); }
.mission-map-pin.recommended .pin-label-pill::before { content: '✦ '; color: #fbbf24; }
.mission-select-card.recommended { outline: 2px solid rgba(251,191,36,.55); outline-offset: 2px; }
.select-card-info small { display: block; margin-top: .28rem; color: #94a3b8; font-size: .7rem; }
