/* ============================================================
   KPL 2026 — Professional Mobile-First Design System
   Rich Colors · Glassmorphism · Premium Typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Rajdhani:wght@500;600;700&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  /* Background */
  --bg-main:        #050a12;
  --bg-surface:     #0b1120;
  --bg-card:        rgba(15, 23, 42, 0.82);
  --bg-card-hover:  rgba(22, 34, 60, 0.92);

  /* Brand Colors */
  --primary-gold:   #f59e0b;
  --gold-bright:    #fbbf24;
  --gold-glow:      rgba(245, 158, 11, 0.4);
  --pitch-green:    #10b981;
  --green-glow:     rgba(16, 185, 129, 0.35);
  --crimson-red:    #ef4444;
  --red-glow:       rgba(239, 68, 68, 0.35);
  --electric-blue:  #38bdf8;
  --blue-glow:      rgba(56, 189, 248, 0.35);
  --purple-accent:  #a78bfa;
  --pink-accent:    #ec4899;

  /* Text */
  --text-main:  #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim:   #64748b;

  /* Border */
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-gold:  rgba(245, 158, 11, 0.4);

  /* Radius */
  --radius-xs:   6px;
  --radius-sm:   10px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-gold: 0 0 24px var(--gold-glow);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(56,189,248,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(245,158,11,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 50% 50%, rgba(167,139,250,0.08) 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background: rgba(5, 10, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 60px;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 900;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(245,158,11,0.5);
  flex-shrink: 0;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: nowrap;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-bottom: 2px solid var(--primary-gold);
}

.nav-link.tab-admin.active {
  background: rgba(245,158,11,0.18);
  color: var(--gold-bright);
  border-bottom: 2px solid var(--primary-gold);
}

.nav-link.tab-reg.active {
  background: rgba(56,189,248,0.18);
  color: var(--electric-blue);
  border-bottom: 2px solid var(--electric-blue);
}

.nav-link.tab-viewers {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}

.nav-link.tab-viewers:hover,
.nav-link.tab-viewers.active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 0 18px rgba(239,68,68,0.4);
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #ef4444;
  animation: pulseDot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

.nav-link.tab-viewers.active .live-pulse-dot,
.nav-link.tab-viewers:hover .live-pulse-dot {
  background: #fff;
  box-shadow: 0 0 6px #fff;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(0.9); opacity: 0.75; }
  50%       { transform: scale(1.4); opacity: 1; }
}

/* Mobile menu toggle */
.mobile-toggle {
  display: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  line-height: 1;
  flex-shrink: 0;
}

/* Mobile nav dropdown */
@media (max-width: 760px) {
  .mobile-toggle { display: flex; align-items: center; justify-content: center; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(5, 10, 18, 0.98);
    backdrop-filter: blur(20px);
    padding: 0.75rem;
    gap: 0.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
    z-index: 999;
  }

  .nav-links.open { display: flex; }

  .nav-link {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    width: 100%;
    border-radius: 10px;
  }

  .nav-brand span:last-child {
    display: none;
  }
}

/* ── Page Container ───────────────────────────────────────── */
.page-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  flex: 1;
}

@media (max-width: 480px) {
  .page-container {
    padding: 1rem 0.75rem 3rem;
  }
}

/* ── Glass Cards ──────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 480px) {
  .glass-card { padding: 1.1rem; border-radius: 16px; }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.97) !important; }

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

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

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 18px rgba(239,68,68,0.35);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239,68,68,0.5);
}

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.14);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.22);
}

.btn-warning {
  background: rgba(245,158,11,0.15);
  color: var(--gold-bright);
  border: 1px solid rgba(245,158,11,0.4);
}
.btn-warning:hover {
  background: rgba(245,158,11,0.25);
}

/* Full-width on mobile */
@media (max-width: 480px) {
  .btn-block-mobile { width: 100%; justify-content: center; }
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-batsman   { background: rgba(239,68,68,0.15);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.badge-bowler    { background: rgba(56,189,248,0.15);   color: #7dd3fc; border: 1px solid rgba(56,189,248,0.3); }
.badge-allrounder{ background: rgba(245,158,11,0.15);   color: #fde68a; border: 1px solid rgba(245,158,11,0.3); }
.badge-keeper    { background: rgba(16,185,129,0.15);   color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }

/* Role badge (auction) */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid;
}
.role-badge.badge-allrounder { background: rgba(245,158,11,0.18); color: var(--gold-bright); border-color: rgba(245,158,11,0.4); }
.role-badge.badge-batsman    { background: rgba(239,68,68,0.18);  color: #fca5a5; border-color: rgba(239,68,68,0.4); }
.role-badge.badge-bowler     { background: rgba(56,189,248,0.18); color: #7dd3fc; border-color: rgba(56,189,248,0.4); }
.role-badge.badge-keeper     { background: rgba(16,185,129,0.18); color: #6ee7b7; border-color: rgba(16,185,129,0.4); }

/* Player ID tag */
.player-id-tag {
  background: rgba(245,158,11,0.12);
  color: var(--primary-gold);
  border: 1px solid rgba(245,158,11,0.35);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 800;
}

/* ── Form Controls ────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}
.form-label .req { color: var(--crimson-red); }

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(10, 16, 30, 0.8);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--electric-blue);
  background: rgba(10, 16, 30, 0.95);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.18);
}
.form-control::placeholder { color: var(--text-dim); }

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 18px;
  padding-right: 2.5rem;
}
select.form-control option { background: #0b1120; color: #fff; }

/* ── Photo/UPI Section ────────────────────────────────────── */
.photo-uploader {
  border: 2px dashed rgba(255,255,255,0.18);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1rem;
  text-align: center;
  background: rgba(15,23,42,0.4);
  transition: border-color 0.2s ease;
  cursor: pointer;
}
.photo-uploader:hover { border-color: var(--primary-gold); }

.photo-preview-wrap {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  border: 3px solid var(--primary-gold);
  overflow: hidden;
  box-shadow: 0 0 24px var(--gold-glow);
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-preview-img { width: 100%; height: 100%; object-fit: cover; }
.upload-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

.payment-section {
  background: linear-gradient(135deg, rgba(22,34,60,0.8), rgba(10,15,28,0.95));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 0 20px rgba(245,158,11,0.12);
}

.upi-apps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.upi-app-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.08);
  touch-action: manipulation;
}
.upi-app-btn:active { transform: scale(0.96); }

.upi-phonepe { background: linear-gradient(135deg, #5f259f, #7a2fc7); }
.upi-gpay    { background: linear-gradient(135deg, #1a73e8, #4285f4); }
.upi-paytm   { background: linear-gradient(135deg, #002e6e, #00b9f1); }
.upi-bhim    { background: linear-gradient(135deg, #00875a, #00b377); }

@media (max-width: 400px) {
  .upi-apps-grid { grid-template-columns: 1fr; }
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}

/* ── Utility ──────────────────────────────────────────────── */
.text-gold   { color: var(--primary-gold); }
.text-green  { color: var(--pitch-green); }
.text-blue   { color: var(--electric-blue); }
.text-red    { color: var(--crimson-red); }
.text-muted  { color: var(--text-muted); }

.gradient-text-gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); }

/* ── Mobile-safe touch targets ────────────────────────────── */
@media (max-width: 600px) {
  .btn { min-height: 44px; }
  .form-control { min-height: 48px; font-size: 16px; } /* prevents iOS zoom */
}

/* ── Round tag / Pool status ──────────────────────────────── */
.round-tag {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-gold);
  white-space: nowrap;
}

/* ── Universal Auto-Fit 1-Tap Team Grid (Mobile-Safe) ─────── */
#hostTeamGrid, #quickTeamGrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.45rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 0.5rem !important;
}

@media (max-width: 320px) {
  #hostTeamGrid, #quickTeamGrid {
    grid-template-columns: 1fr !important;
  }
}

.team-quick-card, .team-quick-bid-card {
  min-width: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  padding: 0.5rem 0.55rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  touch-action: manipulation !important;
}

.team-quick-card:active, .team-quick-bid-card:active {
  transform: scale(0.98);
}

