/* FC Berkana design tokens */
:root {
  --color-gold: #C5A059;
  --color-gold-soft: #D4AF37;
  --color-gold-muted: #A88B4A;
  --color-focus-ring: #E8D5A3;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --font-display: "Cinzel", serif;
  --font-ui: "Manrope", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --max-content: 1120px;
  --nav-h: 64px;
  --bottom-nav-h: 60px;
  --transition: 200ms ease;
}

html.theme-dark {
  --bg-page: #121A14;
  --bg-elevated: #1B1B1B;
  --bg-subtle: #1E2A22;
  --bg-overlay: rgba(0, 0, 0, 0.72);
  --text-primary: #F2F2F2;
  --text-secondary: #B8B8B8;
  --text-muted: #8A8A8A;
  --border-accent: var(--color-gold);
  --border-subtle: rgba(197, 160, 89, 0.35);
  --accent: var(--color-gold);
  --accent-contrast: #121A14;
  --nav-active: var(--color-gold);
  --danger: #C45C5C;
  --success: #6B9F7A;
  --radar-player: #3B82C4;
  --radar-norm: rgba(197, 160, 89, 0.35);
  --radar-team: var(--color-gold);
  --table-berkana-bg: rgba(197, 160, 89, 0.12);
}

html.theme-light {
  --bg-page: #F7F5F0;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #E8EDE8;
  --bg-overlay: rgba(18, 26, 20, 0.55);
  --text-primary: #1B3022;
  --text-secondary: #3D4F42;
  --text-muted: #6B7A6E;
  --border-accent: var(--color-gold-muted);
  --border-subtle: rgba(27, 48, 34, 0.15);
  --accent: #2E4D32;
  --accent-contrast: #F7F5F0;
  --nav-active: #2E4D32;
  --danger: #C45C5C;
  --success: #6B9F7A;
  --radar-player: #2E5A8C;
  --radar-norm: rgba(46, 77, 50, 0.2);
  --radar-team: var(--color-gold-muted);
  --table-berkana-bg: rgba(46, 77, 50, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  transition: background-color var(--transition), color var(--transition);
}
html.theme-light { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(46, 77, 50, 0.25), transparent 50%),
    var(--bg-page);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.container {
  width: min(100% - 2 * var(--space-4), var(--max-content));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-page) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--nav-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

/* Theme logos: green bg for dark UI, white bg for light UI */
.brand-logo {
  display: block;
  object-fit: contain;
  background: transparent;
}
.brand-logo-light { display: none; }
html.theme-light .brand-logo-dark { display: none; }
html.theme-light .brand-logo-light { display: block; }

.brand-logo--header {
  width: auto;
  height: 52px;
  border-radius: var(--radius-sm);
}
@media (min-width: 768px) {
  .brand-logo--header { height: 58px; }
}

.brand-logo--placeholder {
  width: 88px;
  height: 88px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.brand-logo--avatar {
  width: 78%;
  height: 78%;
  border-radius: 0;
  object-fit: contain;
}

.brand-logo--profile {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  object-fit: contain;
  margin-left: auto;
}

.card-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
}
.nav-desktop {
  display: none;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 1024px) {
  .nav-desktop { display: flex; }
}
.nav-desktop a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}
.nav-desktop a:hover,
.nav-desktop a.is-active {
  color: var(--nav-active);
  border-bottom-color: var(--nav-active);
  text-decoration: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
}
.icon-btn:hover { border-color: var(--border-accent); }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--bottom-nav-h);
  color: var(--text-muted);
  font-size: 9px;
  text-decoration: none;
  padding-inline: 1px;
}
.bottom-nav a.is-active { color: var(--nav-active); }

