.ui-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.ui-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
}

#ui-slots {
  position: absolute;
  inset: 0;
  pointer-events: none; /* same sloty mają pointery */
}

/* ==================== SLOTY ==================== */

.slot {
  position: absolute;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: box-shadow .2s, background .2s;
}

.slot img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity .2s;
}

.slot:hover {
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 10px rgba(0,255,170,.3);
}

/* ==================== STATUS TEKST ==================== */

.slot .status {
  position: absolute;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 0 4px rgba(0,0,0,.8);
  white-space: nowrap;
  color: #ff4444;
  pointer-events: none;
  transform: none;
}

/* kordy ustawiasz ręcznie – te są tylko przykładowe */
.slot[data-type="potwor"] .status { top: 50%; left: -720%; }
.slot[data-type="metin"] .status { top: 50%; left: -720%; }
.slot[data-type="mapa"] .status { top: 50%; left: -720%; }
.slot[data-type="legenda"] .status { top: 50%; left: -720%; }
.slot[data-type="wyprawa"] .status { top: 50%; left: -720%; }
.slot[data-type="zywiol"] .status { top: 50%; left: -720%; }

.slot.active .status {
  color: #3cff7b;
}

/* ==================== BLOKOWANY SLOT ==================== */

.slot.locked {
  filter: grayscale(1);
  opacity: .5;
}

/* ==================== PRZYCISKI WYBORU ŻYWIOŁU ==================== */

.el-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  justify-content: center;
}

.el-btn {
  background: #0f1822;
  color: #bdfdff;
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.el-btn:hover {
  transform: translateY(-1px);
}

.el-btn.active {
  background: linear-gradient(90deg,#00ffaa33,#00ffaa55);
  color: #0b1116;
  border-color: #00ffaa77;
  box-shadow: 0 0 12px rgba(0,255,170,.3);
}


#icon-panel {
  position: absolute;
  top: 0;
  right: -160px; /* odsuń od UI – możesz dopasować */
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10px;
}

.icon-chip {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-chip img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  opacity: 0.8;
}

.icon-chip:hover {
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 10px rgba(0,255,170,.3);
}

.icon-chip.active {
  border-color: #00ffaa;
  box-shadow: 0 0 8px rgba(0,255,170,.5);
}

.icon-chip.active img {
  opacity: 1;
}

#active-souls {
  position: absolute;
  right: -310px;
  top: 10px;
  width: 120px;
  min-height: 180px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-content: flex-start;
}

.soul-mini {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  transition: transform .15s ease;
}

.soul-mini img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.soul-mini:hover {
  transform: scale(1.1);
}

.muted {
  color: #7b8a96;
  font-size: 13px;
  text-align: center;
  width: 100%;
}

#ui-buttons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ui-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  background: rgba(172, 5, 5, 0); /* całkowicie przezroczysty */
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.ui-btn:hover {
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 8px rgba(0,255,170,0.4);
  border-radius: 4px;
}

/* === PANEL DUSZ === */
.flex-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.soul-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 260px;
  max-width: 100%;
}

.soul-card {
  background: linear-gradient(180deg, #0d141a, #0a1116);
  border: 1px solid #203040;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.soul-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 255, 170, 0.2);
}

.soul-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.5));
}

.soul-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.soul-name {
  font-weight: 600;
  color: #b8f7ff;
}

.soul-status {
  font-size: 13px;
  font-weight: 500;
  margin-top: 2px;
}

.soul-status.got {
  color: #3cff7b;
}

.soul-status.missing {
  color: #ff4444;
}

.soul-card.clicked {
  box-shadow: 0 0 15px rgba(0, 255, 170, 0.6);
  transform: scale(1.03);
}

/* === Dwukolumnowy układ UI + panel dusz === */
.dual-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.dual-layout .ui-wrap {
  flex: 0 0 auto;
}

.dual-layout .soul-panel {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 900px) {
  .dual-layout {
    flex-direction: column;
    align-items: center;
  }
}

