#head .d-flex {
  justify-content: center; /* place title+spinner exactly centered */
}
/* Roman Urdu: Simple custom styles yahan rakhein */
@import url('./fonts.css');

/* Global fonts: Body Nastaliq, numbers Poppins later override */
body {
  font-family: 'Noto Nastaliq Urdu', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* Prevent any horizontal overflow */
}

/* Horizontal scroll wrapper for wide tables */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Center the chips bar and header meta */
#head { text-align: center; }
#t-name {
  display: block;
  margin: 0 auto;
  font-family: 'Noto Nastaliq Urdu', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
}
#t-desc {
  max-width: 800px;
  margin: 4px auto 0;
}
#head::after { display: none; }
#daysBar {
  justify-content: center;
  margin-top: 4px;
  margin-bottom: 10px; /* closer to tables */
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Tabs row should read RTL (dates and total button) */
#daysBar { direction: rtl; }
#daysOnly {
  display: flex;
  direction: rtl;
  flex-direction: row; /* with RTL, items flow right-to-left in DOM order */
  gap: 8px;
}

/* Pretty tabs (chips) */
#daysBar .btn {
  border-radius: 999px;
  padding: 6px 12px;
}

/* Tables base */
table.table {
  table-layout: fixed;
  width: 100%;
  font-size: 12px; /* tighter to fit more columns */
}

/* RTL for tournament tables */
#dailyTable,
#totalTable {
  direction: rtl;
  width: 100%;
  table-layout: fixed; /* make percentage widths effective */
}

/* Force RTL direction inside Total table cells explicitly */
#totalTable thead th,
#totalTable tbody td {
  direction: rtl;
}

/* =====================
   Tournament Detail: Title styling
   ===================== */
#head {
  text-align: center;
  padding: 14px 0 14px; /* vertical spacing */
  margin: 8px 0 8px;   /* extra separation from sections */
}
#t-name {
  display: inline-block;
  margin: 0;
  font-family: 'Noto Nastaliq Urdu';
  font-weight: 500;
  font-size: 10px;
  color: #2065fa;
}
.title{
  margin: 10px;
  padding: 30px;
  border: solid;
  border-color: #efe9fa;
  border-width: 1px;
  border-radius: 10px;
}

/* underline removed as requested */
#t-desc,
#t-meta {
  text-align: center;
}


/* =====================
   Global Header & Footer
   ===================== */
/* Header wrapper */
header.py-3.border-bottom.bg-light {
  background: #ffffff !important;
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.04);
}
/* Brand title */
header .h5.m-0 {
  font-family: 'Noto Nastaliq Urdu', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #1f1f1f;
}
/* Nav links */
header .nav .nav-link {
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 600;
  color: #444;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background-color .15s ease, color .15s ease;
}
header .nav .nav-link:hover {
  background-color: rgba(103,58,183,0.08);
  color: #673AB7;
}
header .nav .nav-link.active {
  background-color: rgba(103,58,183,0.12);
  color: #673AB7 !important;
}

/* Footer */
footer.py-4.border-top.bg-light {
  background: #faf9ff !important;
  border-top: 1px solid rgba(103,58,183,0.15) !important;
}
footer .text-muted {
  color: #6b6b6b !important;
}

/* =====================
   Home: Tournament Cards
   ===================== */
/* Card container */
#list .card {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  background: #fff;
}
#list .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  border-color: rgba(103,58,183,0.25);
}

/* Title */
#list .card .card-title {
  font-family: 'Noto Nastaliq Urdu', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  line-height: 2.35;
  color: #673AB7; /* deep purple brand color */
}

/* Center all content inside card */
#list .card .card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px; /* vertical spacing between elements */
}

/* Date range under title */
#list .card .text-secondary {
  font-family: 'Poppins', Arial, sans-serif;
  opacity: .9;
}

/* Description clamp (2 lines) */
#list .card .small.text-muted.flex-grow-1 {
  display: -webkit-box;
  line-clamp: 2; /* standard */
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px; /* keep height uniform */
}

/* Top players row */
.top-players-row {
  gap: 10px !important;
  justify-content: center;
}
.top-players-row .badge {
  background: #fafafa !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  color: #222 !important;
  border-radius: 999px;
  padding: 10px 12px;
}
.top-players-row .badge span {
  font-family: 'Noto Nastaliq Urdu', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 600;
}
.top-players-row img, .top-players-row .rounded-circle {
  width: 22px !important;
  height: 22px !important;
}

/* Status + View button row */
#list .card .badge {
  border-radius: 999px;
  padding: 6px 6px;
  text-transform: capitalize;
  font-family: 'Poppins', Arial, sans-serif;
}
#list .card .d-flex.justify-content-between.align-items-center.mt-2 {
  justify-content: space-between !important; /* keep buttons on sides */
  gap: 10px;
  width: 100%;
}

