/* Style okna wyboru perków, powiadomienia oraz paska perków w plecaku */

/* 1. Powiadomienie PERK AVAILABLE [P]: przy lewej krawędzi nad wskaźnikami postaci (nad paskiem zasłaniało inne elementy — Topek, 2026-10-07) */
#perk-notify {
  position: fixed;
  bottom: 168px;
  left: 24px;
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(22, 28, 18, 0.94);
  border: 1px solid #c8a038;
  box-shadow: 0 0 16px rgba(220, 175, 50, 0.35), 0 4px 14px rgba(0, 0, 0, 0.75);
  padding: 6px 14px;
  border-radius: 4px;
  color: #f4e8c4;
  font-family: Bahnschrift, 'DIN Alternate', 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 55;
  transform-origin: left center;
  animation: perkPulse 1.8s infinite ease-in-out;
  user-select: none;
}

#perk-notify:hover {
  background: rgba(32, 42, 26, 0.98);
  border-color: #f6cc54;
  box-shadow: 0 0 22px rgba(246, 204, 84, 0.55);
}

#perk-notify .kbd {
  background: #2f3826;
  border: 1px solid #c8a038;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
}

#perk-notify.on {
  display: flex;
}

@keyframes perkPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(200, 160, 56, 0.3); }
  50% { transform: scale(1.03); box-shadow: 0 0 24px rgba(240, 195, 60, 0.6); }
}

/* 2. Modal wyboru perka */
#perks {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 10, 0.78);
  backdrop-filter: blur(2px);
  z-index: 90;
}

#perks.on {
  display: flex;
}

.pk-box {
  position: relative;
  background: #181d16;
  border: 1px solid #5a664e;
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.85), inset 0 0 24px rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  padding: 24px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
}

.pk-box h2 {
  margin: 0 0 6px;
  font-family: Bahnschrift, 'DIN Alternate', 'Segoe UI', sans-serif;
  font-size: 24px;
  letter-spacing: 0.12em;
  color: #e2e8d4;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.pk-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: #a4ae94;
  letter-spacing: 0.05em;
}

.pk-row {
  display: flex;
  gap: 22px;
}

