/* Mycraft Dungeon · las piezas con aspecto del juego: el cofre de casilleros, la descripción de un ítem y la mesa de
   crafteo. Los íconos son una sola plancha (img/items.png, celdas de 32 px); cada uno dice su celda con --x y --y. */

/* ------------------------------------------------------------------ elegir piso */
.pisos-botones { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 2rem; }
.piso-boton {
  width: 3.25rem;
  height: 3.25rem;
  font-family: var(--letra-titulo);
  font-size: 2.5rem;
  line-height: 1;
  color: #5d4f80;
  background: linear-gradient(180deg, var(--obsidiana-3), var(--obsidiana-2) 60%);
  border: 0;
  border-top: 1px solid var(--veta);
  cursor: pointer;
}
.piso-boton:hover { color: var(--bruma); }
.piso-boton[aria-pressed="true"] { color: var(--oro); text-shadow: 0 2px 0 #3a2706; box-shadow: inset 0 -3px 0 var(--oro); }

.items-dos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 27rem); gap: 2rem 2.5rem; align-items: start; }
.items-dos .parte-titulo { font-size: 3rem; margin-bottom: 1.25rem; }
.ficha { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; scrollbar-width: thin; }
.ficha .ficha-rotulo { margin: 1.5rem 0 0.5rem; color: var(--bruma); font-size: 1rem; }
.ficha-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.ficha-lista li { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: 0.6rem; align-items: baseline; }
.ficha-mas { margin-top: 0.5rem; }
.ficha-mas summary { cursor: pointer; color: var(--oro); width: fit-content; }
.ficha-mas summary:hover { text-decoration: underline; }
.ficha-mas .ficha-lista { margin-top: 0.5rem; }
.ficha-lista li::before { content: ""; justify-self: center; width: 0.5rem; height: 0.5rem; transform: translateY(-0.1em) rotate(45deg); background: var(--oro); }

/* ------------------------------------------------------------------ el cofre */
.mc-panel {
  margin: 0 0 1.25rem;
  padding: 0.5rem 0.75rem 0.75rem;
  background: #c6c6c6;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555;
}
.mc-titulo { margin: 0 0 0.3rem; font-family: "Jersey 10", var(--letra); font-weight: 400; font-size: 1.625rem; line-height: 1.1; color: #404040; }
.mc-rejilla { display: grid; grid-template-columns: repeat(auto-fill, 40px); }
.mc-slot {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #8b8b8b;
  border: 0;
  border-radius: 0;
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff;
  font: inherit;
}
button.mc-slot { cursor: pointer; }
/* como en el juego: el casillero bajo el puntero se aclara por encima del ítem */
button.mc-slot:hover::after,
button.mc-slot:focus-visible::after { content: ""; position: absolute; inset: 2px; background: rgba(255, 255, 255, 0.5); pointer-events: none; }
button.mc-slot:focus-visible { outline: 0; border-radius: 0; }
.mc-slot.elegido { z-index: 1; outline: 3px solid var(--oro); outline-offset: -1px; }
.mc-icono {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  background: url("img/items.png") var(--x, 0) var(--y, 0) / 512px auto no-repeat;
  image-rendering: pixelated;
}
/* el brillo de los ítems encantados: un reflejo violeta que pasa solo por encima del dibujo */
.mc-icono.brilla::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(160, 80, 255, 0.28) 20%, rgba(214, 160, 255, 0.75) 45%, rgba(130, 70, 255, 0.4) 60%, rgba(160, 80, 255, 0.28) 80%) 0 0 / 300% 100%;
  mix-blend-mode: screen;
  -webkit-mask: url("img/items.png") var(--x, 0) var(--y, 0) / 512px auto no-repeat;
  mask: url("img/items.png") var(--x, 0) var(--y, 0) / 512px auto no-repeat;
  animation: mc-brillo 4s linear infinite;
}
@keyframes mc-brillo { to { background-position: -300% 0; } }
.mc-cuenta { position: absolute; right: 3px; bottom: -1px; font-family: "Jersey 10", var(--letra); font-size: 20px; line-height: 1; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; pointer-events: none; }

