/* ===== Tennis Spot Tournament — DRAFA brand palette =====
   mint #1CE8A4 · near-black #212020 · black #000 · grey #E6E6E6 · white */
:root {
  --bg: #f4f5f2;
  --panel: #ffffff;
  --ink: #212020;
  --muted: #8d918b;
  --muted-2: #b2b6ae;
  --line: #e6e6e6;
  --line-soft: #f1f1ef;
  --mint: #1ce8a4;
  --mint-deep: #11c187;
  --mint-soft: #d2f7e9;
  --mint-softer: #eafbf4;
  --dark: #212020;
  --dark-2: #000000;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Roboto', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---- DRAFA lockup ---- */
.mark {
  display: inline-block; flex-shrink: 0;
  -webkit-mask: url('/assets/imgs/drafa-mark.svg') no-repeat center / contain;
  mask: url('/assets/imgs/drafa-mark.svg') no-repeat center / contain;
  background-color: currentColor;
}
.drafa-lockup { display: inline-flex; align-items: center; gap: 7px; }
.drafa-lockup .mark { width: 1.05em; height: 1.05em; }
.drafa-word { font-family: 'Archivo Black', 'Roboto', sans-serif; font-weight: 400; letter-spacing: 0.4px; }

/* ---- Top bar ---- */
.tp-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1360px; margin: 0 auto;
}
.tp-topbar img { height: 32px; display: block; }
.tp-topbar .powered {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.tp-topbar .powered .drafa-lockup { color: var(--ink); font-size: 17px; }

/* ---- Shell ---- */
.tp-wrap { max-width: 1360px; margin: 0 auto; padding: 24px 20px 80px; }

/* ---- Intro ---- */
.tp-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  color: var(--mint-deep); margin-bottom: 16px;
}
.tp-eyebrow::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); }
.tp-title { font-size: clamp(32px, 6vw, 54px); font-weight: 900; margin: 0 0 12px; letter-spacing: -1px; line-height: 1.02; }
.tp-sub { font-size: 17px; color: var(--muted); margin: 0 0 28px; max-width: 640px; }

/* ---- Format switcher (Knockout <-> Omiloi) ---- */
.tp-switch { display: inline-flex; gap: 6px; padding: 6px; background: #eceee8; border-radius: 14px; margin-bottom: 18px; }
.tp-switch a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-size: 13px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase;
  color: #7c817a; padding: 11px 18px; border-radius: 10px;
}
.tp-switch a.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px -3px rgba(33,32,32,0.3); }

