/* ==========================================================
   Mo.Co Fashion — hoja de estilos única
   Cada página fija su color con body.theme-*
   ========================================================== */

:root {
  --accent: #00b971;
  --deep: #00241a;
  --ink: #fff;
  --nav: #222222;
  --nav-h: 72px;
  --panel: rgba(0, 0, 0, .52);
  --panel-solid: #0b1f15;
  --radius: 14px;
  --basic: #00ffff;
  --epic: #9900ff;
  --legendary: #ff9900;
  --font: "Lexend", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

body.theme-home        { --accent: #7461c4; --deep: #1c1233; }
body.theme-hats        { --accent: #2ad77a; --deep: #082b18; }
body.theme-weapons     { --accent: #73e6cf; --deep: #112b26; }
body.theme-rides       { --accent: #d9cf67; --deep: #2b2914; }
body.theme-outfits     { --accent: #3b6fe0; --deep: #0a1a3d; }
body.theme-decorations { --accent: #f08a24; --deep: #3a1d05; }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--ink);
  background: var(--accent);
}

img { max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Banner ---------- */
.hero {
  height: clamp(190px, 20.2vw, 376px);
  background-color: var(--accent);
  background-repeat: no-repeat;
  background-position: right top;
  background-size: auto 100%;
}
/* Banners con personaje sobre color plano: se alinean a la derecha */
.theme-hats .hero      { background-image: url("img/iconsAndFront/banner-hats.webp"); }
.theme-outfits .hero   { background-image: url("img/iconsAndFront/banner-outfits.webp"); }
.theme-rides .hero     { background-image: url("img/iconsAndFront/banner-rides.webp"); }
/* Banners de escena completa: cubren todo el ancho */
.theme-home .hero,
.theme-weapons .hero,
.theme-decorations .hero { background-size: cover; background-position: center; }
.theme-home .hero        { background-image: url("img/iconsAndFront/banner-home.webp"); }
.theme-weapons .hero     { background-image: url("img/iconsAndFront/banner-weapons.webp"); }
.theme-decorations .hero { background-image: url("img/iconsAndFront/banner-decorations.webp"); }

/* ---------- Navegación ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--nav-h);
  padding: 0 14px;
  background: var(--nav);
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 22px 0 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  color: #fff;
}
.nav-links a:hover { background: rgba(255, 255, 255, .1); }
.nav-links a[aria-current="page"] { background: rgba(255, 255, 255, .16); }
.nav-links img, .nav-links svg { width: 24px; height: 24px; flex: none; object-fit: contain; }

.search {
  margin-left: auto;
  flex: 0 1 300px;
  min-width: 150px;
}
.search input {
  width: 100%;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font: 500 .95rem var(--font);
}
.search input::placeholder { color: #777; }

/* ---------- Zona de contenido con degradado ---------- */
main {
  flex: 1;
  background: linear-gradient(135deg, var(--deep) 0%, var(--accent) 100%);
  padding: 34px 28px 60px;
}
.wrap { max-width: 1500px; margin: 0 auto; }

/* ---------- Home ---------- */
.tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 44px 56px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 0 20px;
}
.tile {
  position: relative;
  display: block;
  width: clamp(190px, 20vw, 330px);
  text-decoration: none;
}
.tile img { display: block; width: 100%; height: clamp(170px, 18vw, 300px); object-fit: contain; }
.tile span {
  position: absolute;
  left: 0;
  bottom: -6px;
  padding: 8px 26px 10px;
  border-radius: 12px;
  background: var(--panel-solid);
  font-weight: 800;
  font-size: clamp(1.3rem, 1.9vw, 1.9rem);
  line-height: 1.15;
  transition: background .15s;
}
.tile:hover span, .tile:focus-visible span { background: rgba(8, 8, 8, .92); }
.home-note {
  margin: 34px auto 0;
  max-width: 62ch;
  text-align: center;
  font-size: .95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .85);
}
.home-note a { font-weight: 700; }

/* ---------- Barra de filtros ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 26px;
}
.toolbar h1 {
  margin: 0 12px 0 0;
  padding: 6px 22px 8px;
  border-radius: 12px;
  background: var(--panel-solid);
  font-size: 1.6rem;
  font-weight: 800;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 38px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--panel-solid);
  color: #fff;
  font: 700 .88rem var(--font);
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: #fff; color: #111; }
.chip:hover { border-color: rgba(255, 255, 255, .6); }
.count { margin-left: auto; font-weight: 600; font-size: .95rem; padding: 6px 14px; border-radius: 999px; background: var(--panel); }

/* ---------- Secciones y tarjetas ---------- */
.group { margin-bottom: 40px; }
.group[hidden], .card[hidden] { display: none; }
.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0 0 14px;
}
.group-head h2 {
  margin: 0;
  padding: 6px 18px 8px;
  border-radius: 10px;
  background: #000;
  font-size: 1.15rem;
  font-weight: 800;
}
.group-head p { margin: 0; padding: 3px 12px; border-radius: 999px; background: var(--panel); font-size: .88rem; font-weight: 500; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid.text { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  color: #fff;
  font: inherit;
  text-align: left;
}
button.card { cursor: pointer; }
button.card:hover { background: rgba(0, 0, 0, .68); }
.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5 / 6;
  padding: 10px;
  background: rgba(0, 0, 0, .28);
}
.grid.wide .thumb { aspect-ratio: 16 / 7; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.levels { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px 0; }
.levels img { height: 38px; width: auto; border-radius: 4px; }
.meta { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; flex: 1; }
.meta strong { font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.meta .sub { font-size: .84rem; opacity: .9; overflow-wrap: anywhere; }
.meta .src { margin-top: auto; padding-top: 6px; font-size: .78rem; opacity: .72; white-space: pre-line; overflow-wrap: anywhere; }

.rar {
  align-self: flex-start;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  background: #888;
  color: #111;
}
.rar.r-basic { background: var(--basic); color: #002a2a; }
.rar.r-epic { background: var(--epic); color: #fff; }
.rar.r-legendary { background: var(--legendary); color: #2b1700; }
.card.r-basic { box-shadow: inset 0 -4px 0 var(--basic); }
.card.r-epic { box-shadow: inset 0 -4px 0 var(--epic); }
.card.r-legendary { box-shadow: inset 0 -4px 0 var(--legendary); }

.empty, .error {
  max-width: 60ch;
  margin: 40px auto;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--panel-solid);
  line-height: 1.6;
}
.error code { padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .14); }

/* ---------- Pestañas (decoraciones) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

/* ---------- Visor ---------- */
dialog {
  width: min(560px, 94vw);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--panel-solid);
  color: #fff;
  font-family: var(--font);
}
dialog::backdrop { background: rgba(0, 0, 0, .72); }
.viewer-img { display: flex; justify-content: center; padding: 22px; background: rgba(255, 255, 255, .07); }
.viewer-img img { width: auto; max-width: 100%; max-height: 52vh; min-height: 200px; object-fit: contain; }
.viewer-body { padding: 18px 22px 22px; line-height: 1.5; }
.viewer-body h3 { margin: 0 0 4px; font-size: 1.2rem; }
.viewer-body p { margin: 2px 0; font-size: .92rem; opacity: .9; white-space: pre-line; }
.viewer-close {
  float: right;
  margin: 12px 12px 0 0;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: 700 .85rem var(--font);
  cursor: pointer;
}

/* ---------- Pie ---------- */
footer {
  padding: 16px 28px;
  background: var(--nav);
  font-size: .82rem;
  color: #bbb;
}
footer a { color: #fff; }

/* ---------- Adaptación a móvil ---------- */
@media (max-width: 900px) {
  .nav { flex-wrap: wrap; padding: 8px 10px; }
  .nav-links a { padding: 0 12px; }
  .search { flex: 1 1 100%; margin: 4px 0 6px; }
}
@media (max-width: 640px) {
  main { padding: 22px 14px 44px; }
  .nav-links a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav-links a { padding: 0 12px; }
  .tiles { gap: 34px 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .count { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
