
/* =========================================================
   TOKENS
   ========================================================= */
:root {
  /* Цвета */
  --c-bg:           #ECDAB9;
  --c-bg-deep:      #e3cfa7;
  --c-paper:        #f4e8cf;
  --c-ink:          #2c1810;
  --c-ink-soft:     #74625c;
  --c-ink-muted:    #a5948a;
  --c-line:         rgba(44, 24, 16, 0.12);
  --c-line-strong:  rgba(44, 24, 16, 0.24);

  --c-board-frame:  #3d2b1f;
  --c-board-light:  #ecdab9;
  --c-board-dark:   #74625c;

  --c-accent:       #b5722c;
  --c-accent-hi:    #d49248;
  --c-accent-deep:  #8a521c;

  --c-danger:       #b53d3d;
  --c-success:      #4a7c4a;

  /* Шрифты */
  --f-sans:  'Fira Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-serif: 'Fira Sans', system-ui, sans-serif;
  --f-mono:  'Fira Code', 'SF Mono', Menlo, Consolas, monospace;

  /* Тени */
  --sh-soft:  0 2px 8px rgba(44, 24, 16, 0.08);
  --sh-card:  0 8px 24px rgba(44, 24, 16, 0.12);
  --sh-deep:  0 24px 60px rgba(44, 24, 16, 0.24);
  --sh-board: 0 24px 60px rgba(0,0,0,0.35), inset 0 0 40px rgba(0,0,0,0.25), 0 0 0 2px var(--c-board-frame);

  /* Радиусы */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;

  /* Отступы */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 48px;
  --gap-2xl: 80px;

  /* Тайминги */
  --t-fast: 0.15s ease;
  --t-med:  0.25s ease;
  --t-slow: 0.45s cubic-bezier(0.22, 1, 0.36, 1);

  /* Максимальная ширина контента */
  --maxw: 1200px;
}

/* =========================================================
   BASE / RESET
   ========================================================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: var(--f-sans);
  font-size: 16px;
  background: var(--c-bg);
  color: var(--c-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: 'liga' 1, 'calt' 1;
}

img,
svg {
  max-width: 100%;
  display: block;
}

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

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol { list-style: none; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection {
  background: var(--c-accent);
  color: var(--c-paper);
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* Скрыть скроллбар в горизонтальных скроллах */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* =========================================================
   TYPOGRAPHY HELPERS
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-sans);
  color: var(--c-ink);
  line-height: 1.15;
  font-weight: 700;
}

p { color: var(--c-ink-soft); }

/* =========================================================
   UTILITIES
   ========================================================= */
.section-head {
  max-width: var(--maxw);
  margin: 0 auto var(--gap-2xl);
  text-align: center;
  padding: 0 var(--gap-lg);
}

.section-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--c-accent);
  font-weight: 500;
  margin-bottom: var(--gap-md);
  position: relative;
}
.section-eyebrow::before,
.section-eyebrow::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--c-accent);
  vertical-align: middle;
  margin: 0 12px;
  opacity: 0.5;
}

.section-title {
  font-family: var(--f-sans);
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  margin-bottom: var(--gap-md);
}

.section-sub {
  font-size: clamp(15px, 1.3vw, 18px);
  color: var(--c-ink-soft);
  max-width: 620px;
  margin: 0 auto;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--f-sans);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.2;
}
.btn i { font-size: 0.95em; }

.btn-primary {
  background: var(--c-ink);
  color: var(--c-paper);
  box-shadow: var(--sh-soft);
}
.btn-primary:hover {
  background: var(--c-accent-deep);
  transform: translateY(-2px);
  box-shadow: var(--sh-card);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-line-strong);
}
.btn-ghost:hover {
  background: rgba(44, 24, 16, 0.05);
  border-color: var(--c-ink);
}

.btn-block { width: 100%; }

/* =========================================================
   FULLSCREEN
   ========================================================= */
