/* =============================================
   CONFIGURACOES.CSS — Modal de Configurações
   ============================================= */

/* ---- Overlay ---- */
.config-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  width: 100%;
  min-height: 100svh;
  background: rgba(9, 18, 38, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  box-sizing: border-box;
}

.config-overlay[hidden],
.config-overlay.oculto {
  display: none;
}

/* ---- Modal (moldura) ---- */
.config-modal {
  position: relative;
  width: min(92vw, 390px);
  max-height: calc(100svh - 28px);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  /* O fundo (img) define a altura; conteúdo sobrepõe */
}

/* ---- Fundo pergaminho — define a altura natural do modal ---- */
.config-modal-fundo {
  display: block;
  width: 100%;
  min-height: 560px;
  height: auto;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

/* ---- Botão fechar — direto no .config-modal, sempre fixo no topo ---- */
.config-fechar {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, filter 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.config-fechar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.config-fechar:hover,
.config-fechar:focus-visible {
  transform: scale(1.08);
  filter: brightness(0.9);
  outline: none;
}

.config-fechar:active {
  transform: scale(0.94);
}

/* ---- Conteúdo scrollável — sobrepõe o fundo ---- */
.config-conteudo {
  position: absolute;
  inset: 0;
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

/* ---- Banner título ---- */
.config-banner {
  width: min(78%, 250px);
  height: auto;
  object-fit: contain;
  display: block;
  margin: 30px auto 14px;
  flex-shrink: 0;
}

/* ---- Seções ---- */
.config-secao {
  width: 100%;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.config-secao-titulo {
  margin: 0 0 7px;
  color: #173b6d;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1.5px solid rgba(214, 164, 71, 0.65);
  padding-bottom: 5px;
}

.config-titulo-dados {
  color: #8a2f18;
  border-bottom-color: rgba(226, 90, 71, 0.45);
}

/* ---- Linhas (toggle e volume) ---- */
.config-linha {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid rgba(214, 164, 71, 0.8);
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.86);
  color: #173b6d;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  cursor: pointer;
  box-sizing: border-box;
}

.config-linha:last-child {
  margin-bottom: 0;
}

/* ---- Toggle ---- */
.config-linha-toggle {
  justify-content: space-between;
}

.config-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.config-toggle-visual {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #b8c8dc;
  position: relative;
  flex-shrink: 0;
  transition: background 0.18s ease;
  cursor: pointer;
}

.config-toggle-visual::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease;
}

.config-toggle-input:checked ~ .config-toggle-visual {
  background: #2d70b8;
}

.config-toggle-input:checked ~ .config-toggle-visual::after {
  transform: translateX(20px);
}

.config-toggle-input:focus-visible ~ .config-toggle-visual {
  outline: 2px solid #2d70b8;
  outline-offset: 2px;
}

/* ---- Volume ---- */
.config-linha-volume {
  justify-content: space-between;
  gap: 10px;
}

.config-linha-volume span {
  flex-shrink: 0;
  white-space: nowrap;
}

.config-volume-slider {
  flex: 1;
  min-width: 60px;
  accent-color: #2d70b8;
  cursor: pointer;
}

/* ---- Nome do jogador ---- */
.config-nome-jogador {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid #8bb8ec;
  border-radius: 12px;
  background: rgba(237, 246, 255, 0.92);
  color: #173b6d;
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  padding: 0 13px;
  margin-bottom: 7px;
  box-sizing: border-box;
  gap: 8px;
}

/* ---- Botões de ação ---- */
.config-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 7px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.1s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.config-btn:active {
  transform: scale(0.98);
}

.config-btn:last-child {
  margin-bottom: 0;
}

.config-btn-editar {
  border: 1.5px solid #2d70b8;
  color: #173b6d;
}

.config-btn-editar:hover,
.config-btn-editar:focus-visible {
  background: rgba(237, 246, 255, 0.92);
  outline: 2px solid #2d70b8;
  outline-offset: 2px;
}

.config-btn-resetar {
  border: 1.5px solid #e25a47;
  color: #a33122;
  background: rgba(255, 246, 242, 0.92);
}

.config-btn-resetar:hover,
.config-btn-resetar:focus-visible {
  background: rgba(255, 235, 228, 0.96);
  outline: 2px solid #e25a47;
  outline-offset: 2px;
}

/* ---- Aviso do reset ---- */
.config-aviso-reset {
  width: 100%;
  border: 1.5px solid #e6b74d;
  border-radius: 12px;
  background: rgba(255, 243, 208, 0.92);
  color: #6a4518;
  font-size: 0.77rem;
  line-height: 1.4;
  font-weight: 700;
  padding: 9px 12px;
  box-sizing: border-box;
  margin-top: 4px;
}

/* ---- Mini-modal de confirmação ---- */
.config-confirmacao-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: rgba(9, 18, 38, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  box-sizing: border-box;
}

.config-confirmacao-caixa {
  width: min(88vw, 360px);
  border-radius: 24px;
  background: #fffbf0;
  border: 2px solid #d6a447;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  padding: 26px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  box-sizing: border-box;
}

.config-confirmacao-icone {
  font-size: 2.2rem;
  line-height: 1;
}

.config-confirmacao-titulo {
  color: #8a2f18;
  font-size: 1rem;
  font-weight: 900;
  margin: 0;
  line-height: 1.2;
}

.config-confirmacao-mensagem {
  color: #4a3010;
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 0;
  font-weight: 600;
}

.config-confirmacao-acoes {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}

.config-confirmacao-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
}

.config-confirmacao-btn:active {
  transform: scale(0.98);
}

.config-confirmacao-btn-cancelar {
  border: 1.5px solid #b8c8dc;
  background: rgba(255, 255, 255, 0.9);
  color: #173b6d;
}

.config-confirmacao-btn-cancelar:hover,
.config-confirmacao-btn-cancelar:focus-visible {
  background: rgba(237, 246, 255, 0.9);
  outline: 2px solid #8bb8ec;
  outline-offset: 2px;
}

.config-confirmacao-btn-confirmar {
  border: 1.5px solid #e25a47;
  background: rgba(255, 246, 242, 0.95);
  color: #a33122;
}

.config-confirmacao-btn-confirmar:hover,
.config-confirmacao-btn-confirmar:focus-visible {
  background: rgba(255, 228, 220, 0.98);
  outline: 2px solid #e25a47;
  outline-offset: 2px;
}
