/* ============================================================
   startmenu.css — Menu Inicial Minimalista (Dark Blueprint)
   Inspirado no layout limpo de tela cheia com card Última Partida
   e grade de acesso rápido 2×3.
   ============================================================ */

body.start-menu-open #sidebar {
  display: none !important;
}

body.start-menu-open #mapWrap {
  flex: 1 1 100% !important;
  width: 100% !important;
}

body.start-menu-open #mapTitleBanner,
body.start-menu-open #toolbar,
body.start-menu-open #hint,
body.start-menu-open #mapOpts,
body.start-menu-open #mapLevels,
body.start-menu-open #simBar,
body.start-menu-open #trainFollowHud,
body.start-menu-open #inspector,
body.start-menu-open .leaflet-control-zoom,
body.start-menu-open #btnSidebar,
body.start-menu-open #sbToggle {
  opacity: 0 !important;
  pointer-events: none !important;
}

.start-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background-color: #070b15;
  background-image:
    radial-gradient(ellipse 68% 50% at 50% 18%, rgba(225, 29, 72, 0.14), transparent 65%),
    radial-gradient(ellipse 60% 48% at 32% 72%, rgba(37, 99, 235, 0.12), transparent 68%),
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  overflow-y: auto;
  opacity: 1;
  transition: opacity 0.2s ease;
  color: #f8fafc;
}

.start-menu-overlay.closing {
  opacity: 0;
  pointer-events: none;
}

.sm-shell {
  width: min(720px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Barra Superior ---------- */
.sm-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sm-brand-id {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sm-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.sm-brand-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
}

.sm-ver-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.24);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sm-ver-pill:hover {
  background: rgba(148, 163, 184, 0.26);
  border-color: rgba(148, 163, 184, 0.45);
  color: #ffffff;
}

.sm-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sm-top-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sm-top-account-btn:hover {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(30, 41, 59, 0.85);
  color: #ffffff;
}

.sm-top-account-btn.is-pro {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.sm-lang-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
}

.sm-lang-select {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  cursor: pointer;
  outline: none;
}

.sm-lang-select option {
  background: #0f172a;
  color: #f8fafc;
}

/* ---------- Card Principal: Última Partida ---------- */
.sm-hero-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(17, 25, 42, 0.94) 0%, rgba(13, 19, 34, 0.96) 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 22px 24px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sm-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 45%, #f43f5e 100%);
}

.sm-hero-head {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sm-hero-eyebrow {
  display: inline-flex;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.sm-hero-map-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sm-metrics-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 13px 16px;
  border-radius: 11px;
  background: rgba(7, 11, 21, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.sm-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sm-metric-val {
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.3px;
}

.sm-metric-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: #64748b;
}

.sm-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.sm-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.52);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sm-btn-ghost:hover {
  background: rgba(51, 65, 85, 0.65);
  border-color: rgba(148, 163, 184, 0.44);
  color: #ffffff;
}

.sm-btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.36);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.sm-btn-play:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 28px rgba(225, 29, 72, 0.48);
}

/* ---------- Grade 2×3 de Ações Rápidas ---------- */
.sm-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.sm-tile {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.sm-tile:hover {
  border-color: rgba(125, 211, 252, 0.42);
  background: rgba(24, 36, 62, 0.88);
  transform: translateY(-1px);
}

.sm-tile-ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.11);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
}

.sm-tile-pro .sm-tile-ico {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.sm-tile-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sm-tile-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sm-tile-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-tile-sub {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-nav-pill {
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.sm-nav-pill.pro {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.42);
}

/* ---------- Rodapé Minimalista ---------- */
.sm-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 6px;
}

.sm-foot-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 3px 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease;
}

.sm-foot-link:hover {
  color: #ffffff;
}

.sm-foot-dot {
  color: #334155;
  font-size: 12px;
  user-select: none;
}

/* ---------- Modal Novo Mapa / Cidade ---------- */
.sm-city-modal-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sm-city-modal-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sm-city-modal-box h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.sm-city-modal-box p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.sm-city-modal-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.sm-city-modal-select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}

.sm-city-modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.modal.modal-dark .sm-city-modal-box {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 13px 15px;
  gap: 10px;
}

.modal.modal-dark .sm-city-modal-box h4 {
  font-size: 13.5px;
  color: #f8fafc;
}

.modal.modal-dark .sm-city-modal-box p {
  font-size: 12.2px;
  color: #94a3b8;
  line-height: 1.45;
}

.modal.modal-dark .sm-city-modal-row {
  align-items: center;
}

.modal.modal-dark .sm-city-modal-row .start-modal-city-wrap {
  flex: 1;
  min-width: 0;
  width: auto;
}

.modal.modal-dark .sm-city-modal-row .btn.primary {
  white-space: nowrap;
  flex: none;
  padding: 9px 15px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 640px) {
  .start-menu-overlay {
    padding: 16px 12px;
    align-items: flex-start;
  }
  .sm-hero-card {
    padding: 18px 16px;
  }
  .sm-hero-map-title {
    font-size: 18px;
  }
  .sm-metrics-bar {
    gap: 8px;
    padding: 11px 12px;
  }
  .sm-metric-val {
    font-size: 15.5px;
  }
  .sm-hero-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .sm-actions-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Pantalla de Carga Progresiva ---------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1120;
  color: #f8fafc;
  transition: opacity 0.25s ease;
}

.loading-screen.hidden {
  display: none !important;
}

.loading-box {
  width: 100%;
  max-width: 420px;
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #e11d48;
  border-radius: 50%;
  animation: loadingSpin 0.8s linear infinite;
  margin-bottom: 18px;
}

@keyframes loadingSpin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  margin-bottom: 4px;
}

.loading-subtitle {
  font-size: 13.5px;
  color: #94a3b8;
  margin-bottom: 22px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loading-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e11d48, #f43f5e, #38bdf8);
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

.loading-stage {
  font-size: 12px;
  color: #64748b;
  min-height: 18px;
}

/* ---------- Banner Comunidade Oficial no Discord ---------- */
.sm-discord-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(88, 101, 242, 0.42);
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.22) 0%, rgba(71, 82, 196, 0.14) 100%);
  color: #f8fafc;
  text-decoration: none;
  box-sizing: border-box;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.sm-discord-banner:hover {
  border-color: rgba(129, 140, 248, 0.72);
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.34) 0%, rgba(71, 82, 196, 0.24) 100%);
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.26);
  transform: translateY(-1px);
}

.sm-discord-ico {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #5865F2;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.45);
}

.sm-discord-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sm-discord-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.sm-discord-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.sm-discord-pill {
  flex: none;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.38);
  color: #e0e7ff;
  border: 1px solid rgba(165, 180, 252, 0.45);
}

.sm-discord-sub {
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.35;
}

.sm-discord-cta {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 8px;
  background: #5865F2;
  color: #ffffff;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.sm-discord-banner:hover .sm-discord-cta {
  background: #4752C4;
}

@media (max-width: 580px) {
  .sm-discord-banner {
    flex-wrap: wrap;
    padding: 12px 13px;
  }
  .sm-discord-cta {
    width: 100%;
    text-align: center;
    margin-top: 2px;
  }
}
