/* Pro Tourny – Frontend styles */
:root {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --text: #1a2332;
  --text-muted: #5c6b7c;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --green: #059669;
  --green-bg: #d1fae5;
  --purple: #7c3aed;
  --purple-bg: #ede9fe;
  --yellow: #d97706;
  --yellow-bg: #fef3c7;
  --live-red: #dc2626;
  --live-glow: rgba(220, 38, 38, 0.35);
  --ai-violet: #6d28d9;
  --ai-glow: rgba(109, 40, 217, 0.25);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --font: "Outfit", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  /* Shared header / logo (welcome + app shell) */
  --header-logo-size: 60px;
  --header-logo-radius: 14px;
  --footer-logo-size: 56px;
  --header-bar-pad-y: 1.05rem;
  --header-bar-pad-x: 1.5rem;
}

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

/* Prevent layout blowout on phones / tablets */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.dashboard-body,
.draws-body,
.start-tournament-body,
body.pt-bootstrap {
  overflow-x: hidden;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ----- Header ----- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 6px 28px rgba(15, 23, 42, 0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--header-bar-pad-y) var(--header-bar-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.logo-icon {
  width: var(--header-logo-size);
  height: var(--header-logo-size);
  flex-shrink: 0;
  background-color: #fff;
  background-image: url("public/PRO_TOURNY_LOGO.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border-radius: var(--header-logo-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* Custom site logo image (injected from site settings) */
.logo .site-logo-header-img,
.dash-logo .site-logo-header-img,
.td-logo-button .site-logo-header-img,
.td-brand-logo.site-logo-header-img {
  height: var(--header-logo-size);
  width: auto;
  max-width: min(200px, 42vw);
  object-fit: contain;
  display: block;
  border-radius: var(--header-logo-radius);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.05);
  background: #fff;
}

.logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.logo-title {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-ghost:hover {
  background: rgba(37, 99, 235, 0.08);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-green {
  color: var(--green);
  border-color: var(--green);
}

.btn-green:hover { background: var(--green-bg); }

.btn.btn-green {
  background: var(--green);
  color: white;
  border: none;
}

.btn-small { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ----- Hero ----- */
.hero {
  position: relative;
  padding: 4rem 1.5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #e0e7ff 0%, #f0f4f8 45%, #fef3c7 100%);
  opacity: 0.9;
}

.hero-content {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-muted);
  box-shadow: var(--shadow);
}

.stat-icon { font-size: 1rem; }

.stat-green {
  color: var(--green);
  border: 1px solid var(--green);
  background: var(--green-bg);
}

.stat-purple {
  color: var(--purple);
  border: 1px solid var(--purple);
  background: var(--purple-bg);
}

/* ----- Welcome: Canvas 2 + optional AI mode (index only) ----- */
body.welcome-page {
  background: linear-gradient(180deg, #e6edf6 0%, var(--bg) 24%, var(--bg) 100%);
}

body.welcome-page.ai-mode {
  background: linear-gradient(180deg, #ece8fb 0%, #e5eaf4 32%, var(--bg) 72%);
}

body.welcome-page .header--welcome {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 10px 36px rgba(15, 23, 42, 0.07);
}

body.welcome-page.ai-mode .header--welcome {
  border-bottom-color: rgba(109, 40, 217, 0.16);
  box-shadow: 0 4px 32px rgba(99, 102, 241, 0.09);
}

.hero.hero--canvas2 {
  isolation: isolate;
}

.hero.hero--canvas2 .hero-bg {
  z-index: 0;
  opacity: 0.96;
  background: linear-gradient(156deg, #d8e2ff 0%, #eef2f7 40%, #fdf4e4 100%);
}

.hero.hero--canvas2::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.88;
  background:
    radial-gradient(ellipse 88% 58% at 12% -8%, rgba(37, 99, 235, 0.24), transparent 56%),
    radial-gradient(ellipse 72% 52% at 94% 6%, rgba(124, 58, 237, 0.2), transparent 52%),
    radial-gradient(ellipse 58% 48% at 50% 104%, rgba(5, 150, 105, 0.14), transparent 50%),
    conic-gradient(
      from 200deg at 42% 48%,
      rgba(37, 99, 235, 0.06),
      transparent 35%,
      rgba(124, 58, 237, 0.07),
      transparent 70%,
      rgba(5, 150, 105, 0.05),
      transparent 92%
    );
  animation: welcome-canvas2-mesh 24s ease-in-out infinite alternate;
}

body.welcome-page.ai-mode .hero.hero--canvas2::before {
  opacity: 1;
  animation-duration: 11s;
}

.hero.hero--canvas2::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
}

.hero-sports-decor {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.hero-sports-decor[hidden] {
  display: none !important;
}

.hero-sport {
  position: absolute;
  font-size: clamp(1.35rem, 3.8vw, 2.6rem);
  line-height: 1;
  opacity: 0;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.18));
  will-change: transform, opacity;
  --drift-x: 12vw;
  --drift-y: -10vh;
  animation: welcome-sport-drift 10s ease-in-out infinite;
}

.hero-sport--1 {
  left: 6%;
  top: 22%;
  --drift-x: 20vw;
  --drift-y: -14vh;
  animation-duration: 9.5s;
  animation-delay: 0s;
}

.hero-sport--2 {
  left: 78%;
  top: 18%;
  --drift-x: -16vw;
  --drift-y: 16vh;
  animation-duration: 11s;
  animation-delay: 1.1s;
}

.hero-sport--3 {
  left: 14%;
  top: 62%;
  --drift-x: 28vw;
  --drift-y: 8vh;
  animation-duration: 8.5s;
  animation-delay: 2.4s;
}

.hero-sport--4 {
  right: 8%;
  top: 48%;
  left: auto;
  --drift-x: -22vw;
  --drift-y: -12vh;
  animation-duration: 10.2s;
  animation-delay: 3.2s;
}

.hero-sport--5 {
  left: 42%;
  top: 12%;
  --drift-x: -10vw;
  --drift-y: 22vh;
  animation-duration: 12s;
  animation-delay: 0.7s;
}

.hero-sport--6 {
  left: 52%;
  top: 68%;
  --drift-x: 14vw;
  --drift-y: -18vh;
  animation-duration: 9s;
  animation-delay: 4.5s;
}

.hero-sport--7 {
  top: 72%;
  right: 4%;
  left: auto;
  --drift-x: -18vw;
  --drift-y: -8vh;
  animation-duration: 10.8s;
  animation-delay: 2s;
}

.hero-sport--8 {
  left: 34%;
  top: 42%;
  --drift-x: -24vw;
  --drift-y: 14vh;
  animation-duration: 11.5s;
  animation-delay: 5.3s;
}

@keyframes welcome-sport-drift {
  0% {
    opacity: 0;
    transform: translate3d(0, 12px, 0) rotate(-18deg) scale(0.82);
  }
  6% {
    opacity: 0;
  }
  12% {
    opacity: 0.88;
  }
  28% {
    opacity: 0.88;
  }
  38% {
    opacity: 0;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x), var(--drift-y), 0) rotate(22deg) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-sport {
    animation: none !important;
    opacity: 0 !important;
  }
}

body.welcome-page.ai-mode .hero.hero--canvas2::after {
  opacity: 0.42;
}

@keyframes welcome-canvas2-mesh {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    transform: translate(2.5%, 3.5%) rotate(5deg) scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero.hero--canvas2::before {
    animation: none;
  }
  body.welcome-page.ai-mode .hero.hero--canvas2::before {
    animation: none;
  }
}

/* ----- Registration flow: mesh canvas + glass (event picker, register, thank you) ----- */
body.registration-canvas-flow {
  position: relative;
  background: linear-gradient(180deg, #ece8fb 0%, #e5eaf4 30%, var(--bg) 62%, var(--bg) 100%);
}

.reg-flow-canvas-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.reg-flow-canvas-bg__mesh {
  position: absolute;
  inset: -42%;
  opacity: 0.94;
  background:
    radial-gradient(ellipse 88% 58% at 12% -8%, rgba(37, 99, 235, 0.22), transparent 56%),
    radial-gradient(ellipse 72% 52% at 94% 6%, rgba(124, 58, 237, 0.18), transparent 52%),
    radial-gradient(ellipse 58% 48% at 50% 104%, rgba(5, 150, 105, 0.12), transparent 50%),
    conic-gradient(
      from 200deg at 42% 48%,
      rgba(37, 99, 235, 0.06),
      transparent 35%,
      rgba(124, 58, 237, 0.07),
      transparent 70%,
      rgba(5, 150, 105, 0.05),
      transparent 92%
    );
  animation: reg-flow-mesh-drift 20s ease-in-out infinite alternate;
}

.reg-flow-canvas-bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.36;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='rg'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23rg)'/%3E%3C/svg%3E");
}

@keyframes reg-flow-mesh-drift {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    transform: translate(2.2%, 3.2%) rotate(4.5deg) scale(1.035);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reg-flow-canvas-bg__mesh {
    animation: none;
  }
}

body.registration-canvas-flow > header,
body.registration-canvas-flow > main {
  position: relative;
  z-index: 1;
}

body.registration-canvas-flow .dash-header {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid rgba(109, 40, 217, 0.14);
  box-shadow: 0 4px 28px rgba(99, 102, 241, 0.08);
}

body.registration-canvas-flow .dash-tagline {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(37, 99, 235, 0.14));
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: #5b21b6;
  box-shadow: 0 1px 12px rgba(99, 102, 241, 0.12);
}

body.registration-canvas-flow .dash-section {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 4px 28px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.registration-canvas-flow .dash-table thead {
  background: rgba(241, 245, 249, 0.88);
}

body.registration-canvas-flow .dash-table tbody tr:hover {
  background: rgba(248, 250, 252, 0.92);
}

body.registration-canvas-flow .register-page-main {
  background: transparent;
}

body.registration-canvas-flow .draws-card {
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 4px 26px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.registration-canvas-flow .draws-card-title {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.5));
  border-bottom-color: rgba(99, 102, 241, 0.1);
}

body.registration-canvas-flow .reg-fieldset {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(99, 102, 241, 0.14);
  box-shadow: 0 2px 16px rgba(99, 102, 241, 0.06);
}

body.registration-canvas-flow .thankyou-card {
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 8px 40px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(99, 102, 241, 0.08) inset;
}

body.registration-canvas-flow .thankyou-icon {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.25), rgba(37, 99, 235, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #047857;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.2);
}

.hero.hero--canvas2 .hero-content {
  position: relative;
  z-index: 3;
}

body.welcome-page.ai-mode .hero-title {
  background: linear-gradient(104deg, #0f172a 0%, var(--primary) 36%, #6366f1 62%, var(--ai-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.welcome-page .hero-desc {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.welcome-page .hero-stats .stat:not(.stat-green):not(.stat-purple) {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 22px rgba(15, 23, 42, 0.07);
}

body.welcome-page .hero-stats .stat.stat-green {
  background: rgba(209, 250, 229, 0.88);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  box-shadow: 0 4px 22px rgba(5, 150, 105, 0.08);
}

body.welcome-page .hero-stats .stat.stat-purple {
  background: rgba(237, 233, 254, 0.88);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  box-shadow: 0 4px 22px rgba(124, 58, 237, 0.1);
}

body.welcome-page.ai-mode .hero-stats .stat:not(.stat-green):not(.stat-purple) {
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: 0 6px 26px rgba(99, 102, 241, 0.12);
}

body.welcome-page.ai-mode .hero-stats .stat.stat-green {
  box-shadow: 0 6px 26px rgba(5, 150, 105, 0.14);
}

body.welcome-page.ai-mode .hero-stats .stat.stat-purple {
  box-shadow: 0 6px 26px rgba(124, 58, 237, 0.14);
}

body.welcome-page.ai-mode .logo-icon {
  box-shadow: 0 4px 20px rgba(109, 40, 217, 0.28);
}

body.welcome-page.ai-mode main {
  position: relative;
}

body.welcome-page.ai-mode main::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: min(55vh, 520px);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(109, 40, 217, 0.07), transparent 55%);
}

body.welcome-page.ai-mode .hero.hero--canvas2,
body.welcome-page.ai-mode .tabs-section,
body.welcome-page.ai-mode .features,
body.welcome-page.ai-mode .reviews-section,
body.welcome-page.ai-mode .partners-section {
  position: relative;
  z-index: 1;
}

/* ----- Tabs ----- */
.tabs-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.tabs-above {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tabs-above .location-display:empty {
  display: none;
}

.tabs-above .tabs-wrap--center {
  justify-content: flex-end;
}

.location-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.location-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.location-label::before {
  content: "📍 ";
}

.tabs-wrap {
  display: flex;
  gap: 0.25rem;
}

.tabs-wrap--center {
  justify-content: center;
}

.tab {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tab:hover {
  background: #f8fafc;
  color: var(--text);
}

.tab-active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tabs-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  min-height: 120px;
  box-shadow: var(--shadow);
}

body.welcome-page .tabs-content {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 10px 40px rgba(15, 23, 42, 0.08),
    0 0 90px rgba(37, 99, 235, 0.06);
}

body.welcome-page.ai-mode .tabs-content {
  border-color: rgba(109, 40, 217, 0.18);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.58) inset,
    0 14px 48px rgba(15, 23, 42, 0.11),
    0 0 120px rgba(109, 40, 217, 0.14);
}

body.welcome-page .tabs-above {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

body.welcome-page.ai-mode .tab-active {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 50%, var(--ai-violet) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.38);
}

body.welcome-page.ai-mode .tab:hover:not(.tab-active) {
  background: rgba(237, 233, 254, 0.55);
  border-color: rgba(109, 40, 217, 0.12);
}

.tabs-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

/* ----- Tournaments table ----- */
.tournaments-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tournaments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tournaments-table th,
.tournaments-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  background-clip: padding-box;
}

