body {
  font-family: "Plus Jakarta Sans", "Manrope", "Inter", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-rajdhani {
  font-family: "Oxanium", "Space Grotesk", sans-serif;
  letter-spacing: 0.01em;
}

/* --- Layout Stability Fixes --- */
.max-w-7xl,
.container {
  max-width: 1440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Ensure consistent spacing for hero and main sections */
.home-hero,
footer,
main {
  width: 100%;
  display: block;
  position: relative;
}

main {
  padding-bottom: 3rem;
}

/* Force centering on tournament and news listings */
.tour-listing,
.news-listing,
.matches-listing {
  width: 100%;
  margin: 0 auto;
  padding-block: 1rem !important; /* Further reduced padding for tighter layout */
}

/* Tournament listing specific adjustments for tighter spacing */
.tour-listing {
  padding-block: 1rem !important;
}

.tour-topbar {
  margin-bottom: 0.75rem !important;
}

.tour-subtitle {
  display: none !important; /* Hide the subtitle text */
}

.tour-primary-filters {
  gap: 0.25rem !important;
}

.tour-filter-block {
  margin-bottom: 0.25rem !important;
  padding-bottom: 0.2 rem !important;
  -webkit-backdrop-filter: blur(14px);
}

/* Reduce gap between filter chips */
.tour-chip-row {
  gap: 0.25rem !important;
}

footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
}

/* Expanded Grid Gaps */
.tour-grid,
.news-grid,
.matches-listing .grid,
.trn-main-grid {
  gap: 2.5rem !important;
}

.news-listing .grid {
  gap: 2.5rem !important;
}

.matches-listing .space-y-3 {
  gap: 1.5rem !important;
  display: flex;
  flex-direction: column;
}

.trn-left-col > .space-y-5 {
  gap: 1.5rem !important;
}

.gradient-text {
  background: linear-gradient(
    120deg,
    var(--accent-purple-light),
    var(--accent-cyan-light)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.clip-corner-tr {
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
}

.clip-corner-bl {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.esports-btn {
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.esports-btn-outline {
  clip-path: none;
}

.angular-card,
.card-border {
  background: rgba(8, 15, 26, 0.55);
  border: 1px solid var(--border-default);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.angular-card:hover,
.card-border:hover {
  border-color: var(--border-bright);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px);
}

html[data-theme="light"] .angular-card,
html[data-theme="light"] .card-border {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
}

.hero-bg {
  background:
    radial-gradient(
      circle at 18% 12%,
      rgba(59, 130, 246, 0.24),
      transparent 44%
    ),
    radial-gradient(
      circle at 86% 83%,
      rgba(139, 92, 246, 0.2),
      transparent 42%
    ),
    linear-gradient(145deg, #071423 0%, #0f1f33 48%, #1d2f45 100%);
  position: relative;
  overflow: hidden;
}

html[data-theme="light"] .hero-bg {
  background:
    radial-gradient(
      circle at 18% 12%,
      rgba(59, 130, 246, 0.12),
      transparent 44%
    ),
    radial-gradient(
      circle at 86% 83%,
      rgba(139, 92, 246, 0.1),
      transparent 42%
    ),
    linear-gradient(145deg, #f8fbff 0%, #f0f6ff 48%, #eef4fd 100%);
}

.hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(148, 163, 184, 0.28) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.42;
}

.hex-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg width='56' height='56' viewBox='0 0 56 56' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M28 4 L47 14.5 L47 35.5 L28 46 L9 35.5 L9 14.5 Z' fill='none' stroke='%2394a3b8' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 56px 56px;
  pointer-events: none;
}

.nav-link {
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
  text-decoration: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
  transition: width 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.theme-toggle {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.55rem;
  border: 1px solid var(--border-default);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.theme-toggle:hover {
  border-color: var(--border-bright);
  background: rgba(148, 163, 184, 0.16);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-purple-light);
  outline-offset: 2px;
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: inline-block;
}

.theme-toggle-sm {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.notif-badge {
  min-width: 1rem;
  padding-inline: 0.25rem;
}

.notif-dropdown {
  z-index: 10001;
  width: min(22rem, calc(100vw - 1.5rem));
}

.notif-dropdown-meta {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
}

.notif-dropdown-list {
  overscroll-behavior: contain;
}

.notif-action-btn,
.notif-retry-btn {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.notif-retry-btn {
  margin-top: 0.5rem;
  color: #93c5fd;
  font-size: 0.8rem;
}

.notif-retry-btn:hover,
.notif-retry-btn:focus-visible {
  color: #dbeafe;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.85);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.notif-item:hover,
.notif-item:focus-visible {
  background: rgba(37, 99, 235, 0.12);
  outline: none;
}

.notif-item:last-child {
  border-bottom: 0;
}

.notif-item--read {
  opacity: 0.8;
}

.notif-item-dot {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.4rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.notif-item--unread .notif-item-dot {
  background: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.notif-item-body {
  min-width: 0;
  flex: 1;
}

.notif-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.notif-item-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.35;
}

.notif-item--read .notif-item-title {
  font-weight: 500;
  color: #cbd5e1;
}

.notif-item-message {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-time {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: #64748b;
  white-space: nowrap;
}

.notif-item-link {
  flex-shrink: 0;
  align-self: center;
  color: #60a5fa;
  font-size: 0.8rem;
}

.notif-mark-read {
  flex-shrink: 0;
  align-self: center;
  background: none;
  border: none;
  color: #60a5fa;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  line-height: 1;
  border-radius: 0.25rem;
  transition:
    color 0.15s,
    background 0.15s;
  margin-left: 0.25rem;
}
.notif-mark-read:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

html[data-theme="light"] .notif-dropdown {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.3);
}

html[data-theme="light"] .notif-dropdown-meta,
html[data-theme="light"] .notif-item-message,
html[data-theme="light"] .notif-item-time {
  color: #64748b;
}

html[data-theme="light"] .notif-item-title {
  color: #0f172a;
}

html[data-theme="light"] .notif-item--read .notif-item-title {
  color: #334155;
}

@media (max-width: 767px) {
  .notif-dropdown {
    position: fixed;
    top: 4.5rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-height: calc(100vh - 6rem);
  }
}

/* Logo icon styling */
.logo-icon {
  color: white;
}

html[data-theme="light"] .logo-icon {
  color: white;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-anim 1.5s ease-in-out infinite;
}

@keyframes pulse-anim {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid;
  margin-bottom: 0.5rem;
}

.alert-success {
  background: var(--st-success-bg);
  border-color: var(--st-success-brd);
  color: var(--st-success);
}

.alert-error {
  background: var(--st-error-bg);
  border-color: var(--st-error-brd);
  color: var(--st-error);
}

.alert-warning {
  background: var(--st-warning-bg);
  border-color: var(--st-warning-brd);
  color: var(--st-warning);
}

.alert-info {
  background: var(--st-info-bg);
  border-color: var(--st-info-brd);
  color: var(--st-info);
}

html[data-theme="light"] #userMenuDropdown {
  background: var(--bg-secondary) !important;
  border-color: var(--border-default) !important;
  box-shadow: 0 20px 34px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] #userMenuDropdown .border-slate-800 {
  border-color: rgba(15, 23, 42, 0.09) !important;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.42);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.62);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-110%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-110%);
  }
}

@keyframes toast-bar {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-default);
  border-left: 3px solid;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.26);
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  overflow: hidden;
  min-width: 260px;
  background: var(--bg-card);
}

.toast.hiding {
  animation: toast-out 0.3s ease-in both;
}

.toast-icon {
  font-size: 1.1rem;
  margin-top: 0.05rem;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  font-size: 1.1rem;
  opacity: 0.5;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: opacity 0.15s;
  padding: 0 2px;
}

.toast-close:hover {
  opacity: 1;
}

.toast-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  animation: toast-bar 4.5s linear forwards;
}

.toast-success {
  background: var(--st-success-bg);
  border-color: var(--st-success-brd);
}

.toast-success .toast-icon {
  color: var(--st-success-dark);
}

.toast-success .toast-bar {
  background: var(--st-success-dark);
}

.toast-error {
  background: var(--st-error-bg);
  border-color: var(--st-error-brd);
}

.toast-error .toast-icon {
  color: var(--st-error-dark);
}

.toast-error .toast-bar {
  background: var(--st-error-dark);
}

.toast-warning {
  background: var(--st-warning-bg);
  border-color: var(--st-warning-brd);
}

.toast-warning .toast-icon {
  color: var(--st-warning-dark);
}

.toast-warning .toast-bar {
  background: var(--st-warning-dark);
}

.toast-info {
  background: var(--st-info-bg);
  border-color: var(--st-info-brd);
}

.toast-info .toast-icon {
  color: var(--st-info-dark);
}

.toast-info .toast-bar {
  background: var(--st-info-dark);
}

html[data-theme="light"] .toast {
  background: var(--bg-secondary);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .toast-success {
  background: var(--st-success-bg);
  border-color: var(--st-success-brd);
}

html[data-theme="light"] .toast-error {
  background: var(--st-error-bg);
  border-color: var(--st-error-brd);
}

html[data-theme="light"] .toast-warning {
  background: var(--st-warning-bg);
  border-color: var(--st-warning-brd);
}

/* Navbar & Footer Branding: consistent white text in dark theme */
#mainNav .font-rajdhani,
footer .font-rajdhani.font-bold {
  letter-spacing: 0.03em;
  color: #ffffff;
}

html[data-theme="light"] #mainNav .font-rajdhani,
html[data-theme="light"] footer .font-rajdhani.font-bold {
  color: var(--text-primary);
}

#mainNav .gradient-text,
footer .gradient-text {
  font-size: 1.15em;
}

/* Navbar active-page indicator */
.nav-link[aria-current="page"],
.nav-link.is-active {
  color: var(--accent-purple) !important;
}

.nav-link[aria-current="page"]::after,
.nav-link.is-active::after {
  width: 100% !important;
}

/* Notif badge */
.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  background: var(--accent-purple);
  color: #fff;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg-primary);
}

/* Improved card-border — cleaner, less translucent */
.card-border {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 0.875rem !important;
  box-shadow: 0 2px 12px rgba(2, 6, 23, 0.18) !important;
  transition:
    border-color 0.2s,
    box-shadow 0.22s,
    transform 0.22s !important;
}

.card-border:hover {
  border-color: var(--teal-border-md) !important;
  box-shadow: 0 12px 36px rgba(59, 130, 246, 0.09) !important;
  transform: translateY(-2px) !important;
}

html[data-theme="light"] .card-border {
  background: #fff !important;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07) !important;
}

html[data-theme="light"] .card-border:hover {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1) !important;
}