/* Calendar */
.cal-week-schedule {
  width: 100vw;
  max-width: 100vw;
  margin: 0 0 var(--space-6);
  margin-left: calc(50% - 50vw);
  background: var(--bg-subtle);
  border-block: 1px solid var(--border-subtle);
  padding: var(--space-5) 0 var(--space-6);
}
.cal-week-schedule__inner {
  width: min(100% - 2 * var(--space-4), 1400px);
  margin-inline: auto;
}
.cal-week-schedule__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.cal-week-schedule__heading {
  text-align: center;
  flex: 1;
}
.cal-week-schedule__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  color: var(--text-primary);
}
.cal-week-schedule__range {
  margin: var(--space-1) 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.cal-week-nav {
  min-width: 44px;
  font-size: 1.4rem;
  line-height: 1;
  padding-inline: var(--space-3);
}
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-3);
}
@media (max-width: 1023px) {
  .cal-week-grid {
    grid-auto-flow: column;
    grid-template-columns: repeat(7, minmax(220px, 1fr));
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .cal-week-day { scroll-snap-align: center; }
  .cal-week-day--today { scroll-snap-align: center; }
}
.cal-week-day {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  min-height: 220px;
}
.cal-week-day--today {
  border-color: var(--border-accent);
  box-shadow: inset 0 0 0 1px var(--border-accent);
}
.cal-week-day__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}
.cal-week-day__weekday {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-week-day__date {
  font-weight: 700;
  font-size: 1.05rem;
}
.cal-week-day__events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.cal-week-day__empty {
  color: var(--text-muted);
  font-size: 13px;
}
.cal-week-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--cal-bg, #1F6F4A);
  color: var(--cal-fg, #F5C542);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  min-height: 88px;
}
.cal-week-card__main {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  color: inherit;
  text-decoration: none;
  flex: 1;
}
.cal-week-card__main:hover {
  filter: brightness(1.06);
  text-decoration: none;
  color: inherit;
}
.cal-week-card__maps {
  align-self: flex-start;
  font-size: 12px;
}
.cal-week-card__icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
}
.cal-week-card__icon .cal-event__icon-img {
  width: 28px;
  height: 28px;
}
.cal-week-card__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.cal-week-card__type {
  font-size: 11px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cal-week-card__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}
.cal-week-card__time,
.cal-week-card__place {
  font-size: 12px;
  opacity: 0.92;
}
.cal-months-lead { margin-top: var(--space-2); }

