:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --subtle: #f4f3ef;
  --ink: #141a16;
  --ink-2: #545b56;
  --muted: #8b918c;
  --line: #e9e7e1;
  --line-strong: #d9d6ce;
  --accent: #0e5c3c;
  --accent-soft: #eaf1ec;
  --hero: #e8ede5;
  --hero-ground: #dfe6da;
  --good: #16794a;
  --bad: #b8412c;
  --focus: #3b6db3;
  --note: #f6eb8f;
  --under: #2d5a98;
  --over: #a3402d;
  --series-1: #3b6db3;
  --series-2: #d4643c;
  --series-3: #2e9575;
  --series-4: #c99a1e;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;
  --series-other: #b5b2a8;
  --radius: 14px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Comic Sans MS', cursive;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.2;
  font-weight: 600;
}

button {
  font: inherit;
  color: inherit;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.muted {
  color: var(--muted);
}

/* ---------- Мелкие элементы ---------- */

.ball {
  display: inline-block;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
}

.player-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  white-space: nowrap;
}

.place {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--subtle);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.medal-1 {
  background: linear-gradient(145deg, #f8e9ae, #dfbb52);
  color: #4d3a08;
}

.medal-2 {
  background: linear-gradient(145deg, #f4f5f6, #c6cacf);
  color: #3a3f44;
}

.medal-3 {
  background: linear-gradient(145deg, #f2d3b6, #cc9063);
  color: #4e2b10;
}

.medal-4 {
  background: linear-gradient(145deg, #eee6d8, #c7b293);
  color: #4b3b26;
}

.tag-hard {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
  vertical-align: 2px;
}

.topar {
  display: inline-block;
  min-width: 36px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.is-good {
  color: var(--good);
}

.is-bad {
  color: var(--bad);
}

.is-even {
  color: var(--ink-2);
}

.topar.is-good {
  background: #e7f2eb;
}

.topar.is-bad {
  background: #f7e8e3;
}

.topar.is-even {
  background: var(--subtle);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--subtle);
}

.periods {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: #efede7;
}

.period {
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.period:hover {
  color: var(--ink);
}

.period.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 26, 22, 0.1);
}

/* ---------- Верхняя панель ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tabs {
  display: flex;
  gap: 28px;
  height: 100%;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.tab:hover,
.tab[aria-current="page"] {
  color: var(--ink);
}

.tab[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.topbar .periods {
  justify-self: end;
}

/* ---------- Шапка: лужайка, стикер и мяч ---------- */

.hero {
  margin-top: 28px;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 32px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--hero);
}

.hero-text {
  padding: 44px 0 28px 44px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.hero-title {
  margin-top: 10px;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.hero-tagline {
  margin: 14px 0 0;
  max-width: 460px;
  font-size: 17px;
  color: var(--ink-2);
}

.sticky-note {
  position: relative;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 270px;
  margin: 36px 44px 12px 0;
  padding: 22px 22px 20px;
  background: var(--note);
  color: #2e2618;
  text-decoration: none;
  transform: rotate(-2deg);
  box-shadow: 0 12px 20px -14px rgba(60, 50, 10, 0.55), 0 1px 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease;
}

.sticky-note::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  width: 80px;
  height: 22px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transform: translateX(-50%) rotate(3deg);
}

.sticky-note:hover {
  transform: rotate(0deg) scale(1.02);
}

.note-kicker,
.note-date,
.note-result {
  font-family: var(--font-hand);
  line-height: 1.15;
}

.note-kicker {
  font-size: 19px;
  color: #7a6a2c;
}

.note-title {
  font-size: 17px;
  font-weight: 600;
}

.note-title .tag-hard {
  border-color: rgba(46, 38, 24, 0.3);
  color: rgba(46, 38, 24, 0.7);
}

.note-date {
  font-size: 19px;
}

.note-result {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
}

.green {
  position: relative;
  grid-column: 1 / -1;
  height: 64px;
  background: var(--hero-ground);
  border-top: 1px solid rgba(20, 26, 22, 0.06);
}

.cup {
  position: absolute;
  right: 40%;
  top: 50%;
}

.cup-hole {
  position: absolute;
  left: -12px;
  top: -4px;
  width: 24px;
  height: 8px;
  border-radius: 50%;
  background: #1d2620;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6);
}

.cup-hole.is-hit {
  animation: cup-flash 0.9s ease;
}

@keyframes cup-flash {
  30% {
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6), 0 0 0 5px rgba(14, 92, 60, 0.18);
  }
}

.pin {
  position: absolute;
  left: -3px;
  bottom: 0;
  width: 24px;
  height: 60px;
  overflow: visible;
  transform-origin: 3px 58px;
}

.cup:has(.is-hit) .pin {
  animation: pin-pop 0.7s ease;
}

@keyframes pin-pop {
  40% {
    transform: translateY(-6px) rotate(-5deg);
  }
}

.pin-flag {
  transform-box: fill-box;
  transform-origin: left center;
  animation: flag-wave 3s ease-in-out infinite;
}

@keyframes flag-wave {
  0%, 100% {
    transform: scaleX(1) skewY(0deg);
  }
  50% {
    transform: scaleX(0.86) skewY(-5deg);
  }
}

.ball-putt {
  position: absolute;
  left: 44px;
  top: calc(50% - 11px);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.ball-putt::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
}

.golf-ball {
  position: relative;
  width: 18px;
  height: 18px;
  overflow: hidden;
  border-radius: 50%;
  background: #fbfbf8;
  box-shadow: 0 2px 3px rgba(20, 26, 22, 0.28);
  transition: box-shadow 0.2s ease;
}

.golf-dimples {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.11) 0.6px, transparent 1.1px) 0 0 / 3px 3px,
    radial-gradient(circle, rgba(0, 0, 0, 0.11) 0.6px, transparent 1.1px) 1.5px 1.5px / 3px 3px;
}