.live-board:fullscreen {
  background: var(--c-bg-deep);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.live-board:fullscreen .section-head {
  display: none;   /* в полноэкранном режиме заголовок не нужен */
}

.live-board:fullscreen .live-board-wrap {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--gap-lg);
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.live-board:fullscreen .board-frame {
  max-width: min(82vh, 900px);
  margin: 0 auto;
}

.live-board:fullscreen .live-board-side {
  position: static;
  max-height: none;
}

/* Мобильный/узкий fullscreen — колонки в столбик */
@media (max-width: 1024px) {
  .live-board:fullscreen .live-board-wrap {
    grid-template-columns: 1fr;
  }
}

/* Safari — свой синтаксис */
.live-board:-webkit-full-screen {
  background: var(--c-bg-deep);
  padding: 24px;
}
.live-board:-webkit-full-screen .section-head { display: none; }
.live-board:-webkit-full-screen .board-frame {
  max-width: min(82vh, 900px);
}


/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(236, 218, 185, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-line);
  transition: padding var(--t-med), background var(--t-med);
}
.nav.scrolled {
  padding: 10px 32px;
  background: rgba(236, 218, 185, 0.95);
}

.nav-logo {
  font-family: var(--f-sans);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--c-ink);
  display: flex;
  align-items: baseline;
}
.nav-logo-mark.alt { color: var(--c-accent); }

.nav-links {
  display: flex;
  gap: 36px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--c-ink-soft);
  transition: color var(--t-fast);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--c-accent);
  transition: width var(--t-med);
}
.nav-links a:hover { color: var(--c-ink); }
.nav-links a:hover::after { width: 100%; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-cta {
  padding: 10px 22px;
  background: var(--c-ink);
  color: var(--c-paper);
  font-size: 14px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast), transform var(--t-fast);
}
.nav-cta:hover {
  background: var(--c-accent-deep);
  transform: translateY(-1px);
}

/* Переключатель языка */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: rgba(44, 24, 16, 0.03);
}
.lang-switch button {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--c-ink-soft);
  border-right: 1px solid var(--c-line);
  transition: background var(--t-fast), color var(--t-fast);
}
.lang-switch button:last-child { border-right: none; }
.lang-switch button:hover {
  color: var(--c-ink);
  background: rgba(44, 24, 16, 0.05);
}
.lang-switch button.active {
  background: var(--c-ink);
  color: var(--c-paper);
}
.lang-switch-mobile {
  align-self: flex-start;
  margin-top: 12px;
}

/* Burger */
.nav-burger {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-ink);
  transition: transform var(--t-med), opacity var(--t-med);
}
.nav-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Мобильное меню */
.nav-mobile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--c-bg);
  padding: 80px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-bottom: 1px solid var(--c-line);
  transform: translateY(-100%);
  transition: transform var(--t-slow);
}
.nav-mobile.open { transform: translateY(0); }
.nav-mobile a {
  font-family: var(--f-sans);
  font-size: 22px;
  font-weight: 500;
  color: var(--c-ink);
}
.nav-mobile-cta {
  margin-top: 20px;
  padding: 16px;
  background: var(--c-ink);
  color: var(--c-paper) !important;
  text-align: center;
  border-radius: var(--r-sm);
  font-family: var(--f-sans) !important;
  font-size: 15px !important;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 32px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: clamp(300px, 42vw, 620px);
  letter-spacing: 6px;
  color: var(--c-ink);
  opacity: 0.045;
  white-space: nowrap;
  user-select: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(44, 24, 16, 0.06);
  border: 1px solid var(--c-line);
  border-radius: 100px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-ink-soft);
  margin-bottom: var(--gap-lg);
}

.hero-dot {
  width: 6px;
  height: 6px;
  background: var(--c-success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(74, 124, 74, 0.2);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(74, 124, 74, 0.2); }
  50%      { box-shadow: 0 0 0 8px rgba(74, 124, 74, 0.05); }
}