.cal-months {
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 960px) {
  .cal-months { grid-template-columns: 1fr 1fr; }
}
.cal-month__title {
  margin: 0 0 var(--space-4);
  font-size: 1.25rem;
}
.cal-grid__head,
.cal-grid__week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
}
.cal-grid__wd {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: var(--space-2) 0;
}
.cal-day {
  min-height: 88px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  overflow: visible;
  position: relative;
  min-width: 0;
}
.cal-day--out { opacity: 0.45; }
.cal-day__num {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.cal-day__events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  min-width: 0;
  width: 100%;
}
.cal-event-wrap {
  position: relative;
  max-width: 100%;
  min-width: 0;
}
.cal-event-wrap:hover,
.cal-event-wrap:focus-within,
.cal-event-wrap.is-open {
  z-index: 25;
}
.cal-event {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--cal-bg, #1F6F4A);
  color: var(--cal-fg, #F5C542);
  border-radius: 4px;
  padding: 3px 2px;
  font-size: 10px;
  line-height: 1;
  text-decoration: none;
  position: relative;
  z-index: 1;
}
.cal-event:hover {
  text-decoration: none;
  color: var(--cal-fg, #F5C542);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.cal-event__tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 200px;
  max-width: min(280px, 70vw);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
@media (hover: hover) and (pointer: fine) {
  .cal-event-wrap:hover .cal-event__tip,
  .cal-event-wrap:focus-within .cal-event__tip {
    display: grid;
    gap: 4px;
  }
}
.cal-event-wrap.is-open .cal-event__tip {
  display: grid;
  gap: 4px;
}
.cal-event__tip-type {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cal-event__tip-title {
  font-weight: 700;
  font-size: 13px;
}
.cal-event__tip-time,
.cal-event__tip-desc,
.cal-event__tip-place {
  font-size: 12px;
  color: var(--text-secondary);
}
.cal-event__tip-maps,
.cal-event__tip-more {
  font-size: 12px;
  font-weight: 600;
}
.cal-event__tip-more {
  color: var(--color-gold, #C5A059);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: 2px;
}
.cal-maps-link,
a.cal-maps-link {
  color: #3B82F6;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cal-maps-link:hover,
a.cal-maps-link:hover {
  color: #60A5FA;
}
html.theme-light .cal-maps-link,
html.theme-light a.cal-maps-link {
  color: #2563EB;
}
html.theme-light .cal-maps-link:hover,
html.theme-light a.cal-maps-link:hover {
  color: #1D4ED8;
}
.cal-event__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
.cal-event__icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
  border-radius: 2px;
}
.cal-icon-light { display: none; }
html.theme-light .cal-icon-dark { display: none; }
html.theme-light .cal-icon-light { display: block; }
.cal-detail__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.cal-detail__icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
}
.cal-detail__icon .cal-event__icon-img {
  width: 28px;
  height: 28px;
}
.cal-event__title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  min-width: 0;
}
.cal-months .cal-event__title {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  -webkit-line-clamp: unset;
}
.cal-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.cal-detail__badge {
  display: inline-block;
  background: var(--cal-bg);
  color: var(--cal-fg);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: var(--space-3);
  font-size: 13px;
}
.attendance-grid {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 640px) {
  .attendance-grid { grid-template-columns: 1fr 1fr; }
}
.attendance-public-block p { margin: 0.25rem 0; }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.linkish {
  background: none;
  border: none;
  color: var(--nav-active);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}
.linkish.danger { color: #c44; }
.table-actions { white-space: nowrap; }
.table-actions form { display: inline; }

.page {
  padding-block: var(--space-5) var(--space-8);
}
@media (max-width: 1023px) {
  .page { padding-bottom: calc(var(--bottom-nav-h) + var(--space-6)); }
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 var(--space-5);
}

h2 { font-size: 20px; font-weight: 600; margin: 0 0 var(--space-4); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-secondary {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .card-grid.news { grid-template-columns: repeat(2, 1fr); }
  .card-grid.players { grid-template-columns: repeat(2, 1fr); }
  .card-grid.media { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid.players { grid-template-columns: repeat(4, 1fr); }
  .card-grid.media { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
  color: inherit;
  text-decoration: none;
  display: block;
}
.card:hover {
  border-color: var(--border-accent);
  text-decoration: none;
}
.card-cover {
  aspect-ratio: 16 / 9;
  background: var(--bg-subtle);
  object-fit: cover;
  object-position: center top;
  width: 100%;
}
.card-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-body { padding: var(--space-4); }
.card-title {
  margin: 0 0 var(--space-2);
  font-size: 18px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { color: var(--text-muted); font-size: 13px; margin-bottom: var(--space-2); }
.card-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.player-card {
  text-align: center;
  padding: var(--space-4);
  overflow: visible;
}
.player-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
  min-height: 96px;
}
.player-card .player-avatar-wrap {
  margin: 0;
  flex: 0 0 96px;
}
.player-list-jersey {
  flex: 0 0 80px;
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-list-jersey__canvas {
  position: relative;
  width: 80px;
  isolation: isolate;
}
.player-list-jersey__img {
  display: block;
  position: relative;
  z-index: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
.player-list-jersey__overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.player-list-jersey__number {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  color: #f0e2b8 !important;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.65);
  top: 22%;
  width: 56%;
  text-align: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.player-list-jersey__number--double {
  width: 70%;
  font-size: 24px;
  letter-spacing: -0.04em;
}
.player-card .player-secondary-position {
  margin-top: calc(-1 * var(--space-1));
  margin-bottom: 0;
  font-size: 12px;
}
/* Обёртка = тот же бокс, что был у .player-avatar (центрирование + отступ снизу) */
.player-avatar-wrap {
  position: relative;
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-3);
  overflow: visible;
  line-height: 0;
}
.player-avatar-wrap--lg {
  width: 140px;
  height: 140px;
  margin: 0;
}
.player-avatar-wrap .player-avatar {
  width: 100%;
  height: 100%;
  margin: 0;
}
.player-avatar {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-gold);
  object-fit: cover;
  margin: 0 auto var(--space-3);
  background: var(--bg-subtle);
  display: block;
}
.player-avatar.lg {
  width: 140px;
  height: 140px;
}
.captain-armband {
  position: absolute;
  top: -6%;
  right: -6%;
  width: 36%;
  height: auto;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.player-avatar-wrap--lg .captain-armband,
.captain-armband--lg {
  width: 38%;
  top: -5%;
  right: -5%;
}
.captain-label {
  display: block;
  margin-top: var(--space-1);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.position-group-title {
  margin: var(--space-6) 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-secondary);
}
.position-group:first-child .position-group-title {
  margin-top: 0;
}
.coach-profile-toolbar {
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.captain-toggle-form {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-weight: 500;
}
.checkbox-row input {
  width: auto;
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}
.form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}


.stars { color: var(--color-gold); letter-spacing: 2px; }

/* Profile */
.profile-header {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
}
@media (min-width: 768px) {
  .profile-header {
    grid-template-columns: auto minmax(280px, 1fr) minmax(160px, 200px) auto auto;
    align-items: center;
  }
  .profile-header:not(:has(.profile-psych)) {
    grid-template-columns: auto minmax(280px, 1fr) minmax(160px, 200px) auto;
  }
}
.profile-summary {
  min-width: 0;
}
.profile-psych {
  justify-self: center;
}
.profile-name {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 var(--space-2);
}
.profile-jersey {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-width: 0;
}
.profile-jersey__canvas {
  position: relative;
  width: 100%;
  max-width: 208px;
  isolation: isolate;
}
.profile-jersey__img {
  display: block;
  position: relative;
  z-index: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
.profile-jersey__overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.profile-jersey__name,
.profile-jersey__number {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  color: #f0e2b8 !important;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.65);
}
.profile-jersey__name {
  top: 14%;
  width: 64%;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.05;
}
.profile-jersey__number {
  top: 26%;
  width: 56%;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(52px, 6vw, 82px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.profile-jersey__number--double {
  width: 68%;
  font-size: clamp(44px, 5vw, 70px);
  letter-spacing: -0.04em;
}
.profile-club-logo {
  justify-self: end;
}
@media (max-width: 767px) {
  .profile-header {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
  .player-avatar-wrap--lg {
    grid-column: 1;
    grid-row: 1;
  }
  .profile-summary {
    grid-column: 2;
    grid-row: 1;
  }
  .profile-jersey {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .profile-jersey__canvas {
    width: min(82%, 320px);
    min-height: 180px;
  }
  .profile-psych {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
  }
  .profile-club-logo {
    grid-column: 1 / -1;
    grid-row: 4;
    justify-self: center;
  }
}
.profile-attrs {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
}
@media (min-width: 768px) {
  .profile-attrs { grid-template-columns: 1fr 1fr; }
}
.attr-block {
  border-top: 1px solid var(--border-accent);
  padding-top: var(--space-3);
}
.attr-label { color: var(--text-muted); font-size: 13px; margin-bottom: var(--space-1); }

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.partners-panel {
  max-width: 720px;
  margin-inline: auto;
}
.partner-card {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  text-align: center;
}
.partner-logo {
  width: min(100%, 520px);
  border-radius: var(--radius-md);
  background: #fff;
  padding: var(--space-3);
}
.partner-name {
  margin: 0;
  font-family: var(--font-display);
}
.partner-note {
  margin: 0;
  color: var(--text-secondary);
}

.contacts-panel {
  max-width: 100%;
}
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  align-items: start;
}
.contact-card {
  height: 100%;
}
.contact-photo {
  width: min(100%, 280px);
  aspect-ratio: 1;
  object-fit: cover;
  padding: 0;
  background: var(--bg-subtle);
}
.contact-role {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
@media (max-width: 767px) {
  .contacts-grid {
    gap: var(--space-2);
  }
  .contact-photo {
    width: 100%;
  }
  .contact-card .partner-name {
    font-size: 0.95rem;
  }
  .contact-card .btn {
    font-size: 12px;
    padding-inline: var(--space-2);
  }
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-4);
  min-height: 40px;
  cursor: pointer;
  font: inherit;
}
.segmented button.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-4);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
table.data th { color: var(--text-muted); font-weight: 600; }
table.data tr.row-warn td { color: var(--danger, #b00020); }
table.data tr.row-muted td { color: var(--text-muted); opacity: 0.85; }
table.data tr.row-insurance-alert td {
  background: rgba(196, 92, 92, 0.18);
  color: #8b1e1e;
}
table.data tr.row-insurance-soon td {
  background: rgba(201, 162, 39, 0.28);
  color: #5c4a0a;
}
table.data.data-insurance {
  table-layout: fixed;
  width: 100%;
}
table.data.data-insurance th,
table.data.data-insurance td {
  text-align: center;
  vertical-align: middle;
}
table.data.data-insurance th:first-child,
table.data.data-insurance td.col-player {
  text-align: left;
}
table.data.data-insurance th:nth-child(4),
table.data.data-insurance td.col-status {
  width: 28%;
  white-space: nowrap;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
table.data.data-insurance th:nth-child(5),
table.data.data-insurance td:last-child {
  width: 5.5rem;
}
.table-scroll { overflow-x: auto; }
.team-logo-cell {
  width: 36px;
  padding-left: 4px !important;
  padding-right: 4px !important;
}
.team-logo {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: block;
}
.standings-table .col-place {
  width: 2rem;
  padding-right: 4px !important;
  text-align: center;
}
.standings-table .col-logo {
  width: 36px;
  padding: 4px !important;
}
.standings-table .col-team {
  padding-left: 6px !important;
  white-space: nowrap;
  font-weight: 600;
}
.standings-table .col-chess {
  min-width: 2.4rem;
  max-width: 3.2rem;
  padding: 4px 2px !important;
  text-align: center;
  font-size: 11px;
  font-family: var(--font-mono);
  border-left: 1px solid var(--border-subtle);
}
.standings-table .col-chess-end {
  border-right: 1px solid var(--border-accent);
}
.standings-table td.col-stat,
.standings-table th.col-stat {
  padding-left: 4px !important;
  padding-right: 4px !important;
  text-align: center;
  white-space: nowrap;
}
.standings-table .col-chess-end + .col-stat {
  padding-left: 10px !important;
}
.standings-table td.col-pts,
.standings-table th.col-pts {
  padding-left: 2px !important;
  padding-right: 8px !important;
  font-weight: 700;
}
.standings-table .cell-self {
  color: var(--text-muted);
  background: var(--bg-subtle);
}
.standings-table .cell-win { color: var(--success); }
.standings-table .cell-loss { color: var(--danger); }
.standings-table .cell-empty { color: var(--text-muted); }

.radar-duo {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 900px) {
  .radar-duo { grid-template-columns: 1fr 1fr; }
}
.radar-duo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.radar-duo-item canvas {
  width: 100% !important;
  max-width: 420px;
}
.radar-caption {
  margin: var(--space-3) 0 0;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.awards-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-2);
}
.awards-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-4);
}
.awards-row--personal {
  /* starts on its own line below tournament row */
}
.award-badge {
  margin: 0;
  width: 112px;
  cursor: help;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.award-badge--mvp {
  width: 226px; /* asset ~2.02:1 vs square 112 */
}
.award-badge--league {
  width: 96px; /* vertical ~2:3 league posters */
}
.award-badge--tour {
  /* same media as MVP ribbon; count overlay */
}
.award-badge__media {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
}
.award-badge img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition);
  object-fit: contain;
}
.award-badge--mvp img {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.award-badge--league img {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.award-badge:hover img {
  border-color: var(--border-accent);
}
.award-badge--mvp:hover img,
.award-badge--league:hover img {
  border-color: transparent;
}
.award-badge__count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 1.5em;
  padding: 1px 7px;
  border-radius: 999px;
  background: #0d2418;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.35;
  text-align: center;
  border: 2px solid #d4af37;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  z-index: 1;
}
.award-badge__caption {
  display: block;
  margin-top: 8px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.25;
  min-height: 2.5em; /* 2 lines — row captions don't shift neighbors */
}
@media (max-width: 767px) {
  .award-badge { width: 84px; }
  .award-badge--mvp { width: 170px; }
  .award-badge--league { width: 72px; }
  .award-badge__count {
    right: 4px;
    bottom: 4px;
    font-size: 0.85rem;
  }
}

.tour-team-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.tour-team-label {
  font-weight: 700;
  min-width: 4.5rem;
  padding-top: 0.4rem;
}
.tour-team-icons {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  flex: 1;
  padding-bottom: 4px;
}
.player-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  min-width: 64px;
}
.player-chip img,
.player-chip__ph {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.player-chip__name {
  font-size: 0.7rem;
  text-align: center;
  max-width: 72px;
  line-height: 1.2;
}
.banner-warn {
  padding: var(--space-3);
  background: #fff3cd;
  border: 1px solid #e6d28a;
  border-radius: var(--radius-sm);
  max-width: 720px;
}

.delta-better { color: var(--success); }
.delta-worse { color: var(--danger); }

/* Forms */
.form-stack { display: grid; gap: var(--space-4); max-width: 640px; }
.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-primary);
  font: inherit;
}
.form-field textarea { min-height: 120px; padding: var(--space-3); }
.form-field .hint { color: var(--text-muted); font-size: 13px; margin-top: var(--space-1); }
.form-field .error { color: var(--danger); font-size: 13px; margin-top: var(--space-1); }
.awards-editor__row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
@media (max-width: 640px) {
  .awards-editor__row {
    grid-template-columns: 1fr;
  }
}

.norm-tip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--border-accent);
  color: inherit;
}
.norm-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  min-width: 220px;
  max-width: min(320px, 70vw);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-accent);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-line;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  pointer-events: none;
}
.norm-tip:hover::after,
.norm-tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.otp-inputs {
  display: flex;
  gap: var(--space-2);
  font-family: var(--font-mono);
}
.otp-inputs input {
  width: 44px;
  text-align: center;
  font-size: 20px;
}

.messages { list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.messages li {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  margin-bottom: var(--space-2);
}
.messages .success { border-color: var(--success); }
.messages .error { border-color: var(--danger); }

.tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.tabs a, .tabs button {
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}
.tabs a.is-active, .tabs button.is-active {
  color: var(--nav-active);
  border-bottom-color: var(--nav-active);
}

.media-thumb {
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
  background: var(--bg-subtle);
}
.shop-card {
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.shop-card-title {
  font-size: 15px;
  margin: 0 0 var(--space-1);
}
.shop-card-price {
  margin: 0;
  font-weight: 700;
  color: var(--color-gold);
}
.shop-notice {
  margin: 0 0 var(--space-4);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
}
.shop-filters {
  overflow-x: auto;
}

.pagination {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-5);
}

.coach-shell .bottom-nav { display: none !important; }
.coach-shell .page { padding-bottom: var(--space-8); }

.coach-hub {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .coach-hub { grid-template-columns: repeat(2, 1fr); }
}
.coach-tile {
  padding: var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
}
.coach-tile:hover {
  border-color: var(--border-accent);
  text-decoration: none;
}
.coach-tile h2 { margin: 0 0 var(--space-2); }

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-5) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom));
  color: var(--text-muted);
  font-size: 13px;
}
@media (max-width: 1023px) {
  .site-footer {
    padding-bottom: calc(var(--bottom-nav-h) + var(--space-5) + env(safe-area-inset-bottom));
  }
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.footer-copy { margin: 0; }
.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-elevated);
}
.social-link:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  text-decoration: none;
}
.social-link span { font-size: 13px; font-weight: 500; }
.icon-btn.is-muted {
  opacity: 0.55;
  text-decoration: line-through;
}


.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.lightbox img { max-height: 85vh; max-width: 95vw; border-radius: var(--radius-md); }
.lightbox-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

.crop-preview {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.crop-preview.cover { width: 240px; height: 135px; border-radius: var(--radius-sm); }

/* Psychotypes */
.psych-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-2);
}
.psych-badge--lg { gap: 10px; }
.psych-badge__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.psych-badge__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.psych-badge--lg .psych-badge__icon { width: 40px; height: 40px; }
.psych-badge__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gold);
}
.psych-badge--lg .psych-badge__name { font-size: 17px; }
.psych-tooltip {
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + 8px);
  width: min(320px, 80vw);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-top: 2px solid var(--color-gold);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  text-align: left;
}
.psych-tooltip p { margin: var(--space-2) 0 0; font-size: 13px; color: var(--text-secondary); }
.psych-tooltip__role { color: var(--text-primary) !important; font-weight: 500; }
.psych-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.psych-chip {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 13px;
}
.psych-mismatch {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  background: rgba(196, 92, 92, 0.12);
  font-size: 14px;
}
.psych-formula { margin: var(--space-2) 0 0; padding-left: 1.2rem; }
.lineup-formation-form { margin-bottom: var(--space-4); }
.lineup-pitch {
  display: grid;
  gap: var(--space-3);
  max-width: 520px;
  margin: 0 auto var(--space-5);
  padding: var(--space-5);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.lineup-slot {
  display: grid;
  gap: var(--space-1);
  justify-items: center;
}
.lineup-slot-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.lineup-slot select { width: min(100%, 280px); }
.function-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.function-chip {
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 13px;
  border: 1px solid var(--border-subtle);
}
.function-chip.is-on {
  border-color: var(--success);
  color: var(--success);
}
.function-chip.is-off {
  color: var(--text-muted);
  border-style: dashed;
}
.risk-card {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-gold);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--bg-subtle);
}

