/* =========================================================
   TOUR — общее
   ========================================================= */

/* ---------- HERO ---------- */
.tour-hero {
  position: relative;
  padding: 100px 32px 36px;
  text-align: center;
  overflow: hidden;
}
.tour-hero::before {
  content: attr(data-watermark);
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: clamp(160px, 28vw, 420px);
  letter-spacing: 6px;
  color: var(--c-ink);
  opacity: 0.045;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.tour-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}
.tour-hero h1 {
  font-family: var(--f-sans);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--c-ink);
}
.tour-hero h1 em {
  font-style: normal;
  color: var(--c-accent);
}
.tour-hero-sub {
  font-size: clamp(14px, 1.3vw, 17px);
  color: var(--c-ink-soft);
  max-width: 620px;
  margin: 0 auto 18px;
  line-height: 1.55;
}
.tour-hero-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  padding: 10px 18px;
  background: rgba(44, 24, 16, 0.05);
  border: 1px solid var(--c-line);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--c-ink-soft);
}
.tour-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.tour-hero-meta i {
  color: var(--c-accent);
}
.tour-hero-meta strong {
  color: var(--c-ink);
  font-weight: 600;
  font-family: var(--f-mono);
}

/* ---------- СЕКЦИИ ---------- */
.tour-section {
  padding: 28px 32px;
}
.tour-section.alt {
  background: var(--c-bg-deep);
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
  padding: 24px 32px;
}
.tour-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
}

/* ---------- ЗАГОЛОВОК СЕКЦИИ (по центру) ---------- */
.tour-section .section-head {
  text-align: center;
  margin-bottom: 20px;
}
.tour-section .section-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
}
.tour-section .section-title {
  font-size: clamp(22px, 2.8vw, 34px);
  margin: 0 0 6px;
}
.tour-section .section-sub {
  font-size: 14px;
  line-height: 1.5;
  max-width: 620px;
  margin: 0 auto 10px;
  text-align: center;
}

/* ---------- ИНФО-ПОЛОСА ---------- */
.tour-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.tour-info li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  text-align: left;
}
.tour-info li > i {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  margin-top: 2px;
  font-size: 14px;
  color: var(--c-accent);
}
.tour-info li strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 2px;
}
.tour-info li span {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--c-ink-soft);
}

/* ---------- СПИСОК СТРОК ТУРНИРОВ ---------- */
.tour-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 100px 60px 220px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  text-align: left;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.tour-row:hover {
  transform: translateY(-1px);
  border-color: var(--c-accent);
  box-shadow: var(--sh-card);
}

.tour-row-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--c-ink);
  color: var(--c-paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.tour-row[data-tc="bullet"]    .tour-row-icon { background: #b5722c; }
.tour-row[data-tc="blitz"]     .tour-row-icon { background: #b53d3d; }
.tour-row[data-tc="rapid"]     .tour-row-icon { background: #4a7c4a; }
.tour-row[data-tc="classical"] .tour-row-icon { background: var(--c-ink); }

.tour-row-main { min-width: 0; }
.tour-row-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.2;
  margin-bottom: 2px;
}
.tour-row-sub {
  font-size: 12px;
  color: var(--c-ink-muted);
}

.tour-row-dates {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  color: var(--c-ink-soft);
  min-width: 0;
}
.tour-row-dates span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tour-row-dates i {
  font-size: 11px;
  color: var(--c-accent);
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}

.tour-row-stat,
.tour-row-prize {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--c-ink-soft);
  white-space: nowrap;
}
.tour-row-stat i,
.tour-row-prize i {
  font-size: 12px;
  color: var(--c-accent);
}
.tour-row-prize span {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--c-ink);
}

.tour-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.tour-row-actions .btn {
  padding: 8px 14px;
  font-size: 12.5px;
}

/* ---------- ПУСТОЕ СОСТОЯНИЕ ---------- */
.leaders-empty[hidden] { display: none; }
.tour-section .leaders-empty {
  padding: 28px 20px;
  font-size: 14px;
  text-align: center;
}

/* ---------- КНОПКА «ПРАВИЛА» ---------- */
.arena-rules-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 16px;
  background: var(--c-ink);
  color: var(--c-paper);
  border: 1px solid var(--c-ink);
  border-radius: 8px;
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.arena-rules-btn:hover {
  background: var(--c-accent-deep);
  border-color: var(--c-accent-deep);
  transform: translateY(-1px);
}
.arena-rules-btn i {
  font-size: 12px;
  color: var(--c-accent-hi);
}

/* ---------- МОДАЛКА ПРАВИЛ ---------- */
.arena-rules-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: arenaRulesFadeIn .2s ease;
  overflow-y: auto;
}
.arena-rules-overlay[hidden] { display: none; }

