/* ============================================================
   NEOWEAVER – TW DECK
   Panel kart (bottom HUD) i system tabów.
   Wymaga tw-core.css.
   ============================================================ */

/* 1. ANIMACJE */
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

@keyframes glitch-anim {
  0%   { transform: translate(0);         filter: hue-rotate(0deg);   clip-path: inset(0); }
  20%  { transform: translate(-3px, 2px); filter: hue-rotate(90deg);  clip-path: inset(10% 0 30% 0); }
  40%  { transform: translate(3px, -1px); filter: hue-rotate(180deg); clip-path: inset(40% 0 10% 0); }
  60%  { transform: translate(-1px, 3px); filter: hue-rotate(270deg); clip-path: inset(20% 0 50% 0); }
  100% { transform: translate(0);         filter: hue-rotate(360deg); clip-path: inset(0); }
}

@keyframes pulseSelect {
  0%,100% { transform: scale(1.6); }
  50%     { transform: scale(1.5); }
}

@keyframes pulse-cost {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.1); }
}

/* 2. SCENARIO CARD */
.scenario-card {
  transition: all 0.3s ease;
  cursor: pointer;
}
.scenario-card.is-loading {
  opacity: 0.6 !important;
  pointer-events: none !important;
  background: linear-gradient(90deg, #adff00, #7fff00);
  animation: pulse 1.5s infinite;
}

/* 3. DECK PANEL */
#deck-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Tło */
  background: rgba(3, 7, 18, 0.15);
  backdrop-filter: blur(4px);

  /* Obramowanie i cień */
  border-top: 1px solid rgba(173, 255, 0, 0.5);
  box-shadow:
    0 -10px 30px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(173, 255, 0, 0.1);
}

/* Efekt scanlines */
#deck-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
    linear-gradient(90deg,
      rgba(255, 0, 0, 0.02),
      rgba(0, 255, 0, 0.01),
      rgba(0, 0, 255, 0.02));
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
  z-index: 10;
  opacity: 0.25;
}

#deck-panel.is-collapsed {
  transform: translateY(calc(100% - 42px));
}

/* Inner tło */
#deck-container {
  background: radial-gradient(
    circle at top,
    rgba(15, 23, 42, 0.06),
    rgba(15, 23, 42, 0.25)
  );
}

/* 4. PASEK TABÓW */
.deck-tabs-wrapper {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  background: #05080f;
  border-bottom: 1px solid rgba(173, 255, 0, 0.1);
  cursor: pointer;
  position: relative;
  z-index: 1001;
}

.panel-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s;
  position: relative;
}
.panel-tab.is-active {
  color: #adff00;
}
.panel-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  width: 70%;
  height: 2px;
  background: #adff00;
  box-shadow: 0 0 10px #adff00;
}

#toggle-deck {
  margin-left: auto;
  color: #ff4b4b;
}

/* 5. ZAWARTOŚĆ TABÓW */
.deck-tab-content {
  display: none;
  padding: 20px;
  max-height: 520px;
  overflow: visible;
}
.deck-tab-content.is-active {
  display: block;
}
/* 6. QUEST FAILED */
@keyframes tw-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.failed-animation {
  border-color: #ff0055 !important;
  animation: tw-shake 0.4s ease both;
  opacity: 0.5;
}

.quest-failed-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Chakra Petch', sans-serif;
}
.failed-title {
  color: #ff0055;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 0 0 30px rgba(255, 0, 85, 0.8);
}
.failed-subtitle {
  color: #adff00;
  font-size: 1rem;
  margin-top: 12px;
  letter-spacing: 2px;
  opacity: 0.7;
}
