/* ============================================
   DOMÍNIO URBANO - LOBBY v3.3
   Background adaptativo mobile/desktop
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Roboto', 'Segoe UI', 'Arial', sans-serif;
  background-color: #050508;
}

/* ── CONTAINER PRINCIPAL ── */
.lobby-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 🔥 MOBILE: imagem vertical */
  background: url('../assets/img/banner_mobile.jpeg') no-repeat center center/cover;
  background-color: #0a0a0f;
}

/* 🔥 DESKTOP: imagem horizontal */
@media (min-width: 768px) {
  .lobby-container {
    background: url('../assets/img/banner_desktop.jpeg') no-repeat center center/cover;
  }
}

.lobby-container::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: 
    repeating-linear-gradient(0deg, rgba(255,215,0,0.02) 0px, rgba(255,215,0,0.02) 2px, transparent 2px, transparent 8px),
    repeating-linear-gradient(90deg, rgba(255,215,0,0.02) 0px, rgba(255,215,0,0.02) 2px, transparent 2px, transparent 12px);
  pointer-events: none; z-index: 1;
}

.lobby-container::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 2px, transparent 2px, transparent 6px);
  pointer-events: none; z-index: 3;
}

/* ── OVERLAY ── */
.overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at center, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.85) 100%);
  backdrop-filter: blur(1px);
  z-index: 2; pointer-events: none;
}

/* ── CONTENT ── */
.content {
  position: relative; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  text-align: center;
  width: 100%; max-width: 460px;
  padding: 1.5rem 1rem 1rem;
  height: 100%;
  overflow-y: auto;
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.1) forwards;
}

/* ── DESKTOP: centralizar conteúdo com fundo semi-transparente ── */
@media (min-width: 768px) {
  .content {
    background: rgba(5,5,8,0.75);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    max-width: 520px;
    margin: 2rem auto;
    height: auto;
    max-height: 90vh;
    border: 1px solid rgba(255,215,0,0.1);
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
  }
}

/* ════════════════════════════════════════════
   TÍTULO PRINCIPAL
   ════════════════════════════════════════════ */
.title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

.game-title {
  font-family: 'Inter', 'Roboto', 'Segoe UI', sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 8vw, 3rem);
  color: #ffd700;
  letter-spacing: 0.4rem;
  text-shadow: 0 0 30px rgba(255,215,0,0.6), 0 0 60px rgba(255,215,0,0.3), 0 4px 8px rgba(0,0,0,0.8);
  line-height: 1;
  text-transform: uppercase;
}

.game-subtitle {
  font-family: 'Inter', 'Roboto', sans-serif;
  font-weight: 400;
  font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  color: rgba(255,215,0,0.7);
  letter-spacing: 0.5rem;
  text-shadow: 0 0 10px rgba(255,215,0,0.3);
  margin-top: 2px;
}

/* ════════════════════════════════════════════
   SEÇÃO DE TÍTULOS
   ════════════════════════════════════════════ */
.section-title {
  font-family: 'Inter', 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 0.65rem;
  color: rgba(255,215,0,0.75);
  letter-spacing: 0.2rem;
  margin-bottom: 0.7rem;
  text-shadow: 0 0 8px rgba(255,215,0,0.3);
  text-transform: uppercase;
}

/* ════════════════════════════════════════════
   LISTA DE MODOS (VERTICAL)
   ════════════════════════════════════════════ */
.mode-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0.8rem;
}

/* CARD DE MODO */
.mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.08);
  transition: all 0.25s ease;
  background: rgba(10,10,20,0.7);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

.mode-card:hover {
  border-color: rgba(255,215,0,0.4);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(255,215,0,0.15);
}

.mode-card.selected {
  border-color: #ffd700 !important;
  box-shadow: 0 0 20px rgba(255,215,0,0.4), 0 0 40px rgba(255,215,0,0.15) !important;
  background: rgba(255,215,0,0.08);
}

.mode-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 🔥 ÍCONE COMO IMAGEM PNG */
.mode-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.4));
}

.mode-info {
  flex: 1;
  text-align: left;
}

.mode-name {
  color: #ffd700;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  margin-bottom: 3px;
}

.mode-desc {
  color: #bbb;
  font-size: 0.55rem;
  font-weight: 500;
  margin-bottom: 5px;
}

.mode-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255,255,255,0.06);
  color: #aaa;
  font-size: 0.48rem;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}

.mode-arrow {
  color: rgba(255,215,0,0.4);
  font-size: 1.4rem;
  font-weight: 300;
  flex-shrink: 0;
}

.coming-soon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  background: rgba(0,0,0,0.85);
  color: #ffd700;
  padding: 5px 16px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12rem;
  border: 1px solid #ffd700;
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
  z-index: 5;
}

/* ════════════════════════════════════════════
   SELEÇÃO DE FACÇÃO
   ════════════════════════════════════════════ */
.faction-selection {
  width: 100%;
  margin-bottom: 0.8rem;
}

.faction-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}

