/* ============================================================================
   PITCHMATE — DARK & LIGHT STADIUM UI THEME
   CENG 371 Software Engineering Term Project — Enes Erşan (240201014)
   Default: Dark Stadium (#0B0F19) + Neon Turf Green (#10B981) + Electric Blue
   Toggleable: Clean Pitch Light Mode
   ============================================================================ */

:root {
  color-scheme: dark;
  --bg: #0b0f19;
  --bg-elevated: #111827;
  --surface: rgba(17, 24, 39, 0.86);
  --surface-solid: #131c2e;
  --surface-2: #1e293b;
  --surface-hover: #263449;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(16, 185, 129, 0.38);

  --accent: #10b981;
  --accent-strong: #059669;
  --accent-glow: rgba(16, 185, 129, 0.22);
  --accent-soft: rgba(16, 185, 129, 0.13);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.15);
  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.16);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --purple: #8b5cf6;

  --pitch-grass-1: #064e3b;
  --pitch-grass-2: #065f46;
  --pitch-line: rgba(236, 253, 245, 0.42);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.45), 0 4px 12px -2px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 28px rgba(16, 185, 129, 0.25);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --tabbar: 68px;
  --font-sans: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Poppins', 'Inter', system-ui, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.11);
  --line-strong: rgba(5, 150, 105, 0.4);

  --accent: #059669;
  --accent-strong: #047857;
  --accent-glow: rgba(5, 150, 105, 0.18);
  --accent-soft: rgba(16, 185, 129, 0.12);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.11);
  --gold: #d97706;
  --gold-soft: rgba(217, 119, 6, 0.13);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);

  --pitch-grass-1: #047857;
  --pitch-grass-2: #059669;
  --pitch-line: rgba(255, 255, 255, 0.65);

  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 8px 24px rgba(5, 150, 105, 0.2);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ============================================================================
   ANIMATED STADIUM & TACTICAL PLAYBOOK BACKGROUND LAYER (#page-bg)
   ============================================================================ */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.stadium-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.34;
}

:root[data-theme="light"] .stadium-glow {
  opacity: 0.16;
}

.stadium-glow.g1 {
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  top: -160px;
  left: -120px;
}

.stadium-glow.g2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  top: 18%;
  right: -140px;
}

.stadium-glow.g3 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, #059669 0%, transparent 70%);
  bottom: -200px;
  left: 25%;
}

.pitch-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0.7) 20%, transparent 88%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0.7) 20%, transparent 88%);
  opacity: 0.4;
}

.tactical-playbook-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.44;
  transition: opacity 0.3s ease;
}

:root[data-theme="light"] .tactical-playbook-svg {
  opacity: 0.36;
}

.tactical-pass-line {
  stroke-dasharray: 12 8;
  animation: tacticalDashFlow 18s linear infinite;
}

.tactical-cross-line {
  stroke-dasharray: 10 6;
  animation: tacticalDashFlow 14s linear infinite;
}

.tactical-shot-line {
  stroke-dasharray: 8 5;
  animation: tacticalDashFlow 10s linear infinite;
}

.tactical-player-ring {
  transform-origin: center;
  animation: tacticalNodePulse 3.2s ease-in-out infinite alternate;
}

.tactical-goal-flash {
  transform-origin: center;
  animation: tacticalGoalPulse 2.2s ease-in-out infinite;
}

@keyframes tacticalDashFlow {
  0% { stroke-dashoffset: 360; }
  100% { stroke-dashoffset: 0; }
}

@keyframes tacticalNodePulse {
  0% { opacity: 0.72; }
  100% { opacity: 1; }
}

@keyframes tacticalGoalPulse {
  0%, 100% { opacity: 0.55; r: 18px; }
  50% { opacity: 1; r: 28px; }
}

/* ============================================================================
   DEMO SWITCHER TOP BANNER (FOR PRESENTATION & TESTING)
   ============================================================================ */
.demo-bar {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.14), rgba(59, 130, 246, 0.14));
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  padding: 6px 16px;
}

.demo-bar-in {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.74rem;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--line-strong);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.demo-accounts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.demo-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.77rem;
  font-weight: 600;
  background: var(--surface-solid);
  color: var(--text-secondary);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.18s ease;
}

