/* ==========================================================================
   css/passaporte.css
   Tela inicial mobile first - Passaporte do Explorador
   ========================================================================== */

html,
body {
  min-height: 100%;
}

body:has(.screen-passaporte) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  align-items: flex-start !important; /* evita que o flex center corte o scroll vertical */

  background-image: url('../img/fundos/fundo-inicio.webp');
  background-size: cover;
  background-position: center top;
  background-repeat: repeat-y;
}

/* Neutraliza o card geral apenas na tela inicial */
.game-card-passaporte {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Remove interferências da tela setup */
.screen-passaporte {
  width: 100%;
  min-height: 100vh;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Tela principal: container de conteúdo centralizado */
.passaporte-view {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 42px;
  box-sizing: border-box;

  overflow: visible;
}

/* Banner superior já existente */
.passaporte-banner-principal {
  position: relative;
  z-index: 2;
  width: 84%;
  max-width: 340px;
  height: auto;
  display: block;
  margin: 0 auto 20px;
}

/* Área interativa */
.passaporte-overlay {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  gap: 16px;

  padding: 0 0 32px;
}

/* Cards centrais */
.passaporte-card {
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  border-radius: 22px;

  background: rgba(255, 250, 236, 0.72);
  border: 1px solid rgba(163, 130, 72, 0.18);
  box-shadow: 0 8px 18px rgba(55, 35, 10, 0.07);

  backdrop-filter: blur(2px);
}

.passaporte-card-title {
  margin: 0;
  color: #16336e;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
}

.passaporte-card-subtitle {
  margin: 6px 0 16px;
  color: #526990;
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
}

/* Grade de avatares */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.avatar-opcao {
  position: relative;
  border: 2px solid rgba(27, 76, 152, 0.12);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.97);
  padding: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.avatar-opcao:hover {
  transform: translateY(-1px);
}

.avatar-opcao.oculto {
  display: none;
}

.avatar-foto {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 13px;
  background: #f7f5ef;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.avatar-selo {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2f6fd6;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);

  opacity: 0;
  transform: scale(0.85);
  transition: 0.18s ease;
}

.avatar-opcao.selecionado {
  border-color: #2f6fd6;
  box-shadow:
    0 0 0 3px rgba(47, 111, 214, 0.16),
    0 7px 16px rgba(0, 0, 0, 0.1);
}

.avatar-opcao.selecionado .avatar-selo {
  opacity: 1;
  transform: scale(1);
}

/* Botões secundários */
.passaporte-secundario-btn {
  width: 100%;
  border: 1px solid rgba(47, 111, 214, 0.22);
  border-radius: 15px;
  background: rgba(235, 242, 252, 0.96);
  color: #214a92;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  padding: 11px 14px;
  cursor: pointer;

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.passaporte-secundario-btn:hover {
  background: rgba(224, 236, 251, 1);
  transform: translateY(-1px);
}

.passaporte-secundario-btn-foto {
  margin-top: 4px;
  background: rgba(252, 247, 233, 0.98);
  border-color: rgba(184, 145, 67, 0.24);
  color: #7a5920;
}

.passaporte-secundario-btn-foto:hover {
  background: rgba(250, 242, 220, 1);
}

.passaporte-secundario-btn-foto.ativo {
  border-color: rgba(47, 111, 214, 0.52);
  box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.12);
}

.btn-icone,
.btn-icone-grande {
  line-height: 1;
}

/* Input file escondido */
.input-file-escondido {
  display: none;
}

.foto-status {
  margin: 8px 0 16px;
  color: #6d7d99;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
}

/* Labels */
.passaporte-label {
  display: block;
  margin: 0 0 7px;
  color: #18356f;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.2px;
}

/* Campos */
.campo-passaporte {
  position: relative;
  display: flex;
  align-items: center;

  background: rgba(255, 252, 244, 0.97);
  border: 1px solid rgba(190, 166, 117, 0.32);
  border-radius: 17px;

  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);

  margin-bottom: 16px;
  overflow: hidden;
}

.campo-icone {
  flex: 0 0 44px;
  width: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #375794;
  font-size: 1rem;
}

.passaporte-input {
  width: 100%;
  min-width: 0;

  border: none;
  outline: none;
  background: transparent;

  color: #24335f;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;

  padding: 14px 14px 14px 0;
}

.passaporte-input::placeholder {
  color: #8a8a8a;
  font-weight: 600;
}

.campo-passaporte:focus-within {
  border-color: rgba(47, 111, 214, 0.52);
  box-shadow:
    0 0 0 3px rgba(47, 111, 214, 0.12),
    inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Select */
.campo-select {
  position: relative;
}

.passaporte-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  cursor: pointer;
}

.campo-select::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;

  transform: translateY(-50%);

  color: #6d7d99;
  font-size: 0.9rem;

  pointer-events: none;
}

