/* CBF Master Points — web UI
   Restrained, trustworthy federation aesthetic: navy + gold + neutral, generous
   whitespace, tabular figures. The standings table is the hero. A full-bleed
   background layer (.bg) is reserved for later artwork — content sits in panels
   above it so a painting drops in with zero relayout. */

:root {
  --ink: #14233d;          /* primary text / navy */
  --ink-2: #33465f;
  --muted: #6c788c;
  --faint: #9aa6b6;
  --gold: #a9802f;
  --gold-2: #c9a24e;
  --silver: #8893a3;
  --navy: #16263f;
  --navy-2: #1d3354;
  --line: #e5e9f0;
  --line-2: #eef1f6;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --bg-1: #eaeef4;
  --bg-2: #e3e9f1;
  --good: #2f7d5b;
  --warn: #b06d1f;
  --bad: #b23a36;
  --info: #355f93;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20,35,61,.05), 0 6px 20px rgba(20,35,61,.06);
  --maxw: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-2);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Reserved full-bleed background layer (artwork later). */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 80% -10%, #f3f6fb 0%, rgba(243,246,251,0) 60%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%);
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em;
  background: var(--line-2); padding: 1px 5px; border-radius: 5px; color: var(--ink-2); }

/* ---- Header ---------------------------------------------------------- */
.site-header { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; border-bottom: 3px solid var(--gold); box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between;
  gap: 18px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 13px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; width: 38px; height: 38px;
  place-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px; font-size: 11px; line-height: 1; }
.suit { display: block; }
.suit-h, .suit-d { color: var(--gold-2); }
.suit-s, .suit-c { color: #dfe6f1; }
.brand-text { display: flex; flex-direction: column; }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); }
.nav { display: flex; gap: 4px; }
.nav a { color: #cdd6e4; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { color: var(--navy); background: var(--gold-2); }

/* ---- Page head + filters --------------------------------------------- */
main.container { padding-top: 26px; padding-bottom: 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 27px; letter-spacing: -.2px; color: var(--ink); }
.lede { margin: 0; color: var(--muted); max-width: 70ch; font-size: 14.5px; }
.page-stat { text-align: right; line-height: 1; white-space: nowrap; }
.stat-num { display: block; font-size: 30px; font-weight: 700; color: var(--navy);
  font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }

.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 8px; border-radius: 999px; vertical-align: middle; margin-left: 8px; }
.tag-temp { background: #fbf0dd; color: var(--warn); border: 1px solid #f0dcb6; }

.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.grow { flex: 1 1 220px; }
.field.actions { flex-direction: row; align-items: center; gap: 8px; margin-left: auto; }
.field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); }
.filters select, .filters input { font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 40px; }
.filters input { width: 100%; }
.filters select:focus, .filters input:focus { outline: 2px solid var(--gold-2); outline-offset: 1px;
  border-color: var(--gold-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  padding: 0 16px; border-radius: 9px; border: 1px solid var(--navy); background: var(--navy);
  color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--navy-2); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }

/* ---- Panels ---------------------------------------------------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; margin-bottom: 18px; }
.panel > .section-h, .panel > .section-note, .panel > .sub-h { padding-left: 12px; padding-right: 12px; }
.empty { padding: 26px 14px; color: var(--muted); text-align: center; }

/* ---- Tables ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint);
  font-weight: 700; text-align: left; padding: 12px 12px 9px; border-bottom: 1px solid var(--line);
  background: var(--panel); position: sticky; top: 0; }
.standings thead .subhead th { padding: 0 12px 8px; color: var(--gold); font-size: 10.5px;
  letter-spacing: .1em; border-bottom: 1px solid var(--line); }
.standings tbody td { padding: 10px 10px; border-bottom: 1px solid var(--line-2); }
.standings thead th { padding: 12px 10px 9px; }
.standings tbody tr:last-child td { border-bottom: none; }
.standings tbody tr:hover { background: #fbfcfe; }
.col-pos { width: 40px; color: var(--faint); font-variant-numeric: tabular-nums; }
.col-name { font-weight: 600; color: var(--ink); white-space: nowrap; }
.col-club { white-space: nowrap; }
.standings .num { font-size: 13.5px; color: var(--ink-2); width: 42px; padding-left: 5px; padding-right: 8px; }
.standings .num.strong { font-weight: 700; color: var(--ink); }
.standings thead .num { padding-left: 5px; padding-right: 8px; }
.col-rank { min-width: 108px; }
.group-start { border-left: 1px solid var(--line); }

/* CBF# next to a name */
.cbf { margin-left: 7px; font-size: 11.5px; color: var(--faint); font-weight: 500;
  font-variant-numeric: tabular-nums; }
.col-cbf { color: var(--muted); font-variant-numeric: tabular-nums; width: 56px; }
.col-status { width: 84px; }

