/* ============================================================
   Tianwar Web - Páginas de Personajes (Premium Claro)
   Vellum · Dorado · Texto oscuro · Alta legibilidad
   ============================================================ */

/* Páginas internas necesitan padding superior por header fijo */
.chars-hero, .download-page, .char-detail-page, .legal-page, .contact-page {
  padding-top: 100px;
}

.chars-hero {
  background: #faf8f3;
  text-align: center;
  padding-bottom: 30px;
}
.page-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 3px;
  margin-bottom: 8px;
}
.page-sub {
  color: #4a5568;
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto;
}

.chars-section {
  padding: 30px 0 80px;
  background: #faf8f3;
  min-height: 60vh;
}

/* Buscador */
.search-bar-chars {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d4a520;
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.search-bar-chars input {
  flex: 1;
  background: transparent;
  border: none;
  color: #1a1a2e;
  font-size: 14px;
  font-family: inherit;
}
.search-bar-chars input:focus { outline: none; }
.search-bar-chars .material-symbols-outlined { color: #d4a520; }

/* Grid de personajes - paginado */
.chars-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
@media (max-width: 1024px) { .chars-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) { .chars-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .chars-grid { grid-template-columns: repeat(2, 1fr); } }

.char-card-web {
  background: #fff;
  border: 1px solid #e0d8c8;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: #1a1a2e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}
.char-card-web:hover {
  transform: translateY(-3px);
  border-color: #d4a520;
  box-shadow: 0 6px 20px rgba(212,165,32,0.15);
}
.char-card-img-web {
  height: 160px;
  background: #f5f0e8;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.char-card-img-web img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.char-card-info-web {
  padding: 10px 12px;
  text-align: center;
}
.char-card-name-web {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 3px;
}
.char-card-meta-web {
  font-size: 10px;
  color: #d4a520;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.char-card-locked-badge {
  position: absolute;
  top: 6px; right: 6px;
  background: #e0392e;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* Paginación */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
}
.page-btn {
  background: #fff;
  border: 1px solid #d4a520;
  color: #4a5568;
  width: 36px; height: 36px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.page-btn:hover { background: #f0e8d8; }
.page-btn.active {
  background: #d4a520;
  color: #fff;
  border-color: #d4a520;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-info {
  color: #4a5568;
  font-size: 13px;
  margin: 0 8px;
}

/* ===== Detalle de personaje (Premium) ===== */
.char-detail-page {
  background: #faf8f3;
  min-height: 80vh;
  padding-bottom: 60px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4a5568;
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 20px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid #e0d8c8;
  border-radius: 4px;
  transition: all 0.15s;
}
.back-link:hover { color: #d4a520; border-color: #d4a520; }

.char-detail-wrap-web {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) { .char-detail-wrap-web { grid-template-columns: 1fr; } }

.char-detail-left-web {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Marco de filigrana dorada para el retrato */
.char-portrait-web {
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 8px;
  border: 3px solid #d4a520;
  box-shadow:
    0 0 0 1px #f0c040,
    0 0 0 5px #faf8f3,
    0 0 0 6px #e0d8c8,
    0 4px 16px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.char-portrait-web img { width: 100%; height: 100%; object-fit: cover; }

.char-info-web {
  text-align: center;
  background: #fff;
  border: 1px solid #e0d8c8;
  border-radius: 8px;
  padding: 16px;
}
.char-info-web h2 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: #1a1a2e;
  margin-bottom: 6px;
  font-weight: 700;
}
.myth-badge {
  display: inline-block;
  background: #f5f0e8;
  color: #a07810;
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid #d4a520;
}
.char-desc-web {
  color: #2d3748;
  font-size: 14px;
  line-height: 1.7;
  background: #fff;
  border: 1px solid #e0d8c8;
  border-radius: 8px;
  padding: 14px 16px;
}

/* Habilidades - paneles claros tipo vellum */
.abilities-list-web h3 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: #1a1a2e;
  margin-bottom: 14px;
  border-bottom: 2px solid #d4a520;
  padding-bottom: 8px;
  font-weight: 700;
}

.ability-card-web {
  background: #fff;
  border: 1px solid #e0d8c8;
  border-left: 4px solid #d4a520;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.ability-card-web:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08); }
.ability-card-web:nth-child(odd) { border-left-color: #3a7fc2; }
.ability-card-web:nth-child(even) { border-left-color: #d4a520; }

.ability-card-head-web {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* Cuadro de imagen de habilidad */
.abil-img-box {
  width: 52px; height: 52px;
  border-radius: 6px;
  background: #f5f0e8;
  border: 2px solid #d4a520;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}
.abil-img-box img { width: 100%; height: 100%; object-fit: cover; }
.abil-img-locked {
  background: #e8e4dc;
  border-color: #aaa;
  color: #888;
}

.abil-head-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.ability-card-web h4 {
  font-family: 'Cinzel', serif;
  color: #1a1a2e;
  font-size: 15px;
  font-weight: 700;
}
.slot-badge-web {
  background: #d4a520;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-block;
  width: fit-content;
}
.slot-badge-web.replacement {
  background: #e0392e;
}

/* Info de reemplazo */
.ability-replaces {
  background: #fef5f0;
  border: 1px solid rgba(224,57,46,0.25);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  color: #922b21;
  margin-bottom: 8px;
}
.ability-replaces strong { color: #e0392e; font-weight: 700; }

.ability-desc-web {
  color: #2d3748;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.ability-meta-web {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: #4a5568;
  font-weight: 600;
}
.ability-meta-web span {
  background: #f5f0e8;
  padding: 3px 8px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.qi-chip-web {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}
.qi-chip-web.xue { background: rgba(224,57,46,0.1); color: #c0392b; }
.qi-chip-web.yang { background: rgba(212,165,32,0.1); color: #a07810; }
.qi-chip-web.yin { background: rgba(58,127,194,0.1); color: #2c5f8a; }
.qi-chip-web.verdadero { background: rgba(6,167,126,0.1); color: #06a67e; }

.ability-locked .ability-desc-web {
  color: #888;
  font-style: italic;
}

/* ===== Tienda ===== */
.web-shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.wsh-currencies { display: flex; gap: 12px; }
.wsh-currency {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e0d8c8;
  padding: 7px 14px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  color: #1a1a2e;
}
.wsh-currency .material-symbols-outlined { color: #d4a520; }
.wsh-tabs { display: flex; gap: 6px; }
.wst {
  background: #fff;
  border: 1px solid #e0d8c8;
  color: #4a5568;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.wst:hover { border-color: #d4a520; }
.wst.active {
  background: #d4a520;
  color: #fff;
  border-color: #d4a520;
}

.web-shop-group {
  background: #fff;
  border: 1px solid #e0d8c8;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.wsg-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0d8c8;
}
.wsg-header strong { color: #1a1a2e; font-size: 15px; }
.wsg-ranks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.wsg-rank-card {
  background: #faf8f3;
  border: 1px solid #e0d8c8;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}
.wsg-rank-label {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 13px;
  color: #d4a520;
  margin-bottom: 4px;
}
.wsg-rank-bonus {
  font-size: 11px;
  color: #4a5568;
  margin-bottom: 8px;
}

/* Diamantes */
.web-diamonds-card {
  background: #fff;
  border: 2px solid #d4a520;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}
.web-diamonds-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: #1a1a2e;
  margin: 12px 0 8px;
}
.web-diamonds-card p { color: #4a5568; font-size: 13px; margin-bottom: 16px; }
.web-diamonds-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}
.web-diamonds-form input,
.web-diamonds-form select {
  background: #faf8f3;
  border: 1px solid #e0d8c8;
  color: #1a1a2e;
  padding: 10px 14px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}

/* ===== Ranking ===== */
.rank-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  justify-content: center;
}
.rank-filter {
  background: #fff;
  border: 1px solid #e0d8c8;
  color: #4a5568;
  padding: 7px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.rank-filter:hover { border-color: #d4a520; }
.rank-filter.active {
  background: #d4a520;
  color: #fff;
  border-color: #d4a520;
}

/* v122: filtros de país/estado del ranking (ver el ranking de cada país) */
.rank-loc-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.rank-loc-select {
  background: #fff;
  border: 1px solid #e0d8c8;
  color: #4a5568;
  padding: 7px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-width: 180px;
  max-width: 300px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #d4a520 50%), linear-gradient(135deg, #d4a520 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.rank-loc-select:focus {
  outline: none;
  border-color: #d4a520;
  box-shadow: 0 0 0 2px rgba(212,165,32,.2);
}
@media (max-width: 600px) {
  .rank-loc-select { min-width: 140px; width: 100%; max-width: none; }
}

.rank-table {
  background: #fff;
  border: 1px solid #e0d8c8;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.rank-row-web {
  display: grid;
  grid-template-columns: 50px 1fr 100px 80px;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #f0ebe0;
  font-size: 14px;
  align-items: center;
  transition: background 0.15s;
}
.rank-row-web:hover { background: #faf8f3; }
.rank-row-web.me {
  background: #f5f0e8;
  border-left: 3px solid #d4a520;
}
.rank-num-web {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  color: #1a1a2e;
}
.rank-num-web.top1 { color: #d4a520; font-size: 18px; }
.rank-num-web.top2 { color: #8088a0; }
.rank-num-web.top3 { color: #cd7f32; }
.rank-player-web { font-weight: 700; color: #1a1a2e; }
.rank-level-web { color: #d4a520; font-weight: 600; font-size: 12px; }
.rank-wins-web { color: #3a7fc2; font-weight: 700; }

/* ===== Descarga ===== */
.download-page {
  background: #faf8f3;
  min-height: 80vh;
  padding-bottom: 60px;
}
.download-card-large {
  background: #fff;
  border: 2px solid #d4a520;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.dl-icon-big { font-size: 72px; margin-bottom: 16px; }
.download-card-large h2 {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  color: #1a1a2e;
  margin-bottom: 12px;
}
.dl-desc { color: #4a5568; margin-bottom: 20px; }
.dl-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  background: #faf8f3;
  padding: 14px;
  border-radius: 6px;
}
.dl-meta div { font-size: 13px; color: #4a5568; }
.dl-meta strong { color: #d4a520; }

/* ===== Páginas legales ===== */
.legal-page, .contact-page {
  background: #faf8f3;
  min-height: 80vh;
  padding-bottom: 60px;
}
.legal-content {
  background: #fff;
  border: 1px solid #e0d8c8;
  border-radius: 8px;
  padding: 32px 40px;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.legal-content h2 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: #1a1a2e;
  margin-bottom: 16px;
  margin-top: 24px;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li {
  color: #2d3748;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 10px;
}
.legal-content ul { padding-left: 24px; margin-bottom: 16px; }
.legal-content a { color: #d4a520; text-decoration: none; }
.legal-content a:hover { text-decoration: underline; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 20px auto 0;
}
.contact-form input, .contact-form textarea {
  background: #faf8f3;
  border: 1px solid #e0d8c8;
  color: #1a1a2e;
  padding: 12px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: #d4a520;
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-info {
  text-align: center;
  margin: 20px 0;
  color: #4a5568;
  font-size: 14px;
}
.contact-info a { color: #d4a520; text-decoration: none; font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
  .char-detail-wrap-web { grid-template-columns: 1fr; }
  .char-portrait-web { max-width: 200px; margin: 0 auto; }
  .ability-card-head-web { flex-wrap: wrap; }
  .web-diamonds-form { grid-template-columns: 1fr; }
  .rank-row-web { grid-template-columns: 40px 1fr 60px; font-size: 12px; }
  .legal-content { padding: 20px 24px; }
}

/* ============================================================
   Story Article Box (recuadro blanco con borde azul rey)
   ============================================================ */
.char-story-section {
  max-width: 880px;
  margin: 36px auto 56px;
  padding: 0 16px;
}
.char-story-box {
  background: #ffffff;
  border: 2px solid #1e40af;
  border-left: 6px solid #1e3a8a;
  border-radius: 10px;
  padding: 28px 32px 24px;
  box-shadow: 0 6px 22px rgba(30, 64, 175, 0.12);
  position: relative;
}
.char-story-box::before {
  content: '';
  position: absolute;
  top: -1px; right: -1px;
  width: 70px; height: 70px;
  background: linear-gradient(135deg, transparent 50%, #1e40af 50%);
  border-top-right-radius: 8px;
}
.char-story-box::after {
  content: '✦';
  position: absolute;
  top: 6px; right: 12px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.char-story-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 4px;
  letter-spacing: 1px;
  border-bottom: 1px solid #c5d4f0;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.char-story-title .material-symbols-outlined {
  color: #1e40af;
  font-size: 22px;
}
.char-story-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.char-story-content {
  font-family: 'Inter', 'Georgia', serif;
  font-size: 15px;
  line-height: 1.85;
  color: #1f2937;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.char-story-content p { margin: 0 0 14px; }
.char-story-content p:last-child { margin-bottom: 0; }
.char-story-empty {
  color: #9ca3af;
  font-style: italic;
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}
.char-story-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed #c5d4f0;
  font-size: 11px;
  color: #6b7280;
  letter-spacing: 0.5px;
  text-align: right;
}
@media (max-width: 600px) {
  .char-story-box { padding: 20px 18px 18px; }
  .char-story-title { font-size: 17px; }
  .char-story-content { font-size: 14px; line-height: 1.75; }
}

/* ============================================================
   Filtro mitología en página personajes — Diseño Premium
   ============================================================ */
.myth-filter-bar {
  max-width: 960px;
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #1e3a8a;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(30, 58, 138, 0.1);
}
.myth-filter-bar::before {
  content: 'Filtrar por mitología:';
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.myth-chip {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
  white-space: nowrap;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.myth-chip:hover {
  background: #e0e7ff;
  color: #1e3a8a;
  border-color: #818cf8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}
.myth-chip.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #ffffff;
  border-color: #1e3a8a;
  box-shadow: 0 3px 12px rgba(30, 58, 138, 0.35);
  transform: translateY(-1px);
}
.myth-chip .myth-count {
  display: inline-block;
  margin-left: 2px;
  font-size: 11px;
  opacity: 0.75;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  padding: 1px 6px;
  border-radius: 999px;
}
.myth-chip:not(.active) .myth-count {
  background: #f1f5f9;
  color: #64748b;
}
.search-bar-chars {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #d4a520;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(212, 165, 32, 0.08);
}
.search-bar-chars input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: #1f2937;
}
.search-bar-chars .material-symbols-outlined { color: #94a3b8; font-size: 20px; }

/* ============================================================
   v100: IMÁGENES A CUADRO COMPLETO (object-fit: cover)
   Fix del usuario: las imágenes deben cubrir TODA la extensión del
   cuadro, sin bordes blancos internos ni espacio fantasma.
   (Reemplaza al contain con padding de v59.)
   ============================================================ */

/* Marco de personaje en detalle: la imagen LLENA todo el marco */
.char-portrait-web {
  padding: 0 !important;          /* sin espacio blanco interno */
  overflow: hidden !important;
  display: block !important;
  line-height: 0 !important;      /* elimina espacio fantasma en la base */
}
.char-portrait-web img {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  object-fit: cover !important;   /* ocupa todo el marco sin deformarse */
  object-position: center top !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Card de personaje en grid: cuadro completo */
.char-card-web {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.char-card-img-web {
  width: 100%;
  aspect-ratio: 1 / 1;   /* cuadro (ajustar a 3/4 si los recuadros son más altos) */
  position: relative;
  overflow: hidden;
  background-color: #1a1a1a;   /* fondo mientras carga la imagen */
}
.char-card-img-web img {
  width: 100%;
  height: 100%;
  object-fit: cover;            /* cubre todo el cuadro */
  object-position: center top;  /* centrado hacia la parte superior */
  display: block;
  transition: transform 0.3s ease;
}
.char-card-web:hover .char-card-img-web img {
  transform: scale(1.04);
}

/* Marco de habilidad: sin borde blanco interno */
.abil-img-box {
  padding: 0 !important;         /* elimina el borde blanco interno */
  overflow: hidden !important;
  line-height: 0 !important;
}
.abil-img-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* v100: estado de carga del bloque de habilidades (las páginas ya no
   traen habilidades predeterminadas: se renderizan desde el server) */
.abil-load {
  padding: 26px 18px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  background: #fff;
  border: 1px dashed #d4a520;
  border-radius: 8px;
}
.abil-error {
  padding: 22px 18px;
  text-align: center;
  color: #b45309;
  font-size: 14px;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 8px;
}

/* Preview en formularios del admin */
.admin-body .img-preview {
  max-width: 120px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  margin-top: 8px;
  border: 2px solid #d4a520;
  background: #f5f0e8;
  padding: 4px;
  box-sizing: border-box;
}

/* Thumb en tablas del admin */
.admin-body .data-table .thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #f5f0e8;
  border-radius: 6px;
  border: 1px solid #e0d8c8;
  padding: 2px;
  box-sizing: border-box;
}

/* Imágenes en galería de index.html */
.char-gallery-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(26,31,46,0.9), rgba(40,46,66,0.9));
  overflow: hidden;
}
.char-gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 8px;
  box-sizing: border-box;
}

/* ===== v94: Misiones (misiones.html — tarjetas vivas del server) ===== */
/* v95: FILTRO de misiones — por NIVEL y por CATEGORÍA */
.wmis-filters {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 12px 14px; margin: 0 auto 16px; max-width: 720px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.wmis-filter { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 180px; }
.wmis-filter span {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #6b7280;
}
.wmis-filter select {
  font: 600 14px/1.2 inherit; color: #1f2937; width: 100%;
  background: #f9fafb; border: 1px solid #d1d5db; border-radius: 8px;
  padding: 8px 10px; outline: none; cursor: pointer;
}
.wmis-filter select:focus { border-color: #b8860b; }
.wmis-cat {
  background: #efe6c8 !important; color: #6b5116 !important;
  background-image: none !important; border: 1px solid #c9a648;
}
.wmis-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.wmis-head { display: flex; gap: 14px; align-items: stretch; margin-bottom: 10px; }
.wmis-img {
  width: 110px; min-height: 78px; object-fit: cover; border-radius: 10px;
  border: 2px solid #b8860b; flex: none;
  background: linear-gradient(135deg, #1f2937, #0d1526); display: grid; place-items: center;
}
.wmis-img-def { color: #d6a531; }
.wmis-img-def .material-symbols-outlined { font-size: 38px; }
.wmis-head-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.wmis-head-info h3 { margin: 0; font-family: 'Cinzel', serif; font-size: 1.05rem; color: #1f2937; letter-spacing: 0.5px; }
.wmis-lvl {
  align-self: flex-start; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #d6a531, #b8860b); padding: 3px 10px; border-radius: 100px;
}
.wmis-desc { color: #4b5563; font-size: 13px; line-height: 1.55; margin: 0 0 12px; }
.wmis-reqs { list-style: none; margin: 0 0 12px; padding: 10px 12px; background: #f8fafc; border-radius: 10px; border: 1px solid #e2e8f0; }
.wmis-req { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: #374151; font-size: 13px; font-weight: 500; }
.wmis-req + .wmis-req { border-top: 1px dotted #e2e8f0; }
.wmis-char-img {
  width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex: none;
  border: 2px solid #0ea5e9; background: #0d1526; display: grid; place-items: center;
}
.wmis-char-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.wmis-char-def { color: #0ea5e9; font-size: 18px; }
.wmis-reward {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(184,134,11,0.10), rgba(120,80,30,0.06));
  border: 1px solid #b8860b; border-radius: 10px; padding: 10px 14px;
}
.wmis-reward-tag { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: #b8860b; }
.wmis-reward .wmis-char-img { border-color: #b8860b; }
.wmis-reward-name { font-family: 'Cinzel', serif; font-weight: 800; color: #92660a; letter-spacing: 1px; font-size: 15px; }


/* ===== v99: misiones.html ESTÁTICA — intro + grid de tarjetas ===== */
.wmis-intro {
  max-width: 720px; margin: 0 auto 18px;
  background: linear-gradient(135deg, rgba(184,134,11,.08), rgba(120,80,30,.05));
  border: 1px solid #c9a648; border-radius: 12px;
  padding: 12px 16px; text-align: center;
}
.wmis-intro p { margin: 0; color: #6b5116; font-size: 14px; line-height: 1.6; }
.wmis-intro strong { color: #92660a; }
@media (max-width: 640px) {
  .wmis-card { padding: 14px; }
  .wmis-img { width: 84px; min-height: 64px; }
  .wmis-head { gap: 10px; }
}