.tournaments-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: #f8fafc;
  vertical-align: bottom;
}

.tournaments-table tbody td {
  vertical-align: top;
  background-color: var(--surface, #fff);
}

.tournaments-table .th-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: none;
  color: var(--text-muted);
}

.tournaments-table tbody tr:hover td {
  background-color: #f1f5f9;
}

body.welcome-page.ai-mode .tournaments-table thead th {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(248, 250, 252, 0.94));
  color: rgba(51, 65, 85, 0.95);
}

body.welcome-page.ai-mode .tournaments-table tbody tr:hover td {
  background-color: rgba(237, 233, 254, 0.55);
}

.tournaments-table .th-action,
.tournaments-table .td-action:not(.td-action-stack) {
  white-space: nowrap;
  width: 1%;
}

.tournaments-table .td-action.td-action-stack {
  white-space: normal;
  vertical-align: top;
  width: auto;
  min-width: 8.5rem;
}

.tournaments-table .td-action-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.tournaments-table .td-action-stack .btn {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}

.tournaments-table .th-poster,
.tournaments-table .td-poster {
  min-width: 4.75rem;
  max-width: 7rem;
  text-align: center;
  vertical-align: top;
  border-left: 1px solid #e2e8f0;
}

.td-poster-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  margin: 0 auto;
  max-width: 7rem;
}

