/* ═══════════════════════════════════════════════════════════════
   NEOWEAVER — LIST CAMPAIGNS  v10 (glass / terminal / CRT)
   font: Chakra Petch | accent: #adff00
   ═══════════════════════════════════════════════════════════════ */

/* ── wrapper ─────────────────────────────────────────────────── */
.tw-campaigns-wrap {
  font-family: 'Chakra Petch', sans-serif;
  padding: 8px 0 32px;
}

.tw-campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  padding: 16px 4px 8px;
}

/* ── card shell ─────────────────────────────────────────────────*/
.tw-campaign-card {
  position: relative;
  border-radius: 22px;
  background:
    linear-gradient(135deg,
      rgba(10,12,16,.82) 0%,
      rgba(6,9,14,.90) 100%);
  border: 1px solid rgba(173,255,0,.18);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 6px 32px rgba(0,0,0,.55),
    0 0 0 0 transparent;
  overflow: visible;
  transition: box-shadow .25s ease, border-color .25s ease, transform .22s ease;
  container-type: inline-size;
}

.tw-campaign-card:hover {
  transform: translateY(-3px);
  border-color: rgba(173,255,0,.42);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 14px 42px rgba(0,0,0,.65),
    0 0 28px rgba(173,255,0,.08);
}

/* CRT scanlines overlay */
.tw-campaign-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,.07) 3px,
    rgba(0,0,0,.07) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── SVG background — pełna karta ───────────────────────────────*/
.tw-card-bg {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.tw-card-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: .14;
  filter: saturate(0) brightness(1.6) contrast(.85);
  transition: opacity .35s ease;
}
.tw-campaign-card:hover .tw-card-bg img {
  opacity: .24;
}

/* ── 1. SOLO/TEAM badge — wystający lewy górny ──────────────────*/
.tw-card-mode-badge {
  position: absolute;
  top: -12px;
  left: 18px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 5px 10px;
  border-radius: 99px;
  background: rgba(10,12,16,.95);
  border: 1px solid rgba(173,255,0,.45);
  color: #adff00;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: 0 2px 12px rgba(173,255,0,.18), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.tw-card-mode-badge svg {
  flex-shrink: 0;
}

/* ── 6. DIFFICULTY tab — wystający prawy górny ──────────────────*/
.tw-card-difficulty-tab {
  position: absolute;
  top: -1px;
  right: -1px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px 6px 12px;
  border-radius: 0 22px 0 16px;
  background: rgba(10,12,16,.95);
  border: 1px solid;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

/* ── GM STYLE BLOCK — pod difficulty, z prawej ──────────────────*/
.tw-card-gm-style-block {
  position: absolute;
  top: 38px;
  right: -1px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* ikona AI */
.tw-gm-ai-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px 0 0 8px;
  background: rgba(10,12,16,.90);
  border: 1px solid rgba(100,180,255,.28);
  border-right: none;
  color: rgba(100,180,255,.75);
  box-shadow: 0 0 10px rgba(100,180,255,.10);
}
.tw-gm-ai-icon svg {
  flex-shrink: 0;
}

/* GM style badge */
.tw-gm-style-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 5px 10px;
  border-radius: 10px 0 0 10px;
  background: rgba(10,12,16,.90);
  border: 1px solid rgba(173,255,0,.20);
  border-right: none;
  color: rgba(200,230,160,.80);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.tw-gm-style-badge svg {
  color: rgba(173,255,0,.60);
  flex-shrink: 0;
}

/* ── 5. JOIN CODE — prawy środkowy ─────────────────────────────*/
.tw-card-join {
  position: absolute;
  right: -1px;
  bottom: 72px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.tw-join-invite-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(173,255,0,.50);
  padding: 4px 10px 2px 12px;
  background: rgba(10,12,16,.80);
  border: 1px solid rgba(173,255,0,.18);
  border-right: none;
  border-bottom: none;
  border-radius: 8px 0 0 0;
}

.tw-join-code-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  background: rgba(10,12,16,.95);
  border: 1px solid rgba(173,255,0,.28);
  border-right: none;
  border-radius: 0 0 0 10px;
}
.tw-join-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: #adff00;
  font-variant-numeric: tabular-nums;
}
.tw-join-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(173,255,0,.10);
  border: 1px solid rgba(173,255,0,.25);
  color: rgba(173,255,0,.7);
  cursor: pointer;
  transition: background .18s, color .18s;
}
.tw-join-copy-btn:hover {
  background: rgba(173,255,0,.22);
  color: #adff00;
}

