/* Календарь вкладки «Турниры» кабинета (tour-cal.js, 15.11.2026): сетка
   месяца с точками, окно «турниры дня», «Мой ближайший турнир», плашка с
   датой у карточек. Цвета — клубные (--accent), золотой — «можно записаться». */
.tournaments-card { --tc-gold: #c28a12; --tc-gold-soft: #fbf3df; --tc-cell-line: color-mix(in srgb, var(--accent) 18%, #fff); }
.tc-eyebrow { margin: 0 0 2px; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* мой ближайший турнир */
.tc-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); align-items: center; margin-top: var(--s3);
  padding: var(--s4); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--r-lg); background: rgba(255, 255, 255, .7); }
.tc-hero[hidden] { display: none; }
.tc-hero-count { width: 124px; padding: 14px 8px; border-radius: var(--r-md); background: var(--accent); color: #fff; text-align: center; }
.tc-hero-count b { display: block; font-size: 2.75rem; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.tc-hero-count b.is-word { font-size: 1.375rem; line-height: 1.3; }
.tc-hero-count span { font-size: .8125rem; opacity: .92; }
.tc-hero-name { margin: 2px 0; font-size: 1.125rem; line-height: 1.3; }
.tc-hero-name a { color: inherit; }
.tc-hero .sub { margin: 0; }

/* шаги заявки */
.tc-steps { display: flex; gap: 4px; margin: var(--s3) 0 0; }
.tc-steps span { flex: 1 1 auto; padding: 9px 0 0; position: relative; font-size: .75rem; line-height: 1.2; color: var(--muted); }
.tc-steps span::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 3px; background: var(--line); }
.tc-steps .is-done { color: var(--ok); }
.tc-steps .is-done::before { background: var(--ok); }
.tc-steps .is-now { color: var(--accent-ink); font-weight: 700; }
.tc-steps .is-now::before { background: var(--accent); }

/* кто едет из клуба */
.tc-mates { display: flex; align-items: center; flex-wrap: wrap; margin-top: var(--s2); font-size: .8125rem; color: var(--muted); }
.tc-mates i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; display: grid; place-items: center;
  font-style: normal; font-size: .6875rem; font-weight: 700; color: #fff; }
.tc-mates i:first-child { margin-left: 0; }
.tc-mates span { margin-left: 8px; }

/* сетка месяца */
.tc-cal { margin-top: var(--s4); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(255, 255, 255, .7); }
.tc-cal[hidden] { display: none; }
.tc-cal-head { display: flex; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s3); }
.tc-cal-title { margin: 0; font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--accent-ink); }
.tc-cal-nav { margin-left: auto; display: flex; gap: var(--s2); }
.tc-nav-btn { min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--tc-cell-line); background: var(--accent-soft);
  color: var(--accent-ink); font: inherit; font-weight: 600; font-size: .9375rem; cursor: pointer; }
