/* Estil GUI Minecraft: panells amb relleu, slots enfonsats, barres beige. */

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 3px solid var(--edge);
  box-shadow: inset 0 2px 0 var(--bevel-light), inset 0 -2px 0 var(--bevel-dark);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--shadow-txt);
  white-space: nowrap;
}
.brand-mark {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border: 2px solid var(--edge);
  display: inline-block;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 6px 12px;
  font-size: 22px;
  color: var(--muted);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: var(--accent); text-shadow: 1px 1px 0 var(--shadow-txt); }
.nav-link--soon {
  color: var(--muted);
  opacity: 0.55;
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.soon {
  font-size: 16px;
  text-transform: uppercase;
  background: var(--title-bar);
  color: var(--title-text);
  padding: 0 6px;
  border: 2px solid var(--edge);
  border-radius: 4px;
}

.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; gap: 5px; }
.lang-btn,
.theme-btn {
  font-family: var(--font-body);
  font-size: 20px;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--edge);
  border-radius: 5px;
  box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark);
  cursor: pointer;
  padding: 2px 10px;
  line-height: 1.2;
}
.theme-btn {
  width: 40px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lang-btn:hover,
.theme-btn:hover { color: var(--accent); }
.lang-btn.is-active {
  background: var(--title-bar);
  color: var(--title-text);
  box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 var(--slot-light);
}

/* ---------- Banner ---------- */
.banner {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: var(--surface-2);
  border-bottom: 3px solid var(--edge);
  box-shadow: inset 0 2px 0 var(--bevel-light), inset 0 -2px 0 var(--bevel-dark);
  padding: clamp(32px, 6vw, 56px) 0;
}
.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.banner-inner { position: relative; }
.banner-title {
  font-family: var(--font-pixel);
  font-size: clamp(20px, 5vw, 38px);
  margin: 0;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--shadow-txt);
}
.legend { margin: 16px 0 0; font-size: 20px; color: var(--muted); }

/* ---------- Títol de secció (barra beige) ---------- */
.section-title {
  display: inline-block;
  font-size: 25px;
  color: var(--title-text);
  background: var(--title-bar);
  border: 2px solid var(--edge);
  border-radius: 5px;
  box-shadow: inset 2px 2px 0 var(--title-bar-l), inset -2px -2px 0 var(--title-bar-d);
  padding: 6px 16px;
  margin: clamp(30px, 5vw, 48px) 0 18px;
}

/* ---------- Graella d'ítems ---------- */
.items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(16px, 2.2vw, 26px);
}

.item-card {
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark);
  padding: 18px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.item-card:hover { filter: brightness(1.09); }

.item-sprites {
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slot);
  border: 2px solid var(--edge);
  border-radius: 5px;
  box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 var(--slot-light);
}
.item-sprite {
  width: 70px;
  height: 70px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.item-sprite--smooth { image-rendering: auto; }

.item-name {
  margin: 0;
  font-size: 24px;
  color: var(--text);
  text-shadow: 1px 1px 0 var(--shadow-txt);
  line-height: 1.15;
}
.item-ench { width: 100%; }
.ench { margin: 0; font-size: 20px; line-height: 1.35; color: var(--muted); }
.excl { color: var(--excl); }
.opt { color: var(--opt); }

/* ---------- Taula per material ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark);
  padding: 5px;
}
.mtable { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 21px; }
.mtable th,
.mtable td { padding: 8px 12px; text-align: center; }
.mtable th:first-child,
.mtable td:first-child { text-align: left; }
.mtable thead th {
  background: var(--title-bar);
  color: var(--title-text);
  border: 2px solid var(--edge);
}
.mtable tbody td {
  border: 2px solid var(--edge);
  background: var(--slot);
  color: var(--text);
}
.mtable td.col-total { color: var(--accent); }
.mtable tr.is-best td { background: var(--surface-2); }
.mtable tr.is-best td:first-child { color: var(--accent); }
.mtable .mat { display: inline-flex; align-items: center; gap: 9px; }
.mineral { width: 26px; height: 26px; image-rendering: pixelated; flex: none; }

/* ---------- Propietats especials ---------- */
.special-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.special-card {
  flex: 1 1 280px;
  max-width: 360px;
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.special-icon {
  width: 58px;
  height: 58px;
  flex: none;
  padding: 7px;
  background: var(--slot);
  border: 2px solid var(--edge);
  border-radius: 5px;
  box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 var(--slot-light);
  image-rendering: pixelated;
  object-fit: contain;
}
.special-body { min-width: 0; }
.special-name { margin: 0 0 6px; font-size: 23px; color: var(--text); text-shadow: 1px 1px 0 var(--shadow-txt); }
.special-desc { margin: 0; font-size: 20px; color: var(--muted); line-height: 1.35; }

/* ---------- Home ---------- */
.hero { text-align: center; padding: clamp(40px, 9vw, 80px) 0 clamp(24px, 5vw, 40px); }
.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(22px, 6vw, 44px);
  margin: 0 0 20px;
  line-height: 1.4;
  color: var(--text);
  text-shadow: 3px 3px 0 var(--shadow-txt);
}
.hero-title .plus { color: var(--accent); }
.hero-tag { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: clamp(19px, 2.5vw, 24px); }
.home-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin-top: clamp(28px, 5vw, 48px);
}
.sec-card {
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.sec-card:hover { filter: brightness(1.09); }
.sec-thumb {
  width: 66px;
  height: 66px;
  object-fit: contain;
  image-rendering: pixelated;
  background: var(--slot);
  border: 2px solid var(--edge);
  border-radius: 5px;
  box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 var(--slot-light);
  padding: 7px;
}
.sec-name { font-size: 23px; color: var(--text); text-shadow: 1px 1px 0 var(--shadow-txt); }
.sec-card--soon { opacity: 0.7; }

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  margin-top: clamp(40px, 7vw, 72px);
  background: var(--surface);
  border-top: 3px solid var(--edge);
  box-shadow: inset 0 2px 0 var(--bevel-light), inset 0 -2px 0 var(--bevel-dark);
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 26px 20px; text-align: center; }
.socials { display: flex; justify-content: center; gap: 12px; }
.social {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--slot);
  border: 2px solid var(--edge);
  border-radius: 5px;
  box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 var(--slot-light);
  color: var(--muted);
}
.social:hover { color: var(--accent); }
.social-glyph {
  width: 22px;
  height: 22px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.credit { margin: 16px 0 0; font-size: 20px; color: var(--muted); }

/* ---------- Grups (Herramientas / Pociones) ---------- */
.tool-group + .tool-group { margin-top: clamp(20px, 3vw, 36px); }
#items > .tool-group:first-child .section-title { margin-top: 0; }

body[data-page="weapons"] .tool-group .items { grid-template-columns: 1fr; }
@media (min-width: 560px) {
  body[data-page="weapons"] .tool-group .items { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  body[data-page="weapons"] .tool-group .items { grid-template-columns: repeat(3, 1fr); }
}

body[data-page="potions"] .tool-group .items { display: flex; flex-wrap: wrap; justify-content: center; }
body[data-page="potions"] .tool-group .items > .item-card { flex: 1 1 200px; max-width: 240px; }
body[data-page="potions"] .tool-group:first-child .items { max-width: 800px; margin-inline: auto; }

/* Armaduras: centra l'última fila */
body[data-page="armors"] .items { display: flex; flex-wrap: wrap; justify-content: center; }
body[data-page="armors"] .items > .item-card { flex: 1 1 200px; max-width: 250px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .nav-tools { margin-left: auto; }
}
