/* tournament bracket page — classic tennis net */
.tp-box { width: 100%; margin: 0 auto; padding: 16px 18px 30px; display: flex; flex-direction: column; gap: 10px;
  min-height: 100vh; box-sizing: border-box; }
.tp-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.tp-title { font-size: 24px; font-weight: 900; letter-spacing: 1px; color: var(--gold); }
.tp-sub { color: var(--dim); font-size: 12px; }
.tp-back { color: #d9a868; text-decoration: none; font-size: 12.5px; }
.tp-back:hover { color: var(--gold); }
.tp-tabs { display: flex; gap: 8px; }
@media (max-width: 700px) {
  .tp-tabs { overflow-x: auto; flex-wrap: nowrap; gap: 14px; padding-bottom: 4px; scrollbar-width: none; }
  .tp-tab { white-space: nowrap; flex: 0 0 auto; }
}
.tp-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--dim);
  padding: 6px 4px; font: inherit; font-size: 12px; letter-spacing: 1.5px; cursor: pointer; }
.tp-tab.sel { color: var(--gold); border-bottom-color: var(--gold); }
.tp-status { font-size: 13px; color: var(--text); }
.tp-status b { color: var(--gold); }
#tp-action { min-height: 4px; }
.tp-join-btn { padding: 10px 22px; border-radius: 10px; border: 1px solid rgba(240,184,41,.55);
  background: rgba(240,184,41,.14); color: var(--gold); font: inherit; font-size: 14px;
  font-weight: 800; letter-spacing: 1px; cursor: pointer; transition: all .15s; }
.tp-join-btn:hover { background: rgba(240,184,41,.26); }
.tp-join-btn.tp-leave { border-color: var(--line); background: transparent; color: var(--dim); }

/* the net: fills the screen — every round column stretches, slots share the height */
.tp-bracket { display: flex; gap: 0; overflow: auto; padding: 8px 6px; position: relative;
  background: linear-gradient(170deg, rgba(52,12,12,.94), rgba(28,7,7,.96));
  border: 1px solid var(--line); border-radius: 14px;
  flex: 1; min-height: 420px; }
.br-rails { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.br-rail { stroke: rgba(240,184,41,.4); stroke-width: 1.2; fill: none; }
.br-round { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 210px; flex: 1; }
.br-round-name { text-align: center; font-size: 10px; letter-spacing: 2px; color: var(--dim);
  text-transform: uppercase; padding: 6px 0; flex: 0 0 auto; }
.br-slots { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 12px; padding-top: 14px; }
.br-slot { display: flex; align-items: center; position: relative; padding: 0 15px; min-height: 74px; flex: 0 0 auto; }
/* top-anchored columns: a player keeps their vertical spot round to round —
   no jumping from top to bottom when the next round opens. Connectors are the
   SVG rails (paintRails), no CSS stubs */
.br-match { width: 100%; display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: 7px; background: rgba(14,5,6,.7); overflow: hidden;
  animation: brIn .3s ease-out both; } /* soft pop-in — boxes never "jump" on updates */
@keyframes brIn { from { opacity: 0; transform: translateY(6px); } }
.br-p { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13.5px;
  white-space: nowrap; overflow: hidden; }
.br-p + .br-p { border-top: 1px solid rgba(230,90,70,.12); }
.br-p .br-seed { width: 18px; text-align: right; color: var(--dim); font-size: 11px; flex: 0 0 auto; }
.br-p .br-name { overflow: hidden; text-overflow: ellipsis; font-weight: 700; text-decoration: none; }
.br-p .br-name:hover { text-decoration: underline; }
.br-p .br-rating { color: var(--gold); font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.br-p.br-empty { color: rgba(138,112,96,.5); font-style: italic; }
.br-p.br-winner { color: var(--gold); font-weight: 800; }
.br-p.br-loser { color: var(--dim); text-decoration: line-through; }
.br-p.br-me { background: rgba(240,184,41,.1); }
.br-match.br-live { border-color: rgba(255,90,58,.65); box-shadow: 0 0 12px rgba(255,90,58,.3); }
.br-match.br-proj { border-style: dashed; opacity: .85; } /* projected advancers — not official yet */
.br-match.br-watch { cursor: pointer; }
.br-match.br-watch:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(240,184,41,.35); }
.br-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5a3a;
  box-shadow: 0 0 8px #ff5a3a; margin-left: auto; flex: 0 0 auto; animation: dotPulse 1.6s infinite; }
.br-champ { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 10px; }
.br-champ .br-crown { font-size: 30px; }
.br-champ .br-cname { color: var(--gold); font-weight: 800; font-size: 15px; }
.br-champ .br-cwait { color: var(--dim); font-size: 11px; text-align: center; }
.tp-recent { color: var(--dim); font-size: 12px; }
.tp-recent b { color: var(--gold); }
.br-empty-note { margin: auto; color: var(--dim); font-size: 14px; padding: 40px; text-align: center; }
.tp-hint { margin-top: 8px; font-size: 11.5px; color: var(--dim); }
.tp-seat { display: inline-block; padding: 11px 22px; border-radius: 10px; text-decoration: none;
  background: rgba(255,90,58,.14); border: 1px solid rgba(255,90,58,.6); color: #ff8a6a;
  font-size: 14px; font-weight: 800; letter-spacing: 1px; }
.tp-seat:hover { background: rgba(255,90,58,.26); color: #ffb09a; }
@media (max-width: 760px) { .br-round { min-width: 150px; } }

/* hover player card on bracket names */
#tour-card { position: fixed; z-index: 130; width: 260px;
  background: linear-gradient(170deg, rgba(52,12,12,.97), rgba(28,7,7,.98));
  border: 1px solid rgba(240,184,41,.4); border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55); font-size: 12px; }
