/*
 * The imbuing window of the Imbuing Shrines (src/ui/modals/modal-imbuing.js, TabTibia r132), laid out like Tibia's Imbue
 * Item window in the colours of the crafting station (crafting.css): Item Information with the item and its three slots,
 * the panel of the chosen slot (the two lists, what it does, the astral sources and the imbue button, or the time left
 * and the clear button), the answer of the server, and the gold with Close. Fixed to the page with the z-index of every
 * modal (modal.css .modal).
 */

#imbuing-modal.imbuing-window {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 580px;
  max-width: calc(100vw - 8px);
  max-height: calc(100vh - 8px);
  box-sizing: border-box;
  flex-direction: column;
  background-image: url("/png/bg3.png");
  border: 1px solid black;
  box-shadow: 0 0 12px 0 black;
  color: #d8d8d8;
  font-size: 11px;
  user-select: none;
}

#imbuing-modal button {
  margin: 0;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 10px;
}

#imbuing-modal select {
  flex: 1 1 0;
  min-width: 0;
  height: 20px;
  color: white;
  background: #111317;
  border: 1px solid #3a3f47;
  font-family: Verdana, "Sans-Serif";
  font-size: 11px;
  font-weight: bold;
}

#imbuing-modal select:disabled {
  color: #7a7a7a;
}

.imbuing-titlebar {
  position: relative;
  height: 18px;
  line-height: 18px;
  flex: 0 0 auto;
  text-align: center;
  color: #b8b8b8;
  background-image: url("/png/bg4.png");
}

.imbuing-titlebar .imbuing-close-x {
  position: absolute;
  right: 2px;
  top: 1px;
  padding: 0 4px;
  line-height: 14px;
}

.imbuing-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.imbuing-panel {
  border: 1px solid black;
  background: #1a1c20;
}

.imbuing-panel-title {
  padding: 3px 4px;
  text-align: center;
  font-weight: bold;
  background: #101114;
  border-bottom: 1px solid #2c2f35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imbuing-item-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px;
}

.imbuing-item {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: bold;
  color: #e6e6e6;
}

.imbuing-item canvas {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  image-rendering: pixelated;
}

.imbuing-label {
  font-weight: bold;
  color: #c8c8c8;
}

.imbuing-slots {
  display: flex;
  gap: 8px;
}

#imbuing-modal .imbuing-slot,
#imbuing-modal .imbuing-big {
  width: 64px;
  height: 64px;
  padding: 4px;
  box-sizing: border-box;
  background: #22252b;
  background-image: none;
  border: 1px solid #0b0c0e;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px #3a3f47;
  cursor: pointer;
}

#imbuing-modal .imbuing-slot:hover:not(:disabled),
#imbuing-modal .imbuing-big:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1px #8a8a8a;
}

#imbuing-modal .imbuing-slot.selected {
  box-shadow: inset 0 0 0 2px #e8e8e8;
}

#imbuing-modal .imbuing-slot.locked {
  cursor: default;
  background: repeating-linear-gradient(45deg, #1b1d21 0 4px, #2a2d33 4px 8px);
}

#imbuing-modal .imbuing-big:disabled {
  cursor: default;
  opacity: 0.5;
}

#imbuing-modal .imbuing-slot svg,
#imbuing-modal .imbuing-big svg {
  display: block;
  width: 100%;
  height: 100%;
}

.imbuing-socket {
  fill: #5c6068;
  stroke: #2a2d33;
  stroke-width: 2;
}

.imbuing-groove {
  fill: none;
  stroke: #33363c;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.imbuing-imbue .imbuing-groove {
  stroke: #3fd13f;
}

.imbuing-clear .imbuing-groove {
  stroke: #e53b3b;
}

.imbuing-gem {
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 2;
}

.imbuing-gem-shine {
  fill: rgba(255, 255, 255, 0.35);
}

.imbuing-slot-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

.imbuing-lists {
  display: flex;
  gap: 8px;
}

.imbuing-description {
  min-height: 28px;
  white-space: pre-line;
  font-weight: bold;
  color: #e6e6e6;
}