.faction-card {
  position: relative;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
  transition: all 0.2s ease;
  background: rgba(10,10,20,0.6);
  padding: 8px 4px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.faction-card:hover {
  border-color: rgba(255,215,0,0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255,215,0,0.2);
}

.faction-card.selected {
  border-color: #ffd700 !important;
  box-shadow: 0 0 16px rgba(255,215,0,0.5), 0 0 32px rgba(255,215,0,0.2) !important;
  background: rgba(255,215,0,0.08);
}

.faction-card.selected::after {
  content: "✓";
  position: absolute;
  top: 4px; right: 4px;
  width: 16px; height: 16px;
  background: #ffd700; color: #111;
  font-size: 0.55rem; font-weight: bold;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}

.faction-emoji {
  font-size: 1.4rem;
  margin-bottom: 3px;
  filter: drop-shadow(0 0 4px rgba(255,215,0,0.3));
}

.faction-name {
  color: #fff;
  font-size: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.03rem;
  margin-bottom: 2px;
  line-height: 1.2;
}

.faction-bonus {
  color: #ffd700;
  font-size: 0.4rem;
  font-weight: 500;
  margin-bottom: 1px;
}

.faction-territory {
  color: rgba(255,255,255,0.5);
  font-size: 0.38rem;
  font-weight: 500;
}

/* ════════════════════════════════════════════
   SELEÇÃO DE TROPAS (CONFRONTO RÁPIDO)
   ════════════════════════════════════════════ */
.quick-selection {
  width: 100%;
  margin-bottom: 0.8rem;
}

.quick-setup {
  background: rgba(10,10,20,0.6);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 12px;
  padding: 14px;
}

.quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 0.7rem;
  color: #fff;
}

.quick-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-btn {
  background: rgba(20,20,40,0.8);
  color: #ffd700;
  border: 1px solid #555;
  padding: 4px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: bold;
  transition: all 0.15s;
}

.quick-btn:hover {
  background: rgba(40,40,70,0.9);
  border-color: #ffd700;
}

.quick-value {
  color: #ffd700;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 24px;
  text-align: center;
}

.quick-info {
  color: #aaa;
  font-size: 0.55rem;
  margin-top: 8px;
  text-align: center;
}

/* ════════════════════════════════════════════
   BOTÕES DE AÇÃO
   ════════════════════════════════════════════ */
.action-btn {
  background: rgba(20, 20, 40, 0.9);
  border: 1px solid #555;
  padding: 0.7rem 2rem;
  font-size: clamp(0.85rem, 3.5vw, 1rem);
  font-weight: 700;
  font-family: 'Inter', 'Roboto', sans-serif;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  color: #ffd700;
  border-radius: 4px;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: all 0.2s ease;
  z-index: 20;
  min-width: 180px;
  margin-top: 0.3rem;
}

.gold-btn {
  background: rgba(139, 117, 0, 0.25);
  border-color: rgba(255,215,0,0.4);
}

.action-btn:hover:not(:disabled) {
  background: rgba(40, 40, 70, 0.95);
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255,215,0,0.4);
  transform: scale(1.03);
}

.action-btn:active { transform: scale(0.96); }

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.5);
}

.back-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #aaa;
  padding: 0.5rem 1.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'Inter', 'Roboto', sans-serif;
  letter-spacing: 0.06rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.4rem;
}

.back-btn:hover {
  border-color: #ffd700;
  color: #ffd700;
}

.warning-text {
  color: #ff6666;
  font-size: 0.6rem;
  font-weight: 500;
  margin-top: 0.3rem;
  letter-spacing: 0.04rem;
}

/* ════════════════════════════════════════════
   UTILITÁRIOS
   ════════════════════════════════════════════ */
.hidden { display: none !important; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVIDADE ── */
@media (max-width: 480px) {
  .game-title { font-size: 2rem; }
  .mode-card { padding: 12px 14px; }
  .mode-icon { width: 40px; height: 40px; }
  .mode-name { font-size: 0.65rem; }
  .faction-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .faction-name { font-size: 0.4rem; }
  .faction-emoji { font-size: 1.2rem; }
}

@media (max-width: 360px) {
  .faction-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════════
   MODAL DE CAMPANHA SALVA
   ════════════════════════════════════════════ */
.save-modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}

.save-modal.hidden {
  display: none;
}

.save-modal-content {
  background: linear-gradient(135deg, #0d0d1a 0%, #111122 100%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 16px;
  padding: 20px 18px;
  width: 85%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.08);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.save-modal-icon {
  font-size: 2.5rem;
  margin-bottom: 6px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.save-modal-title {
  color: #ffd700;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  margin-bottom: 12px;
  font-family: 'Inter', 'Roboto', sans-serif;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.save-info-grid {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.save-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.58rem;
}

.save-info-row:last-child {
  border-bottom: none;
}

.save-info-row span:first-child {
  color: #888;
}

.save-info-row span:last-child {
  color: #ffd700;
  font-weight: 600;
}

.save-modal-content .action-btn,
.save-modal-content .back-btn {
  width: 100%;
  margin-top: 6px;
}

.save-modal-content .gold-btn {
  margin-top: 8px;
}

/* ════════════════════════════════════════════
   LINHA DE RENDA DA FACÇÃO
   ════════════════════════════════════════════ */
.faction-income {
  color: #4caf50;
  font-size: 0.38rem;
  font-weight: 600;
  margin-bottom: 1px;
  text-shadow: 0 0 4px rgba(76, 175, 80, 0.3);
}