.hero-title {
  font-family: var(--f-sans);
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--c-ink);
  margin-bottom: var(--gap-lg);
}
.hero-title-accent {
  color: var(--c-accent);
  font-weight: 700;
}

.hero-sub {
  font-size: clamp(16px, 1.5vw, 20px);
  color: var(--c-ink-soft);
  max-width: 560px;
  margin: 0 auto var(--gap-xl);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: var(--gap-2xl);
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 60px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hero-stat-num {
  font-family: var(--f-sans);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1;
}
.hero-stat-label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-ink-muted);
  text-align: center;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--c-ink-muted);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: float 3s ease-in-out infinite;
}
.hero-scroll i { font-size: 14px; }
@keyframes float {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -8px); }
}

/* =========================================================
   MODES
   ========================================================= */
.modes {
  padding: var(--gap-2xl) 32px;
  background: var(--c-bg-deep);
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}

.modes-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-lg);
}

.mode-card {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 32px 24px;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
  display: flex;
  flex-direction: column;
  gap: 12px;
    text-decoration: none;     
  color: inherit;             
  cursor: pointer; 
  position: relative;
}
.mode-card::after {
  content: '';
  position: absolute;
  top: 24px;
  right: 24px;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5948a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 5l7 7-7 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--t-fast), transform var(--t-fast);
  pointer-events: none;
}

.mode-card:hover::after {
  opacity: 0.6;
  transform: translateX(0);
}

.mode-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  background: var(--c-ink);
  color: var(--c-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
  transition: background var(--t-fast);
}
.mode-card:hover .mode-icon { background: var(--c-accent-deep); }

.mode-card h3 {
  font-family: var(--f-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.2;
}
.mode-card p {
  font-size: 14px;
  color: var(--c-ink-soft);
  line-height: 1.55;
  flex: 1;
}

.mode-tag {
  align-self: flex-start;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-accent);
  padding: 4px 10px;
  border: 1px solid var(--c-accent);
  border-radius: 100px;
  margin-top: 4px;
}

/* =========================================================
   STEPS
   ========================================================= */
.steps { padding: var(--gap-2xl) 32px; }

.steps-list {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-xl);
}

.step {
  position: relative;
  padding-top: 32px;
  border-top: 2px solid var(--c-line-strong);
}

.step-num {
  font-family: var(--f-mono);
  font-size: 40px;
  font-weight: 400;
  color: var(--c-accent);
  line-height: 1;
  margin-bottom: 16px;
}
.step h3 {
  font-family: var(--f-sans);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 12px;
}
.step p {
  font-size: 15px;
  color: var(--c-ink-soft);
  line-height: 1.6;
}

/* =========================================================
   LIVE BOARD
   ========================================================= */
.live-board {
  padding: var(--gap-2xl) 32px;
  background: var(--c-bg-deep);
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}

.live-board-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--gap-xl);
  align-items: start;
}

/* --- Board frame --- */
.board-frame {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: var(--c-board-frame);
  border-radius: var(--r-sm);
  padding: 10px;
  box-shadow: var(--sh-board);
  position: relative;
}
.board-frame::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--r-sm);
  padding: 2px;
  background: linear-gradient(135deg, #6b4c3a, var(--c-board-frame), #6b4c3a);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* --- Board grid --- */
.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  height: 100%;
  border-radius: 2px;
  overflow: hidden;
  background: var(--c-board-light);
  box-shadow: inset 0 0 24px rgba(0,0,0,0.15);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* --- Square --- */
.sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  font-size: clamp(22px, 4.8vw, 48px);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: background var(--t-fast);
}
.sq.light { background: var(--c-board-light); }
.sq.dark  { background: var(--c-board-dark); }