[x-cloak]{display:none!important}

.media-albums {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .media-albums {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .media-albums {
    grid-template-columns: repeat(3, 1fr);
  }
}
.media-album-card .card-body {
  display: grid;
  gap: var(--space-2);
}
.media-photo-assign-form {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.media-photo-card {
  scroll-margin-top: 24px;
}
.album-photo-picker {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.album-photo-picker__item {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}
.album-photo-picker__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.album-photo-picker__item span {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.lineup-workspace {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
  margin-bottom: var(--space-5);
}
@media (min-width: 1100px) {
  .lineup-workspace {
    grid-template-columns: minmax(340px, 420px) minmax(460px, 580px);
    justify-content: start;
  }
}
.lineup-config-panel,
.lineup-preview-panel {
  margin-bottom: 0;
  width: 100%;
}
.lineup-config-panel { max-width: 420px; }
.lineup-workspace--five .lineup-preview-panel { max-width: 520px; }
.lineup-workspace--six .lineup-preview-panel { max-width: 580px; }
.lineup-preview-panel {
  justify-self: stretch;
}
.lineup-config-grid {
  display: grid;
  gap: var(--space-4);
}
.lineup-slot {
  justify-items: start;
}
.lineup-slot-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lineup-slot select {
  width: 100%;
  max-width: none;
}
.lineup-preview-panel h2 {
  margin-bottom: var(--space-4);
}
.lineup-field {
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(9, 27, 20, 0.12), rgba(9, 27, 20, 0.12)),
    url("../img/lineup_field_horizontal.jpg") center / cover no-repeat;
  border: 1px solid rgba(201, 168, 92, 0.35);
  box-shadow: inset 0 0 0 1px rgba(201, 168, 92, 0.08);
}
.lineup-field--five {
  aspect-ratio: 1.34 / 1;
  max-height: min(46vh, 380px);
}
.lineup-field--six {
  aspect-ratio: 1.2 / 1;
  max-height: min(50vh, 420px);
}
.lineup-marker {
  position: absolute;
  transform: translate(-50%, -50%);
}
.lineup-token {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 102px;
}
.lineup-token__photo {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-gold);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.lineup-token__photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
}
.lineup-token__name {
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(12, 20, 17, 0.88);
  border: 1px solid rgba(201, 168, 92, 0.25);
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}
.lineup-token--empty .lineup-token__name {
  color: #fff;
  border-style: dashed;
}
@media (max-width: 767px) {
  .lineup-config-panel,
  .lineup-preview-panel {
    max-width: none;
  }
  .lineup-field {
    max-height: none;
  }
  .lineup-field--five {
    aspect-ratio: 1.22 / 1;
  }
  .lineup-field--six {
    aspect-ratio: 1.12 / 1;
  }
  .lineup-token {
    width: 84px;
  }
  .lineup-token__photo {
    width: 48px;
    height: 48px;
  }
  .lineup-token__name {
    font-size: 11px;
    padding: 4px 6px;
  }
}

.tournament-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.tournament-switcher select {
  min-width: min(280px, 100%);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: inherit;
  font: inherit;
}
.organizer-card {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  flex-wrap: wrap;
}
.organizer-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.organizer-photo--empty {
  background: var(--bg-subtle);
}
.organizer-name { margin: 0 0 var(--space-3); }
.organizer-links { justify-content: flex-start; }
.regulation-text {
  font-family: var(--font-body, inherit);
  line-height: 1.55;
  color: var(--text-primary);
}
.regulation-text p {
  margin: 0 0 0.55em;
  white-space: pre-wrap;
}
.regulation-gap { height: 0.75em; }

/* Tournament participants row */
.participants-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  padding: var(--space-2) 0;
}
.participant-logo-btn,
.logo-inline-btn,
.chess-score-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.participant-logo-btn {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
  min-width: 0;
}
.participant-logo {
  width: clamp(36px, 8vw, 64px);
  height: clamp(36px, 8vw, 64px);
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: block;
}
.participant-logo--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  width: clamp(36px, 8vw, 64px);
  height: clamp(36px, 8vw, 64px);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
}
.participant-logo--placeholder.sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
}
.chess-score-btn {
  text-decoration: underline;
  text-underline-offset: 2px;
  min-width: 100%;
  min-height: 28px;
}
.chess-score-btn:hover { color: var(--accent); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-title { margin: 0 0 var(--space-4); padding-right: 2rem; }
.team-photo-wrap { margin-bottom: var(--space-4); }
.team-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: block;
}
.team-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--text-muted);
}
.team-socials {
  justify-content: center;
  width: 100%;
}