/* Inline flags on names (anomalies) */
.flag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.flag-muted { background: var(--line-2); color: var(--muted); }
.flag-review { background: #fbf0dd; color: var(--warn); }
.flag-excluded { background: #fbe9e7; color: var(--bad); }

/* Status pill (Members) */
.status { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.status-y { background: #e7f3ec; color: var(--good); }
.status-n { background: var(--line-2); color: var(--muted); }

/* Active / All segmented toggle */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  margin-bottom: 16px; background: #fff; box-shadow: var(--shadow); }
.seg-btn { padding: 9px 18px; font-weight: 600; font-size: 14px; color: var(--muted); background: #fff; }
.seg-btn:hover { color: var(--ink); text-decoration: none; }
.seg-btn.on { background: var(--navy); color: #fff; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }

/* Small button (e.g. CSV download in a section header) */
.btn-sm { min-height: 32px; padding: 0 13px; font-size: 12.5px; font-weight: 600; border-radius: 8px;
  background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-sm:hover { background: var(--line-2); text-decoration: none; }
.section-h .btn-sm { margin-left: auto; }

/* Club pills */
.club-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: var(--line-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap; }
.club-limassol { background: #eaf1fb; color: #2a4f86; border-color: #d4e2f6; }
.club-nicosia { background: #eaf5ef; color: #276748; border-color: #cfe8da; }
.club-paphos { background: #fdefe6; color: #9c5226; border-color: #f6dcc9; }
.club-zenon { background: #f0ecf9; color: #5a3f96; border-color: #e0d6f2; }
.club-lefkara { background: #fbf0e0; color: #8a6210; border-color: #f1ddba; }
.club-ayiosandreas { background: #e8f2f4; color: #246b76; border-color: #cfe6ea; }

/* Rank labels — subtle tier accent via a leading dot */
.rank { display: inline-flex; align-items: baseline; gap: 7px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); line-height: 1.25; }
.rank::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint);
  flex: none; align-self: center; }
.rank-t0 { color: var(--faint); }
.rank-t0::before { background: #c7cedb; }
.rank-t1::before, .rank-t2::before, .rank-t3::before { background: #9bb0cf; }
.rank-t4::before, .rank-t5::before { background: #6f8fbf; }
.rank-t6::before, .rank-t7::before, .rank-t8::before { background: #3f8f86; }
.rank-t9::before, .rank-t10::before, .rank-t11::before { background: var(--info); }
.rank-t12::before { background: var(--gold); }
.rank-t13::before, .rank-t14::before { background: var(--gold); box-shadow: 0 0 0 3px #f3e6c8; }
.rank-t13, .rank-t14 { color: var(--gold); font-weight: 700; }

/* ---- Data Quality ---------------------------------------------------- */
.dq-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.dq-jump a { background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dq-jump a:hover { border-color: var(--gold-2); text-decoration: none; color: var(--navy); }
.section-h { font-size: 18px; margin: 10px 0 4px; display: flex; align-items: center; gap: 10px; }
.section-note { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; max-width: 80ch; }
.sub-h { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  margin: 16px 12px 6px; display: flex; align-items: center; gap: 8px; }
.count { font-size: 13px; font-weight: 700; color: var(--navy); background: var(--line-2);
  border-radius: 999px; padding: 1px 10px; }
.count-sm { font-size: 11px; padding: 0 8px; }
.grid { font-size: 13.5px; }
.grid thead th { padding: 10px 12px; }
.grid tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.grid tbody tr:hover { background: #fbfcfe; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.plain { margin: 4px 12px 8px; padding-left: 20px; color: var(--ink-2); }
.suggest { display: inline-block; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 3px 9px; margin: 0 5px 4px 0; font-size: 13px; }
.suggest .score { color: var(--good); font-weight: 700; font-size: 12px; margin-left: 4px; }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 9px; border-radius: 999px; }
.badge-open, .badge-warning { background: #fbf0dd; color: var(--warn); }
.badge-ok { background: #e7f3ec; color: var(--good); }
.badge-info { background: #e9f0f9; color: var(--info); }
.badge-error { background: #fbe9e7; color: var(--bad); }

/* ---- Footer ---------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.6); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 0; font-size: 13px; color: var(--ink-2); }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .header-inner { min-height: 0; padding: 12px 0; }
  .nav { width: 100%; }
  .nav a { flex: 1; text-align: center; padding: 8px 6px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head h1 { font-size: 23px; }
  .page-stat { text-align: left; }
  .field.actions { margin-left: 0; width: 100%; }
  .field.actions .btn { flex: 1; }
  .grid { font-size: 13px; }
}

/* Standings become stacked cards on phones — points & rank stay visible. */
@media (max-width: 600px) {
  .panel { padding: 0; background: transparent; border: none; box-shadow: none; }
  .standings thead { display: none; }
  .standings, .standings tbody, .standings tr, .standings td { display: block; }
  .standings tr { position: relative; background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 15px 10px; margin-bottom: 12px; }
  .standings tbody tr:hover { background: var(--panel); }
  .standings td { border: none !important; padding: 0; }
  .standings .col-pos { position: absolute; top: 14px; right: 15px; width: auto;
    font-size: 12px; font-weight: 700; color: var(--faint); }
  .standings .col-pos::before { content: "#"; }
  .standings .col-name { font-size: 16px; font-weight: 700; padding-right: 36px; }
  .standings .col-club { margin: 6px 0 12px; }
  .standings tr::after { content: ""; display: block; clear: both; }
  .standings .num { float: left; width: 50%; display: flex; justify-content: space-between; gap: 10px;
    align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line-2) !important;
    font-size: 14.5px; }
  .standings .num.group-start { clear: left; padding-right: 18px; }  /* Gold = left column */
  .standings .num::before { content: attr(data-label); color: var(--muted); font-weight: 600;
    font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
  .standings .col-rank { clear: both; display: flex; justify-content: space-between; align-items: center;
    padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line-2) !important; }
  .standings .col-rank::before { content: "Rank"; color: var(--muted); font-weight: 600;
    font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
  .standings .rank { font-size: 13.5px; text-align: right; }
  /* Members table reuses the card layout: CBF# to the corner, status inline. */
  .members .col-cbf { position: absolute; top: 14px; right: 15px; width: auto;
    font-size: 12px; color: var(--faint); }
  .members .col-cbf::before { content: "#"; }
  .members .col-status { margin: 0 0 12px; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; text-align: center; }
}
