/* ============================================================
   КПРБ — публичный дизайн (вынесено из standalone.html, §7)
   ============================================================ */

:root {
  /* Text — Notion's warm near-black */
  --text: rgb(55, 53, 47);
  --text-light: rgba(55, 53, 47, 0.65);
  --text-faint: rgba(55, 53, 47, 0.45);
  --text-ghost: rgba(55, 53, 47, 0.28);
  --white-text: #ffffff;

  /* Surfaces */
  --bg: #ffffff;
  --bg-sidebar: rgb(247, 247, 245);
  --bg-subtle: rgb(251, 251, 250);
  --bg-hover: rgba(55, 53, 47, 0.055);
  --bg-active: rgba(55, 53, 47, 0.085);
  --bg-block: rgba(55, 53, 47, 0.04);

  /* Lines */
  --border: rgba(55, 53, 47, 0.09);
  --border-mid: rgba(55, 53, 47, 0.13);
  --border-strong: rgba(55, 53, 47, 0.2);

  /* Accent — Notion blue */
  --blue: #2383e2;
  --blue-hover: #0b6bcb;
  --blue-soft: rgba(35, 131, 226, 0.12);
  --blue-softer: rgba(35, 131, 226, 0.06);
  --blue-text: #1a73c7;

  /* Orienteering orange (×2 stage, emblem) */
  --orange: #e8590c;
  --orange-soft: rgba(232, 89, 12, 0.1);
  --orange-text: #c2410c;

  /* Status palette (Notion-ish muted) */
  --green: #2f9e44;
  --green-soft: rgba(47, 158, 68, 0.12);
  --green-text: #1b7a32;
  --amber: #d9a200;
  --amber-soft: rgba(217, 162, 0, 0.14);
  --amber-text: #946800;
  --gray-pill: rgba(55, 53, 47, 0.08);

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-pop: 0 0 0 1px rgba(15, 15, 15, 0.05), 0 3px 6px rgba(15, 15, 15, 0.1), 0 9px 24px rgba(15, 15, 15, 0.12);
  --shadow-card: 0 1px 2px rgba(15, 15, 15, 0.04);

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: #e9e9e7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   Emblem / brand
   ============================================================ */
.emblem { display: inline-block; border-radius: 5px; flex: none; }

.brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.brand-lockup .bl-name { font-weight: 700; font-size: 17px; letter-spacing: -0.2px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; line-height: 1;
  padding: 0 14px; height: 34px; white-space: nowrap;
  transition: background .12s, box-shadow .12s, border-color .12s;
  color: var(--text); background: transparent;
}
.btn-ghost { color: var(--text-light); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { height: 28px; font-size: 13px; padding: 0 10px; border-radius: var(--radius-sm); }

/* ============================================================
   Pills / badges
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 500; line-height: 1;
  padding: 4px 9px; border-radius: 100px; white-space: nowrap;
  background: var(--gray-pill); color: var(--text-light);
}
.pill.green { background: var(--green-soft); color: var(--green-text); }
.pill.amber { background: var(--amber-soft); color: var(--amber-text); }
.pill.neutral { background: var(--gray-pill); color: var(--text-light); }

/* ============================================================
   Public site shell
   ============================================================ */
.pub { background: var(--bg); }
.pub-nav {
  display: flex; align-items: center; gap: 28px;
  padding: 16px 40px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); z-index: 5;
}
.pub-nav .nav-links { display: flex; align-items: center; gap: 4px; }
.pub-nav .nav-links a {
  font-size: 14.5px; font-weight: 500; color: var(--text-light);
  text-decoration: none; padding: 7px 11px; border-radius: var(--radius);
}
.pub-nav .nav-links a:hover { background: var(--bg-hover); color: var(--text); }
.pub-nav .nav-links a.active { color: var(--text); }
.pub-nav .nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pub-body { padding: 40px 40px 64px; max-width: 1180px; margin: 0 auto; }

.pub-footer { padding: 16px 40px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-faint); }

/* ============================================================
   Season header
   ============================================================ */