#ui-buttons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ui-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  background: rgba(255, 255, 255, 0);
  border: none;
  border-radius: 6px;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.ui-btn:hover {
  background: rgba(0, 255, 170, 0.12);
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
}


#ui-img {
  transition: opacity 0.3s ease-in-out;
}

/* tooltip wygląd */
.tooltip {
  position: absolute;
  z-index: 9999;
  background: rgba(11, 18, 24, 0.95);
  border: 1px solid #1f3a48;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  padding: 10px 12px;
  color: #d9faff;
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  opacity: 0;
  transform: translateY(4px);
}
.tooltip hr {
  border: none;
  border-top: 1px solid #224050;
  margin: 1px 0;
}
.tooltip .tt-h {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tooltip .tt-h img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.tooltip {
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateY(-12px);
  opacity: 0;
}

.tooltip:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.craft-card {
  margin-top: 30px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(15,22,28,.95), rgba(10,14,18,.9));
  border: 1px solid var(--edge);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.tbl-craft {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 14px;
}
.tbl-craft th {
  background: #0f1a22;
  color: #9fe8ff;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #203040;
}
.tbl-craft td {
  padding: 8px 10px;
  border-bottom: 1px solid #12202b;
  color: var(--ink);
}

.craft-summary {
  margin: 10px 0;
  font-size: 15px;
  color: #c0f0ff;
}
.absorb {
  color: #3cff7b;
}

.infotext {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.insert-zone {
  border: 2px dashed #3cff7b55;
  border-radius: 10px;
  padding: 16px;
  min-height: 90px;
  text-align: center;
  transition: background .2s, border-color .2s;
}
.insert-zone:hover {
  background: rgba(0,255,170,0.05);
  border-color: #3cff7b;
}
.insert-label {
  color: #9fe8ff;
  font-size: 14px;
}
.inserted-list {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.inserted-list img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #1f3f4f;
  background: rgba(255,255,255,0.05);
}

/* ===== CRAFTING ===== */
.craft-grid{
  display:grid;
  grid-template-columns: 1.2fr 1.6fr 1.2fr;
  gap:16px;
}
@media (max-width: 980px){
  .craft-grid{ grid-template-columns:1fr; }
}

.craft-col{
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:12px;
}

.craft-h{ margin:4px 0 10px; color:#b8f7ff; }

.craft-req{ margin:0 0 12px 18px; line-height:1.6; }

.btn-primary{
  background:#0f1822;
  border:1px solid var(--edge);
  color:#bdfdff;
  border-radius:10px;
  padding:10px 14px;
  font-weight:700; cursor:pointer;
}
.btn-primary:disabled{ opacity:.5; cursor:not-allowed; }

.crafted-summary{ display:grid; gap:6px; margin-bottom:10px; }
.stars-wrap>div{ margin:2px 0; }
.stars{ color:#ffd76a; letter-spacing:1px; }

.feed-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:8px; margin:10px 0;
}
.feed-btn{
  background:#0f1822; color:#dff8ff;
  border:1px solid var(--edge);
  border-radius:10px;
  padding:8px 10px; text-align:left; cursor:pointer;
}
.feed-btn:disabled{ opacity:.5; cursor:not-allowed; }

.absorb-list{ margin:0; padding-left:18px; line-height:1.8; }

.tbl-craft img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 4px;
  transition: transform .15s ease;
}
.tbl-craft img:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(0,255,170,.3);
}

.tbl-craft button.btn-primary {
  width: 100%;
  font-size: 13px;
  padding: 6px;
}
.tbl-craft td img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  transition: transform .15s ease;
  padding: 3px;
}
.tbl-craft td img:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(0,255,170,.3);
}
.tbl-craft button.btn-primary {
  width: 100%;
  font-size: 13px;
  padding: 6px;
}

.crafted-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  box-shadow: 0 0 6px rgba(0, 255, 170, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.crafted-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  outline: none;
  display: block;
  filter: drop-shadow(0 0 3px rgba(0,255,170,0.25));
  pointer-events: none;
}

