/* ==========================================================================
   ChessResults.com.in - Elite Modern Stylesheet
   ========================================================================== */

:root {
  --bg-page: #0b1120;
  --bg-card: #151f32;
  --bg-surface: #1e293b;
  --bg-surface-hover: #293548;
  --border-subtle: #243046;
  --border-strong: #334155;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --brand-primary: #38bdf8;
  --brand-primary-hover: #0284c7;
  --brand-accent: #6366f1;
  --brand-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  
  --badge-live: #ef4444;
  --badge-win: #10b981;
  --badge-draw: #f59e0b;
  --badge-loss: #f43f5e;
  
  --table-stripe: rgba(255, 255, 255, 0.015);
  --table-hover: rgba(56, 189, 248, 0.06);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;
  
  --brand-primary: #0284c7;
  --brand-primary-hover: #0369a1;
  --brand-accent: #4f46e5;
  --brand-gradient: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  
  --table-stripe: #f8fafc;
  --table-hover: #e0f2fe;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}

/* Light Mode Overrides for High Contrast & Flawless Legibility */
[data-theme="light"] .cr-topbar {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
[data-theme="light"] .cr-topbar .topbar-tool-link {
  color: #334155 !important;
}
[data-theme="light"] .cr-topbar .topbar-tool-link:hover {
  color: #0284c7 !important;
}
[data-theme="light"] .cr-langs a {
  color: #334155 !important;
}
[data-theme="light"] .cr-langs a:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
[data-theme="light"] .cr-fontsize-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
[data-theme="light"] .site-header {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}
[data-theme="light"] .nav-link {
  color: #334155 !important;
}
[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
  color: #0284c7 !important;
  background: #f1f5f9 !important;
}
[data-theme="light"] .theme-toggle-btn {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
[data-theme="light"] .theme-toggle-btn:hover {
  background: #e2e8f0 !important;
  border-color: #0284c7 !important;
}
[data-theme="light"] .mobile-menu-btn {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
[data-theme="light"] .pro-table,
[data-theme="light"] .data-table,
[data-theme="light"] .table {
  color: #0f172a !important;
}
[data-theme="light"] th {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #e2e8f0 !important;
}
[data-theme="light"] td {
  border-color: #f1f5f9 !important;
  color: #0f172a !important;
}
[data-theme="light"] .main-search-input,
[data-theme="light"] .custom-select,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="search"],
[data-theme="light"] select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
[data-theme="light"] .btn-surface {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
[data-theme="light"] .btn-surface:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
}
[data-theme="light"] .filter-chip {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}
[data-theme="light"] .filter-chip:hover,
[data-theme="light"] .filter-chip.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}
[data-theme="light"] .cr-welcome-banner {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
[data-theme="light"] .table-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
[data-theme="light"] .nav-links {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
[data-theme="light"] .cr-modal-box {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   Header & Navbar
   ========================================================================== */
.site-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  width: 100%;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  position: relative;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.brand-name {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 3px;
  list-style: none;
  white-space: nowrap;
  margin: 0;
  padding: 0;
}

.nav-link {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  white-space: nowrap !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover, .nav-link.active {
  color: #38bdf8 !important;
  background: var(--bg-surface);
  font-weight: 700;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--brand-primary);
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.theme-toggle-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

.theme-icon {
  font-size: 13px;
  line-height: 1;
}

.theme-label {
  font-size: 11.5px;
  letter-spacing: 0.2px;
}

.topbar-tool-link {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
  transition: color 0.15s ease;
}
.topbar-tool-link:hover {
  color: #38bdf8;
}

.nav-link.live-link {
  color: var(--badge-live);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap !important;
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--badge-live);
  box-shadow: 0 0 10px var(--badge-live);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.nav-actions .btn {
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
}

.btn-surface {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-surface:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.theme-btn {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  font-size: 16px;
}

/* ==========================================================================
   Hero & Search Section
   ========================================================================== */
.hero-section {
  padding: 40px 0 24px 0;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, transparent 100%);
}

.hero-content {
  text-align: center;
  max-width: 840px;
  margin: 0 auto 32px auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.hero-heading {
  font-size: 38px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-subheading {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.main-search-wrapper {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.main-search-input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  font-size: 15px;
  box-shadow: var(--shadow-card);
  outline: none;
  transition: all 0.2s ease;
}

.main-search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2), var(--shadow-card);
}

.search-leading-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-dim);
}

/* ==========================================================================
   Live & Trending Tournaments Grid
   ========================================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-caption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tournaments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.t-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.t-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.25);
}

.t-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.t-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-live {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-finished {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-upcoming {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.t-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}

.t-card-title a:hover {
  color: var(--brand-primary);
}

.t-card-location {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.t-card-meta-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--bg-surface);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: auto;
  font-size: 12px;
}

.t-card-meta-item {
  display: flex;
  flex-direction: column;
}

.t-meta-k {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.t-meta-v {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Filter & Tabs Bar
   ========================================================================== */
.filter-tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.filter-tabs-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-chip:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
  margin-bottom: 40px;
}

.pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.pro-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.pro-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.pro-table tr:nth-child(even) td {
  background-color: var(--table-stripe);
}

.pro-table tr:hover td {
  background-color: var(--table-hover);
}

/* Badges */
.badge-gm {
  background: #ea580c;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.badge-im {
  background: #0284c7;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.badge-fm, .badge-wgm {
  background: #7c3aed;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.badge-cm, .badge-wim, .badge-wfm, .badge-wcm {
  background: #059669;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.badge-res {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  min-width: 58px;
}

.res-1-0 {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.res-draw {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.res-0-1 {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.res-live {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 24px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
}

/* ==========================================================================
   Classic Chess-Results Two-Tier Navigation Menu Bar
   ========================================================================== */
.cr-topbar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 16px;
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cr-langs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.cr-langs a {
  color: #94a3b8;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cr-langs a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.cr-langs a.active {
  background: #0284c7;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] .cr-menu-items {
  direction: rtl;
}
html[dir="rtl"] .cr-submenu {
  direction: rtl;
}
.cr-fontsize-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #475569;
  color: #cbd5e1;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.cr-fontsize-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
}
.cr-fontsize-btn.active {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .cr-fontsize-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}
[data-theme="light"] .cr-fontsize-btn:hover {
  background: #e2e8f0;
  color: #0284c7;
  border-color: #0284c7;
}
[data-theme="light"] .cr-fontsize-btn.active {
  background: #0284c7 !important;
  border-color: #0369a1 !important;
  color: #ffffff !important;
}

/* Level 1: Main Menu */
.cr-main-menu {
  background: #1e3a8a;
  border-bottom: 2px solid #f59e0b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  flex-wrap: wrap;
  gap: 4px;
}
.cr-menu-items {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cr-menu-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap !important;
}
.cr-menu-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
.cr-menu-link.active {
  background: #60a5fa !important;
  color: #0f172a !important;
  font-weight: 800;
}
.cr-menu-badges {
  display: flex;
  gap: 6px;
  padding: 6px 0;
}
.cr-badge-green {
  background: #15803d;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid #166534;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cr-badge-green:hover {
  background: #16a34a;
  color: #fff;
}

/* Level 2: Submenu (Tournament Database submenu) */
.cr-submenu {
  background: #0f2744;
  border-bottom: 1px solid #334155;
  display: flex;
  padding: 0 16px;
  overflow-x: auto;
  list-style: none;
  margin: 0;
}
.cr-sub-link {
  display: inline-block;
  padding: 8px 14px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  cursor: pointer;
}
.cr-sub-link:hover, .cr-sub-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #38bdf8;
}

/* Modal styling for Menu popups */
.cr-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}
.cr-modal-overlay.modal-active {
  display: flex !important;
}
.cr-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 950px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.modal-chip:hover, .modal-chip.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-question {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-question:hover {
  color: var(--brand-primary);
}
.faq-answer {
  padding: 0 18px 14px 18px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-links a:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .hero-heading { font-size: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .hero-heading { font-size: 24px; }
  .tournaments-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ==========================================================================
   Upcoming Tournament Calendar & Live Countdowns
   ========================================================================== */
.upcoming-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.upcoming-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
}
.upcoming-banner {
  height: 4px;
  width: 100%;
}
.countdown-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
}
.countdown-box.cd-live {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
  justify-content: center;
  font-size: 13px;
  gap: 8px;
}
.cd-digit-block {
  text-align: center;
  flex: 1;
}
.cd-num {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #38bdf8;
  display: block;
  line-height: 1.1;
}
.cd-lbl {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cd-sep {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 2px;
}
.badge-tz {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Editorial News & Blog Components
   ========================================================================== */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.news-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}
.news-badge-strip {
  height: 4px;
  width: 100%;
}
.news-badge-strip.badge-red { background: linear-gradient(90deg, #ef4444, #f87171); }
.news-badge-strip.badge-blue { background: linear-gradient(90deg, #38bdf8, #60a5fa); }
.news-badge-strip.badge-purple { background: linear-gradient(90deg, #a855f7, #c084fc); }
.news-badge-strip.badge-green { background: linear-gradient(90deg, #10b981, #34d399); }
.news-badge-strip.badge-amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.news-badge-strip.badge-teal { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }

.news-tag {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.cr-live-clock-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-family: var(--font-mono);
}


/* Clean Enterprise Status Dots (Replaces Emojis) */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot-live { background-color: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.dot-finished { background-color: #38bdf8; }
.dot-upcoming { background-color: #f59e0b; }

/* Highlighted 'Play Chess' Navigation Button Across Header & Menus */
.cr-menu-link.play-chess-highlight {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
}
.cr-menu-link.play-chess-highlight:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
  color: #ffffff !important;
}

.nav-link.play-chess-highlight {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  padding: 4px 8px !important;
  border-radius: 5px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4) !important;
  transition: all 0.2s ease;
}
.nav-link.play-chess-highlight:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.7) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

@keyframes pulse-emerald {
  0% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.35); }
  50% { box-shadow: 0 0 14px rgba(16, 185, 129, 0.65); }
  100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.35); }
}

.play-badge-pill {
  background: #ffffff;
  color: #065f46;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

/* Header & Menu Responsive Constraints (Prevents horizontal overflow on all screen sizes) */
@media (max-width: 1360px) {
  .nav-links { gap: 2px !important; }
  .nav-link { padding: 4px 6px !important; font-size: 11.5px !important; }
  .brand-link img { height: 36px !important; }
}

@media (max-width: 1140px) {
  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .nav-links {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 2px solid var(--border-strong);
    flex-direction: column;
    padding: 12px 16px;
    gap: 6px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    max-height: 82vh;
    overflow-y: auto;
  }
  .nav-links.mobile-open {
    display: flex !important;
    animation: slideDownMenu 0.2s ease-out;
  }
  .nav-links li {
    width: 100%;
  }
  .nav-link {
    width: 100%;
    padding: 10px 14px !important;
    font-size: 14px !important;
    border-radius: var(--radius-sm);
    justify-content: flex-start;
  }
}

@keyframes slideDownMenu {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .cr-topbar {
    padding: 4px 10px;
    font-size: 10px;
    gap: 6px;
  }
  .nav-container {
    height: 58px;
    padding: 0 12px;
  }
  .brand-link img {
    height: 32px !important;
  }
  .theme-toggle-btn {
    padding: 4px 9px;
    font-size: 11px;
  }
  .theme-label {
    display: none;
  }
  .mobile-menu-btn {
    padding: 5px 10px;
    font-size: 16px;
  }
}