.season-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.season-head h1 { font-size: 40px; line-height: 1.05; letter-spacing: -1.3px; font-weight: 800; margin: 0 0 8px; }
.season-head .sub { font-size: 15.5px; color: var(--text-light); }
.season-head .sub b { color: var(--text); font-weight: 600; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.stat-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 18px 16px; background: var(--bg); position: relative;
}
.stat-card.lead { background: linear-gradient(180deg, var(--blue-softer), transparent 70%); border-color: var(--blue-soft); }
.stat-card .sc-label { font-size: 12.5px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 6px; }
.stat-card .sc-value { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.stat-card .sc-value .small { font-size: 15px; font-weight: 600; color: var(--text-light); letter-spacing: 0; }
.stat-card .sc-meta { font-size: 13px; color: var(--text-light); margin-top: 5px; }

/* ============================================================
   Tables (the priority)
   ============================================================ */
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 30px 0 12px; }
.block-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; margin: 0; display: flex; align-items: center; gap: 9px; }
.block-head .bh-meta { font-size: 13px; color: var(--text-faint); }

.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); }
.table-scroll { overflow-x: auto; }
table.kp { border-collapse: collapse; width: 100%; font-size: 14px; }
table.kp thead th {
  text-align: right; font-weight: 600; font-size: 12.5px; color: var(--text-faint);
  padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--bg-subtle); position: sticky; top: 0;
}
table.kp thead th.left { text-align: left; }
table.kp tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; vertical-align: middle; }
table.kp tbody tr:last-child td { border-bottom: 0; }
table.kp tbody tr:hover td { background: var(--bg-hover); }
table.kp td.left, table.kp th.left { text-align: left; }
.col-sticky { position: sticky; left: 0; background: var(--bg); z-index: 2; }
table.kp thead th.col-sticky { background: var(--bg-subtle); z-index: 3; }
table.kp tbody tr:hover td.col-sticky { background: #f3f3f1; }

/* Standings specifics */
.place { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 700; font-size: 13.5px; color: var(--text-light); background: var(--bg-block); }
.place.p1 { background: #2383e2; color: #fff; }
.place.p2 { background: rgba(55,53,47,0.16); color: var(--text); }
.place.p3 { background: var(--orange-soft); color: var(--orange-text); }
.club-cell { display: flex; align-items: center; gap: 11px; }
.club-cell .cc-name { font-weight: 600; font-size: 14.5px; }
.club-cell .cc-city { font-size: 12.5px; color: var(--text-faint); }
.club-badge { width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }

tr.leader td { background: var(--blue-softer) !important; }
tr.leader td.col-sticky { background: #eef5fd !important; }
tr.leader:hover td { background: var(--blue-soft) !important; }

td.dropped { color: var(--text-ghost); position: relative; }
td.dropped .val { text-decoration: line-through; text-decoration-color: rgba(55,53,47,0.35); }
th.x2col, td.x2col { background: rgba(232,89,12,0.05); }
th.x2col { color: var(--orange-text); }
td.total { font-weight: 800; font-size: 15px; }

.x2-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--orange-text); background: var(--orange-soft); padding: 1px 5px; border-radius: 4px; letter-spacing: 0.3px; }

.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--text-light); }
.legend .li { display: inline-flex; align-items: center; gap: 7px; }
.legend .swatch { width: 26px; height: 16px; border-radius: 4px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; }
.legend .swatch.drop { background: var(--bg-block); color: var(--text-ghost); text-decoration: line-through; }
.legend .swatch.x2 { background: var(--orange-soft); color: var(--orange-text); }

/* Stage cards */
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.stage-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 15px 16px;
  background: var(--bg); cursor: pointer; transition: box-shadow .12s, border-color .12s, transform .08s;
  display: flex; flex-direction: column; gap: 9px; text-decoration: none; color: inherit;
}
.stage-card:hover { box-shadow: var(--shadow-card); border-color: var(--border-mid); }
.stage-card .sc-top { display: flex; align-items: center; justify-content: space-between; }
.stage-card .sc-date { font-size: 12.5px; color: var(--text-faint); font-weight: 500; }
.stage-card .sc-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.2px; display: flex; align-items: center; gap: 7px; }
.stage-card .sc-org { font-size: 13px; color: var(--text-light); }
.stage-card .sc-link { display: flex; align-items: center; gap: 5px; color: var(--blue-text); font-size: 13px; font-weight: 500; margin-top: 2px; }
.stage-card.x2 { border-color: var(--orange-soft); background: linear-gradient(180deg, rgba(232,89,12,0.04), transparent 60%); }

/* ============================================================
   Empty state
   ============================================================ */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 60px 30px; }
.empty .em-title { font-size: 17px; font-weight: 700; }
.empty .em-sub { font-size: 14px; color: var(--text-light); margin-top: 6px; max-width: 380px; line-height: 1.5; }

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

/* ============================================================
   Responsive (§8)
   ============================================================ */
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: 1fr; }
  .pub-body { padding: 20px 16px 40px; }
  .season-head h1 { font-size: 28px; }
}