.td-poster-contact {
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  color: var(--text-muted);
}

.td-poster-contact-line .td-poster-contact-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.td-poster-contact-line + .td-poster-contact-line {
  margin-top: 0.35rem;
}

.td-poster-contact--empty {
  font-size: 0.8rem;
}

.tournaments-table .td-email-link {
  color: var(--primary);
  text-decoration: none;
  word-break: break-word;
}

.tournaments-table .td-email-link:hover {
  text-decoration: underline;
}

.tournaments-table .th-stat,
.tournaments-table .td-stat {
  text-align: center;
  white-space: nowrap;
  width: 4.5rem;
  font-variant-numeric: tabular-nums;
}

.tournaments-table .th-phone,
.tournaments-table .td-phone {
  max-width: 9.5rem;
  font-size: 0.88rem;
  word-break: break-word;
}

.tournaments-table .td-phone-link {
  color: var(--primary);
  text-decoration: none;
}

.tournaments-table .td-phone-link:hover {
  text-decoration: underline;
}

.tournaments-table .td-venue-cell {
  vertical-align: top;
  max-width: 14rem;
}

.tournaments-table .td-venue-line {
  line-height: 1.35;
}

.tournaments-table .td-venue-link {
  margin-top: 0.35rem;
  font-size: 0.88rem;
}

.tournaments-table .td-venue-map-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.tournaments-table .td-venue-map-link:hover {
  text-decoration: underline;
}

.tournaments-table .td-venue-pin {
  font-style: normal;
  line-height: 1;
}

/* Tournament details — Winners tab */
.td-winners-wrap {
  margin-top: 0.75rem;
}
.td-winners-table .td-winner-event-name {
  font-weight: 600;
}
.td-winners-table .td-winner-note {
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

.td-winners-table .td-winner-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.td-winners-table .td-podium-photo {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.td-winners-table .td-podium-photo:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

@media (min-width: 768px) {
  .td-winners-table .td-podium-photo {
    max-width: 220px;
  }
}

/* Tournament details — podium lightbox title inside wide modal box */
.td-podium-photo-modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  padding-right: 2.5rem;
  color: #0f172a;
}

.welcome-results-photo-modal-box .modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
}

.td-winners-table .td-winner-name {
  font-size: 0.95rem;
  line-height: 1.3;
  word-break: break-word;
}

.tournament-poster {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
  cursor: pointer;
}