.crafted-icon .absorb-val {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 11px;
  color: #3cff7b;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.crafted-icon:hover {
  transform: scale(1.07);
  box-shadow: 0 0 12px rgba(0, 255, 170, 0.4);
}

/* toast */
.toast{
  position: fixed; left:50%; bottom: 24px; transform: translateX(-50%) translateY(12px);
  background: rgba(0,0,0,.85); color:#fff; padding:8px 12px; border-radius:8px; font-weight:600;
  opacity:0; transition: .18s ease; z-index:99999; border:1px solid #1f3a48;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

/* Reinforce toolbar */
.reinforce-toolbar{
  display:flex; gap:10px; align-items:center; margin:8px 0 12px;
}
.reinforce-toolbar select{
  background:#0f1822; color:#c9f8ff; border:1px solid var(--edge); border-radius:8px; padding:6px 10px;
}

/* Ikony do przeciągania */
.drag-soul{
  position: relative;
  display:inline-flex; align-items:center; justify-content:center;
  width:56px; height:56px; margin:6px; border-radius:8px;
  background: rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.15);
  cursor: grab; transition: transform .15s ease, box-shadow .15s ease;
}
.drag-soul img{ width:80%; height:80%; object-fit:contain; pointer-events:none; }
.drag-soul:hover{ transform: scale(1.06); box-shadow:0 0 10px rgba(0,255,170,.25); }
.drag-soul.disabled{ opacity:.45; cursor:not-allowed; }
.drag-soul .drag-count{
  position:absolute; bottom:2px; right:4px; font-size:11px; color:#9fffb6; background:rgba(0,0,0,.6);
  border-radius:4px; padding:0 4px; font-weight:700;
}

/* Drop target */
.drop-target{
  background: rgba(255,255,255,0.03);
  border:1px dashed #2f5d6f; border-radius:12px; padding:12px;
  min-height: 160px;
}
.drop-target.over{ box-shadow: 0 0 14px rgba(0,255,170,.35); border-color:#00ffaa; }
.drop-target.locked{ opacity:.6; filter: grayscale(1); pointer-events:none; }

.target-head{ display:flex; gap:10px; align-items:center; margin-bottom:8px; }
.target-head img{ width:44px; height:44px; object-fit:contain; }
.target-title{ color:#b8f7ff; font-weight:700; }
.target-abs{ color:#c0f0ff; }

.target-stars{ margin:8px 0 10px; display:grid; gap:2px; }
.stars{ color:#ffd76a; letter-spacing:1px; }

/* Bonus lista w target */
.bonus-list{ margin:6px 0 0 16px; line-height:1.8; }


.craft-soul{
  width:36px;height:36px;border-radius:6px;border:2px solid transparent;
  display:grid;place-items:center;cursor:pointer;transition:border .15s,transform .15s;
  background:rgba(255,255,255,0.05);
}
.craft-soul img{width:90%;height:90%;object-fit:contain}
.craft-soul.active{border-color:#00ff99;box-shadow:0 0 6px rgba(0,255,170,.4)}
.craft-soul:hover{transform:scale(1.08)}

/* === Reroll / Przeroluj === */
.btn-secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  margin-top:6px;

  background: linear-gradient(180deg,#0e1720,#0a1219);
  color:#bdfdff;
  border:1px solid #284152;
  border-radius:10px;
  padding:8px 10px;
  font-weight:700;
  font-size:13px;
  cursor:pointer;

  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.btn-secondary:hover{
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(0,255,170,.25);
  border-color:#00ffaa66;
  background: linear-gradient(180deg,#0f1c26,#0b151d);
}

.btn-secondary:active{
  transform: translateY(0);
  box-shadow: 0 0 6px rgba(0,255,170,.2);
}

.btn-secondary:focus{
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,255,170,.25);
}

.btn-secondary:disabled{
  opacity:.55;
  cursor:not-allowed;
  filter:saturate(.7);
}

/* w tabeli craftingu wygląd spójny z primary */
.tbl-craft .btn-secondary{
  width:100%;
  font-size:13px;
  padding:6px 8px;
}