.imbuing-area {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.imbuing-sources {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.imbuing-materials {
  min-height: 54px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.imbuing-material {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #121317;
  border: 1px solid #2a2d33;
}

.imbuing-material canvas {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.imbuing-material-count {
  font-weight: bold;
}

.imbuing-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.imbuing-price {
  min-width: 120px;
  padding: 2px 6px;
  box-sizing: border-box;
  text-align: center;
  font-weight: bold;
  background: #08090b;
  border: 1px solid #2a2d33;
}

.imbuing-bar {
  position: relative;
  height: 18px;
  background: #08090b;
  border: 1px solid #2a2d33;
}

.imbuing-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(#c89a2a, #8a6418);
}

.imbuing-bar-text {
  position: relative;
  display: block;
  line-height: 18px;
  text-align: center;
  font-weight: bold;
  color: #f0f0f0;
  text-shadow: 1px 1px 0 black;
}

.imbuing-message {
  min-height: 30px;
  padding: 6px;
  box-sizing: border-box;
  text-align: center;
  font-style: italic;
  background: #08090b;
  border: 1px solid #2a2d33;
}

.imbuing-ok {
  color: #3fd13f;
}

.imbuing-missing {
  color: #e53b3b;
}

.imbuing-soon {
  color: #8a8a8a;
  font-style: italic;
}

.imbuing-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.imbuing-gold {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  font-weight: bold;
  background: #08090b;
  border: 1px solid #2a2d33;
}

.imbuing-gold canvas {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

@media (max-width: 600px) {
  .imbuing-item-row,
  .imbuing-area {
    justify-content: center;
  }
  .imbuing-lists {
    flex-direction: column;
  }
}

/* r183b (user 2026-11-02: the other windows "con el estilo y que se vea bien en Movil que estas nuevas"): on a phone the
   shrine window is the dark panel of the NPC windows (npc-dialog.css), over the HUD and inside the screen (lying down it
   scrolls inside), with a 40 px title, a 34 px ✕, 36 px lists in 16 px (an iPhone zooms into a smaller field) and the
   Imbue and Clear buttons as they are (64 px) */
body.force-mobile #imbuing-modal.imbuing-window {
  z-index: 40000;
  width: min(580px, calc(100vw - 16px));
  max-width: none;
  max-height: calc(100dvh - 16px);
  background: rgba(38, 37, 35, 0.97);
  color: #ece6d6;
  border: 1px solid #0c0c0c;
  outline: 1px solid #4a4741;
  border-radius: 3px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
  font: 12px Verdana, Arial, sans-serif;
}
body.force-mobile .imbuing-titlebar {
  height: 40px;
  line-height: 40px;
  background: linear-gradient(180deg, rgba(60, 58, 54, 0.9), rgba(40, 39, 36, 0.9));
  border-bottom: 1px solid #0c0c0c;
  font: bold 16px Verdana, Arial, sans-serif;
  color: #f4efe2;
}
body.force-mobile #imbuing-modal .imbuing-close-x {
  top: 3px;
  right: 4px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
}
body.force-mobile #imbuing-modal button:not(.imbuing-big) {
  min-height: 34px;
  padding: 0 14px;
  font: bold 13px Verdana, Arial, sans-serif;
  color: #ece6d6;
  background: #1b1a18;
  border: 1px solid #0c0c0c;
  box-shadow: inset 0 0 0 1px #3d3a34;
  border-radius: 6px;
}
body.force-mobile #imbuing-modal select {
  height: 36px;
  font-size: 16px;
}
body.force-mobile .imbuing-panel-title {
  padding: 6px 0;
  font-size: 13px;
}
body.force-mobile .imbuing-description {
  font-size: 13px;
  line-height: 1.45;
}
@media screen and (orientation: portrait) {
  body.force-mobile .imbuing-lists {
    flex-direction: column;
  }
  body.force-mobile .imbuing-item-row {
    flex-wrap: wrap;
    justify-content: center;
  }
}
body.force-mobile .imbuing-titlebar {
  display: flex;
  align-items: center;
  justify-content: center;
}
body.force-mobile #imbuing-modal select {
  font-family: Verdana, Arial, sans-serif;
}