/* Footer links — use teal instead of purple */
footer a {
  color: var(--text-muted);
  transition: color 0.18s;
}

footer a:hover {
  color: var(--accent-purple);
}

footer .gradient-text {
  font-size: 1.05em;
}

/* Page-level ambient glow (subtle) */
body::before {
  content: "";
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 400px;
  background: radial-gradient(
    ellipse at center,
    rgba(59, 130, 246, 0.07) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

html[data-theme="light"] body::before {
  opacity: 0.4;
}

/* Ensure main content is above the ambient glow */
#mainNav,
main,
footer {
  position: relative;
  z-index: 1;
}

/* Section dividers */
.v-section {
  padding: 3rem 0;
}

.v-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.v-section-title {
  font-family: "Oxanium", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.v-section-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Page width container */
.v-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 768px) {
  .v-container {
    padding: 0 1rem;
  }
}

/* Spacing utility */
.v-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.v-stack-sm {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.v-stack-lg {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Truncate utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Keyboard focus ring */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
}

/* â”€â”€ Home section headers (matching old home-section-head) â”€â”€ */
.home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.home-section-title {
  font-family: "Oxanium", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.home-section-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* â”€â”€ Vercel-style input group â”€â”€ */
.v-search-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.v-search-input {
  flex: 1;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  background: var(--form-input-bg);
  border: 1px solid var(--form-input-border);
  border-radius: 0.625rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
  outline: none;
}

.v-search-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.v-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

/* â”€â”€ chip-style filter pills (used on tournament page) â”€â”€ */
.tour-chip-link.is-active {
  background: var(--teal-glow-sm) !important;
  border-color: var(--teal-border-md) !important;
  color: var(--accent-purple) !important;
}

/* â”€â”€ Responsive grid for feature cards â”€â”€ */
.feature-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

html[data-theme="light"] .toast-info {
  background: var(--st-info-bg);
  border-color: var(--st-info-brd);
}

/* --- CSP-safe Hover Styles --- */
.feedback-btn-hover:hover {
  border-color: #06b6d4 !important;
  background: var(--form-input-bg) !important;
}

.bug-report-btn-hover:hover {
  border-color: #ef4444 !important;
  background: var(--form-input-bg) !important;
}