.pk-card {
  width: 236px;
  min-height: 352px;
  background: linear-gradient(180deg, #2a3324 0%, #1b2118 62%);
  border: 1px solid #48543e;
  border-radius: 5px;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  user-select: none;
}

.pk-card:hover {
  transform: translateY(-10px) scale(1.05);
  border-color: #f0cc58;
  box-shadow: 0 0 0 1px #f0cc58, 0 14px 34px rgba(240, 200, 80, 0.45), inset 0 0 26px rgba(240, 200, 80, 0.14);
  background: linear-gradient(180deg, #3a4530 0%, #232b1e 62%);
  z-index: 2;
}
.pk-card:hover .pk-ico { box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 30px 6px rgba(240, 200, 80, 0.5); border-color: #f0cc58; }
.pk-card:hover .pk-ico img { transform: scale(1.12); }

/* wejście kart jak w oknie łupu: wjazd z dołu z obrotem, kolejne karty z opóźnieniem */
.pk-card.enter {
  animation: pkCardIn 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

@keyframes pkCardIn {
  from { opacity: 0; transform: translateY(54px) scale(0.7) rotate(-5deg); }
  to { opacity: 1; transform: none; }
}

/* kompromis (opis z „but”): ramka dwukolorowa — zielona górą i z lewej (zysk), pomarańczowa dołem i z prawej (koszt) */
.pk-card.trade { border-color: transparent; background: linear-gradient(180deg, #2a3324 0%, #1b2118 62%) padding-box, linear-gradient(135deg, #7fc46a 0%, #7fc46a 48%, #e0743a 52%, #e0743a 100%) border-box; border-width: 2px; }
.pk-card.trade:hover { border-color: transparent; background: linear-gradient(180deg, #3a4530 0%, #232b1e 62%) padding-box, linear-gradient(135deg, #a4e490 0%, #a4e490 48%, #ff9658 52%, #ff9658 100%) border-box; }
.pk-gain { display: block; color: #a4e490; }
.pk-cost { display: block; margin-top: 6px; color: #f0a070; }

.pk-card.flash {
  animation: pkFlash 0.3s ease-out forwards;
}

@keyframes pkFlash {
  0% { transform: scale(1.04); box-shadow: 0 0 32px #ffe270; filter: brightness(1.6); }
  100% { opacity: 0; transform: scale(0.92); }
}

.pk-ico {
  width: 112px;
  height: 112px;
  background: radial-gradient(circle, #2b3526 0%, #141712 72%);
  border: 2px solid #4c5a42;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 18px 2px rgba(150, 200, 110, 0.22);
  animation: pkGlow 2.6s ease-in-out infinite;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
@keyframes pkGlow { 0%, 100% { box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 14px 1px rgba(150, 200, 110, 0.18); } 50% { box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 26px 5px rgba(150, 200, 110, 0.4); } }

.pk-ico img {
  width: 82px;
  height: 82px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.7));
  transition: transform 0.15s ease;
}

.pk-name {
  font-family: Bahnschrift, 'DIN Alternate', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #f2ebd4;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.pk-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
}

.pk-tag.new {
  background: rgba(100, 160, 80, 0.22);
  color: #8edc76;
  border: 1px solid rgba(142, 220, 118, 0.35);
}

.pk-tag.up {
  background: rgba(216, 178, 68, 0.22);
  color: #f0c850;
  border: 1px solid rgba(240, 200, 80, 0.35);
}

.pk-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}

.pk-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #363c32;
  border: 1px solid #545e4e;
}

.pk-dot.filled {
  background: #7fc46a;
  border-color: #a4e490;
  box-shadow: 0 0 6px rgba(127, 196, 106, 0.5);
}

.pk-dot.next {
  background: #f0c850;
  border-color: #ffe070;
  box-shadow: 0 0 7px rgba(240, 200, 80, 0.6);
}

.pk-desc {
  font-size: 13px;
  line-height: 1.4;
  color: #c4ccb6;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pk-key {
  margin-top: 14px;
  font-size: 11px;
  color: #8a947c;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pk-key .kbd {
  background: #283024;
  border: 1px solid #58664e;
  color: #e4ebd8;
  padding: 1px 7px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 12px;
}

/* 3. Pasek perków w oknie plecaka (TAB) */
.bp-perks-box {
  margin-top: 12px;
  background: rgba(18, 22, 16, 0.85);
  border: 1px solid #3c4634;
  border-radius: 4px;
  padding: 6px 10px;
}

.bp-perks-h {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #929e84;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.bp-perks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  align-items: center;
}

.bp-perk-item {
  position: relative;
  width: 32px;
  height: 32px;
  background: #222a1e;
  border: 1px solid #4a5842;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.bp-perk-item:hover {
  transform: scale(1.1);
  border-color: #f0c850;
  z-index: 2;
}

.bp-perk-item img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

.bp-perk-rank {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: #141812;
  border: 1px solid #7fc46a;
  color: #a4e490;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 2px;
}

/* 4. Porównanie statystyk broni i pancerza w tooltipach */
.p-power-box {
  margin: 8px 0 10px;
  padding: 6px 10px;
  background: rgba(14, 18, 12, 0.88);
  border: 1px solid #3e4838;
  border-radius: 4px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.p-power-val {
  font-family: Bahnschrift, 'DIN Alternate', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #f4ecd6;
  letter-spacing: 0.04em;
}

.p-power-val span {
  font-size: 11px;
  color: #8c9880;
  font-weight: 400;
  margin-left: 4px;
}

.cmp-diff {
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.cmp-up {
  color: #7fc46a !important;
}

.cmp-down {
  color: #e06848 !important;
}

.cmp-eq {
  color: #9aa090 !important;
}

.cmp-muted {
  color: #889080 !important;
  font-weight: 400;
  font-size: 11px;
}

.p-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0;
  font-size: 12px;
}

.p-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.p-row span:first-child {
  color: #9ca68e;
}

.p-row span:last-child {
  color: #e2e8d4;
  font-weight: 600;
}

/* Znacznik badge lepsza/gorsza na ikonie przedmiotu */
.wpn-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 900;
  z-index: 3;
  pointer-events: none;
}

.wpn-badge.up {
  background: rgba(20, 50, 20, 0.88);
  border: 1px solid #7fc46a;
  color: #8ee476;
}

.wpn-badge.down {
  background: rgba(50, 20, 16, 0.88);
  border: 1px solid #e0563c;
  color: #f27458;
}

/* przy węższym oknie konsola maszynisty (ui/console.js) sięga lewej kolumny — powiadomienie o perku wyżej */
@media (max-width: 1500px) { #perk-notify { bottom: 206px; } }