.match-modal-scoreline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-5);
}
.match-modal-club {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}
.match-modal-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.match-modal-logo--ph {
  background: var(--bg-subtle);
}
.match-modal-score {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.match-modal-stats-title {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}
.match-modal-stats {
  list-style: none;
  margin: 0;
  padding: 0;
}
.match-modal-stats li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.cup-bracket {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 28px minmax(0, 1fr) 28px minmax(0, 0.95fr);
  align-items: stretch;
  gap: 0;
  width: 100%;
  overflow-x: auto;
  min-height: 420px;
}
.cup-bracket__col {
  display: grid;
  align-items: center;
  min-width: 0;
}
.cup-bracket__col--qf {
  grid-template-rows: repeat(4, 1fr);
  gap: 0;
}
.cup-bracket__col--sf {
  grid-template-rows: 1fr 1fr;
  gap: 0;
}
.cup-bracket__col--final {
  display: flex;
  align-items: center;
}
.cup-bracket__node {
  display: flex;
  align-items: center;
  min-height: 0;
  height: 100%;
  padding: 6px 0;
  box-sizing: border-box;
}
.cup-bracket__col--final .cup-bracket__node {
  width: 100%;
  height: auto;
  padding: 0;
}
.cup-bracket__connectors {
  display: grid;
  align-self: stretch;
  min-width: 28px;
}
.cup-bracket__connectors--qf-sf {
  grid-template-rows: 1fr 1fr;
}
.cup-bracket__connectors--sf-final {
  grid-template-rows: 1fr;
}
.cup-bracket__fork {
  position: relative;
  height: 100%;
  min-height: 64px;
}
/* Две горизонтали + вертикаль + выход к следующему раунду */
.cup-bracket__fork::before {
  content: "";
  position: absolute;
  left: 0;
  right: 50%;
  top: 25%;
  bottom: 25%;
  border-top: 1px solid var(--border-accent);
  border-bottom: 1px solid var(--border-accent);
  border-right: 1px solid var(--border-accent);
  opacity: 0.65;
  pointer-events: none;
}
.cup-bracket__fork::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--border-accent);
  opacity: 0.65;
  pointer-events: none;
}
.cup-slot {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--bg-elevated);
  width: 100%;
}
.cup-slot-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.cup-slot-teams { display: flex; flex-direction: column; gap: var(--space-2); }
.cup-slot-team {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
}
.cup-slot-team.is-winner { font-weight: 700; color: var(--success); }
.cup-slot-score { margin-top: var(--space-2); text-align: center; }