.golf-ball::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95) 0 16%, rgba(255, 255, 255, 0) 38%, rgba(20, 26, 22, 0.16) 100%);
}

.ball-putt:hover .golf-ball {
  box-shadow: 0 2px 3px rgba(20, 26, 22, 0.28), 0 0 0 5px rgba(14, 92, 60, 0.12);
}

.putt-caption {
  position: absolute;
  left: 84px;
  right: 22%;
  top: 50%;
  font-size: 14px;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.putt-caption.is-visible {
  animation: caption 3.2s ease forwards;
}

@keyframes caption {
  0% {
    opacity: 0;
    transform: translateY(-30%);
  }
  10%, 80% {
    opacity: 1;
    transform: translateY(-50%);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%);
  }
}

/* ---------- Секции ---------- */

main {
  padding-bottom: 56px;
}

.section {
  margin-top: 72px;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: 24px;
  letter-spacing: -0.015em;
}

.section-head p {
  margin: 6px 0 0;
  max-width: 640px;
  color: var(--ink-2);
}

.panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.note {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.empty {
  margin: 64px 0;
  text-align: center;
  color: var(--muted);
}

/* ---------- Итоги ---------- */

.scoreboard {
  margin-top: 48px;
}

.scoreboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sb-item {
  display: flex;
  flex-direction: column;
  padding: 4px 24px;
}

.sb-item:first-child {
  padding-left: 0;
}

.sb-item + .sb-item {
  border-left: 1px solid var(--line);
}

.sb-value {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.sb-label {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.scoreboard-since {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Таблица лидеров ---------- */

.board-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.board {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.board thead th {
  padding: 14px 10px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.board td {
  padding: 16px 10px;
  vertical-align: middle;
}

.board tbody tr + tr td {
  border-top: 1px solid var(--line);
}

.board .num {
  text-align: right;
  white-space: nowrap;
}

.b-pos {
  width: 48px;
  padding-left: 20px !important;
}

.b-player {
  min-width: 230px;
}

.b-who {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
}

.b-who .ball {
  align-self: center;
}

.b-name {
  font-size: 15px;
  font-weight: 600;
}

.b-nick {
  font-size: 13px;
  color: var(--muted);
}

.b-notes {
  display: block;
  margin-top: 3px;
  padding-left: 20px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.b-notes span {
  cursor: help;
  white-space: nowrap;
  border-bottom: 1px dotted var(--line-strong);
}

.b-main {
  font-size: 20px;
  font-weight: 600;
}

.mini-meter {
  display: block;
  width: 48px;
  height: 3px;
  margin: 6px 0 0 auto;
  border-radius: 2px;
  background: color-mix(in srgb, var(--c) 20%, transparent);
  overflow: hidden;
}

.mini-meter span {
  display: block;
  height: 100%;
  background: var(--c);
}

.form-list {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.form-item {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
}

/* ---------- Графики ---------- */

.chart-box {
  position: relative;
  min-height: 120px;
  margin-top: 12px;
}

.chart-box.is-waiting .chart-svg,
.chart-box.is-waiting .sbar-track {
  visibility: hidden;
}

.chart-svg {
  display: block;
  max-width: 100%;
  overflow: visible;
  font-family: var(--font);
}

.chart-svg .grid {
  stroke: #f0eee9;
  stroke-width: 1;
}

.chart-svg .axis,
.hole-strip .axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart-svg .tick {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart-svg .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-svg .dot {
  stroke: var(--surface);
  stroke-width: 2;
}

.chart-svg .end-label {
  fill: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.chart-svg .end-value {
  fill: var(--ink);
  font-weight: 600;
}

.chart-svg .bar {
  transform-box: fill-box;
  transform-origin: bottom;
}

.chart-svg .cap-label {
  fill: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
}

.chart-svg .crosshair-line {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart-svg .hit {
  fill: transparent;
  cursor: crosshair;
  touch-action: pan-y;
  outline: none;
}

.chart-svg rect.hit.is-active,
.chart-svg rect.hit:focus-visible {
  fill: rgba(20, 26, 22, 0.04);
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(20, 26, 22, 0.1);
  font-size: 12px;
  pointer-events: none;
}

.tooltip-title {
  margin-bottom: 6px;
  color: var(--muted);
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1px 0;
}

.tooltip-key {
  flex-shrink: 0;
  width: 12px;
  height: 2px;
  border-radius: 1px;
}

.tooltip-key--box {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.tooltip-value {
  min-width: 28px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tooltip-label {
  color: var(--ink-2);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-key {
  display: inline-block;
  width: 14px;
  height: 2px;
  border-radius: 1px;
}

.legend-key--box {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.sbar {
  margin-bottom: 16px;
}

.sbar:last-of-type {
  margin-bottom: 0;
}

.sbar-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

.key-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.sbar-name {
  font-weight: 600;
}

.sbar-total {
  color: var(--muted);
  font-size: 13px;
}

.sbar-track {
  display: flex;
  gap: 2px;
  height: 22px;
}

.sbar-seg {
  display: grid;
  place-items: center;
  flex-basis: 0;
  min-width: 3px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  cursor: default;
  outline-offset: 1px;
}

.sbar-seg:first-child {
  border-radius: 4px 0 0 4px;
}

.sbar-seg:last-child {
  border-radius: 0 4px 4px 0;
}

.sbar-seg:only-child {
  border-radius: 4px;
}

.sbar-seg:hover {
  filter: brightness(1.05);
}

.sbar-seg--light {
  color: #ffffff;
}

.sbar-seg--dark {
  color: #1b1d1a;
}

.table-view {
  margin-top: 16px;
  font-size: 13.5px;
}

.table-view > summary {
  color: var(--muted);
  cursor: pointer;
}

.table-scroll {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
  white-space: nowrap;
}

.data-table thead th {
  color: var(--muted);
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Кто кого ---------- */

.h2h {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 14px;
}

.h2h th {
  padding: 6px 8px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.h2h-head {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-size: 13px;
  color: var(--ink-2);
}

.h2h td {
  padding: 10px 8px;
  border-radius: 8px;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: var(--subtle);
}

.h2h-cell strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.h2h-cell small {
  color: var(--muted);
  font-size: 11px;
}

.h2h-self {
  color: var(--muted);
}

/* ---------- Рекорды ---------- */

.records {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.record {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

a.record:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.record-icon {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1;
}

.record-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.record-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.record-who {
  font-weight: 600;
}

.record-detail {
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- Места ---------- */

.section--first {
  margin-top: 48px;
}

.panel--flush {
  padding: 0;
  overflow: hidden;
}

.medals {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.medals th,
.medals td {
  padding: 14px 12px;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}

.medals th:first-child {
  padding-left: 24px;
}

.medals td:last-child {
  padding-right: 24px;
}

.medals thead th {
  padding-top: 16px;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.medals tbody tr {
  border-top: 1px solid var(--line);
}

.medals .num {
  text-align: center;
}

.medals td.num:not(.muted) {
  font-size: 17px;
  font-weight: 600;
}

.medal-head {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.medal-share {
  width: 30%;
}

.medal-bar {
  display: flex;
  gap: 2px;
  height: 8px;
  min-width: 140px;
  overflow: hidden;
  border-radius: 4px;
}

.medal-bar span {
  flex-basis: 0;
}

.months {
  display: grid;
  gap: 16px;
}

.month {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.month-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 16px 20px 12px;
  font-size: 13px;
}

.month-head h3 {
  font-size: 16px;
}

.places-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.places-table th,
.places-table td {
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}

.places-table th:first-child,
.places-table td:first-child {
  padding-left: 20px;
}

.places-table th:last-child,
.places-table td:last-child {
  padding-right: 20px;
}

.places-table thead th {
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.places-table .num {
  width: 1%;
  text-align: center;
}

.places-table .pt-cell {
  text-align: center;
}

.pt-player {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
}

.pt-when a {
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.pt-when a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pt-course {
  display: block;
  max-width: 280px;
  overflow: hidden;
  font-size: 11.5px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.places-table tfoot th,
.places-table tfoot td {
  border-top-color: rgba(20, 26, 22, 0.06);
  background: var(--hero);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.places-table tfoot th {
  color: var(--ink-2);
  font-weight: 400;
}

.places-table tfoot .is-best {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Партии ---------- */

.periods--sub {
  margin-top: 48px;
}

.evening {
  margin-top: 40px;
}

.evening-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
  margin-bottom: 14px;
}

.evening-head h3 {
  font-size: 17px;
}

.evening-meta {
  font-size: 13.5px;
  color: var(--muted);
}

.evening-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 16px;
  align-items: start;
}

.game,
.course {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 110px;
}

.game.is-focused {
  border-color: var(--accent);
  animation: focus-pulse 1.6s ease 2;
}

@keyframes focus-pulse {
  50% {
    box-shadow: 0 0 0 5px rgba(14, 92, 60, 0.14);
  }
}

.game-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px 10px;
}

.game-title {
  font-size: 17px;
  font-weight: 600;
}

.game-meta {
  font-size: 13px;
  color: var(--muted);
}

.standings {
  width: 100%;
  border-collapse: collapse;
}

.standings td,
.standings th {
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-weight: inherit;
}

.standings .num {
  text-align: right;
}

.standings td:last-child {
  width: 1%;
}

.standings .st-place {
  width: 1%;
  padding-right: 0;
}

.standings tr.is-winner {
  background: #f7f9f6;
}

.standings tr.is-winner .player-tag {
  font-weight: 600;
}

.st-strokes {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.game-note {
  margin: 12px 20px 0;
  font-size: 14px;
  font-style: italic;
  color: var(--ink-2);
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

.game-note--last {
  margin-bottom: 18px;
}

/* ---------- Карточка по лункам ---------- */

.scorecard-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.scorecard {
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.scorecard th,
.scorecard td {
  padding: 5px 3px;
  text-align: center;
  white-space: nowrap;
}

.scorecard thead th {
  min-width: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.scorecard tbody th,
.scorecard thead tr > th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 5px 14px 5px 0;
  background: var(--surface);
  text-align: left;
  font-weight: 500;
}

.par-row td,
.par-row th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.sc-total {
  padding-left: 12px !important;
  font-weight: 600;
  text-align: left !important;
}

.sc-total small {
  font-weight: 500;
  color: var(--muted);
}

.sc {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-weight: 500;
  line-height: 1;
}

.sc--birdie,
.sc--eagle,
.sc--ace {
  border-radius: 50%;
}

.sc--birdie {
  box-shadow: inset 0 0 0 1.5px var(--under);
}

.sc--eagle {
  box-shadow: inset 0 0 0 1.5px var(--under), inset 0 0 0 3px var(--surface), inset 0 0 0 4.5px var(--under);
}

.sc--ace {
  background: var(--under);
  color: #ffffff;
}

.sc--bogey,
.sc--double,
.sc--disaster {
  border-radius: 3px;
}

.sc--bogey {
  box-shadow: inset 0 0 0 1.5px var(--over);
}

.sc--double {
  box-shadow: inset 0 0 0 1.5px var(--over), inset 0 0 0 3px var(--surface), inset 0 0 0 4.5px var(--over);
}

.sc--disaster {
  background: var(--over);
  color: #ffffff;
}

.sc-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.sc-legend .sc {
  width: 20px;
  height: 20px;
  font-size: 11px;
}

.sc-legend .sc:not(:first-child) {
  margin-left: 8px;
}

/* ---------- Трассы ---------- */

.courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 16px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 20px;
  margin: 0;
  padding: 6px 20px 18px;
}

.facts dt {
  font-size: 12px;
  color: var(--muted);
}

.facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  font-weight: 500;
}

.holder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  white-space: nowrap;
}

.hole-strip {
  margin: 0;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

.hole-strip svg {
  display: block;
  width: 100%;
  height: 64px;
}

.hole-strip figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Окно карточки по лункам ---------- */

.sheet {
  width: fit-content;
  min-width: min(calc(100vw - 32px), 420px);
  max-width: min(calc(100vw - 32px), 960px);
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(20, 26, 22, 0.25);
}

.sheet[open] {
  animation: sheet-in 0.22s ease-out;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.sheet::backdrop {
  background: rgba(20, 26, 22, 0.4);
}

.sheet-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.sheet-title {
  font-size: 18px;
}

.sheet-meta {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.sheet-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--subtle);
  color: var(--ink-2);
  font-size: 15px;
  cursor: pointer;
}

.sheet-close:hover {
  background: var(--line);
}

.sheet-body {
  padding: 16px 24px 24px;
  overflow: auto;
}

.sheet-shot {
  margin-top: 16px;
}

/* ---------- Лайтбокс и подвал ---------- */

.lightbox {
  width: min(96vw, 1400px);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #000000;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(15, 20, 17, 0.8);
}

.lightbox img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 92vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
}

.site-footer {
  padding-top: 32px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.site-footer p {
  margin: 0 0 6px;
}

/* ---------- Адаптив ---------- */

@media (max-width: 860px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand periods" "tabs tabs";
    row-gap: 8px;
    height: auto;
    padding-top: 14px;
  }

  .brand {
    grid-area: brand;
  }

  .topbar .periods {
    grid-area: periods;
  }

  .tabs {
    grid-area: tabs;
    gap: 24px;
    height: 44px;
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .cup {
    right: 14%;
  }

  .hero-text {
    padding: 32px 24px 8px;
  }

  .hero-title {
    font-size: 48px;
  }

  .sticky-note {
    justify-self: start;
    margin: 20px 24px 22px 28px;
  }

  .ball-putt {
    left: 24px;
  }

  .putt-caption {
    left: 62px;
  }

  .scoreboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 20px;
  }

  .records {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sb-item:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 1100px) {
  .board-wrap {
    border: 0;
    background: none;
  }

  .board thead {
    display: none;
  }

  .board,
  .board tbody {
    display: block;
  }

  .board tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 12px 10px;
    margin-bottom: 12px;
    padding: 16px 16px 16px 52px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .board td,
  .board tbody tr + tr td {
    padding: 0;
    border: 0;
  }

  .board .num {
    text-align: left;
  }

  .board td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--muted);
  }

  .b-pos {
    position: absolute;
    left: 0;
    top: 14px;
    width: 52px;
    padding-left: 0 !important;
    text-align: center;
  }

  .b-player,
  .b-form {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .b-notes {
    padding-left: 0;
  }

  .b-main {
    font-size: 15px;
  }

  .mini-meter {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .topbar .periods {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .period {
    padding: 5px 8px;
  }

  .tabs {
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tab {
    font-size: 14.5px;
    white-space: nowrap;
  }

  .tab[aria-current="page"]::after {
    bottom: 0;
  }

  .brand-name {
    display: none;
  }

  .hero {
    margin-top: 20px;
  }

  .hero-card {
    border-radius: 16px;
  }

  .hero-text {
    padding: 30px 22px 6px;
  }

  .hero-title {
    font-size: 40px;
  }

  .hero-tagline {
    font-size: 15px;
  }

  .sticky-note {
    width: auto;
    max-width: 280px;
    margin: 20px 22px 26px 26px;
  }

  .green {
    height: 56px;
  }

  .cup {
    right: 12%;
  }

  .ball-putt {
    left: 22px;
  }

  .putt-caption {
    left: 56px;
    right: 20%;
    font-size: 13px;
  }

  .section {
    margin-top: 52px;
  }

  .section-head h2 {
    font-size: 21px;
  }

  .scoreboard {
    margin-top: 36px;
  }

  .sb-item {
    padding: 2px 16px;
  }

  .sb-value {
    font-size: 32px;
  }

  .panel {
    padding: 18px 16px;
  }

  .h2h {
    font-size: 13px;
  }

  .sheet {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100vh - 32px);
  }

  .sheet-inner {
    max-height: calc(100vh - 32px);
  }

  .sheet-head {
    padding: 16px 16px 12px;
  }

  .sheet-body {
    padding: 14px 16px 18px;
  }

  .records {
    grid-template-columns: 1fr;
  }

  .h2h-head span:last-child,
  .medal-head span:last-child {
    display: none;
  }

  .medal-share {
    display: none;
  }

  .medals th,
  .medals td {
    padding-left: 6px;
    padding-right: 6px;
  }

  .medals th:first-child {
    padding-left: 16px;
  }

  .medals td:last-child {
    padding-right: 16px;
  }

  .places-table th,
  .places-table td {
    padding-left: 4px;
    padding-right: 4px;
  }

  .pt-course {
    max-width: 96px;
  }

  .pt-player {
    font-size: 11.5px;
  }

  .month-head,
  .places-table th:first-child,
  .places-table td:first-child {
    padding-left: 16px;
  }

  .month-head,
  .places-table th:last-child,
  .places-table td:last-child {
    padding-right: 16px;
  }

  .game-head,
  .standings td,
  .standings th,
  .game-actions {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