/* Hide description inside the card on home page */
#list .card .small.text-muted.flex-grow-1 {
  display: none !important;
}
#list .card .btn.btn-primary {
  border-radius: 12px;
  padding:2px 8px 8px 8px;
  font-weight: 600;
  background-color: #673AB7;
  border-color: #673AB7;
  box-shadow: 0 6px 14px rgba(103,58,183,0.28);
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}
#list .card .btn.btn-primary:hover {
  transform: translateY(-1px);
  background-color: #5e35b1; /* slightly darker */
  border-color: #5e35b1;
  box-shadow: 0 10px 22px rgba(103,58,183,0.34);
}
#list .card .btn.btn-primary:active {
  transform: translateY(0);
}
#list .card .btn.btn-primary:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(103,58,183,0.18), 0 8px 20px rgba(103,58,183,0.32);
}

/* Ensure tables have a minimum width so columns don't squeeze too much */
.table-wide {
  min-width: 100%;
}

/* Column widths */
.col-index { width: 5%; }
.col-pigeons { width: 5%; }
.col-player { width: 30%; }
.col-period { width: auto; }
.col-day { width: auto; }
.col-total { width: 8%; }

/* Player cell contents */
.player-avatar {
  width: 40px; /* smaller */
  height: 40px;
  object-fit: cover;
  border: 0.5px solid #673DE6;
  /* deep purple border */
}

.player-name {
  display: inline-block;
  max-width: 110px; /* tighter */
  white-space: normal;      /* wrap allow */
  overflow: visible;        /* no clipping */
  text-overflow: clip;
  line-height: 2.3;         /* Nastaliq better spacing */
}

/* Header tighten */
.table thead th,
.table-dark th,
.table-dark td,
#dailyTable thead th,
#totalTable thead th,
#dailyTable thead th *,
#totalTable thead th * {
  vertical-align: middle;
  text-align: center;
  /* Urdu headers should use Nastaliq; numbers are handled separately below */
  font-family: 'Noto Nastaliq Urdu', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif !important;
  line-height: 1.4;
  white-space: normal; /* allow wrap */
}

/* Countdown small and subtle */
#t-meta {
  font-size: 12px;
}

/* Force numeric columns to Poppins on all cells */
.table td.col-index,
.table td.col-period,
.table td.col-day,
.table td.col-total,
.table td.col-pigeons,
.table th.col-index,
.table th.col-period,
.table th.col-day,
.table th.col-total,
.table th.col-pigeons {
  font-family: 'Poppins', Arial, sans-serif !important;
}

/* Numeric columns (index, periods, day totals, grand) use Poppins for clarity */
.col-index,
.col-period,
.col-day,
.col-total {
  text-align: center !important;
  font-family: 'Poppins', Arial, sans-serif;
}

/* Prevent long names from breaking layout */
.player-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tight row height */
.table td,
.table th {
  padding: 6px 8px; /* tighter */
  vertical-align: middle;
  line-height: 1.6; /* Nastaliq glyphs clip na hon */
  word-break: break-word; /* prevent overflow */
}

/* Zebra striping: odd = light green, even = light pink */
table.table tbody tr:nth-child(odd) td {
  background-color: #ebfcf0 !important; /* light green */
}
table.table tbody tr:nth-child(even) td {
  background-color: #fef3ec !important; /* light pink */
}

/* Make sure Bootstrap utilities don't override our zebra colors */
.table tbody tr td.bg-light,
.table tbody tr td.bg-white {
  background-color: inherit !important;
}

/* Highlight TOTAL column cells (body only) */
table.table tbody td.col-total {
  background-color: #ffc800 !important; /* soft yellow */
  color: #000; /* readable text */
}

/* Stronger specificity for our two tables */
#dailyTable tbody td.col-total,
#totalTable tbody td.col-total {
  background-color: #ffc800 !important;
  color: #000 !important;
}

/* Pigeon count column: force white background in body cells (header unchanged) */
table.table tbody td.col-pigeons { background: #ffffff !important; }
#dailyTable tbody td.col-pigeons,
#totalTable tbody td.col-pigeons { background: #ffffff !important; }

/* =====================
   Unified table borders
   ===================== */
#dailyTable,
#dailyTable th,
#dailyTable td,
#totalTable,
#totalTable th,
#totalTable td {
  border: 1px solid #bababa !important; /* one solid color for all borders */
}
#dailyTable thead th,
#totalTable thead th {
  border-bottom: 1px solid #696969 !important; /* keep header bottom border same color */
}

/* Cards subtle */
.card {
  border-radius: 10px;
}

/* Header nav */
header .nav-link {
  color: #333;
}

header .nav-link.active {
  font-weight: 600;
}

/* Footer */
footer {
  font-size: 12px;
}

