/* ============================================================
   KPL Live Auction Arena CSS — Mobile-First Premium Design
   ============================================================ */

/* ── Auction Layout ───────────────────────────────────────── */
.auction-stage {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  margin-top: 0.75rem;
  align-items: start;
}

/* ── Player Active Card ───────────────────────────────────── */
.player-active-card {
  background: linear-gradient(145deg, rgba(18,28,50,0.95), rgba(8,12,22,0.98));
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 40px rgba(245,158,11,0.12);
  position: relative;
  overflow: hidden;
}

.player-active-card::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(245,158,11,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Player Showcase ──────────────────────────────────────── */
.player-showcase {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.photo-frame {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid var(--primary-gold);
  overflow: hidden;
  box-shadow: 0 0 32px var(--gold-glow), 0 8px 24px rgba(0,0,0,0.6);
  background: #1e293b;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
}

.photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

/* ── Player Meta ──────────────────────────────────────────── */
.player-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-main-name {
  font-size: 1.9rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.15;
  word-break: break-word;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.stat-item {
  background: rgba(10,16,30,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.15rem;
}

.stat-val {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ── Bid Odometer Box ─────────────────────────────────────── */
.bid-odometer-box {
  background: linear-gradient(145deg, rgba(0,0,0,0.6), rgba(5,10,20,0.8));
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.5), 0 0 24px rgba(16,185,129,0.1);
  position: relative;
  overflow: hidden;
}

.bid-odometer-box::before {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 60px;
  background: radial-gradient(ellipse, rgba(16,185,129,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.bid-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.bid-amount {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--pitch-green);
  line-height: 1;
  text-shadow: 0 0 30px rgba(16,185,129,0.5);
  font-variant-numeric: tabular-nums;
  font-family: 'Rajdhani', 'Plus Jakarta Sans', sans-serif;
}

.bid-team-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(245,158,11,0.15);
  color: var(--gold-bright);
  border: 1px solid rgba(245,158,11,0.35);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

/* ── Bid Modifiers Bar ────────────────────────────────────── */
.bid-modifiers-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.btn-mod {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 800;
  padding: 0.65rem 0.3rem;
  border-radius: 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s ease;
  touch-action: manipulation;
  font-family: inherit;
  min-height: 44px;
}

.btn-mod:hover {
  background: rgba(245,158,11,0.2);
  border-color: var(--primary-gold);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.btn-mod:active { transform: scale(0.96); }

/* ── Big Action Buttons ───────────────────────────────────── */
.action-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.65rem;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s ease;
  min-height: 52px;
  touch-action: manipulation;
  letter-spacing: 0.01em;
}

.btn-action:active { transform: scale(0.96); }

.btn-next-draw {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 18px rgba(99,102,241,0.35);
  grid-column: span 2;
  padding: 1rem;
  font-size: 1.05rem;
}
.btn-next-draw:hover { box-shadow: 0 8px 24px rgba(99,102,241,0.5); transform: translateY(-1px); }

.btn-sold {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 18px rgba(16,185,129,0.4);
}
.btn-sold:hover { box-shadow: 0 8px 24px rgba(16,185,129,0.55); transform: translateY(-1px); }

.btn-unsold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  box-shadow: 0 4px 18px rgba(245,158,11,0.35);
}
.btn-unsold:hover { box-shadow: 0 8px 24px rgba(245,158,11,0.5); transform: translateY(-1px); }

.btn-perm-unsold {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.4);
}
.btn-perm-unsold:hover { background: rgba(239,68,68,0.28); }

/* ── Team Purse Sidebar ───────────────────────────────────── */
.team-purse-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.team-card-auction {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.team-card-auction:hover {
  border-color: rgba(245,158,11,0.4);
  transform: translateX(2px);
}
.team-card-auction.current-bidder {
  border-color: var(--pitch-green);
  box-shadow: 0 0 20px rgba(16,185,129,0.2);
  background: rgba(16,185,129,0.08);
}

.team-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.team-card-name {
  font-weight: 800;
  font-size: 0.98rem;
  color: #fff;
}

.team-squad-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  color: var(--text-muted);
}

.team-progress-bg {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.team-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.team-financials {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.team-rem-budget { font-weight: 800; color: var(--pitch-green); }
.team-spent-budget { color: var(--text-dim); }

/* ── Viewer banner ────────────────────────────────────────── */
.viewer-banner {
  background: linear-gradient(90deg, #dc2626, #b91c1c);
  color: #fff;
  text-align: center;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ── Sold Celebration Overlay ─────────────────────────────── */
.sold-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.sold-modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.sold-card-popup {
  background: linear-gradient(145deg, #1a2744, #0d1526);
  border: 2px solid var(--primary-gold);
  border-radius: 22px;
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 0 60px rgba(245,158,11,0.4), 0 16px 48px rgba(0,0,0,0.7);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sold-banner {
  font-size: 2rem;
  font-weight: 900;
  color: var(--pitch-green);
  text-shadow: 0 0 24px var(--green-glow);
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}

/* ── Modals ───────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn  { from { transform: scale(0.75); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse  { 0%, 100% { opacity: 0.6; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.3); } }

/* ── Responsive: Tablet ───────────────────────────────────── */
@media (max-width: 900px) {
  .auction-stage {
    grid-template-columns: 1fr;
  }

  .team-purse-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.6rem;
  }

  .team-purse-sidebar > h3 {
    grid-column: 1 / -1;
  }
}

/* ── Responsive: Mobile ───────────────────────────────────── */
@media (max-width: 600px) {
  .page-container { padding: 0.6rem 0.6rem 2rem !important; }

  .player-showcase {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .photo-frame {
    width: 150px;
    height: 150px;
  }

  .player-main-name {
    font-size: 1.55rem;
    text-align: center;
  }

  .player-meta {
    align-items: center;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .bid-amount { font-size: 2.6rem; }
  .bid-odometer-box { padding: 1rem; }

  .bid-modifiers-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Move -₹50 to its own row */
  .bid-modifiers-bar .btn-mod:last-child {
    grid-column: 1 / -1;
  }

  .auction-header-bar {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.6rem;
  }

  .auction-header-bar h1 {
    font-size: 1.45rem !important;
  }

  .sold-card-popup {
    padding: 1.5rem 1.1rem;
  }

  .sold-banner { font-size: 1.6rem; }

  .team-purse-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .action-buttons-grid {
    grid-template-columns: 1fr;
  }
  .btn-next-draw { grid-column: span 1; }
  .team-purse-sidebar {
    grid-template-columns: 1fr;
  }
}

/* ── Spectator Enhancements ──────────────────────────────── */
.pool-grid-scroll::-webkit-scrollbar,
.activity-feed-box::-webkit-scrollbar {
  width: 6px;
}
.pool-grid-scroll::-webkit-scrollbar-thumb,
.activity-feed-box::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 9999px;
}
.pool-grid-scroll::-webkit-scrollbar-track,
.activity-feed-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

/* ── Auction Countdown Timer Styles ───────────────────────── */
.timer-pulse-red {
  animation: timerWarningPulse 0.8s infinite alternate !important;
}

@keyframes timerWarningPulse {
  0% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.6);
  }
  100% {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.9), 0 0 15px rgba(239, 68, 68, 0.7);
    border-color: #ef4444;
  }
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
}
.switch input:checked + .slider {
  background-color: #10b981;
}
.switch input:checked + .slider:before {
  transform: translateX(22px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}
.timer-preset-btn.active-preset {
  background: #f59e0b !important;
  color: #000 !important;
  border-color: #f59e0b !important;
}