.sq .coord {
  position: absolute;
  font-size: 10px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0.55;
  font-family: var(--f-sans);
}
.sq .coord-file { bottom: 2px; right: 4px; }
.sq .coord-rank { top: 2px; left: 4px; }
.sq.light .coord { color: #5a4a3a; }
.sq.dark  .coord { color: var(--c-board-light); }

.sq.has-piece { cursor: grab; }
.sq.has-piece:active { cursor: grabbing; }

.sq.selected {
  background: rgba(220, 190, 100, 0.92) !important;
}
.sq.last-move {
  background: rgba(212, 165, 116, 0.55) !important;
}

.sq.valid-move::before {
  content: '';
  position: absolute;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: rgba(60, 40, 20, 0.3);
  pointer-events: none;
  z-index: 2;
  animation: dotIn var(--t-med);
}
.sq.dark.valid-move::before {
  background: rgba(255, 255, 255, 0.22);
}
.sq.valid-capture {
  box-shadow: inset 0 0 0 4px rgba(180, 60, 60, 0.55);
}

@keyframes dotIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* --- Piece (Font Awesome) --- */
.sq .piece {
  pointer-events: none;
  line-height: 1;
  z-index: 1;
  position: relative;
  font-size: inherit;
  transition: transform var(--t-fast);
}
.piece.white {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.piece.black {
  color: #1a1a1a;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.08);
}

.sq.dragging .piece {
  transform: translateY(-6px) scale(1.12);
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.5));
}

/* --- Ghost (drag) --- */
#ghost {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  font-size: clamp(26px, 5.2vw, 52px);
  line-height: 1;
  transform: translate(-50%, -50%) scale(1.15);
  opacity: 0;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.55));
  will-change: transform, left, top;
}
#ghost.visible { opacity: 1; }
#ghost .piece {
  font-size: inherit;
  pointer-events: none;
}
#ghost .piece.white { color: #ffffff; }
#ghost .piece.black { color: #1a1a1a; }

/* --- Side panel --- */
.live-board-side {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  padding: 24px;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  position: sticky;
  top: 90px;
}
.side-block {
  padding-bottom: var(--gap-md);
  border-bottom: 1px solid var(--c-line);
}
.side-block:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}
.side-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-ink-muted);
  margin-bottom: 6px;
}
.side-value {
  font-family: var(--f-sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--c-ink);
  line-height: 1.3;
}
.side-value.side-hint {
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--c-ink-soft);
  line-height: 1.55;
}

/* =========================================================
   LEADERS
   ========================================================= */
.leaders { padding: var(--gap-2xl) 32px; }

.leaders-table {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-soft);
}

.leaders-head,
.leaders-row {
  display: grid;
  grid-template-columns: 60px 1fr 100px 80px 80px 80px;
  gap: 16px;
  padding: 16px 24px;
  align-items: center;
}

.leaders-head {
  background: var(--c-ink);
  color: var(--c-paper);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.leaders-row {
  border-bottom: 1px solid var(--c-line);
  font-size: 15px;
  transition: background var(--t-fast);
}
.leaders-row:last-child { border-bottom: none; }
.leaders-row:hover { background: rgba(212, 165, 116, 0.08); }

.leaders-rank {
  font-family: var(--f-mono);
  font-size: 18px;
  color: var(--c-ink-soft);
  text-align: center;
}
.leaders-row:nth-child(2) .leaders-rank { color: #c9a227; }
.leaders-row:nth-child(3) .leaders-rank { color: #9a9a9a; }
.leaders-row:nth-child(4) .leaders-rank { color: #a86f3c; }

.leaders-name {
  font-weight: 500;
  color: var(--c-ink);
}
.leaders-grade {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--c-accent-deep);
}
.leaders-stat {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 14px;
}
.leaders-stat.win  { color: var(--c-success); }
.leaders-stat.lose { color: var(--c-danger); }

/* =========================================================
   ARENA
   ========================================================= */
.arena {
  padding: var(--gap-2xl) 32px;
  background: var(--c-bg-deep);
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}

.arena-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-lg);
}

.arena-card {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.arena-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-card);
}