.demo-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.demo-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================================
   STICKY HEADER & NAVIGATION
   ============================================================================ */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
}

.top-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-glow);
  transition: transform 0.2s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.06) rotate(-3deg);
}

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

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-title span {
  color: var(--accent);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.18s ease;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-link.cta-nav {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.nav-link.cta-nav:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--gold);
  color: #0b0f19;
  font-size: 0.72rem;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================================
   MAIN CONTAINER & HERO SECTION
   ============================================================================ */
.main-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 20%, rgba(16, 185, 129, 0.22), transparent 45%),
    radial-gradient(circle at 12% 85%, rgba(59, 130, 246, 0.18), transparent 45%),
    var(--surface);
  border: 1px solid var(--line-strong);
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 28px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid var(--line-strong);
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #34d399, #10b981, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0 0 22px;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-box {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

/* ============================================================================
   BUTTONS, BADGES & INPUTS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.btn-secondary {
  background: var(--surface-solid);
  color: var(--text);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
  border-radius: 9px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-open { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line-strong); }
.badge-full { background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-completed { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(59, 130, 246, 0.35); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.35); }

.pos-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.pos-Goalkeeper { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.pos-Defender { background: rgba(59, 130, 246, 0.16); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.pos-Midfielder { background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.pos-Forward { background: rgba(239, 68, 68, 0.16); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }

:root[data-theme="light"] .pos-Goalkeeper { color: #b45309; }
:root[data-theme="light"] .pos-Defender { color: #1d4ed8; }
:root[data-theme="light"] .pos-Midfielder { color: #047857; }
:root[data-theme="light"] .pos-Forward { color: #b91c1c; }

/* ============================================================================
   FILTER BAR & SEARCH CONTROLS
   ============================================================================ */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  resize: vertical;
  min-height: 82px;
}

/* ============================================================================
   MATCH CARDS GRID
   ============================================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.match-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.match-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.match-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.match-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}

.match-meta-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.meta-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.vacancies-box {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.vacancies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.slots-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.match-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.organizer-mini {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

/* ============================================================================
   INTERACTIVE 2D HALI SAHA TACTICAL PITCH BOARD
   ============================================================================ */
.match-detail-layout {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 26px;
  align-items: start;
}

.tactical-board-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.pitch-arena {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.1;
  max-height: 560px;
  margin: 0 auto;
  border-radius: 18px;
  background: repeating-linear-gradient(
    0deg,
    var(--pitch-grass-1) 0px,
    var(--pitch-grass-1) 38px,
    var(--pitch-grass-2) 38px,
    var(--pitch-grass-2) 76px
  );
  border: 3px solid var(--pitch-line);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.45), 0 12px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  user-select: none;
}

/* Pitch Markings */
.pitch-halfway {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--pitch-line);
}

.pitch-center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 96px;
  height: 96px;
  border: 2px solid var(--pitch-line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-center-spot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--pitch-line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-penalty-top {
  position: absolute;
  top: 0;
  left: 24%;
  width: 52%;
  height: 15%;
  border: 2px solid var(--pitch-line);
  border-top: none;
}

.pitch-penalty-bottom {
  position: absolute;
  bottom: 0;
  left: 24%;
  width: 52%;
  height: 15%;
  border: 2px solid var(--pitch-line);
  border-bottom: none;
}

/* Tactical Position Nodes on 2D Pitch */
.pitch-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

.pitch-node:hover {
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 10;
}

.node-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  transition: all 0.2s ease;
  position: relative;
}

.pitch-node.open .node-circle {
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  border: 2.5px dashed #ffffff;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.32), 0 6px 16px rgba(0, 0, 0, 0.45);
  animation: pulseOpenSlot 2s infinite;
}

.pitch-node.filled .node-circle {
  background: rgba(15, 23, 42, 0.9);
  color: #94a3b8;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.pitch-node.selected .node-circle {
  background: #f59e0b;
  color: #0b0f19;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.4), 0 8px 20px rgba(0, 0, 0, 0.5);
}

@keyframes pulseOpenSlot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.node-label {
  background: rgba(11, 15, 25, 0.88);
  color: #f8fafc;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.pitch-node.open .node-label {
  border-color: #34d399;
  color: #6ee7b7;
}

/* ============================================================================
   EA FC / FIFA STYLE PLAYER CARD & RADAR CHART
   ============================================================================ */