/* Botão principal */
.passaporte-btn {
  width: 100%;
  margin-top: 4px;

  border: none;
  border-radius: 25px;

  background: linear-gradient(180deg, #4fc875 0%, #1f9a51 100%);
  color: #ffffff;

  font-family: inherit;
  font-size: 1rem;
  font-weight: 900;

  padding: 15px 16px;
  cursor: pointer;

  box-shadow:
    0 6px 0 #15773c,
    0 10px 18px rgba(0, 0, 0, 0.14);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.passaporte-btn:hover {
  background: linear-gradient(180deg, #59d783 0%, #219b54 100%);
}

.passaporte-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 #15773c,
    0 5px 10px rgba(0, 0, 0, 0.12);
}

/* ==========================================================
   Celulares menores em pé
   ========================================================== */
@media (max-width: 360px) {
  .passaporte-view {
    padding: 14px 14px 34px;
  }

  .passaporte-banner-principal {
    width: 88%;
    margin-bottom: 16px;
  }

  .passaporte-card {
    padding: 14px;
    border-radius: 20px;
  }

  .passaporte-card-title {
    font-size: 1.08rem;
  }

  .passaporte-card-subtitle {
    font-size: 0.74rem;
    margin-bottom: 13px;
  }

  .avatar-grid {
    gap: 10px;
  }

  .passaporte-secundario-btn,
  .passaporte-btn {
    font-size: 0.82rem;
  }

  .passaporte-input {
    font-size: 0.82rem;
  }
}

/* ==========================================================
   Telas baixas
   ========================================================== */
@media (max-height: 740px) {
  .passaporte-view {
    min-height: auto;
    padding-top: 14px;
    padding-bottom: 36px;
  }

  .passaporte-banner-principal {
    width: 78%;
    margin-bottom: 14px;
  }

  .passaporte-card-title {
    font-size: 1.08rem;
  }

  .passaporte-card-subtitle {
    margin-bottom: 12px;
  }

  .avatar-grid {
    gap: 10px;
  }

  .passaporte-secundario-btn {
    padding: 10px 12px;
  }

  .passaporte-input {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .passaporte-btn {
    padding: 13px 14px;
  }
}

/* ==========================================================
   Tablet horizontal - passaporte aberto
   ========================================================== */
@media (orientation: landscape) and (min-width: 768px) {

  body:has(.screen-passaporte),
  .screen-passaporte,
  .game-card-passaporte {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .game-card-passaporte,
  .passaporte-view {
    max-width: 920px;
  }

  .passaporte-view {
    min-height: 100vh;
    padding: 18px 30px 28px;
  }

  .passaporte-banner-principal {
    width: 48%;
    max-width: 390px;
    margin: 0 auto 22px;
  }

  .passaporte-overlay {
    max-width: 820px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(300px, 1fr);
    gap: 26px;

    align-items: stretch;
  }

  .passaporte-card {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 250, 236, 0.68);
  }

  .passaporte-card-avatares {
    display: flex;
    flex-direction: column;
  }

  .passaporte-card-dados {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .passaporte-card-title {
    text-align: center;
    font-size: 1.22rem;
  }

  .passaporte-card-subtitle {
    text-align: center;
    font-size: 0.8rem;
    margin: 6px 0 16px;
  }

  .avatar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }

  .avatar-opcao {
    padding: 7px;
  }

  .passaporte-label {
    font-size: 0.78rem;
  }

  .campo-passaporte {
    min-height: 52px;
    margin-bottom: 17px;
  }

  .passaporte-secundario-btn {
    padding: 11px 13px;
    font-size: 0.82rem;
  }

  .foto-status {
    margin: 8px 0 18px;
    text-align: center;
  }

  .passaporte-btn {
    margin-top: 4px;
    padding: 15px 14px;
    font-size: 0.96rem;
  }
}

/* ==========================================================
   Celular horizontal - duas áreas compactas
   ========================================================== */
@media (orientation: landscape) and (max-width: 767px) {

  body:has(.screen-passaporte),
  .screen-passaporte,
  .game-card-passaporte {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .game-card-passaporte,
  .passaporte-view {
    max-width: 100%;
  }

  .passaporte-view {
    min-height: 100vh;
    padding: 10px 14px 24px;
  }

  .passaporte-banner-principal {
    width: 42%;
    max-width: 260px;
    margin: 0 auto 10px;
  }

  .passaporte-overlay {
    max-width: 680px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;

    align-items: stretch;
  }

  .passaporte-card {
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 250, 236, 0.64);
  }

  .passaporte-card-title {
    text-align: center;
    font-size: 0.98rem;
    line-height: 1.1;
  }

  .passaporte-card-subtitle {
    text-align: center;
    font-size: 0.66rem;
    margin: 4px 0 9px;
  }

  .avatar-grid {
    gap: 7px;
    margin-bottom: 9px;
  }

  .avatar-opcao {
    padding: 4px;
    border-radius: 12px;
  }

  .avatar-foto {
    border-radius: 9px;
  }

  .avatar-selo {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  .passaporte-secundario-btn {
    padding: 8px 10px;
    font-size: 0.7rem;
    border-radius: 12px;
  }

  .passaporte-label {
    font-size: 0.68rem;
    margin-bottom: 4px;
  }

  .campo-passaporte {
    min-height: 40px;
    margin-bottom: 9px;
    border-radius: 13px;
  }

  .campo-icone {
    flex-basis: 34px;
    width: 34px;
    font-size: 0.82rem;
  }

  .passaporte-input {
    font-size: 0.72rem;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .foto-status {
    display: none;
  }

  #btn-usar-foto {
    margin-top: 2px;
    margin-bottom: 9px;
  }

  .passaporte-btn {
    margin-top: auto;
    padding: 10px 12px;
    font-size: 0.78rem;
    border-radius: 18px;
  }
}

/* ==========================================================
   Desktop em orientação vertical: mantém experiência mobile
   ========================================================== */
@media (min-width: 431px) and (orientation: portrait) {
  body {
    background: #111827;
  }

  .game-card-passaporte,
  .passaporte-view {
    max-width: 430px;
  }
}

/* ==========================================================
   Botão Iniciar aventura — imagem
   ========================================================== */
.passaporte-btn-img {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 4px auto 0;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  width: min(100%, 320px);
  box-shadow: none;
  line-height: 0;

  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.passaporte-btn-img img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.passaporte-btn-img:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.passaporte-btn-img:active {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.97);
}

.passaporte-btn-img:focus-visible {
  outline: 3px solid rgba(34, 120, 70, 0.35);
  outline-offset: 4px;
  border-radius: 18px;
}

@media (max-width: 360px) {
  .passaporte-btn-img {
    width: min(100%, 280px);
  }
}