.arena-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  align-self: flex-start;
}
.arena-status.live {
  background: rgba(181, 61, 61, 0.12);
  color: var(--c-danger);
}
.arena-status.soon {
  background: rgba(181, 114, 44, 0.12);
  color: var(--c-accent-deep);
}
.arena-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.arena-status.live .arena-status-dot {
  animation: pulse 1.6s infinite;
}

.arena-card h3 {
  font-family: var(--f-sans);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-ink);
}
.arena-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--c-ink-soft);
  flex-wrap: wrap;
}
.arena-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.arena-meta i {
  color: var(--c-accent);
  font-size: 0.95em;
}

/* =========================================================
   MANIFESTO
   ========================================================= */
.manifesto { padding: var(--gap-2xl) 32px; }

.manifesto-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.manifesto-text {
  font-family: var(--f-sans);
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 500;
  line-height: 1.4;
  color: var(--c-ink);
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}
.manifesto-sign {
  margin-top: var(--gap-xl);
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--c-ink-muted);
}

/* =========================================================
   CTA
   ========================================================= */
.cta {
  padding: var(--gap-2xl) 32px;
  background: var(--c-ink);
  color: var(--c-paper);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: 'E4D5';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: clamp(200px, 34vw, 480px);
  color: var(--c-paper);
  opacity: 0.03;
  pointer-events: none;
  white-space: nowrap;
}
.cta-inner {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.cta h2 {
  font-family: var(--f-sans);
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: var(--gap-md);
  color: var(--c-paper);
}
.cta p {
  font-size: 17px;
  color: rgba(244, 232, 207, 0.75);
  margin-bottom: var(--gap-xl);
  line-height: 1.6;
}
.cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.cta .btn-primary {
  background: var(--c-paper);
  color: var(--c-ink);
}
.cta .btn-primary:hover {
  background: var(--c-accent-hi);
  color: var(--c-ink);
}
.cta .btn-ghost {
  color: var(--c-paper);
  border-color: rgba(244, 232, 207, 0.3);
}
.cta .btn-ghost:hover {
  background: rgba(244, 232, 207, 0.08);
  border-color: var(--c-paper);
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: #1a0f0a;
  color: rgba(244, 232, 207, 0.65);
  padding: 60px 32px 32px;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--gap-xl);
  margin-bottom: var(--gap-xl);
}

.footer-brand .nav-logo {
  color: var(--c-paper);
  font-size: 26px;
  margin-bottom: 16px;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  max-width: 300px;
  color: rgba(244, 232, 207, 0.65);
}

.footer-col h4 {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--c-paper);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 14px;
  color: rgba(244, 232, 207, 0.65);
  transition: color var(--t-fast);
}
.footer-col a:hover {
  color: var(--c-accent-hi);
}

.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 32px;
  border-top: 1px solid rgba(244, 232, 207, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}

.footer-social {
  display: flex;
  gap: 16px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(244, 232, 207, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-paper);
  transition: all var(--t-fast);
  font-size: 14px;
}
.footer-social a:hover {
  background: var(--c-accent);
  border-color: var(--c-accent);
  transform: translateY(-2px);
}

/* =========================================================
   REVEAL ON SCROLL
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   RESPONSIVE — 1024
   ========================================================= */