#tour-card.hidden { display: none; }
.tc-loading { color: var(--dim); }
.tc-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.tc-av { width: 44px; height: 44px; border-radius: 8px; image-rendering: pixelated;
  border: 1px solid rgba(240,184,41,.35); }
.tc-name { font-size: 15px; font-weight: 800; }
.tc-title { color: var(--gold); font-size: 10.5px; font-weight: 700; letter-spacing: .5px; }
.tc-from { color: var(--dim); font-size: 11px; }
.tc-stats { display: flex; gap: 8px; }
.tc-stats > div { flex: 1; text-align: center; background: rgba(0,0,0,.25);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; }
.tc-stats b { display: block; color: var(--gold); font-size: 14px; }
.tc-stats span { color: var(--dim); font-size: 9px; letter-spacing: .5px; text-transform: uppercase; }
.tc-bio { margin-top: 10px; color: var(--dim); font-style: italic; font-size: 11.5px; }
.tc-link { display: block; margin-top: 8px; color: #d9a868; text-decoration: none; font-size: 11.5px; }
.tc-link:hover { color: var(--gold); }

/* join/leave errors — a dedicated element render() never overwrites */
.tp-err { margin: 6px 14px; padding: 8px 12px; border: 1px solid rgba(224,90,106,.5);
  border-radius: 8px; background: rgba(224,74,74,.12); color: #ff8a8a;
  font-size: 13px; font-weight: 700; }
.tp-err.hidden { display: none; }

/* walkover strip on bracket matches — a forfeit must not read as a played win.
   In flow, not absolutely positioned: .br-match clips its children (overflow
   hidden for the rounded corners), which ate an overhanging badge entirely. */
.br-wo { background: rgba(224,145,58,.16); color: #e0913a; font-size: 9px;
  font-weight: 800; letter-spacing: .4px; padding: 2px 7px; text-transform: uppercase;
  border-top: 1px solid rgba(224,145,58,.3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
/* the tape of a finished bracket game */
.br-tape { display: block; background: rgba(240,184,41,.12); color: var(--gold);
  font-size: 9px; font-weight: 800; letter-spacing: .8px; padding: 3px 7px;
  text-align: center; text-decoration: none;
  border-top: 1px solid rgba(240,184,41,.28); }
.br-tape:hover, .br-tape:focus-visible { background: rgba(240,184,41,.24); color: #ffd97a; }
