:root {
  /* Базовые цвета */
  --bg-main: #F7F9FB;        /* Светлый, чистый технический фон */
  --bg-card: #FFFFFF;        /* Белоснежные плашки контейнеров */
  --border-color: #E2E8F0;   /* Тончайшие серые разделители */
  --text-main: #0B0F19;      /* Глубокий черный для заголовков */
  --text-muted: #64748B;     /* Серый для подписей и мета-данных */
  
  /* Акцентный Голографический Градиент (Mesh Glow) */
  --holo-gradient: radial-gradient(circle at 50% 50%, 
    rgba(99, 102, 241, 0.25) 0%,   /* Indigo */
    rgba(236, 72, 153, 0.25) 30%,  /* Pink */
    rgba(249, 115, 22, 0.20) 60%,  /* Orange */
    transparent 100%
  );
  
  /* Шрифты */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace; /* Для ID игроков и параметров */
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-main);
}

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

/* 2. Конструктор фона: Техническая сетка (Grid Layout) */
.main-wrapper {
  background-color: var(--bg-main);
  background-image: 
    linear-gradient(var(--border-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
  background-size: 40px 40px; /* Размер квадратных ячеек сетки */
  background-position: center top;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 3. Типографика (Stark Typography) */
h1, h2, h3, h4 {
  text-transform: uppercase;
  font-weight: 800; /* ExtraBold */
  letter-spacing: -0.03em;
  color: #0B0F19;
  margin-top: 0;
}

.mono-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(247, 249, 251, 0.8);
  border-bottom: 1px solid var(--border-color);
}

header .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

header .logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

header .nav-links {
  display: flex;
  gap: 24px;
}

header .nav-links a {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: color 0.2s;
}

header .nav-links a:hover {
  color: #6366f1;
}

header .cta-button {
  padding: 8px 16px;
  border: 1px solid;
  border-image: linear-gradient(to right, #6366f1, #ec4899) 1;
  background: transparent;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s;
}

header .cta-button:hover {
  background: linear-gradient(to right, #6366f1, #ec4899);
  color: #fff;
}

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

footer .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer .footer-links {
  display: flex;
  gap: 24px;
}

footer .footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
}

footer .footer-links a:hover {
  color: var(--text-main);
}

/* 4. Структура Главной страницы (Bento Grid) */
.hero-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-main {
  display: flex;
  gap: 24px;
  height: 500px;
}

.hero-left, .hero-right {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px;
}

.hero-left {
  flex: 0 0 60%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-left h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-left p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 90%;
  margin-bottom: 40px;
}

.hero-cta-buttons {
  display: flex;
  gap: 16px;
}

.btn-primary {
  background: var(--text-main);
  color: #fff;
  padding: 16px 32px;
  text-transform: uppercase;
  font-weight: 800;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 16px 32px;
  text-transform: uppercase;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
}

.hero-right {
  flex: 0 0 calc(40% - 24px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-silhouette {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
  background-image: url('https://placehold.co/300x400/transparent/0B0F19/png?text=Silhouette');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.hero-mesh {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: var(--holo-gradient);
  filter: blur(40px);
  z-index: 1;
}

.tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-main);
  z-index: 3;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tooltip-1 { top: 20%; left: 10%; }
.tooltip-2 { bottom: 30%; right: 10%; }

.hero-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.bento-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bento-box.highlight {
  border: 2px solid var(--text-main);
}

.bento-icon {
  font-size: 24px;
  margin-bottom: 16px;
}

.bento-title {
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.bento-value {
  font-size: 24px;
  font-weight: 800;
}

/* 5. Компонент карточки игрока (pSEO Catalog Card) */
.catalog-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 24px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
  content-visibility: auto; /* Optimization for large grids */
  contain-intrinsic-size: 320px 420px;
}

.player-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.preview-container {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  /* Классический CSS-паттерн "шахматка" для прозрачного PNG */
  background-image: linear-gradient(45deg, #E2E8F0 25%, transparent 25%), 
                    linear-gradient(-45deg, #E2E8F0 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #E2E8F0 75%), 
                    linear-gradient(-45deg, transparent 75%, #E2E8F0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  z-index: 2;
  position: relative;
}

/* Ховер-эффект: плавно зажигает цветной градиент за игроком при наведении */
.player-card:hover .mesh-glow {
  opacity: 1;
}

.mesh-glow {
  position: absolute;
  inset: 0;
  background: var(--holo-gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

/* Наглая водяная знака поперек превью (Защита от парсинга) */
.watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.5rem;
  color: rgba(0, 0, 0, 0.65);
  letter-spacing: 0.1em;
  pointer-events: none;
  z-index: 3;
}

/* Технические маркеры по углам карточки (прицелы └ ┘) */
.corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--text-main);
  z-index: 4;
}
.corner.tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.corner.tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.corner.bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.corner.br { bottom: 8px; right: 8px; border-left: none; border-top: none; }

/* Мета-данные под карточкой */
.card-meta {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-meta span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.card-meta .player-name {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
}

/* Simple generic page container */
.page-container {
  max-width: 800px;
  margin: 60px auto;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.page-container p {
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Pricing specifically */
.pricing-tiers {
  display: flex;
  gap: 24px;
  margin-top: 40px;
}

.pricing-tier {
  flex: 1;
  border: 1px solid var(--border-color);
  padding: 32px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.pricing-tier h3 {
  font-size: 24px;
  margin-bottom: 16px;
}

.pricing-tier .price {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 24px;
}

.pricing-tier ul {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
  flex: 1;
}

.pricing-tier ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 14px;
}

.pricing-tier.pro {
  border-color: var(--text-main);
  background: #fdfdfd;
}

/* Catalog header */
.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
}

/* Sport filter tabs */
.sport-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}

.sport-tab {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.sport-tab:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.sport-tab.active {
  background: var(--text-main);
  color: #fff;
  border-color: var(--text-main);
}

/* Hover tech overlay on card */
.hover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(4px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 5;
}

.player-card:hover .hover-overlay {
  transform: translateY(0);
}

.overlay-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overlay-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.overlay-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fff;
  font-weight: 600;
}

/* Placeholder for missing preview */
.player-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
  z-index: 2;
  position: relative;
}

/* SSR Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 48px;
  padding-bottom: 24px;
}

.page-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 12px 24px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover {
  border-color: var(--text-main);
  background: var(--text-main);
  color: #fff;
}

.page-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.page-info {
  font-size: 13px;
}

/* Advanced Filters */
.advanced-filters {
  margin-bottom: 32px;
}

.filter-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select, .filter-input {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
  cursor: pointer;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230B0F19%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 10px auto;
  padding-right: 32px;
}

.filter-select:hover, .filter-input:hover {
  border-color: #a0aec0;
}

.filter-select:focus, .filter-input:focus {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px rgba(11, 15, 25, 0.1);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  background: var(--text-main);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.modal-close:hover {
  transform: scale(1.1);
}

.bg-toggles {
  display: flex;
  gap: 8px;
}

.bg-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: var(--text-main);
}

.bg-btn.active {
  background: var(--text-main);
  color: #fff;
  border-color: var(--text-main);
}

.modal-body {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Background Types */
.modal-body.checker {
  background-image: 
    linear-gradient(45deg, #e5e5e5 25%, transparent 25%), 
    linear-gradient(-45deg, #e5e5e5 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #e5e5e5 75%), 
    linear-gradient(-45deg, transparent 75%, #e5e5e5 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.modal-body.dark {
  background: #0b0f19;
}

.modal-body.light {
  background: #ffffff;
}

#modal-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.loader {
  position: absolute;
  font-size: 14px;
  color: var(--text-muted);
}

/* -------------------------------------
   Mobile Responsiveness
------------------------------------- */
@media (max-width: 768px) {
  /* Header */
  header .nav-container {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  header .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  /* Hero Section */
  .hero-section {
    margin: 20px auto;
  }
  .hero-main {
    flex-direction: column;
    height: auto;
  }
  .hero-left, .hero-right {
    flex: none;
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
  }
  .hero-left h1 {
    font-size: 2.2rem;
  }
  .hero-right {
    height: 350px;
  }
  .hero-cta-buttons {
    flex-direction: column;
  }
  
  /* Hero Bento Footer */
  .hero-footer {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Catalog */
  .catalog-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .sport-tabs {
    flex-wrap: wrap;
    justify-content: center;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-select, .filter-input {
    width: 100%;
    box-sizing: border-box;
  }

  /* Pricing */
  .pricing-tiers {
    flex-direction: column;
  }

  /* Modal */
  .modal-content {
    height: 90vh;
  }
  .modal-header {
    flex-direction: column;
    gap: 12px;
  }
  .modal-close {
    top: 10px;
    right: 10px;
  }
}