/* ── inner content ──────────────────────────────────────────────*/
.tw-card-inner {
  position: relative;
  z-index: 2;
  padding: 28px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* CRT scan-line animation */
.tw-card-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(173,255,0,.35), transparent);
  border-radius: 2px;
  animation: tw-scan 4s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.tw-campaign-card:hover .tw-card-scan-line {
  opacity: 1;
}
@keyframes tw-scan {
  0%   { top: 0; }
  100% { top: 100%; }
}

/* ── 4. INFO BLOCK ──────────────────────────────────────────────*/
.tw-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* World name */
.tw-info-world {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(173,255,0,.65);
  margin-bottom: 2px;
}

/* Campaign title */
.tw-card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #f0ffe0;
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(173,255,0,.15);
  margin-bottom: 6px;
}

/* Agent row — name + race·class inline */
.tw-info-agent-full {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.tw-info-label {
  color: rgba(200,220,180,.45);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  min-width: 52px;
  flex-shrink: 0;
}
.tw-info-value {
  color: rgba(230,255,210,.9);
  font-weight: 600;
}
.tw-info-sub {
  color: rgba(200,220,180,.50);
  font-size: 11px;
  font-style: italic;
  letter-spacing: .02em;
}
.tw-info-unset {
  color: rgba(200,220,180,.3);
  font-weight: 400;
}

/* Objective row */
.tw-info-row,
.tw-info-objective {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
}

/* ── 2. LENGTH PROGRESS BAR ─────────────────────────────────────*/
.tw-card-length-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tw-length-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(200,220,180,.55);
}
.tw-length-label span:first-child {
  color: rgba(200,220,180,.85);
}

/* segmented track */
.tw-length-track {
  display: flex;
  gap: 3px;
  height: 6px;
  align-items: stretch;
}
.tw-length-seg {
  flex: 1;
  border-radius: 99px;
  background: var(--threat-color, #adff00);
  box-shadow: 0 0 6px color-mix(in srgb, var(--threat-color, #adff00) 60%, transparent);
  opacity: .85;
}

/* Endless — single continuous bar with pulse */
.tw-length--endless {
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  position: relative;
}
.tw-length--endless .tw-length-seg {
  flex: 1;
  border-radius: 0;
  animation: tw-endless-pulse 2.4s ease-in-out infinite;
}
@keyframes tw-endless-pulse {
  0%,100% { opacity:.55; }
  50%      { opacity:1; }
}

/* ── ACTIONS ────────────────────────────────────────────────────*/
.tw-campaign-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

/* primary / main button */
.tw-campaign-actions .tw-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(173,255,0,.35);
  background: rgba(173,255,0,.08);
  color: #adff00;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .15s;
}
.tw-campaign-actions .tw-btn:hover {
  background: rgba(173,255,0,.16);
  border-color: rgba(173,255,0,.65);
  box-shadow: 0 0 16px rgba(173,255,0,.18);
  transform: translateY(-1px);
}
.tw-campaign-actions .tw-btn:active {
  transform: translateY(0);
}

/* delete / X button */
.tw-btn-danger {
  flex: 0 0 auto !important;
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  background: rgba(239,68,68,.08) !important;
  border: 1px solid rgba(239,68,68,.28) !important;
  color: rgba(239,68,68,.7) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.tw-btn-danger:hover {
  background: rgba(239,68,68,.18) !important;
  border-color: rgba(239,68,68,.55) !important;
  color: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239,68,68,.20) !important;
  transform: translateY(-1px) !important;
}

/* ── empty state ────────────────────────────────────────────────*/
.tw-campaigns-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 24px;
  gap: 12px;
  font-family: 'Chakra Petch', sans-serif;
}
.tw-campaigns-empty-icon {
  font-size: 36px;
  opacity: .5;
}
.tw-campaigns-empty-main {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(173,255,0,.7);
}
.tw-campaigns-empty-sub {
  font-size: 11px;
  color: rgba(200,220,180,.45);
  max-width: 30ch;
}
.tw-campaigns-empty-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── error ──────────────────────────────────────────────────────*/
.tw-error {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  color: #ef4444;
  letter-spacing: .06em;
  padding: 12px 0;
}