/* Winner Podium */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  margin: 6px 0 8px;
}
.podium .slot {
  text-align: center;
  padding: 15px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.65));
  box-shadow: 0 15px 11px rgba(35, 35, 35, 0.08);
  animation: popIn 420ms ease-out both, floatY 3.8s ease-in-out infinite;
  position: relative;
}
.podium .slot .avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  /* border: 2px solid #3ceb02f5; */
  
}
.podium .slot .badge-rank {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.podium .slot .medal {
  display: inline-block;
  font-size: 16px;
  margin-bottom: 4px;
}
.podium .slot .name {
  margin-top: 6px;
  font-size: 12px;
}
.podium .slot .time {
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 700;
}
.podium .first { border-top: 5px solid #FFD700; filter: drop-shadow(0 0 10px rgba(255,215,0,0.35)); }
.podium .second { border-top: 5px solid #C0C0C0; }
.podium .third { border-top: 5px solid #CD7F32; }

/* Different heights for podium feel */
.podium .first { transform-origin: center bottom; }
.podium .second { transform-origin: center bottom; }
.podium .third { transform-origin: center bottom; }

/* Tiered layout */
.podium .first { margin-bottom: 12px; }
.podium .second { margin-bottom: 6px; }
.podium .third { margin-bottom: 0; }

/* Royal shimmer on first */
.podium .first::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 5px; /* border width */
  background: linear-gradient(120deg, rgba(255,215,0,0.0), rgba(255, 217, 0, 0.589), rgba(255,215,0,0.0));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: shimmer 2.8s linear infinite;
}

@keyframes popIn {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes floatY {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

/* Mobile-first adjustments */
@media (max-width: 576px) {
  table.table {
    font-size: 4px; /* set a baseline; adjust as needed */
  }
  .col-index { width: 5%; }
  .col-pigeons { width: 5%; }
  .col-player { width: 40%; }
  .col-total { width: 10%; }
  .col-day, .col-period { width: auto; }
  .player-avatar { width: 12px; height: 12px; }
  .player-name { max-width: 100%; }
  .table td, .table th { padding: 2px 3px; }

  /* ========== Mobile (Non-table) ==========
     Header, cards, titles, contact page
     NOTE: Do NOT touch table-related selectors here */
  header.py-3.border-bottom.bg-light {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  header .h5.m-0 { font-size: 16px; }
  header .nav .nav-link { padding: 4px 8px; font-size: 12px; }

  /* Home cards */
  #list .card { border-radius: 12px; }
  #list .card .card-body { padding: 12px; gap: 6px; }
  #list .card .card-title { font-size: 16px; }
  #list .card .text-secondary { font-size: 11px; }
  .top-players-row { gap: 4px !important; }
  .top-players-row .badge { padding: 3px 6px; font-size: 11px; }
  #list .card .btn.btn-primary { padding: 6px 10px; font-size: 12px; }

  /* Tournament header title */
  #head { padding: 10px 0 10px; margin: 6px 0 8px; }
  #t-name { font-size: 50px; line-height: 2.5; }
  #t-meta { font-size: 4px; }

  /* Contact page */
  .contact-icon { width: 24px; height: 24px; font-size: 12px; }
  .poppins { font-size: 10px; }

  /* ========== Mobile Tabs Fix ========== */
  #daysBar {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: center;
    padding-bottom: 8px;
    margin: 0 -10px;
    scrollbar-width: none; /* Firefox */
  }
  #daysBar::-webkit-scrollbar { display: none; } /* Chrome/Safari */
  
  #daysOnly {
    gap: 6px;
    padding: 0 20px; /* more side padding */
  }
  
  #daysBar .btn {
    flex-shrink: 0;
    min-width: max-content;
    padding: 5px 10px;
    font-size: 11px;
    font-family: 'Noto Nastaliq Urdu', sans-serif;
    font-weight: 500;
    border: 1px solid rgba(103,58,183,0.2);
    margin: 0 4px; /* space between buttons */
  }
  
  #daysBar > .btn { /* Total button */
    margin: 0 4px 0 12px; /* more balanced spacing */
  }
}

/* Tablet */
@media (min-width: 577px) and (max-width: 768px) {
  table.table { font-size: 13px; }
  .player-name { max-width: 120px; }
  /* Use percentages on tablet too */
  .col-index { width: 7%; }
  .col-pigeons { width: 12%; }
  .col-player { width: 36%; }
  .col-total { width: 15%; }
  .col-day, .col-period { width: auto; }

  /* ========== Tablet (Non-table) ==========
     Header, cards, titles, contact page */
  header .h5.m-0 { font-size: 18px; }
  header .nav .nav-link { padding: 5px 9px; font-size: 13px; }
  #list .card .card-title { font-size: 18px; }
  #list .card .btn.btn-primary { padding: 7px 12px; font-size: 13px; }
  #t-name { font-size: 20px; }
}

/* =====================
   ULTIMATE AUTHORITY: Tournament title sizes
   (maximum specificity to override everything)
   ===================== */
body #head .title #t-name {
  font-size: 26px !important;
  line-height: 1.35 !important;
}
body #head #t-meta { font-size: 12px !important; }

@media (max-width: 576px) {
  body #head .title #t-name { font-size: 16px !important; }
  body #head #t-meta { font-size: 8px !important; }
}

@media (min-width: 992px) {
  body #head .title #t-name { font-size: 30px !important; }
  body #head #t-meta { font-size: 13px !important; }
}