/* Padel League — court-blue scoreboard identity */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Barlow:wght@400;500;600&display=swap');

:root {
  --court:      #1668B4;
  --court-deep: #0E4D8C;
  --line:       #FFFFFF;
  --ball:       #C9DC2E;
  --ball-soft:  #F3F7D4;
  --ink:        #0F2540;
  --ink-soft:   #51647D;
  --paper:      #F3F6F9;
  --card:       #FFFFFF;
  --win:        #4C8F2F;
  --loss:       #D9534A;
  --draw:       #9AA7B5;
  --hairline:   #DDE5EC;
  --radius:     10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Barlow', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
}
.display { font-family: 'Barlow Condensed', sans-serif; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- header: court band with white line-work ---------- */
header {
  background: linear-gradient(160deg, var(--court) 0%, var(--court-deep) 100%);
  color: var(--line);
  padding: 26px 20px 22px;
  border-bottom: 3px solid var(--line);
  position: relative;
  overflow: hidden;
}
header::after {           /* service-box line motif */
  content: '';
  position: absolute; inset: 12px;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 4px;
  pointer-events: none;
}
header .inner { max-width: 1060px; margin: 0 auto; position: relative; }
header h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: clamp(34px, 6vw, 52px);
  letter-spacing: .04em; text-transform: uppercase;
  margin: 0;
}
header h1 .ball-dot {
  display: inline-block; width: .45em; height: .45em;
  background: var(--ball); border-radius: 50%; margin-left: .18em;
}
header p { margin: 4px 0 0; opacity: .85; font-size: 15px; }
header .entry-link {
  position: absolute; top: 0; right: 0;
  background: var(--ball); color: var(--ink);
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  font-size: 15px; letter-spacing: .05em; text-transform: uppercase;
  text-decoration: none; padding: 8px 14px; border-radius: 6px;
}

main { max-width: 1060px; margin: 0 auto; padding: 22px 16px 60px; }

/* ---------- sections divided by "court lines" ---------- */
section { margin-top: 38px; }
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  border-bottom: 2px solid var(--court);
  padding-bottom: 6px; margin-bottom: 14px;
}
.section-head h2 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 24px; letter-spacing: .05em; text-transform: uppercase;
  margin: 0; color: var(--court-deep);
}
.section-head .note { color: var(--ink-soft); font-size: 13px; }

/* ---------- tab pills ---------- */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pill {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; font-size: 15px;
  padding: 6px 16px; border-radius: 999px;
  border: 1.5px solid var(--court); background: var(--card);
  color: var(--court-deep); cursor: pointer;
}
.pill[aria-pressed="true"] { background: var(--court); color: var(--line); }
.pill:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; }

/* ---------- scoreboard table ---------- */
.board-wrap { overflow-x: auto; background: var(--card);
  border-radius: var(--radius); box-shadow: 0 1px 4px rgba(15,37,64,.08); }
table.board { border-collapse: collapse; width: 100%; min-width: 640px; }
table.board th {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--line); background: var(--court);
  padding: 10px 10px; text-align: right; white-space: nowrap;
}
table.board th:first-child, table.board td:first-child { text-align: left; padding-left: 14px; }
table.board td {
  padding: 10px 10px; text-align: right;
  border-bottom: 1px solid var(--hairline); font-size: 15px;
}
table.board tr:last-child td { border-bottom: none; }
table.board tr.leader td { background: var(--ball-soft); }
.player-cell { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.swatch { width: 11px; height: 11px; border-radius: 50%; flex: none; }
td.score {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 21px; color: var(--court-deep);
}
.move-up   { color: var(--win);  font-weight: 600; white-space: nowrap; }
.move-down { color: var(--loss); font-weight: 600; white-space: nowrap; }
.move-flat { color: var(--draw); white-space: nowrap; }

/* form dots */
.form { display: inline-flex; gap: 3px; }
.form i {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
}
.form .W { background: var(--win); }
.form .D { background: var(--draw); }
.form .L { background: var(--loss); }

/* ---------- chart ---------- */
.chart-card { background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(15,37,64,.08); padding: 14px; }
.chart-card svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- partnerships ---------- */
.pair-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 12px; }
.pair-card { background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(15,37,64,.08); padding: 12px 14px; }
.pair-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.pair-bar { height: 8px; background: var(--hairline); border-radius: 4px; overflow: hidden; }
.pair-bar i { display: block; height: 100%; background: var(--court); }
.pair-card .meta { display: flex; justify-content: space-between;
  color: var(--ink-soft); font-size: 13px; margin-top: 6px; }
