/* Estilos do Brasfoot 22-23 com Setinhas de Fase, Notas SofaScore e Momentum */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700;800&family=Tahoma&display=swap');

:root {
  /* Tokens Semânticos Globais de Marca */
  --brand-primary: #00a651;
  --brand-secondary: #082238;
  --brand-accent: #ffd600;
  --surface-game: #00a651;
  --surface-navy: #0a2a4a;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --accent-score: #ffd600;

  /* Aliases de Compatibilidade */
  --bf-green: var(--brand-primary);
  --bf-green-dark: #008741;
  --bf-green-light: #00a651;
  --bf-navy: var(--brand-secondary);
  --bf-navy-dark: #051624;
  --bf-navy-light: var(--surface-navy);
  --bf-yellow: var(--brand-accent);
  --bf-yellow-dark: #e6b800;
  --bf-text: var(--text-primary);
  --bf-text-dark: #000000;
  --bf-white: var(--text-primary);
  --bf-border: #004d1a;
  --bf-gray: #f4f4f4;
  --bf-gray-dark: #333333;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, -apple-system, BlinkMacSystemFont, 'Segoe UI Variable', sans-serif;
  background-color: var(--brand-secondary, #082238);
  color: #ffffff;
  user-select: none;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.stadium-bg {
  background-image: url('../assets/img/f01.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 1280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-screen {
  display: none;
  width: 100%;
  flex: 1;
}

.game-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Botões */
.bf-btn {
  background: linear-gradient(180deg, #ffffff 0%, #e6e6e6 50%, #cccccc 100%);
  border: 1px solid #707070;
  border-radius: 3px;
  color: #000000;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 14px;
  cursor: pointer;
  box-shadow: inset 1px 1px 0px #fff, 1px 1px 2px rgba(0,0,0,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.bf-btn:hover {
  background: linear-gradient(180deg, #f2f2f2 0%, #d9d9d9 50%, #bfbfbf 100%);
}

.bf-btn:active {
  background: #bfbfbf;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.4);
}

.bf-btn-green {
  background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
  color: #fff;
  border: 1px solid #1e8449;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}

.bf-btn-green:hover {
  background: linear-gradient(180deg, #58d68d 0%, #2ecc71 100%);
}

.bf-btn-danger {
  background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
  border: 1px solid #922b21;
}

/* Menu Inicial Limpo e Elegante */
.menu-box-classic {
  width: 620px;
  min-height: 380px;
  background: linear-gradient(165deg, #005a2b 0%, #003d1c 55%, #00220e 100%);
  border: 2px solid #00a651;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

#auth-status-bar {
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(0, 166, 81, 0.4);
  padding: 6px 14px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #e0e0e0;
}

.menu-brand-header {
  padding: 16px 24px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.menu-brand-title {
  font-family: 'Segoe UI', 'Impact', sans-serif;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffd600;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
  line-height: 1;
}

.menu-brand-sub {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 4px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.menu-classic-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

.menu-item-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  text-align: center;
}

.menu-item-btn:hover {
  transform: translateY(-4px);
  filter: brightness(1.15);
}

.menu-item-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
  font-size: 26px;
  color: #000000;
}

.menu-item-label {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}

.menu-exit-link {
  padding: 8px 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  color: #ffd600;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, color 0.15s ease;
  font-weight: bold;
}

.menu-exit-link:hover {
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
}

.menu-nostalgia-banner {
  background: linear-gradient(90deg, #b8860b 0%, #d4af37 50%, #b8860b 100%);
  color: #000;
  font-size: 11px;
  font-weight: bold;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-top: 1px solid #ffd700;
  transition: filter 0.15s ease;
}

.menu-nostalgia-banner:hover {
  filter: brightness(1.15);
}

.nostalgia-pulse-dot {
  width: 8px;
  height: 8px;
  background: #ff0000;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 8px #ff0000;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.menu-options-footer {
  padding: 6px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bf-btn-link {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.bf-btn-link:hover {
  color: #ffd600;
}

/* Painéis Azul Marinho */
.navy-panel-box {
  background: rgba(8, 34, 56, 0.95);
  border: 1px solid #1a5276;
  border-radius: 4px;
  width: 900px;
  max-width: 95vw;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.navy-panel-title {
  text-align: center;
  color: var(--bf-yellow);
  font-size: 20px;
  font-weight: bold;
}

.navy-panel-sub {
  text-align: center;
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  margin-top: -8px;
}

.navy-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.navy-sub-title {
  color: var(--bf-yellow);
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
}

.navy-table-wrap {
  background: #ffffff;
  border: 1px solid #707070;
  height: 180px;
  overflow-y: auto;
}

.navy-table {
  width: 100%;
  border-collapse: collapse;
  color: #000;
  font-size: 12px;
}

.navy-table th {
  background: #e6e6e6;
  border-bottom: 1px solid #aaa;
  padding: 4px 6px;
  text-align: left;
  font-weight: bold;
}

.navy-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #eee;
}

.navy-table tr.selected {
  background: var(--bf-yellow);
}

.navy-options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.navy-radio-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Painel Principal do Jogo */
.main-game-layout {
  background-color: var(--bf-green-light);
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-top-toolbar {
  background: #000000;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 2px solid #222;
}

.game-top-toolbar {
  background: linear-gradient(180deg, #111111 0%, #050505 100%);
  border-bottom: 2px solid #1a5276;
  padding: 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 500;
}

.toolbar-icons-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: all 0.1s ease;
  user-select: none;
}

.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffd600;
}

/* Dropdown Menus Flutuantes */
.bf-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #0a2a4a;
  border: 1px solid #1a5276;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95);
  min-width: 220px;
  display: none !important;
  flex-direction: column;
  z-index: 99999;
  padding: 4px 0;
  margin-top: 2px;
}

.bf-dropdown-menu.active {
  display: flex !important;
}

.bf-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  font-size: 11px;
  color: #ffffff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.bf-dropdown-item:hover {
  background: #00a651;
  color: #ffffff;
}

.shortcut-key {
  color: #ffd600;
  font-size: 10px;
  font-weight: bold;
  margin-left: 12px;
}

.game-date-display {
  color: #ffd600;
  font-size: 12px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-body-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  padding: 10px;
  gap: 10px;
  flex: 1;
}

.sidebar-left-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-team-info {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-shield {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.sidebar-team-text h3 {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
}

.sidebar-team-text p {
  font-size: 12px;
  color: var(--bf-yellow);
}

.sidebar-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: bold;
  padding: 0 4px;
}

.sidebar-confidence-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 6px;
  border-radius: 4px;
  font-size: 11px;
}

.confidence-bar-outer {
  background: #fff;
  height: 10px;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

.confidence-bar-inner {
  height: 100%;
  background: #27ae60;
}

.sidebar-next-match {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 8px;
  text-align: center;
}

.btn-play-game-big {
  background: linear-gradient(180deg, #ffffff 0%, #d4efdf 100%);
  border: 2px solid #1e8449;
  color: #145a32;
  font-size: 13px;
  font-weight: 900;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.btn-play-game-big:hover {
  background: #ffffff;
}

.player-details-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 8px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-details-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 4px;
  font-weight: bold;
  color: var(--bf-yellow);
}

.sidebar-mini-icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px;
}

/* Tabela Central de Jogadores */
.central-squad-table-wrap {
  background: #ffffff;
  border: 1px solid #004d1a;
  border-radius: 2px;
  overflow-y: auto;
  max-height: calc(100vh - 75px);
}

.squad-classic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: #ffffff;
  color: #000000;
}

.squad-classic-table thead th {
  background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
  color: #333333;
  font-weight: bold;
  padding: 4px 6px;
  text-align: left;
  border-bottom: 2px solid #b0b0b0;
  border-right: 1px solid #d0d0d0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.squad-classic-table tbody tr {
  border-bottom: 1px solid #e8e8e8;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.squad-classic-table tbody tr:hover {
  background-color: #f1f8ff;
}

.squad-classic-table tbody tr.selected {
  background-color: #3498db !important;
  color: #ffffff !important;
}

.squad-classic-table tbody tr.selected td {
  color: #ffffff !important;
}

.squad-classic-table tbody tr.is-starter {
  font-weight: 600;
}

.squad-classic-table tbody td {
  padding: 3px 6px;
  white-space: nowrap;
  border-right: 1px solid #f0f0f0;
}

.energy-badge-green {
  background: #27ae60;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 4px;
  border-radius: 2px;
}

/* BADGES DE NOTAS COLORIDAS SOFASCORE / FOTMOB */
.score-badge-sofa {
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 800;
  font-size: 11px;
  color: #fff;
  display: inline-block;
  min-width: 26px;
  text-align: center;
}

.score-great { background: #1b5e20; }
.score-good { background: #2e7d32; }
.score-avg { background: #f57f17; color: #000; }
.score-bad { background: #c62828; }

/* MODAIS NATIVOS */
.bf-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bf-modal-overlay.active {
  display: flex;
}

.bf-modal-window {
  background: var(--bf-navy);
  border: 2px solid #1a5276;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.9);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.bf-modal-header {
  background: #041421;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1a5276;
}

.bf-modal-header h3 {
  color: var(--bf-yellow);
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bf-modal-close-btn {
  background: #fff;
  border: 1px solid #333;
  color: #000;
  font-weight: bold;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
}

.bf-modal-close-btn:hover {
  background: #ff4d4d;
  color: #fff;
}

.bf-modal-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  color: #fff;
  font-size: 12px;
}

.bf-modal-footer {
  background: #041421;
  padding: 8px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #1a5276;
}

.bf-dialog-box {
  background: #11361b;
  border: 3px solid #2ecc71;
  border-radius: 4px;
  padding: 20px;
  width: 440px;
  max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0,0,0,0.9);
  text-align: center;
}

.bf-dialog-title {
  color: var(--bf-yellow);
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px;
}

.bf-dialog-text {
  font-size: 13px;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 18px;
  white-space: pre-line;
}

/* ==========================================================================
   RESPONSIVIDADE MOBILE & TOUCH (Smartphones & Tablets)
   ========================================================================== */
@media (max-width: 768px) {
  body {
    padding: 4px;
  }

  #app {
    width: 100%;
    max-width: 100vw;
  }

  /* 1. Menu Principal Clássico */
  .menu-box-classic {
    width: 100%;
    max-width: 96vw;
    min-height: auto;
    margin: 8px auto;
  }

  .menu-brand-header {
    padding: 12px 14px 0 14px;
  }

  .menu-brand-title {
    font-size: 32px;
    letter-spacing: 2px;
  }

  .menu-brand-sub {
    font-size: 13px;
  }

  .menu-classic-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px 12px;
  }

  .menu-item-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .menu-item-label {
    font-size: 10px;
  }

  .menu-nostalgia-banner {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 8px 10px;
  }

  .menu-options-footer {
    padding: 8px 10px;
    font-size: 11px;
  }

  /* 2. Painéis Navy (Config Iniciais / Escolha de Time) */
  .navy-panel-box {
    width: 100%;
    max-width: 96vw;
    padding: 12px;
    margin: 8px auto;
  }

  .navy-panel-box div[style*="display: grid; grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .navy-panel-box select,
  .navy-panel-box input[type="text"] {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* 3. Toolbar Superior do Jogo Principal */
  .game-top-toolbar {
    padding: 4px 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .game-top-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-icons-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    min-width: max-content;
  }

  .toolbar-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
    min-width: 52px !important;
    flex-shrink: 0 !important;
  }

  /* 4. Painel de Escalação e Campinho 2D */
  .squad-layout {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .pitch-container {
    height: 360px !important;
  }

  /* 5. Modais e Diálogos */
  .bf-modal-overlay {
    padding: 8px;
  }

  .bf-modal-window {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
  }

  .bf-modal-content {
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .bf-modal-content div[style*="grid-template-columns: 1fr 1fr"],
  .bf-modal-content div[style*="grid-template-columns: 1.1fr 1fr"],
  .bf-modal-content div[style*="grid-template-columns: 260px 1fr"],
  .bf-modal-content div[style*="grid-template-columns: 240px 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  /* 6. Tela de Partida Ao Vivo */
  .bf-match-fullscreen {
    width: 98vw !important;
    max-width: 98vw !important;
    margin: 4px auto;
  }

  .live-match-header {
    padding: 6px 10px;
  }

  .live-match-scoreboard {
    padding: 8px 4px !important;
  }

  .live-team-name {
    font-size: 13px !important;
  }

  .live-score-big {
    font-size: 26px !important;
  }
}

@media (max-width: 480px) {
  .menu-brand-title {
    font-size: 28px;
  }

  .bf-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .live-team-badge {
    width: 28px !important;
    height: 28px !important;
  }
}