@media (max-width: 1024px) {
  .modes-grid { grid-template-columns: repeat(2, 1fr); }
  .arena-grid { grid-template-columns: repeat(2, 1fr); }
  .live-board-wrap { grid-template-columns: 1fr; }
  .live-board-side { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   RESPONSIVE — 860
   ========================================================= */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-right .lang-switch { display: none; }
  .nav-right .nav-cta { display: none; }
  .nav-burger { display: flex; }

  .hero { padding: 100px 24px 60px; min-height: auto; }
  .hero-stats { gap: 32px; }
  .hero-scroll { display: none; }

  .modes,
  .steps,
  .live-board,
  .leaders,
  .arena,
  .manifesto,
  .cta {
    padding: 60px 24px;
  }
  .section-head { margin-bottom: 48px; }

  .steps-list { grid-template-columns: 1fr; gap: 40px; }

  .leaders-head,
  .leaders-row {
    grid-template-columns: 40px 1fr 70px 50px 50px 50px;
    gap: 10px;
    padding: 12px 16px;
    font-size: 13px;
  }
  .leaders-head span:nth-child(5),
  .leaders-row  > *:nth-child(5) { display: none; }

  .footer-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* =========================================================
   RESPONSIVE — 560
   ========================================================= */
@media (max-width: 560px) {
  .modes-grid { grid-template-columns: 1fr; }
  .arena-grid { grid-template-columns: 1fr; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn { width: 100%; }
  .hero-stats { gap: 24px; }
  .hero-stat-num { font-size: 26px; }

  .section-title { font-size: 30px; }

  .leaders-head,
  .leaders-row {
    grid-template-columns: 32px 1fr 60px 40px;
    gap: 8px;
    padding: 10px 12px;
    font-size: 12px;
  }
  .leaders-head span:nth-child(4),
  .leaders-row  > *:nth-child(4),
  .leaders-head span:nth-child(5),
  .leaders-row  > *:nth-child(5) { display: none; }

  .board-frame { padding: 6px; }

  .cta h2 { font-size: 30px; }

  .lang-switch-mobile button {
    padding: 10px 18px;
    font-size: 14px;
  }
}

/* =========================================================
   RESPONSIVE — 380 (очень узкие)
   ========================================================= */
@media (max-width: 380px) {
  .hero-title { font-size: 40px; }
  .hero-stat-num { font-size: 22px; }
  .hero-stat-label { font-size: 10px; letter-spacing: 1px; }
  .side-value { font-size: 16px; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   PRINT
   ========================================================= */
@media print {
  .nav,
  .nav-mobile,
  .hero-scroll,
  body { background: #fff; color: #000; }
  a { text-decoration: underline; }
  .reveal { opacity: 1; transform: none; }
}

.custom-alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}
.custom-alert-overlay.active { display: flex; }

.custom-alert {
  background: linear-gradient(145deg, #2c1810, #1a0f0a);
  border: 2px solid #4a3528;
  border-radius: var(--r-sm);
  padding: 40px 48px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--sh-deep);
  animation: alertPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-alert .alert-icon {
  font-size: 56px;
  margin-bottom: 12px;
  display: block;
  line-height: 1;
}
.custom-alert .alert-icon.check { color: var(--c-danger); }
.custom-alert .alert-icon.mate  { color: var(--c-mate); }
.custom-alert .alert-icon.draw  { color: var(--c-warn); }

.custom-alert .alert-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--c-board-light);
  margin-bottom: 8px;
}
.custom-alert .alert-title.check { color: var(--c-danger); }
.custom-alert .alert-title.mate  { color: var(--c-mate); }
.custom-alert .alert-title.draw  { color: var(--c-warn); }

.custom-alert .alert-subtitle {
  font-size: 16px;
  color: #c4b5a5;
  margin-bottom: 24px;
  line-height: 1.5;
}

.custom-alert .alert-btn {
  background: var(--c-accent);
  color: var(--c-bg-page);
  border: none;
  padding: 12px 36px;
  border-radius: var(--r-sm);
  font-family: var(--f-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-med);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.custom-alert .alert-btn:hover { transform: scale(1.05); background: var(--c-accent-hi); }

@keyframes alertPop {
  0%   { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== Вспышка над доской ===== */
.board-frame {
  position: relative;
}

.board-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.board-flash.visible { opacity: 1; }

.board-flash-text {
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: clamp(36px, 8vw, 96px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 0 40px rgba(0,0,0,0.4);
  animation: flashPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  text-align: center;
  padding: 0 16px;
  line-height: 1.1;
}
.board-flash.visible .board-flash-text { opacity: 1; }

.board-flash.win {
  background: radial-gradient(circle at center,
    rgba(212, 165, 116, 0.85) 0%,
    rgba(181, 114, 44, 0.7) 50%,
    rgba(138, 82, 28, 0.5) 100%);
}
.board-flash.win .board-flash-text { color: #fff8e7; }

.board-flash.lose {
  background: radial-gradient(circle at center,
    rgba(181, 61, 61, 0.85) 0%,
    rgba(120, 30, 30, 0.7) 50%,
    rgba(80, 20, 20, 0.5) 100%);
}

.board-flash.draw {
  background: radial-gradient(circle at center,
    rgba(120, 110, 100, 0.8) 0%,
    rgba(90, 80, 70, 0.6) 50%,
    rgba(60, 50, 40, 0.4) 100%);
}
.board-flash.draw .board-flash-text { color: #f0e8d8; }

@keyframes flashPop {
  0%   { transform: scale(0.4); opacity: 0; }
  50%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.board-frame.pulse {
  animation: framePulse 0.9s ease 3;
}
@keyframes framePulse {
  0%, 100% { box-shadow: var(--sh-board); }
  50% {
    box-shadow:
      0 0 0 4px rgba(212, 165, 116, 0.6),
      0 0 40px rgba(212, 165, 116, 0.4),
      var(--sh-board);
  }
}

/* ===== Подсветка короля под шахом ===== */
.sq.in-check {
  background: rgba(200, 50, 50, 0.55) !important;
  box-shadow: inset 0 0 0 3px rgba(255, 80, 80, 0.8);
  animation: checkPulse 1s infinite;
}
@keyframes checkPulse {
  0%, 100% { background: rgba(200, 50, 50, 0.55); }
  50%      { background: rgba(220, 70, 70, 0.75); }
}

/* ===== Toast ===== */
.board-toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-danger);
  color: #fff;
  padding: 14px 32px;
  border-radius: var(--r-sm);
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 12px 32px rgba(180, 40, 40, 0.5);
  z-index: 9999;
  animation: toastDrop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.board-toast[hidden] { display: none; }
@keyframes toastDrop {
  from { transform: translate(-50%, -40px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

/* ===== Оверлей (для модалок на главной) ===== */
.play-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(26, 15, 10, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}
.play-overlay[hidden] { display: none; }

.play-overlay-card {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 40px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: var(--sh-deep);
  animation: popIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.play-overlay-title {
  font-family: var(--f-sans);
  font-size: 26px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 8px;
}
.play-overlay-sub {
  font-size: 15px;
  color: var(--c-ink-soft);
  line-height: 1.5;
  margin-bottom: 20px;
}
.play-overlay-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.play-end-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 16px;
  color: var(--c-accent);
}

.private-link-input {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-ink);
  background: rgba(44, 24, 16, 0.04);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  text-align: center;
  margin-bottom: 8px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.leaders-table[hidden] { display: none; }
.leaders-empty[hidden] { display: none; }

.leaders-empty {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
  color: var(--c-ink-muted);
  font-size: 15px;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  line-height: 1.5;
}

/* =========================================================
   LEGAL PAGES (rules, privacy)
   ========================================================= */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}

.legal h1 {
  font-family: var(--f-serif);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--c-ink);
  margin-bottom: 12px;
}

.legal .legal-date {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-ink-muted);
  margin-bottom: 40px;
  letter-spacing: 0.5px;
}

.legal h2 {
  font-family: var(--f-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-ink);
  margin-top: 40px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.legal p,
.legal li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-ink-soft);
  margin-bottom: 12px;
}

.legal ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal ul li {
  margin-bottom: 8px;
}

.legal a {
  color: var(--c-accent);
  text-decoration: underline;
  transition: color var(--t-fast);
}

.legal a:hover {
  color: var(--c-accent-deep);
}

@media (max-width: 600px) {
  .legal {
    padding: 100px 20px 60px;
  }
  .legal h1 {
    font-size: 32px;
  }
  .legal h2 {
    font-size: 19px;
    margin-top: 32px;
  }
}