/* ---- Draw toggle ---- */
.tp-tabs { display: inline-flex; gap: 6px; padding: 7px; background: #eceee8; border-radius: 16px; margin-bottom: 26px; }
.tp-tab {
  display: inline-flex; align-items: center; gap: 10px; border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
  color: #7c817a; padding: 13px 22px; border-radius: 11px; transition: background .18s ease, color .18s ease;
}
.tp-tab .cnt { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 7px; background: #dcdfd8; color: #6a6f68; }
.tp-tab.active { background: var(--dark); color: #fff; }
.tp-tab.active .cnt { background: var(--mint); color: var(--dark); }

/* ---- Panel ---- */
.tp-panel { background: var(--panel); border-radius: 22px; padding: 30px 26px; box-shadow: 0 20px 50px -30px rgba(33,32,32,0.35); overflow: hidden; }
.draw { display: none; }
.draw.active { display: block; }
.draw-head { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.draw-head h2 { font-size: 26px; font-weight: 900; margin: 0; letter-spacing: -0.5px; }
.draw-head .pill { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--mint-deep); background: var(--mint-softer); padding: 6px 12px; border-radius: 999px; }

/* ---- Bracket ---- */
.bracket { display: flex; align-items: stretch; overflow-x: auto; padding-bottom: 12px; }
.round { display: flex; flex-direction: column; min-width: 248px; }
.round + .round { margin-left: 44px; }
.round-head { display: flex; align-items: center; justify-content: space-between; background: var(--line-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; }
.round-head .rh-name { font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.round-head .rh-count { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted-2); }
.round.is-final .round-head { background: var(--dark); }
.round.is-final .rh-name { color: #fff; }
.round.is-final .rh-count { color: var(--mint); }

.round-body { display: flex; flex-direction: column; flex: 1 1 auto; }
.match-wrap { flex: 1 1 0; display: flex; flex-direction: column; justify-content: center; position: relative; padding: 9px 0; }

/* connectors */
.round:not(:last-child) .match-wrap::before { content: ''; position: absolute; left: 100%; top: 50%; width: 22px; height: 2px; background: var(--line); }
.round:not(:last-child) .match-wrap::after { content: ''; position: absolute; left: calc(100% + 22px); width: 2px; background: var(--line); }
.round:not(:last-child) .match-wrap:nth-child(odd)::after { top: 50%; bottom: 0; }
.round:not(:last-child) .match-wrap:nth-child(even)::after { top: 0; bottom: 50%; }
.round:not(:first-child) .match-wrap > .match::before { content: ''; position: absolute; right: 100%; top: 50%; width: 22px; height: 2px; background: var(--line); }

/* match card */
.match { position: relative; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 0 2px 6px -4px rgba(33,32,32,0.25); }
.match-label { position: absolute; top: -9px; left: 14px; background: #fff; padding: 0 7px; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--muted-2); }
.player { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; min-height: 48px; }
.player + .player { border-top: 1.5px solid var(--line); }
.player .name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player.tbd .name { color: var(--muted-2); font-weight: 500; }
.player.win { background: var(--mint-soft); border-radius: 12px; }
.player.win .name { font-weight: 800; }
.player.win .name::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--mint-deep); vertical-align: middle; }
.match.pending { border-style: dashed; border-color: #ececec; box-shadow: none; background: #fcfcfb; }
.match.pending .player .name { color: var(--muted-2); font-style: italic; font-weight: 500; }

.sets { display: flex; gap: 5px; flex-shrink: 0; }
.sets span { min-width: 22px; height: 24px; line-height: 24px; text-align: center; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); background: #f1f2ef; border-radius: 6px; }
.player.win .sets span { color: var(--dark); background: #a7ecd4; }

.round.is-final .match { border-color: var(--mint); box-shadow: 0 8px 24px -14px rgba(28,232,164,0.6); }

/* ===== Group stage ===== */
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 20px; }
.section-head h2 { font-size: 24px; font-weight: 900; margin: 0; letter-spacing: -0.4px; }
.section-head .hint { font-size: 13px; color: var(--muted); }
.gs-section + .gs-section { margin-top: 40px; padding-top: 34px; border-top: 1px solid var(--line); }

.groups-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.group-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.group-card .gc-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: var(--line-soft); }
.group-card .gc-head h3 { font-size: 17px; font-weight: 900; margin: 0; letter-spacing: 0.3px; }
.group-card .gc-head .g-pill { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--mint-deep); background: var(--mint-softer); padding: 5px 10px; border-radius: 999px; }

table.standings { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.standings th, table.standings td { text-align: center; padding: 12px 6px; font-size: 13px; }
table.standings th { font-size: 10px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted-2); border-bottom: 1px solid var(--line); }
table.standings td.team, table.standings th.team { text-align: left; padding-left: 16px; }
table.standings td.pos { color: var(--muted-2); font-weight: 800; width: 30px; }
table.standings td.team { font-weight: 700; font-size: 14px; white-space: nowrap; }
table.standings td.pts { font-weight: 800; }
table.standings tr + tr td { border-top: 1px solid var(--line-soft); }
table.standings tr.leading td { background: var(--mint-softer); }
table.standings tr.leading td.team { position: relative; }
table.standings td.team .qbadge { display: inline-block; margin-left: 8px; font-size: 9px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--dark); background: var(--mint); padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
table.standings td.team .lead-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mint-deep); margin-left: 7px; vertical-align: middle; }
table.standings td.diff.pos-v { color: var(--mint-deep); font-weight: 700; }
table.standings td.diff.neg-v { color: #c0574a; font-weight: 700; }
.group-note { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.group-note.tie { color: #b8742a; }

/* fixtures */
.fx-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.fx-group h4 { font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.fx-list { display: flex; flex-direction: column; gap: 10px; }
.fixture { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.fixture.pending { border-style: dashed; border-color: #ececec; background: #fcfcfb; }
.fx-team { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 15px; }
.fx-team + .fx-team { border-top: 1.5px solid var(--line); }
.fx-team .t { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fixture.pending .fx-team .t { color: var(--muted-2); font-style: italic; font-weight: 500; }
.fx-team.win { background: var(--mint-soft); }
.fx-team.win .t { font-weight: 800; }
.fx-team.win .t::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--mint-deep); vertical-align: middle; }
.fx-team .sets { display: flex; gap: 5px; flex-shrink: 0; }
.fx-team .sets span { min-width: 22px; height: 24px; line-height: 24px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); background: #f1f2ef; border-radius: 6px; }
.fx-team.win .sets span { color: var(--dark); background: #a7ecd4; }

/* final */
.final-wrap { display: flex; justify-content: center; }
.final-card { width: 100%; max-width: 520px; border: 1.5px solid var(--mint); border-radius: 18px; overflow: hidden; box-shadow: 0 14px 40px -24px rgba(28,232,164,0.7); }
.final-card .final-top { background: var(--dark); color: #fff; text-align: center; padding: 14px; font-size: 13px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.final-card .final-top .mint { color: var(--mint); }
.final-card .fx-team { padding: 18px 22px; min-height: 60px; }
.final-card .fx-team .t { font-size: 17px; }
.final-champ { background: var(--mint); color: var(--dark); text-align: center; padding: 18px; font-size: 18px; font-weight: 900; letter-spacing: -0.2px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.final-champ .mark { width: 22px; height: 22px; background-color: var(--dark); }
.final-pending { text-align: center; padding: 22px; color: var(--muted); font-size: 14px; font-style: italic; }

@media (max-width: 760px) {
  .groups-grid, .fx-groups { grid-template-columns: 1fr; }
  table.standings th, table.standings td { padding: 11px 3px; font-size: 12px; }
  table.standings th.team, table.standings td.team { padding-left: 12px; }
  table.standings td.team { white-space: normal; font-size: 13px; line-height: 1.2; }
  table.standings td.team .qbadge { display: inline-block; margin: 3px 0 0 6px; }
  table.standings td.pos { width: 22px; }
}

/* ---- Note row ---- */
.tp-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tp-note .n-left { display: inline-flex; align-items: center; gap: 9px; }
.tp-note .n-left::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--mint-deep); flex-shrink: 0; }
.tp-note .n-right { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-2); }

/* ---- Status ---- */
.tp-status { padding: 60px 0; text-align: center; color: var(--muted); font-size: 15px; }
.tp-status.error { color: #c0392b; }
.tp-updated { font-size: 12px; color: var(--muted-2); margin: 18px 2px 0; }

/* ---- CTA band ---- */
.tp-cta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0; margin-top: 44px; border-radius: 24px; overflow: hidden; }
.tp-cta .cta-dark { background: var(--dark); color: #fff; padding: 46px 44px; }
.tp-cta .cta-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--mint); margin-bottom: 18px; }
.tp-cta .cta-dark h3 { font-size: 34px; font-weight: 900; margin: 0 0 14px; letter-spacing: -0.5px; }
.tp-cta .cta-dark p { font-size: 16px; color: #bdbdbd; margin: 0; max-width: 460px; }
.tp-cta .cta-mint { background: var(--mint); color: var(--dark); padding: 46px 40px; display: flex; flex-direction: column; justify-content: center; }
.tp-cta .cta-mint .pb { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #0c7a56; margin-bottom: 12px; }
.tp-cta .cta-mint .pb .drafa-lockup { font-size: 14px; color: var(--dark); }
.tp-cta .cta-mint h4 { font-size: 26px; font-weight: 900; margin: 0 0 22px; letter-spacing: -0.3px; }
.dl-btn { display: inline-flex; align-items: center; gap: 11px; align-self: flex-start; text-decoration: none; background: var(--dark); color: #fff; padding: 15px 24px; border-radius: 14px; font-size: 16px; font-weight: 800; }
.dl-btn .mark { width: 20px; height: 20px; background-color: var(--mint); }
.dl-btn:hover { background: var(--dark-2); }

/* ---- Footer ---- */
.tp-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1360px; margin: 0 auto; padding: 26px 20px 50px; font-size: 13px; color: var(--muted); }
.tp-footer .drafa-lockup { font-size: 14px; color: var(--ink); vertical-align: middle; }
.tp-footer a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tp-footer a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .tp-cta { grid-template-columns: 1fr; }
  .tp-cta .cta-dark, .tp-cta .cta-mint { padding: 34px 26px; }
  .tp-cta .cta-dark h3 { font-size: 27px; }
}
@media (max-width: 640px) {
  .tp-panel { padding: 20px 14px; }
  .round { min-width: 210px; }
  .round + .round { margin-left: 36px; }
  .tp-tab { padding: 11px 15px; font-size: 13px; }
}