.tc-dow, .tc-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.tc-dow { margin-bottom: 6px; font-size: .8125rem; font-weight: 600; color: var(--muted); text-align: center; }
.tc-week + .tc-week { margin-top: 6px; }
.tc-day { position: relative; min-height: 72px; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--tc-cell-line); background: var(--accent-soft);
  display: flex; flex-direction: column; justify-content: space-between; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tc-day-n { font-size: 1.125rem; font-weight: 800; line-height: 1; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.tc-day-marks { display: flex; align-items: center; justify-content: flex-end; gap: 5px; min-height: 14px; font-size: .8125rem; font-weight: 700; color: var(--accent-ink); }
.tc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.tc-dot-mine { background: var(--accent); }
.tc-dot-open { background: var(--tc-gold); }
.tc-dot-wait { border: 2px solid var(--accent); background: transparent; }
.tc-day.is-empty { background: rgba(255, 255, 255, .55); border-color: var(--line); }
.tc-day.is-empty .tc-day-n { color: var(--muted); font-weight: 700; }
.tc-day.is-past { background: rgba(255, 255, 255, .35); border-color: color-mix(in srgb, var(--line) 60%, transparent); }
.tc-day.is-past .tc-day-n { color: #a9afb8; }
.tc-day.is-past .tc-day-marks { opacity: .55; }
.tc-day:disabled { cursor: default; }
.tc-day.is-today { background: #fff; box-shadow: 0 0 0 2px var(--accent) inset; }
.tc-day.is-today::after { content: "сегодня"; position: absolute; top: 9px; right: 9px; font-size: .625rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .04em; }
.tc-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.tc-day[aria-pressed="true"] .tc-day-n, .tc-day[aria-pressed="true"] .tc-day-marks, .tc-day[aria-pressed="true"]::after { color: #fff; }
.tc-day[aria-pressed="true"] .tc-dot-mine { background: #fff; }
.tc-day[aria-pressed="true"] .tc-dot-wait { border-color: #fff; }
@media (hover: hover) {
  .tc-day:not(:disabled):not([aria-pressed="true"]):hover, .tc-nav-btn:hover { border-color: var(--accent); }
}
.tc-cal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-top: var(--s3); padding-top: var(--s3);
  border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
.tc-cal-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.tc-more { display: none; margin-left: auto; }

/* форматы над «Доступными турнирами» */
.tc-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.tc-chips[hidden] { display: none; }
.tc-chip { min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .875rem; cursor: pointer; }
.tc-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* карточка турнира: плашка с датой слева, остальное — как строил кабинет */
.cab-tournaments li.tc-card { display: grid; grid-template-columns: 62px minmax(0, 1fr); column-gap: var(--s3); align-items: start; }
.cab-tournaments li.tc-card[hidden] { display: none; }
.cab-tournaments li.tc-card > * { grid-column: 2; min-width: 0; }
.cab-tournaments li.tc-card > .tc-date { grid-column: 1; grid-row: 1 / span 14; }
.cab-tournaments li.tc-mine { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tc-date { border-radius: 12px; padding: 8px 4px; text-align: center; background: var(--accent-soft); color: var(--accent-ink); }
.tc-mine > .tc-date { background: var(--accent); color: #fff; }
.cab-t-club > .tc-date { background: var(--tc-gold-soft); color: #7a5606; }
.cab-tournaments li.past > .tc-date, .cab-t-unfit > .tc-date { background: var(--surface); color: var(--muted); }
.tc-date b { display: block; font-size: 1.375rem; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-date b.is-long { font-size: .9375rem; padding: 4px 0; }
.tc-date span { font-size: .8125rem; font-weight: 600; }
.tc-date i { display: block; font-style: normal; font-size: .6875rem; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }
.tc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.tc-tag { font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); background: #eef2f4; color: #3c4658; }
.tc-tag-rapid { background: #e8f2f9; color: #1f5f8d; }
.tc-tag-blitz { background: #fdf3d9; color: #8a5a00; }
.tc-when { margin-left: auto; font-size: .8125rem; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* мои результаты */
.tc-results { margin-top: var(--s4); }
.tc-results[hidden] { display: none; }
.tc-results .mini-title { margin: 0 0 var(--s2); font-size: .9375rem; }
.tc-results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.tc-result { padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, .7); }
.tc-result-medal { font-size: 1.625rem; line-height: 1; }
.tc-result h4 { margin: 8px 0 2px; font-size: .9375rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tc-result .sub { margin: 0; }
.tc-result-nums { display: flex; gap: var(--s4); margin-top: var(--s2); }
.tc-result-nums span { display: block; font-size: .6875rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tc-result-nums b { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.tc-result-text { margin: var(--s2) 0 0; font-size: .875rem; }

/* окно «турниры дня»; на телефоне выезжает снизу */
.tc-pop { border: 0; padding: 0; width: min(680px, calc(100vw - 32px)); max-height: min(80vh, 760px); border-radius: var(--r-lg); background: #fff; color: var(--ink);
  box-shadow: 0 24px 64px rgba(20, 21, 26, .3); overflow: hidden; }
.tc-pop[open] { display: flex; flex-direction: column; }
.tc-pop::backdrop { background: rgba(20, 21, 26, .45); }
.tc-pop-head { display: flex; align-items: flex-start; gap: var(--s3); padding: 20px 24px 12px; border-bottom: 1px solid var(--line); }
.tc-pop-title { margin: 0; font-size: 1.375rem; color: var(--accent-ink); }
.tc-pop-x { margin-left: auto; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.tc-pop-body { padding: 4px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.tc-pop-nav { display: flex; gap: var(--s2); padding: 12px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.tc-pop-nav[hidden] { display: none; }
.tc-pop-nav .btn { flex: 1; min-width: 0; min-height: 44px; }
@media (prefers-reduced-motion: no-preference) {
  .tc-pop[open] { animation: tc-pop-in .18s ease-out; }
  .tc-pop[open]::backdrop { animation: tc-pop-fade .18s ease-out; }
  .tc-day, .tc-chip, .tc-nav-btn { transition: background-color .15s, border-color .15s, box-shadow .15s; }
}
@keyframes tc-pop-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes tc-pop-fade { from { opacity: 0; } }

@media (max-width: 760px) {
  .tc-hero { grid-template-columns: 1fr; gap: var(--s3); padding: var(--s3); }
  .tc-hero-count { width: auto; display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 10px; }
  .tc-hero-count b { font-size: 1.875rem; }
  .tc-cal { padding: var(--s3); }
  .tc-cal-head { align-items: center; flex-wrap: wrap; row-gap: var(--s2); }
  .tc-cal-head .tc-eyebrow { display: none; }
  .tc-cal-title { font-size: 1.125rem; white-space: nowrap; }
  .tc-nav-btn { padding: 0 10px; min-width: 40px; font-size: .875rem; }
  .tc-cal-nav { gap: 6px; }
  .tc-dow, .tc-week { gap: 4px; }
  .tc-week + .tc-week { margin-top: 4px; }
  .tc-day { min-height: 60px; padding: 6px; border-radius: 12px; }
  .tc-day-n { font-size: 1rem; }
  .tc-day-marks { gap: 3px; font-size: .6875rem; }
  .tc-dot { width: 7px; height: 7px; }
  .tc-day.is-today::after { display: none; }
  .tc-week-only .tc-week:not(.is-cur) { display: none; }
  .tc-more { display: inline-flex; }
  .tc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tc-chips::-webkit-scrollbar { display: none; }
  .tc-chip { flex: none; }
  .cab-tournaments li.tc-card { grid-template-columns: 54px minmax(0, 1fr); column-gap: 10px; }
  .tc-date b { font-size: 1.1875rem; }
  .tc-date b.is-long { font-size: .8125rem; }
  .tc-when { margin-left: 0; }
  .tc-steps span { font-size: .6875rem; }
  .tc-results-grid { grid-template-columns: 1fr; }
  .tc-pop { width: 100%; max-width: 100%; max-height: 86vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .tc-pop-head { position: relative; padding: 18px 16px 10px; }
  .tc-pop-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-strong); }
  .tc-pop-body { padding: 0 16px 16px; }
  .tc-pop-nav { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
}
