/* ==========================================================================
   🏆 ZAFER ZİNCİRİ MODAL (CHAIN OFFER / ROADMAP STEP-UP EVENT)
   AGENTS.md §4.2: Pencere İçi Panel Kuralı (In-Window Panel Rule)
   - position: absolute; inset: 0;
   - GameWindow.open / GameWindow.close ile yönetilir.
   - vh / vw birimleri yasaktır; % ve clamp kullanılır.
   - Yatay ilerleyen Yol / Roadmap (Progression Track) tasarımı.
   - Temiz Rajdhani spor/futbol tipografisi.
   ========================================================================== */

.chain-offer-modal {
  position: absolute;
  inset: 0;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.92);
  padding: clamp(8px, 2%, 24px);
  pointer-events: auto;
}

.chain-offer-card {
  position: relative;
  width: 100%;
  max-width: 1220px;
  max-height: 96%;
  background: linear-gradient(180deg, #181c24 0%, #12141a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 2px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.chain-offer-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #1e222d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chain-offer-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chain-offer-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chain-offer-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 800;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.chain-offer-timer-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fbbf24;
  font-size: 13px;
  font-weight: 700;
  border-radius: 4px;
  font-family: 'Rajdhani', monospace, sans-serif;
  letter-spacing: 0.5px;
}

.chain-offer-title {
  margin: 3px 0 0 0;
  color: #ffffff;
  font-size: clamp(22px, 2.4%, 28px);
  font-weight: 900;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
}

.chain-header-trophy {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.6));
}

.chain-offer-subtitle {
  margin: 0;
  color: #94a3b8;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.chain-offer-close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  pointer-events: auto !important;
}

.chain-offer-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ef4444;
  transform: rotate(90deg);
}

/* Body & Roadmap Controls */
.chain-offer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  overflow: hidden;
}

.chain-road-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
}

.chain-road-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #20242e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fbbf24;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.chain-road-arrow:hover {
  background: #2a313e;
  border-color: #fbbf24;
  color: #ffffff;
  transform: scale(1.08);
}

.chain-road-scroll-viewport {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  user-select: none;
  scroll-behavior: smooth;
  padding: 6px 4px 12px 4px;
}

.chain-road-scroll-viewport.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

/* Custom horizontal scrollbar */
.chain-road-scroll-viewport::-webkit-scrollbar {
  height: 6px;
}
.chain-road-scroll-viewport::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
}
.chain-road-scroll-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 3px;
}
.chain-road-scroll-viewport::-webkit-scrollbar-thumb:hover {
  background: #f59e0b;
}

/* Track & Roadmap Line */
.chain-road-track {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: max-content;
  padding: 18px 10px 10px 10px;
}

.chain-road-line {
  position: absolute;
  top: 31px;
  left: 90px;
  right: 110px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  z-index: 1;
}

.chain-road-line-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 100%);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  transition: width 0.4s ease;
}

.chain-road-nodes {
  display: flex;
  align-items: stretch;
  gap: 16px;
  z-index: 2;
}

/* Roadmap Node */
.chain-road-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
  flex-shrink: 0;
}

/* Pin atop each node */
.chain-node-pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a1e27;
  border: 2px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 900;
  color: #94a3b8;
  margin-bottom: 10px;
  transition: all 0.25s ease;
  z-index: 3;
}

.chain-road-node.claimed .chain-node-pin {
  background: #10b981;
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.7);
}

.chain-road-node.available .chain-node-pin {
  background: #f59e0b;
  border-color: #fbbf24;
  color: #1a160d;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.8);
  transform: scale(1.2);
}

.chain-road-node.grand-node .chain-node-pin {
  border-color: #fbbf24;
}

/* Node Card */
.chain-node-card {
  width: 100%;
  background: #181c24;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 290px;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.chain-road-node.claimed .chain-node-card {
  background: #13161c;
  border-color: rgba(16, 185, 129, 0.25);
  opacity: 0.85;
}

.chain-road-node.available .chain-node-card {
  background: linear-gradient(180deg, #222631 0%, #151820 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}

.chain-road-node.available:has(.btn-claim-free) .chain-node-card {
  border-color: #10b981;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(16, 185, 129, 0.3);
}

.chain-road-node.locked .chain-node-card {
  background: #14161d;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  opacity: 0.65;
}

/* Grand node styling (#8) */
.chain-road-node.grand-node {
  width: 230px;
}

.chain-road-node.grand-node .chain-node-card {
  background: linear-gradient(180deg, #2b2213 0%, #17140e 100%);
  border: 1.5px solid #d97706;
}

.chain-road-node.grand-node.available .chain-node-card {
  border: 2px solid #fbbf24;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 24px rgba(251, 191, 36, 0.4);
}

/* Card Header & Badge */
.chain-node-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chain-node-badge {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.chain-node-badge.tier-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chain-node-badge.free-badge {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.chain-node-badge.grand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a160d;
  font-weight: 900;
}

/* Center Image */
.chain-node-icon-box {
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 72%);
  border-radius: 50%;
  margin: 2px 0;
}

.chain-node-icon {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s ease;
}

.chain-road-node.available .chain-node-icon {
  transform: scale(1.08);
}

/* Title */
.chain-node-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
  text-align: center;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
}

/* Rewards Container */
.chain-node-rewards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  justify-content: center;
}

/* Reward Row with Real PNG Icon */
.chain-reward-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  box-sizing: border-box;
}

.chain-reward-row.grand-highlight {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
}

.chain-reward-ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.chain-reward-amt {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chain-reward-amt.star-text {
  color: #fbbf24;
  font-weight: 800;
}

/* Action Button */
.chain-node-action {
  width: 100%;
}

.chain-step-btn {
  width: 100%;
  padding: 8px 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.chain-step-btn.claimed {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  cursor: default;
}

.chain-step-btn.locked {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #64748b;
  cursor: not-allowed;
}

.chain-step-btn.btn-claim-free {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.chain-step-btn.btn-claim-free:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
}

.chain-step-btn.btn-buy-step {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #181409;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.chain-step-btn.btn-buy-step:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  transform: translateY(-1px);
}

.chain-step-btn.btn-grand {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0f0c05;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(251, 191, 36, 0.4);
}

.chain-step-btn.btn-grand:hover {
  background: linear-gradient(135deg, #fef08a, #fbbf24);
  transform: translateY(-1px);
}

/* Footer */
.chain-offer-footer {
  padding: 10px 22px;
  background: #14171d;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.chain-offer-footer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.chain-footer-bullet {
  color: #f59e0b;
  font-weight: 900;
}

/* Responsiveness */
@media (max-width: 900px) {
  .chain-road-node {
    width: 170px;
  }
  .chain-road-node.grand-node {
    width: 190px;
  }
  .chain-node-card {
    min-height: 260px;
    padding: 8px;
    gap: 6px;
  }
  .chain-node-icon-box {
    width: 58px;
    height: 58px;
  }
  .chain-node-icon {
    width: 48px;
    height: 48px;
  }
  .chain-reward-row {
    padding: 4px 6px;
  }
  .chain-reward-amt {
    font-size: 11px;
  }
}