@media (max-width: 899px) {
  .cup-bracket {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: var(--space-4);
  }
  .cup-bracket__col--qf,
  .cup-bracket__col--sf,
  .cup-bracket__col--final {
    grid-template-rows: none;
    gap: var(--space-3);
  }
  .cup-bracket__connectors {
    display: none;
  }
}

.news-detail__cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-md);
  margin-top: var(--space-4);
}

/* News home slider */
.news-slider {
  margin: 0 0 var(--space-5);
  perspective: 1200px;
}
.news-slider__viewport {
  position: relative;
  overflow: hidden;
  min-height: 220px;
}
.news-slider__stage {
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-slider__card {
  position: absolute;
  width: min(42%, 360px);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: inherit;
  text-decoration: none;
  transition: transform 0.45s ease, opacity 0.45s ease, filter 0.45s ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}
.news-slider__cover {
  width: 100%;
  height: 72%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.news-slider__title {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-family: Manrope, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-slider__card[data-offset="0"] {
  z-index: 5;
  transform: translateX(0) scale(1) rotateY(0deg);
  filter: none;
  opacity: 1;
}
.news-slider__card[data-offset="-1"] {
  z-index: 4;
  transform: translateX(-58%) scale(0.86) rotateY(18deg);
  filter: blur(1.5px);
  opacity: 0.72;
}
.news-slider__card[data-offset="1"] {
  z-index: 4;
  transform: translateX(58%) scale(0.86) rotateY(-18deg);
  filter: blur(1.5px);
  opacity: 0.72;
}
.news-slider__card[data-offset="-2"] {
  z-index: 3;
  transform: translateX(-98%) scale(0.74) rotateY(28deg);
  filter: blur(2.5px);
  opacity: 0.5;
}
.news-slider__card[data-offset="2"] {
  z-index: 3;
  transform: translateX(98%) scale(0.74) rotateY(-28deg);
  filter: blur(2.5px);
  opacity: 0.5;
}
.news-slider__card[data-offset="-3"] {
  z-index: 2;
  transform: translateX(-128%) scale(0.64) rotateY(34deg);
  filter: blur(3.5px);
  opacity: 0.32;
}
.news-slider__card[data-offset="3"] {
  z-index: 2;
  transform: translateX(128%) scale(0.64) rotateY(-34deg);
  filter: blur(3.5px);
  opacity: 0.32;
}
.news-slider__dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: var(--space-3);
}
.news-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--border-subtle);
  cursor: pointer;
}
.news-slider__dot.is-active {
  background: var(--color-gold, #c5a059);
  transform: scale(1.2);
}
@media (max-width: 767px) {
  .news-slider__stage { height: 220px; }
  .news-slider__card { width: min(78%, 320px); }
  .news-slider__card[data-offset="-1"] {
    transform: translateX(-42%) scale(0.82) rotateY(14deg);
  }
  .news-slider__card[data-offset="1"] {
    transform: translateX(42%) scale(0.82) rotateY(-14deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .news-slider__card { transition-duration: 0.01ms; }
}