/* ------------------------------------------------------------------ la descripción de un ítem */
.mc-tooltip {
  padding: 6px 8px 7px;
  background: rgba(16, 0, 16, 0.95);
  border: 2px solid;
  border-image: linear-gradient(180deg, #5000ff, #28007f) 1;
  box-shadow: 0 0 0 2px rgba(16, 0, 16, 0.95);
  font-family: "Jersey 10", var(--letra);
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #fff;
  font-variant-emoji: text;
}
.mc-flota { position: fixed; top: 0; left: 0; z-index: 20; max-width: min(calc(100vw - 16px), 30rem); pointer-events: none; will-change: transform; }
.mc-renglon { min-height: 0.5em; white-space: pre-wrap; overflow-wrap: anywhere; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55); }
.mc-renglon.vacio { height: 0.55em; }
.mc-nombre { margin-bottom: 3px; }
.mc-l { text-shadow: 1px 0 0 currentColor, 2px 2px 0 rgba(0, 0, 0, 0.55); letter-spacing: 0.05em; }      /* negrita: el juego dibuja la letra dos veces */
.mc-o { font-style: italic; }
.mc-n { text-decoration: underline; }
.mc-m { text-decoration: line-through; }
.mc-n.mc-m { text-decoration: underline line-through; }

/* ------------------------------------------------------------------ la mesa de crafteo */
.mc-mesa { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.mc-pide { display: grid; grid-template-columns: repeat(3, 40px); }
.mc-flecha { flex: none; width: 44px; height: 30px; background: #8b8b8b; clip-path: polygon(0 33%, 58% 33%, 58% 0, 100% 50%, 58% 100%, 58% 67%, 0 67%); }
.mc-sale { width: 56px; height: 56px; }
.mc-panel .mc-nota { margin: 0.4rem 0 0; max-width: none; font-family: "Jersey 10", var(--letra); font-size: 1.25rem; line-height: 1.15; color: #404040; }

/* ------------------------------------------------------------------ jefes */
a.piso-boton { display: inline-grid; place-items: center; text-decoration: none; }
.jefes-piso { margin: 0 0 3rem; scroll-margin-top: 1rem; }
.jefes-piso .parte-titulo { font-size: 3rem; margin: 0 0 1.25rem; }
.jefes-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; align-items: start; }
.mc-panel.jefe { margin: 0; display: grid; gap: 0.5rem; }
.jefe .mc-titulo { color: #7a1414; }
.jefe .jefe-datos { margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-family: "Jersey 10", var(--letra); font-size: 1.375rem; line-height: 1.1; color: #404040; }
.jefe-vida::before { content: "\2764\FE0E\00A0"; color: #b3261e; }
.jefe-danio::before { content: "\2694\FE0E\00A0"; color: #404040; }
.jefe .jefe-rotulo { margin: 0.25rem 0 0; font-family: "Jersey 10", var(--letra); font-size: 1.25rem; line-height: 1.1; color: #404040; }
.jefe .jefe-donde { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.jefe-donde .jefe-rotulo { margin: 0 0.25rem 0 0; }
.jefe-deja { display: flex; flex-wrap: wrap; gap: 0.25rem 2px; }
.jefe-drop { display: grid; justify-items: center; width: 44px; text-decoration: none; }
.jefe-drop:focus-visible { outline: 2px solid var(--oro); outline-offset: 1px; }
.jefe-drop:hover .mc-slot::after { content: ""; position: absolute; inset: 2px; background: rgba(255, 255, 255, 0.5); pointer-events: none; }
.jefe-drop small { font-family: "Jersey 10", var(--letra); font-size: 1.0625rem; line-height: 1.2; color: #404040; }

/* ------------------------------------------------------------------ clases */
.clases { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr)); gap: 1.75rem 2rem; align-items: start; }
.clase { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0.75rem; align-items: start; scroll-margin-top: 1rem; }
.clase .mc-slot { width: 56px; height: 56px; }
.clase .mc-slot .mc-icono { transform: scale(1.4); }
.clase-cartel { max-width: none; }

/* ------------------------------------------------------------------ pantallas chicas */
@media (max-width: 58rem) {
  .items-dos { grid-template-columns: minmax(0, 1fr); }
  .ficha { position: static; max-height: none; overflow: visible; scroll-margin-top: 1rem; }
}
@media (max-width: 36rem) {
  .items-dos .parte-titulo { font-size: 2.25rem; }
  .piso-boton { width: 2.75rem; height: 2.75rem; font-size: 2.125rem; }
  .jefes-piso .parte-titulo { font-size: 2.25rem; }
  .clase { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .mc-icono.brilla::after { animation: none; }
}