.pair-card .pct { font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 19px; color: var(--court-deep); }
.pair-card.perfect { outline: 2px solid var(--ball); }

/* ---------- players ---------- */
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 12px; }
.player-card { background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(15,37,64,.08); padding: 16px; text-align: center; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 26px; color: var(--line); background-size: cover; background-position: center;
}
.player-card h3 { margin: 0; font-size: 18px; }
.player-card .cs { font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 30px; color: var(--court-deep); margin: 2px 0; }
.player-card .sub { color: var(--ink-soft); font-size: 13px; }

/* ---------- sessions ---------- */
.session { background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(15,37,64,.08); margin-bottom: 10px; }
.session > button {
  all: unset; display: flex; width: 100%; align-items: center; gap: 12px;
  padding: 12px 14px; cursor: pointer; box-sizing: border-box;
}
.session > button:focus-visible { outline: 3px solid var(--ball); }
.session .date { font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 18px; min-width: 105px; }
.session .badge { font-size: 12px; background: var(--paper); color: var(--ink-soft);
  border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.session .mini { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-soft); justify-content: flex-end; }
.session .mini b { color: var(--ink); }
.session .yt { color: var(--loss); text-decoration: none; font-size: 13px; font-weight: 600; }
.session .detail { padding: 0 14px 12px; display: none; }
.session.open .detail { display: block; }
.detail table { border-collapse: collapse; width: 100%; font-size: 14px; }
.detail th, .detail td { padding: 4px 8px; text-align: center; border-bottom: 1px solid var(--hairline); }
.detail th { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600; color: var(--ink-soft); }
.detail td.W { color: var(--win); font-weight: 600; }
.detail td.L { color: var(--loss); }
.detail td.D { color: var(--draw); }

.sub { color: var(--ink-soft); font-size: 13px; }
.status { text-align: center; color: var(--ink-soft); padding: 40px 0; }
footer { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 30px 0 50px; }
footer a { color: var(--court-deep); }

/* ---------- entry app ---------- */
.entry main { max-width: 480px; }
.panel { background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(15,37,64,.08); padding: 18px; margin-top: 18px; }
.panel h2 { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  letter-spacing: .05em; margin: 0 0 12px; color: var(--court-deep); font-size: 21px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
input[type=date], input[type=password], input[type=url], select {
  width: 100%; padding: 12px; font-size: 17px; border: 1.5px solid var(--hairline);
  border-radius: 8px; font-family: inherit;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 16px; font-weight: 600; padding: 10px 18px;
  border-radius: 999px; border: 1.5px solid var(--court);
  background: var(--card); color: var(--court-deep); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--court); color: var(--line); }
.btn {
  display: block; width: 100%; margin-top: 16px; padding: 14px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 19px; letter-spacing: .05em; text-transform: uppercase;
  background: var(--ball); color: var(--ink); border: none;
  border-radius: 8px; cursor: pointer;
}
.btn.secondary { background: var(--paper); color: var(--court-deep);
  border: 1.5px solid var(--court); }
.btn:disabled { opacity: .45; cursor: default; }
.option-row { display: grid; gap: 8px; margin-top: 8px; }
.option {
  text-align: left; padding: 12px 14px; font-size: 16px;
  border: 1.5px solid var(--hairline); border-radius: 8px;
  background: var(--card); cursor: pointer; font-family: inherit;
}
.option[aria-pressed="true"] { border-color: var(--court); background: #EAF2FA; }
.scores { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.scores .option { text-align: center; padding: 12px 4px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; }
.entered { margin-top: 14px; font-size: 14px; }
.entered li { margin: 4px 0; }
.error { color: var(--loss); font-weight: 600; margin-top: 10px; min-height: 1.2em; }
.ok { color: var(--win); font-weight: 600; margin-top: 10px; }
.roundtag { font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 26px; color: var(--court-deep); }

@media (prefers-reduced-motion: no-preference) {
  .session .detail { transition: none; }
}
@media (max-width: 640px) {
  header .entry-link { position: static; display: inline-block; margin-top: 10px; }
}