.eafc-card {
  position: relative;
  background:
    linear-gradient(155deg, rgba(16, 185, 129, 0.24) 0%, rgba(17, 24, 39, 0.96) 45%, rgba(59, 130, 246, 0.2) 100%);
  border: 2px solid rgba(16, 185, 129, 0.55);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.5), 0 0 30px rgba(16, 185, 129, 0.2);
  overflow: hidden;
}

:root[data-theme="light"] .eafc-card {
  background: linear-gradient(155deg, #ecfdf5 0%, #ffffff 50%, #eff6ff 100%);
  box-shadow: 0 14px 32px rgba(5, 150, 105, 0.15);
}

.eafc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.eafc-ovr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  padding: 10px 16px;
  border-radius: 16px;
}

.eafc-ovr {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
}

.eafc-pos {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-top: 4px;
}

.eafc-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.eafc-stat-pill {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eafc-stat-code {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.eafc-stat-num {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
}

/* ============================================================================
   TABLES, PANELS & MODALS
   ============================================================================ */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.tab-btn {
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-item {
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  padding: 13px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.25s ease-out;
}

@keyframes slideInToast {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 20px;
  margin-top: 48px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-in {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .hero-card {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .match-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  /* Disable backdrop-filter on .top-header so position:fixed .main-nav is not trapped inside header on mobile browsers */
  .top-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--surface-solid);
  }
  .top-in {
    padding: 10px 14px;
    justify-content: space-between;
  }
  .header-actions {
    margin-left: auto;
  }
  .main-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    margin: 0;
    background: color-mix(in srgb, var(--surface-solid) 96%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 2px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
  }
  .nav-link {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    padding: 5px 2px;
    border-radius: 10px;
    text-align: center;
  }
  .nav-link span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-link.cta-nav {
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: none;
  }
  .nav-link[data-nav="hakkinda"] {
    display: none;
  }
  .nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    font-size: 0.62rem;
    padding: 0 4px;
  }
  body {
    padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 12px);
  }
  .toast-container {
    bottom: calc(var(--tabbar) + 14px);
    left: 14px;
    right: 14px;
  }
}

@media (max-width: 640px) {
  .main-container {
    padding: 16px 12px 48px;
  }
  .brand-title {
    font-size: 1.12rem;
  }
  .brand-sub {
    display: none;
  }
  .hero-card {
    padding: 18px 16px;
    gap: 18px;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .matches-grid {
    grid-template-columns: 1fr;
  }
  .match-meta-list {
    grid-template-columns: 1fr;
  }
  .eafc-stats-grid {
    grid-template-columns: 1fr;
  }
  .glass-card, .tactical-board-card, .match-card {
    padding: 15px;
  }
  .node-circle {
    width: 42px;
    height: 42px;
    font-size: 0.74rem;
  }
  .node-label {
    font-size: 0.65rem;
    padding: 2px 6px;
  }
}

/* ============================================================================
   FAVORITES (HEART BUTTON), SORT BAR, SHARE TOOLBAR & LOCKER ROOM Q&A
   ============================================================================ */
.fav-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.fav-btn:hover {
  border-color: #f43f5e;
  color: #f43f5e;
  transform: scale(1.06);
}

.fav-btn.active {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.45);
  color: #f43f5e;
}

.fav-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.fav-filter-chip:hover {
  border-color: #f43f5e;
  color: var(--text);
}

.fav-filter-chip.active {
  background: rgba(244, 63, 94, 0.16);
  border-color: #f43f5e;
  color: #f43f5e;
}

.share-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-whatsapp {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.38);
}

.btn-whatsapp:hover {
  background: #25d366;
  color: #0b0f19;
}

:root[data-theme="light"] .btn-whatsapp {
  color: #128c7e;
}

:root[data-theme="light"] .btn-whatsapp:hover {
  color: #ffffff;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 4px;
}

.chat-bubble {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
}

.chat-bubble.captain-msg {
  border-left: 3px solid var(--accent);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.formula-box {
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 16px;
  font-family: monospace;
  font-size: 0.92rem;
  color: var(--accent);
  margin: 12px 0;
}

@media print {
  .top-header, .site-footer, .share-toolbar, .toast-container, #page-bg {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}
