/* ============================================================
   AVATAR-SELETOR.CSS — 11/10
   Janelas "Escolher Avatar" e "Arte de Batalha" do Status, no visual
   do jogo (pergaminho + azul-marinho + dourado). Só aparência: a lógica
   continua em js/game.js. Tudo fica dentro de .avsel-modal, por isso o
   seletor do cadastro (register.css) não muda.
   ============================================================ */
.avsel-modal {
  background: radial-gradient(circle at 50% 30%, rgba(16,43,67,.72), rgba(4,10,20,.9)) !important;
  backdrop-filter: blur(3px);
  padding: 16px;
  box-sizing: border-box;
}
.avsel-modal *, .avsel-modal *::before, .avsel-modal *::after { box-sizing: border-box; }

/* ── Caixa ─────────────────────────────────────────────── */
.avsel-modal .avsel-box {
  position: relative;
  width: 1000px; max-width: 100%;
  height: 88vh; max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(90deg, #d9c18d66, transparent 4%, transparent 96%, #d9c18d66),
    linear-gradient(160deg, #fff7e7, #eadbbc);
  border: 1px solid #aa8447;
  border-top: 5px solid #b58a44;
  box-shadow: inset 0 0 0 4px #f6e6bc, 0 22px 60px rgba(0,0,0,.55);
}

/* ── Cabeçalho: faixa azul com título dourado ──────────── */
.avsel-modal .avsel-header {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 18px 64px 10px;
  background: transparent;
  border: 0;
}
.avsel-modal .avsel-title {
  display: inline-block;
  padding: 10px 54px;
  font: 800 22px/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: 3px; text-transform: uppercase;
  color: #ffe7a3;
  -webkit-text-fill-color: #ffe7a3;
  background: linear-gradient(110deg, #102b43, #294e69, #102b43);
  border: 2px solid #c5a15a;
  outline: 1px solid #273d49; outline-offset: 3px;
  box-shadow: 0 6px 12px #49330e40, inset 0 0 0 3px #142e46;
  clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
  text-shadow: 0 2px 2px #000a;
}
.avsel-modal .avsel-close {
  position: absolute; right: 16px; top: 50%; transform: translateY(-40%);
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(#1d3b57, #102b43);
  border: 2px solid #c5a15a;
  color: #ffe7a3; font-size: 22px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 3px 8px #0005;
  transition: transform .15s, filter .15s;
}
.avsel-modal .avsel-close:hover { transform: translateY(-40%) scale(1.08); filter: brightness(1.2); }

/* ── Busca (antes ficava cortada ao meio no cabeçalho) ─── */
.avsel-modal .avsel-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 8px 22px 14px;
  border-bottom: 1px solid #b6975a66;
}
.avsel-modal .avsel-busca {
  flex: 1 1 260px; min-width: 0;
  height: 42px; margin: 0; padding: 0 14px 0 40px;
  font: 600 15px/42px Nunito, system-ui, sans-serif;
  color: #183553;
  background: #fffaf0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23866a35' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px 50%;
  border: 2px solid #b58a44; border-radius: 6px;
  box-shadow: inset 0 2px 4px #8a6a3033;
  outline: none;
  -webkit-appearance: none; appearance: none;
}
.avsel-modal .avsel-busca::placeholder { color: #9b8458; }
.avsel-modal .avsel-busca:focus { border-color: #183553; box-shadow: 0 0 0 3px #c5a15a55, inset 0 2px 4px #8a6a3033; }
.avsel-modal .avsel-dica { font: 600 12px/1.3 Nunito, system-ui, sans-serif; color: #6b5530; }
.avsel-modal .avsel-desc { display: none; }

/* ── Corpo ─────────────────────────────────────────────── */
.avsel-modal .avsel-body {
  flex: 1; min-height: 0; height: auto;
  display: flex; gap: 0;
}

/* Coluna de personagens: painel azul com as faixas */
.avsel-modal .avsel-sidebar {
  width: 320px; flex-shrink: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 12px 12px 12px 14px;
  background: linear-gradient(180deg, #0f2338, #18324d);
  border: 0; border-right: 3px solid #b58a44;
  box-shadow: inset 0 0 0 1px #28455f;
  scrollbar-width: thin; scrollbar-color: #c5a15a #0f2338;
}
.avsel-modal .avsel-sidebar::-webkit-scrollbar { width: 8px; }
.avsel-modal .avsel-sidebar::-webkit-scrollbar-thumb { background: #c5a15a; border-radius: 4px; }

/* Faixa do personagem (estilo do exemplo: nome à esquerda, retrato à
   direita entrando por baixo do nome, canto superior direito cortado). */
.avsel-modal .avsel-sidebar-item {
  --cor-borda: #9fb0c2;
  position: relative;
  display: flex; align-items: center; justify-content: flex-start;
  height: 66px; margin: 0 0 10px; padding: 0 0 0 16px;
  overflow: hidden; cursor: pointer;
  border-radius: 0;
  border: 2px solid var(--cor-borda);
  background: linear-gradient(90deg, #1c2633 0%, #2a3442 55%, #3a4352 100%);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  color: #fff;
  transition: filter .15s, transform .15s, background .15s;
}
/* a borda da diagonal cortada */
.avsel-modal .avsel-sidebar-item::after {
  content: ""; position: absolute; top: 5px; right: -4px;
  width: 24px; height: 2px; background: var(--cor-borda);
  transform: rotate(45deg); z-index: 3;
}
.avsel-modal .avsel-sidebar-item:hover { filter: brightness(1.18); transform: translateX(2px); }
.avsel-modal .avsel-sidebar-item.ativo {
  --cor-borda: #fff3f0;
  background: linear-gradient(90deg, #8e1510 0%, #c2261b 60%, #e0402c 100%);
  box-shadow: inset 0 0 18px #ff705a, inset 0 0 0 1px #ff9c8a;
}
.avsel-modal .avsel-sidebar-thumb {
  position: absolute; top: 0; right: 0; z-index: 1;
  width: 62%; height: 100%;
  border-radius: 0; background: none;
  object-fit: cover; object-position: center 22%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
}
.avsel-modal .avsel-sidebar-nome {
  position: relative; z-index: 2;
  display: block; flex: 0 1 auto; max-width: 72%;
  font: 800 16px/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: .3px; color: #fff;
  text-shadow: 0 2px 3px #000, 0 0 8px #000a;
  white-space: normal; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.avsel-modal .avsel-icon { display: none; }
.avsel-modal .avsel-sem-resultado { color: #d7c597; font: 600 13px Nunito, sans-serif; padding: 28px 10px; text-align: center; }

/* Grade de fotos: fundo de pergaminho, molduras douradas */
.avsel-modal .avsel-grid {
  flex: 1; min-width: 0;
  overflow-y: auto;
  padding: 18px 20px 24px;
  display: grid; gap: 14px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  scrollbar-width: thin; scrollbar-color: #b58a44 transparent;
}
.avsel-modal.avsel-modal--arte .avsel-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.avsel-modal .avsel-grid .avsel-sem-resultado { grid-column: 1 / -1; color: #6b5530; }
.avsel-modal .avsel-card {
  position: relative; cursor: pointer; overflow: hidden;
  border-radius: 4px;
  border: 2px solid #b58a44;
  background: radial-gradient(circle at 50% 35%, #2c4f6d, #0f2338 75%);
  box-shadow: inset 0 0 0 2px #f6e6bc, 0 4px 10px #52391433;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.avsel-modal .avsel-card:hover {
  transform: translateY(-3px);
  border-color: #e0b85c;
  box-shadow: inset 0 0 0 2px #f6e6bc, 0 10px 20px #52391455, 0 0 0 3px #c5a15a66;
}
.avsel-modal .avsel-card--sel {
  border-color: #c2261b;
  box-shadow: inset 0 0 0 2px #ffd9cf, 0 0 0 3px #c2261b88, 0 0 18px #e0402c88;
}
.avsel-modal .avsel-card-sel-badge {
  left: 50%; right: auto; bottom: 8px; transform: translateX(-50%);
  padding: 3px 14px;
  font: 800 11px/1.3 Georgia, serif; letter-spacing: 1.5px; text-transform: uppercase;
  color: #ffe7a3; background: linear-gradient(110deg, #102b43, #294e69);
  border: 1px solid #c5a15a; border-radius: 2px;
}
.avsel-modal .avsel-card--arte img { object-fit: contain; object-position: center bottom; }
.avsel-modal .avsel-fallback { color: #d7c597; }

/* ── Celular ───────────────────────────────────────────── */
@media (max-width: 760px) {
  .avsel-modal { padding: 6px; }
  .avsel-modal .avsel-box { height: 94vh; max-height: 94vh; }
  .avsel-modal .avsel-header { padding: 14px 54px 8px; }
  .avsel-modal .avsel-title { font-size: 16px; padding: 8px 30px; letter-spacing: 2px; }
  .avsel-modal .avsel-close { right: 10px; width: 34px; height: 34px; }
  .avsel-modal .avsel-tools { padding: 6px 12px 10px; }
  .avsel-modal .avsel-dica { display: none; }
  .avsel-modal .avsel-body { flex-direction: column; }
  .avsel-modal .avsel-sidebar {
    width: auto; max-height: 38%;
    border-right: 0; border-bottom: 3px solid #b58a44;
    padding: 10px;
  }
  .avsel-modal .avsel-sidebar-item { height: 56px; margin-bottom: 8px; }
  .avsel-modal .avsel-sidebar-nome { font-size: 15px; }
  .avsel-modal .avsel-grid { padding: 12px; gap: 10px; grid-template-columns: repeat(3, 1fr); }
  .avsel-modal.avsel-modal--arte .avsel-grid { grid-template-columns: repeat(2, 1fr); }
}