.tournament-poster-placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.poster-modal-box {
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.poster-modal-body {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.poster-modal-body img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* Welcome Results + Tournament details Winners: podium lightbox */
.welcome-results-photo-modal-box {
  position: relative;
  max-width: min(96vw, 920px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.welcome-results-photo-modal-body {
  padding: 0.75rem 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.welcome-results-photo-modal-body img {
  max-width: 100%;
  max-height: min(82vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.poster-modal-contact {
  width: 100%;
  max-width: 24rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
}

.poster-modal-contact a {
  color: var(--primary);
  word-break: break-word;
}

.poster-download-btn {
  margin-left: auto;
  margin-right: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.poster-download-btn:hover {
  background: #eff6ff;
  border-color: var(--primary);
}

.btn-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-icon-btn .btn-icon {
  font-size: 1rem;
}

.btn-register {
  background: var(--primary);
  color: white;
  border: none;
}

.btn-register:hover {
  background: var(--primary-hover);
}

.btn-score {
  background: var(--live-red);
  color: white;
  border: none;
}

.btn-score:hover {
  background: #b91c1c;
}

.btn-result {
  background: var(--green);
  color: white;
  border: none;
}

.btn-result:hover {
  background: #047857;
}

/* ----- Pagination ----- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-btns {
  display: flex;
  gap: 0.5rem;
}

.pagination .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ----- CTA Reviews ----- */
.cta-reviews {
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  color: white;
  padding: 3rem 1.5rem;
  text-align: center;
}

.cta-reviews-inner {
  max-width: 560px;
  margin: 0 auto;
}

.cta-reviews h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.cta-reviews p {
  opacity: 0.95;
  margin-bottom: 1.5rem;
}

.btn-cta {
  background: white;
  color: var(--primary);
}

.btn-cta:hover {
  background: #f0f4f8;
  color: var(--primary-hover);
}

.btn-cta .btn-icon {
  margin-right: 0.35rem;
}

/* ----- Reviews section ----- */
.reviews-section {
  padding: 3rem 1.5rem;
  background: linear-gradient(180deg, #e8eef5 0%, #dde5f0 100%);
}

body.welcome-page.ai-mode .reviews-section {
  background: linear-gradient(180deg, #e4e8f2 0%, #dde3ee 48%, #e8e4f5 100%);
}

.reviews-section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.reviews-heading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.reviews-heading {
  margin: 0;
  font-size: 1.5rem;
}

.btn-review-add {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.btn-review-add:hover {
  background: var(--primary);
  color: white;
}

.reviews-layout {
  display: block;
}

.review-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.review-form input,
.review-form select,
.review-form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.review-form textarea {
  resize: vertical;
  min-height: 80px;
}

.review-form .form-error {
  margin-bottom: 0.5rem;
}

.review-photo-input {
  font-size: 0.9rem;
  padding: 0.35rem 0;
}

.reviews-list-wrap {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.reviews-list-wrap::-webkit-scrollbar {
  height: 6px;
}
.reviews-list-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.reviews-list-wrap::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.25);
  border-radius: 999px;
}

.reviews-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.25rem;
}

.review-card {
  min-width: 260px;
  max-width: 320px;
  flex: 0 0 auto;
  background: var(--surface);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.review-card-photo {
  margin: -1.25rem -1.25rem 0.75rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  max-height: 200px;
}

.review-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.review-stars {
  color: var(--yellow);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.review-card p {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.review-author {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ----- Welcome: winners showcase (below tournaments table) ----- */
.winners-showcase-section {
  padding: 2rem 0 2.5rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.6) 100%);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

body.welcome-page.ai-mode .winners-showcase-section {
  background: linear-gradient(180deg, rgba(245, 243, 255, 0.92) 0%, rgba(255, 255, 255, 0.55) 100%);
  border-top-color: rgba(109, 40, 217, 0.12);
}

.winners-showcase-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1.25rem;
  text-align: center;
  letter-spacing: -0.02em;
}

.winners-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

.winner-showcase-card {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 1.15rem 1.2rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

body.welcome-page.ai-mode .winner-showcase-card {
  border-color: rgba(109, 40, 217, 0.15);
  box-shadow: 0 10px 32px rgba(99, 102, 241, 0.1);
}

.winner-showcase-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.winner-showcase-card-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.winner-showcase-score {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e40af;
  margin: 0 0 1rem;
}

body.welcome-page.ai-mode .winner-showcase-score {
  color: #5b21b6;
}

.winner-showcase-podium {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

@media (min-width: 520px) {
  .winner-showcase-podium {
    grid-template-columns: repeat(4, 1fr);
  }
}

.winner-place {
  text-align: center;
  min-width: 0;
}

.winner-place-rank {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.winner-place-photo {
  width: 100%;
  aspect-ratio: 1;
  max-width: 120px;
  margin: 0 auto 0.4rem;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
}

.winner-place-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ----- Welcome: organiser-uploaded results (dashboard Winners tab photos) ----- */
.welcome-organiser-results {
  padding: 2rem 0 2.5rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.92) 100%);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

body.welcome-page.ai-mode .welcome-organiser-results {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 243, 255, 0.88) 100%);
  border-top-color: rgba(109, 40, 217, 0.12);
}

.welcome-organiser-results-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
  text-align: center;
  letter-spacing: -0.02em;
}

.welcome-organiser-results-hint {
  text-align: center;
  font-size: 0.88rem;
  margin: 0 0 1.5rem;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.organiser-results-tournament {
  margin-bottom: 2rem;
  padding: 1.25rem 1.35rem;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  scroll-margin-top: 5rem;
}

.organiser-results-tournament.is-highlighted {
  outline: 2px solid #4f46e5;
  outline-offset: 3px;
  box-shadow: 0 12px 36px rgba(79, 70, 229, 0.15);
}

.organiser-results-tournament-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  color: #111827;
}

.organiser-results-tournament-sport {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 1.25rem;
}

.organiser-results-event {
  margin-bottom: 1.35rem;
}

.organiser-results-event:last-child {
  margin-bottom: 0;
}

.organiser-results-event-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.organiser-results-podium {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

@media (min-width: 520px) {
  .organiser-results-podium {
    grid-template-columns: repeat(4, 1fr);
  }
}

.organiser-results-podium .winner-place-photo {
  max-width: min(100%, 200px);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.organiser-results-podium .winner-place-photo:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.organiser-results-podium .winner-place-photo img {
  cursor: pointer;
}

@media (min-width: 768px) {
  .organiser-results-podium .winner-place-photo {
    max-width: min(100%, 240px);
  }
}

.organiser-results-podium .winner-place-name {
  display: block;
  margin-top: 0.35rem;
  min-height: 1.2em;
}

.winner-place-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
  word-break: break-word;
}

.winner-place--champion .winner-place-rank {
  color: #b45309;
}

.winner-place--champion .winner-place-photo {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.45);
}

/* ----- Features ----- */
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Welcome page: Bootstrap row/cols replace the features grid */
.pt-bootstrap .features {
  display: block;
  max-width: none;
  margin: 0;
  padding: 2rem 0 4rem;
}

.pt-bootstrap .features .row > [class*="col-"] {
  display: flex;
  flex-direction: column;
}

.pt-bootstrap .header-inner.container-xl {
  max-width: 1200px;
}

.pt-bootstrap .reviews-section-inner.container-xl,
.pt-bootstrap .partners-inner.container-xl {
  max-width: 1200px;
}

.pt-bootstrap .footer-inner.container-xl {
  max-width: 1200px;
}

.pt-bootstrap.calc-body .header-inner.container-xl {
  max-width: 1200px;
}

.pt-bootstrap .hero-content.container-xl {
  max-width: 720px;
}

.pt-bootstrap .tabs-section {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

body.welcome-page.ai-mode .feature-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(109, 40, 217, 0.11);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow), 0 0 48px rgba(109, 40, 217, 0.06);
}

body.welcome-page.ai-mode .feature-card:hover {
  box-shadow: var(--shadow-lg), 0 16px 56px rgba(99, 102, 241, 0.16);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature-icon-blue { background: #dbeafe; color: var(--primary); }
.feature-icon-green { background: var(--green-bg); color: var(--green); }
.feature-icon-yellow { background: var(--yellow-bg); color: var(--yellow); }

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.feature-card ul {
  list-style: none;
  margin-bottom: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.feature-card li {
  font-size: 0.9rem;
  padding: 0.25rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.feature-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
}

.feature-actions .btn {
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

/* ----- Partners (welcome screen) ----- */
.partners-section {
  padding: 2.25rem 1.5rem 3rem;
  background: #f9fafb;
}

.partners-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.partners-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.partners-heading {
  margin: 0;
  font-size: 1.35rem;
}

.partners-subtitle {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
  --partner-photo-size: 240px;
}

.partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

body.welcome-page.ai-mode .partner-card {
  border: 1px solid rgba(109, 40, 217, 0.1);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.08);
}

.partner-photo {
  width: var(--partner-photo-size, 240px);
  height: var(--partner-photo-size, 240px);
  min-width: var(--partner-photo-size, 240px);
  min-height: var(--partner-photo-size, 240px);
  border-radius: 20px;
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.partner-photo--img {
  background: #f1f5f9;
}

.partner-photo--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Partner multi-photo carousel (welcome page) */
.partner-carousel {
  width: var(--partner-photo-size, 240px);
  height: var(--partner-photo-size, 240px);
  min-width: var(--partner-photo-size, 240px);
  min-height: var(--partner-photo-size, 240px);
  flex-shrink: 0;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: #f1f5f9;
}

.partner-carousel-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.partner-carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.65s ease;
  pointer-events: none;
}

.partner-carousel-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.partner-location {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.partner-address {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #64748b;
  white-space: pre-line;
  word-break: break-word;
}

.partner-photo--ph.partner-photo--1 {
  background-image: linear-gradient(135deg, #f97316, #ea580c);
}
.partner-photo--ph.partner-photo--2 {
  background-image: linear-gradient(135deg, #22c55e, #16a34a);
}
.partner-photo--ph.partner-photo--3 {
  background-image: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.partner-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  width: 100%;
  align-self: stretch;
}

.partner-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.partner-note {
  font-size: 0.82rem;
  color: #4b5563;
}

.partner-details {
  margin-top: 0.5rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #64748b;
  white-space: pre-line;
  word-break: break-word;
}

@media (max-width: 520px) {
  .partners-grid {
    --partner-photo-size: min(88vw, 320px);
  }
  .partner-photo,
  .partner-carousel {
    width: var(--partner-photo-size, min(88vw, 320px));
    height: var(--partner-photo-size, min(88vw, 320px));
    min-width: unset;
    min-height: unset;
    max-width: 320px;
  }
}

/* ----- Footer (welcome + global) ----- */
.footer {
  margin-top: auto;
  position: relative;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 48%, #172033 100%);
  color: #e2e8f0;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.35);
}

body.welcome-page .footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.45), rgba(99, 102, 241, 0.5), transparent);
  opacity: 0.85;
  pointer-events: none;
}

body.welcome-page.ai-mode .footer::before {
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), rgba(34, 211, 238, 0.4), transparent);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
}

.footer-inner-top {
  padding-bottom: 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: flex-start;
}

.footer-inner-bottom {
  padding-top: 1.25rem;
  align-items: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1 1 220px;
}

.footer-brand .logo-icon {
  flex-shrink: 0;
  width: var(--footer-logo-size);
  height: var(--footer-logo-size);
  min-width: var(--footer-logo-size);
  min-height: var(--footer-logo-size);
  /* background-color: #fff; */
  background-image: url("public/PRO_TOURNY_LOGO.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 78%;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

.footer-brand .site-logo-header-img {
  flex-shrink: 0;
  display: block;
  width: auto;
  height: var(--footer-logo-size);
  min-height: var(--footer-logo-size);
  max-height: 72px;
  max-width: min(200px, 42vw);
  object-fit: contain;
  padding: 6px;
  border-radius: 14px;
  /* background: rgba(255, 255, 255, 0.97); */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 10px 28px rgba(0, 0, 0, 0.35);
}

.footer-brand > div:last-child {
  min-width: 0;
}

.footer-brand strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
  line-height: 1.25;
}

.footer-brand p {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #94a3b8;
  max-width: 22rem;
}

.footer-links {
  display: flex;
  gap: 2.25rem;
  flex-wrap: wrap;
}

.footer-links div {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 8.5rem;
}

.footer-links strong {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.footer-links a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease, transform 0.15s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-copyright {
  font-size: 0.88rem;
  color: #94a3b8;
  letter-spacing: 0.01em;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.footer-legal a {
  color: #cbd5e1;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer-legal a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.footer-sep {
  color: #475569;
  user-select: none;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.footer-social-text {
  font-size: 0.86rem;
  color: #94a3b8;
  line-height: 1.4;
  max-width: 14rem;
}

.footer-social-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.footer-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.footer-icon svg {
  flex-shrink: 0;
}

button.footer-ai-mode-btn {
  margin: 0;
  padding: 0;
  cursor: pointer;
  border: 1px solid rgba(226, 232, 240, 0.35);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
  line-height: 1;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

button.footer-ai-mode-btn:hover {
  color: #fff;
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(109, 40, 217, 0.2);
}

button.footer-ai-mode-btn[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(167, 139, 250, 0.85);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.45), rgba(109, 40, 217, 0.55));
  box-shadow: 0 0 20px rgba(109, 40, 217, 0.35);
}


/* ----- Modals ----- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.modal-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

/* ----- Auth modals — Canvas 2 (glass, aurora mesh, grain) ----- */
.modal--canvas2 .modal-backdrop {
  background: linear-gradient(
    155deg,
    rgba(15, 23, 42, 0.72) 0%,
    rgba(49, 46, 129, 0.55) 42%,
    rgba(13, 148, 136, 0.38) 100%
  );
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
}

.modal-auth-canvas {
  isolation: isolate;
  overflow: hidden;
  padding: 1.65rem 1.75rem 1.55rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 28px 56px -16px rgba(15, 23, 42, 0.32),
    0 0 100px -24px rgba(37, 99, 235, 0.38);
}

.modal-auth-canvas::before {
  content: "";
  position: absolute;
  inset: -45%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 72% 58% at 18% 12%, rgba(37, 99, 235, 0.28), transparent 58%),
    radial-gradient(ellipse 68% 52% at 88% 8%, rgba(124, 58, 237, 0.22), transparent 52%),
    radial-gradient(ellipse 55% 48% at 52% 102%, rgba(5, 150, 105, 0.2), transparent 50%),
    conic-gradient(from 210deg at 50% 50%, rgba(37, 99, 235, 0.06), transparent 28%, rgba(124, 58, 237, 0.07), transparent 62%, rgba(5, 150, 105, 0.05), transparent 88%);
  animation: modal-canvas2-drift 16s ease-in-out infinite alternate;
}

.modal-auth-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
}

@keyframes modal-canvas2-drift {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    transform: translate(3%, 4%) rotate(4deg) scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-auth-canvas::before {
    animation: none;
  }
}

.modal-auth-canvas > *:not(.modal-close) {
  position: relative;
  z-index: 1;
}

.modal-auth-canvas .modal-close {
  position: absolute;
  z-index: 20;
  top: 0.85rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  color: rgba(30, 41, 59, 0.65);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.modal-auth-canvas .modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
}

.modal-auth-canvas > h2 {
  margin-bottom: 1.2rem;
  padding-right: 2.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  background: linear-gradient(110deg, #0f172a 0%, var(--primary) 42%, #6366f1 72%, var(--ai-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-auth-canvas .modal-desc {
  color: rgba(51, 65, 85, 0.92);
}

.modal-auth-canvas .auth-form label {
  color: rgba(30, 41, 59, 0.88);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

.modal-auth-canvas .auth-form input,
.modal-auth-canvas .auth-form select {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 11px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.modal-auth-canvas .auth-form input:focus,
.modal-auth-canvas .auth-form select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.14),
    0 8px 22px rgba(37, 99, 235, 0.1);
}

.modal-auth-canvas .auth-form .auth-radio-option {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.modal-auth-canvas .auth-form .auth-radio-option:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(239, 246, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.modal-auth-canvas .auth-form .btn-primary.btn-block {
  margin-top: 0.35rem;
  padding: 0.62rem 1rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 52%, #7c3aed 100%);
  box-shadow:
    0 4px 18px rgba(37, 99, 235, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.28) inset;
  transition: filter 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.modal-auth-canvas .auth-form .btn-primary.btn-block:hover {
  filter: brightness(1.06);
  box-shadow:
    0 6px 24px rgba(37, 99, 235, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

.modal-auth-canvas .auth-form .btn-primary.btn-block:active {
  transform: translateY(1px);
}

.modal-auth-canvas .auth-form-footer {
  color: rgba(71, 85, 105, 0.95);
}

.modal-auth-canvas .auth-form-footer a {
  font-weight: 600;
}

.modal-auth-canvas .password-toggle {
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.55);
}

.signup-modal-box {
  max-width: 420px;
  padding: 0.95rem 1rem;
}

.signup-modal-box.modal-auth-canvas {
  padding: 1.2rem 1.3rem 1.1rem;
}

.signup-modal-box h2 {
  margin-bottom: 0.65rem;
}

.signup-modal-box .auth-form label {
  font-size: 0.84rem;
  margin-bottom: 0.16rem;
}

.signup-modal-box .auth-form input,
.signup-modal-box .auth-form select {
  padding: 0.46rem 0.6rem;
  font-size: 0.9rem;
  margin-bottom: 0.55rem;
}

.signup-modal-box .auth-form .password-input-wrap {
  margin-bottom: 0.55rem;
}

.signup-modal-box .auth-form .btn-block {
  margin-top: 0.12rem;
  padding: 0.46rem 0.72rem;
}

.signup-modal-box .auth-form .auth-radio-group {
  margin-bottom: 0.55rem;
  gap: 0.22rem 0.58rem;
}

.signup-modal-box .auth-form-footer {
  margin-top: 0.55rem;
  font-size: 0.84rem;
}

/* Create account: country code + national number on one row */
.signup-phone-field {
  margin-bottom: 0.55rem;
}

.signup-phone-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
}

.signup-modal-box .auth-form .signup-phone-row input,
.signup-modal-box .auth-form .signup-phone-row select {
  margin-bottom: 0;
}

.signup-country-code {
  flex: 0 0 auto;
  min-width: 3.4rem;
  max-width: 23%;
  width: auto;
  cursor: pointer;
  font-size: 0.78rem;
  padding-left: 0.35rem;
  padding-right: 1.15rem;
}

.signup-phone-row #signupPhone {
  flex: 1;
  min-width: 0;
  width: auto;
}

/* ----- Login modal: Email vs Mobile + unified phone bar ----- */
.login-modal-box {
  max-width: 420px;
}

.login-method-legend {
  margin: 0 0 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(30, 41, 59, 0.88);
}

.login-method-switch {
  display: flex;
  width: 100%;
  gap: 0;
  margin-bottom: 0.7rem;
  padding: 3px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.login-method-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.48rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  color: rgba(51, 65, 85, 0.88);
  border-radius: 9px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.login-method-tab.is-active {
  background: rgba(255, 255, 255, 0.96);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.login-method-tab:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.login-method-panel {
  margin-bottom: 0.85rem;
}

.login-method-panel[hidden] {
  display: none !important;
}

/* One visual field: country code + national (login mobile only) */
.login-phone-row--unified {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 11px;
  overflow: hidden;
  gap: 0 !important;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-modal-box .auth-form .login-phone-row--unified select.signup-country-code,
.login-modal-box .auth-form .login-phone-row--unified input {
  margin-bottom: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.login-modal-box .auth-form .login-phone-row--unified .signup-country-code {
  min-width: 3.25rem;
  max-width: 28%;
  width: auto;
  border-right: 1px solid rgba(15, 23, 42, 0.1) !important;
  font-size: 0.78rem;
  padding-left: 0.35rem;
  padding-right: 1rem;
}

.login-modal-box .auth-form .login-phone-row--unified #loginPhoneNational:focus,
.login-modal-box .auth-form .login-phone-row--unified .signup-country-code:focus {
  outline: none;
  box-shadow: none !important;
}

.login-phone-row--unified:focus-within {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.14),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.modal-auth-canvas .auth-consent-block {
  margin: 0.75rem 0 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-auth-canvas .auth-consent-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #334155;
  cursor: pointer;
}

.modal-auth-canvas .auth-consent-option input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: auto;
}

.auth-inline-link {
  color: #4f46e5;
  text-decoration: underline;
  font-weight: 500;
}

.auth-inline-link:hover {
  color: #4338ca;
}

.modal-box-text {
  max-width: 560px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}

.modal-body-text {
  padding: 0 1.75rem 1.75rem;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

/* Draw calculator modal summary */
.draw-calc-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 1.25rem;
  font-size: 0.9rem;
}

/* Draw calculator popup layout */
#drawCalcModal .modal-box-text {
  max-width: 420px;
}

#drawCalcModal .modal-body-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

#drawCalcModal .calc-radio-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#drawCalcModal .calc-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
}

#drawCalcModal #calcSize {
  margin-top: 0.15rem;
  margin-bottom: 0.1rem;
}

#drawCalcModal .btn.btn-primary.btn-block {
  margin-top: 0.4rem;
}

.auth-form-footer {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-form-footer a {
  color: var(--primary);
  text-decoration: none;
}

.auth-form-footer a:hover {
  text-decoration: underline;
}

.modal-box h2 {
  margin-bottom: 1.25rem;
  font-size: 1.35rem;
  padding-right: 2rem;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.auth-form .required {
  color: var(--live-red);
}

.auth-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.auth-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.auth-form .auth-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0 0 1rem;
}

.auth-form .auth-radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 500;
  margin: 0;
}

.auth-form .auth-radio-option input[type="radio"] {
  width: auto;
  margin: 0;
  padding: 0;
}

.auth-form .password-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.auth-form .password-input-wrap input {
  padding-right: 2.75rem;
  margin-bottom: 0;
}

.auth-form .password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.15rem;
}

.auth-form .password-toggle:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-error {
  color: var(--live-red);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  min-height: 1.2em;
}

.auth-form .form-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
  margin: -0.35rem 0 0.5rem;
}

.auth-form .form-field-error {
  color: var(--live-red);
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0.2rem 0 0.45rem;
}

.auth-form .form-field-error[hidden] {
  display: none;
}

.modal-auth-canvas .auth-form input[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.auth-form .btn-block {
  margin-top: 0.5rem;
}

/* ----- Responsive: iPad, tablet, phone, small phone ----- */

/* Tablet / iPad portrait and below */
@media (max-width: 1024px) {
  :root {
    --header-bar-pad-x: 1.1rem;
  }
  .header-inner,
  .tabs-section,
  .footer-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .tabs-above .location-display {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  :root {
    --header-bar-pad-y: 0.85rem;
    --header-logo-size: 54px;
  }
  .header-inner {
    flex-wrap: wrap;
    padding: var(--header-bar-pad-y) 1rem;
    align-items: center;
    row-gap: 0.65rem;
  }
  /* Full-width bar under logo so Log in / Create account stay right-aligned on phones */
  .header-inner .logo {
    flex: 1 1 auto;
    min-width: 0;
  }
  .header-inner .nav {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .header-inner .auth-buttons {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .logo-title {
    font-size: 1rem;
  }
  .logo-subtitle {
    font-size: 0.75rem;
  }
  .hero {
    padding: 2rem 1rem;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .hero-desc {
    font-size: 0.95rem;
  }
  .hero-stats {
    gap: 0.5rem;
  }
  .stat {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }
  .tabs-section {
    padding: 0 1rem 2rem;
  }
  .tabs-wrap {
    flex-wrap: wrap;
  }
  .tabs-content {
    padding: 1rem;
  }
  .tournaments-table {
    font-size: 0.85rem;
  }
  .tournaments-table th,
  .tournaments-table td {
    padding: 0.5rem 0.6rem;
  }
  .tournament-poster {
    width: 24px;
    height: 24px;
  }
  .btn-icon-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }
  .pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .features {
    padding: 1.5rem 1rem 3rem;
    grid-template-columns: 1fr;
  }
  .feature-card {
    padding: 1.25rem;
  }
  .reviews-section {
    padding: 2rem 1rem;
  }
  .reviews-layout {
    grid-template-columns: 1fr;
  }
  .reviews-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    padding: 1.25rem 1rem;
  }
  .footer-inner-top {
    flex-direction: column;
    gap: 1.5rem;
  }
  .footer-inner-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .footer-social {
    flex-direction: column;
  }
  .modal {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-box {
    margin: auto 0;
    max-width: 100%;
  }
  .modal-auth-canvas {
    border-radius: 16px;
    padding: 1.4rem 1.3rem 1.3rem;
  }
  .signup-modal-box.modal-auth-canvas {
    padding: 1.1rem 1.15rem 1rem;
  }
}

/* Large phone / small tablet */
@media (max-width: 600px) {
  :root {
    --header-logo-size: 48px;
  }
  .auth-buttons {
    gap: 0.4rem;
  }
  .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
  }
  .location-label {
    font-size: 0.85rem;
  }
  .tournaments-table .th-poster,
  .tournaments-table .td-poster {
    min-width: 3.75rem;
    max-width: 5.75rem;
  }
  .footer-legal {
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer-social-text {
    font-size: 0.85rem;
    text-align: center;
  }
}

/* Phone portrait (iPhone, Android) */
@media (max-width: 480px) {
  :root {
    --header-logo-size: 44px;
    --header-bar-pad-y: 0.65rem;
  }
  .header-inner {
    padding: var(--header-bar-pad-y) 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }
  .header-inner .logo {
    flex: 0 0 auto;
    width: 100%;
  }
  .header-inner .nav {
    flex: 0 0 auto;
    width: 100%;
    justify-content: flex-end;
  }
  .logo-text {
    max-width: 160px;
  }
  .logo-title {
    font-size: 0.95rem;
  }
  .hero {
    padding: 1.5rem 0.75rem;
  }
  .hero-title {
    font-size: 1.35rem;
  }
  .hero-stats {
    flex-direction: column;
  }
  .stat {
    width: 100%;
    justify-content: center;
  }
  .tabs-section {
    padding: 0 0.75rem 1.5rem;
  }
  .tab {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  .tournaments-table {
    font-size: 0.8rem;
    min-width: 520px;
  }
  .tournaments-table th,
  .tournaments-table td {
    padding: 0.4rem 0.5rem;
  }
  .pagination-info {
    font-size: 0.8rem;
  }
  .features {
    padding: 1.25rem 0.75rem 2.5rem;
  }
  .feature-card h3 {
    font-size: 1.05rem;
  }
  .feature-card p,
  .feature-card li {
    font-size: 0.85rem;
  }
  .footer-copyright,
  .footer-legal,
  .footer-social-text {
    font-size: 0.85rem;
  }
  .footer-social-icons {
    justify-content: center;
  }
  .modal-box {
    padding: 1.25rem;
  }
  .modal-box h2 {
    font-size: 1.2rem;
  }
  .auth-form input {
    font-size: 16px; /* prevents zoom on focus on iOS */
  }
}

/* Small phone (e.g. iPhone SE, narrow Android) */
@media (max-width: 360px) {
  .header-inner .auth-buttons {
    width: 100%;
    justify-content: flex-end;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .header-inner .auth-buttons .btn {
    flex: 0 1 auto;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
  }
  .hero-title {
    font-size: 1.2rem;
  }
  .footer-inner {
    gap: 1rem;
  }
}

/* ----- Floating help chat (welcome page) ----- */
.help-chat-root {
  position: relative;
  z-index: 260;
}

.help-chat-fab {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 55%, var(--ai-violet) 100%);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.help-chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.help-chat-fab__icon {
  font-size: 1.15rem;
  line-height: 1;
}

.help-chat-panel {
  position: fixed;
  bottom: 4.75rem;
  right: 1.25rem;
  width: min(100vw - 2rem, 340px);
  max-height: min(78vh, 520px);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.help-chat-panel[hidden] {
  display: none !important;
}

.help-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(109, 40, 217, 0.08));
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.help-chat-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.help-chat-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-chat-close:hover {
  color: var(--text);
  background: #fff;
}

.help-chat-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.help-chat-lead {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.help-chat-choice {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s;
}

.help-chat-choice:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eff6ff;
}

.help-chat-choice strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.help-chat-choice-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.help-chat-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  margin-top: 0.5rem;
}

.help-chat-label:first-of-type {
  margin-top: 0;
}

.help-chat-optional {
  font-weight: 400;
  opacity: 0.85;
}

.help-chat-input,
.help-chat-textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.9rem;
}

.help-chat-textarea {
  resize: vertical;
  min-height: 3.5rem;
}

.help-chat-error {
  color: var(--live-red);
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
  min-height: 1.2em;
}

.help-chat-submit {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 11px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--ai-violet));
}

.help-chat-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.help-chat-back {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  border: none;
  background: none;
  font-size: 0.85rem;
  color: var(--primary);
  cursor: pointer;
  font-family: var(--font);
}

.help-chat-thanks {
  text-align: center;
}

.help-chat-success-icon {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  color: var(--green);
}

.help-chat-thanks-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

.help-chat-thanks-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 1rem;
}

.help-chat-done {
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 480px) {
  .help-chat-fab {
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem 0.85rem;
  }
  .help-chat-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 4.25rem;
    max-height: 70vh;
  }
}