.arena-rules-modal {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: 16px;
  box-shadow: var(--sh-deep);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: arenaRulesPopIn .3s cubic-bezier(.22, 1, .36, 1);
  margin: auto;
}

.arena-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--c-line);
  flex-shrink: 0;
}
.arena-rules-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--c-ink);
}
.arena-rules-title i {
  color: var(--c-accent);
  font-size: 17px;
}
.arena-rules-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--c-line);
  color: var(--c-ink-soft);
  font-size: 15px;
  cursor: pointer;
  transition: all .15s ease;
}
.arena-rules-close:hover {
  background: rgba(44, 24, 16, 0.05);
  color: var(--c-ink);
}

.arena-rules-body {
  padding: 20px 24px;
  overflow-y: auto;
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--c-ink-soft);
}

.arena-rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.arena-rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-line);
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-ink-soft);
}
.arena-rules-list li:first-child { padding-top: 0; }
.arena-rules-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.arena-rules-list li > i {
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  margin-top: 2px;
  font-size: 15px;
  color: var(--c-accent);
}
.arena-rules-list li strong {
  color: var(--c-ink);
  font-weight: 600;
}

.arena-rules-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--c-line);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

@keyframes arenaRulesFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes arenaRulesPopIn {
  from { transform: scale(.9); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

/* =========================================================
   TOUR — страница одного турнира (/tour/:slug)
   ========================================================= */

.tour-crumbs {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 32px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--c-ink-muted);
}
.tour-crumbs a {
  color: var(--c-ink-soft);
  transition: color var(--t-fast);
}
.tour-crumbs a:hover { color: var(--c-accent); }
.tour-crumbs i {
  font-size: 10px;
  opacity: .5;
}
.tour-crumbs [data-tour-crumb] {
  color: var(--c-ink);
  font-weight: 500;
}

.tour-hero--single {
  padding-top: 16px;
}
.tour-hero--single h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.tour-hero--single h1 [data-tour-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--c-ink);
  color: var(--c-paper);
  font-size: 20px;
  flex-shrink: 0;
}
.tour-hero--single h1 [data-tour-icon].tc-bullet    { background: #b5722c; }
.tour-hero--single h1 [data-tour-icon].tc-blitz     { background: #b53d3d; }
.tour-hero--single h1 [data-tour-icon].tc-rapid     { background: #4a7c4a; }
.tour-hero--single h1 [data-tour-icon].tc-classical { background: var(--c-ink); }

.tour-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.tour-statusbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.tour-statusbar-note {
  font-size: 13px;
  color: var(--c-ink-soft);
}
.tour-statusbar-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tour-statusbar-right .btn {
  padding: 10px 18px;
  font-size: 13.5px;
}

/* ---------- Участники ---------- */
.participants-head,
.participants-row {
  display: grid;
  grid-template-columns: 50px 1fr 90px 50px 50px 50px 50px 70px;
  gap: 12px;
  padding: 12px 20px;
  align-items: center;
}
.participants-head {
  background: var(--c-ink);
  color: var(--c-paper);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.participants-row {
  border-bottom: 1px solid var(--c-line);
  font-size: 14px;
  transition: background var(--t-fast);
}
.participants-row:last-child { border-bottom: none; }
.participants-row:hover { background: rgba(212, 165, 116, 0.08); }

.p-num   { font-family: var(--f-mono); color: var(--c-ink-soft); text-align: center; }
.p-name  { font-weight: 500; color: var(--c-ink); display: flex; align-items: center; gap: 10px; }
.p-flag  { font-size: 13px; color: var(--c-ink-muted); }
.p-grade { font-family: var(--f-mono); font-weight: 700; color: var(--c-accent-deep); }
.p-stat  { text-align: center; font-family: var(--f-mono); font-size: 13.5px; color: var(--c-ink-soft); }
.p-stat.win  { color: var(--c-success); }
.p-stat.lose { color: var(--c-danger); }
.p-points {
  text-align: center;
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--c-ink);
  font-size: 15px;
}

/* ---------- Результаты ---------- */
.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.result-card {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.result-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-ink-muted);
  font-weight: 600;
  margin-bottom: 10px;
}
.result-card h4 i {
  font-size: 12px;
  color: var(--c-accent);
  opacity: .85;
}
.result-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--c-line);
  font-size: 13.5px;
}
.result-pair:last-child { border-bottom: none; }
.result-white { text-align: right; color: var(--c-ink); font-weight: 500; }
.result-black { text-align: left;  color: var(--c-ink); font-weight: 500; }
.result-score {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--c-accent-deep);
  padding: 2px 10px;
  background: rgba(181, 114, 44, 0.1);
  border-radius: var(--r-sm);
  font-size: 13px;
}

/* ---------- Расписание ---------- */
.schedule {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.schedule-item {
  position: relative;
  padding: 16px;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.schedule-item:hover {
  transform: translateY(-2px);
  border-color: var(--c-accent);
  box-shadow: var(--sh-card);
}
.schedule-item.done { opacity: .68; }
.schedule-item.live {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px rgba(181, 61, 61, .12);
}
.schedule-round {
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-ink-muted);
  margin-bottom: 5px;
}
.schedule-date {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.2;
  margin-bottom: 3px;
}
.schedule-time {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--c-ink-soft);
  margin-bottom: 10px;
}
.schedule-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 100px;
  background: rgba(44, 24, 16, 0.06);
  color: var(--c-ink-muted);
}
.schedule-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.schedule-item.done .schedule-status { color: var(--c-success); }
.schedule-item.live .schedule-status { color: var(--c-danger); }
.schedule-item.live .schedule-status::before { animation: arena-pulse 1.4s ease-in-out infinite; }
.schedule-item.soon .schedule-status { color: var(--c-accent-deep); }

/* =========================================================
   АДАПТИВ
   ========================================================= */

@media (max-width: 1024px) {
  .tour-section { padding: 24px; }
  .tour-section.alt { padding: 22px 24px; }
  .tour-info { grid-template-columns: 1fr; }
  .schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results  { grid-template-columns: 1fr; }

  .tour-row {
    grid-template-columns: 40px minmax(0, 1fr) 80px 110px auto;
  }
  .tour-row-dates { display: none; }
}

@media (max-width: 860px) {
  .tour-hero { padding: 92px 20px 28px; }
  .tour-section { padding: 22px 20px; }
  .tour-section.alt { padding: 20px 20px; }
  .tour-hero-meta {
    font-size: 12px;
    padding: 9px 16px;
    gap: 7px 14px;
  }

  .tour-crumbs { padding: 88px 20px 0; font-size: 12px; }
  .tour-hero--single h1 [data-tour-icon] { width: 44px; height: 44px; font-size: 18px; }

  .tour-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
      "icon main actions"
      "icon meta meta";
    gap: 8px 12px;
    padding: 12px 14px;
  }
  .tour-row-icon { grid-area: icon; }
  .tour-row-main { grid-area: main; }
  .tour-row-actions { grid-area: actions; }
  .tour-row-stat,
  .tour-row-prize {
    grid-area: meta;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 12px;
  }
  .tour-row-actions { justify-content: flex-end; }
  .tour-row-actions .btn-ghost { display: none; }

  .participants-head,
  .participants-row {
    grid-template-columns: 36px 1fr 70px 40px 40px 40px 60px;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
  }
  .participants-head span:nth-child(4),
  .participants-row  > *:nth-child(4) { display: none; }

  .tour-statusbar { flex-direction: column; align-items: stretch; }
  .tour-statusbar-right { justify-content: stretch; }
  .tour-statusbar-right .btn { flex: 1; justify-content: center; }
}

@media (max-width: 560px) {
  .tour-section { padding: 20px 16px; }
  .tour-section.alt { padding: 18px 16px; }
  .tour-section .section-title { font-size: 20px; }

  .schedule { grid-template-columns: 1fr; gap: 10px; }

  .tour-row {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas:
      "icon main"
      "meta meta"
      "actions actions";
  }
  .tour-row-icon { width: 34px; height: 34px; font-size: 13px; }
  .tour-row-actions { justify-content: stretch; }
  .tour-row-actions .btn { flex: 1; justify-content: center; }

  .arena-rules-list li { padding: 8px 0; font-size: 13px; }
  .arena-rules-modal { border-radius: 14px; max-height: 95vh; }
  .arena-rules-head { padding: 14px 18px; }
  .arena-rules-body { padding: 16px 18px; font-size: 13.5px; }
  .arena-rules-foot { padding: 12px 18px; }

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

  .result-pair { font-size: 12.5px; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .tour-row,
  .tour-row-icon,
  .arena-rules-list li > i {
    transition: none;
  }
  .tour-row:hover { transform: none; }
}

/* ===== Пустое состояние (регистрация идёт) ===== */
.tour-empty-state {
  padding: 40px 24px;
  text-align: center;
  background: var(--c-paper);
  border: 1px dashed var(--c-line-strong);
  border-radius: var(--r-md);
  color: var(--c-ink-soft);
}
.tour-empty-state[hidden] { display: none; }
.tour-empty-state > i {
  font-size: 36px;
  color: var(--c-accent);
  margin-bottom: 12px;
  display: block;
}
.tour-empty-state h3 {
  font-family: var(--f-sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 6px;
}
.tour-empty-state p {
  font-size: 14px;
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto;
}
.tour-table[hidden] { display: none; }