/* ============================================================================
   sub-tournament-new.css -- the v2-shell rebuild of sub-tournament.aspx
   ----------------------------------------------------------------------------
   Loaded AFTER sg-bridge.css / sg-shell.css (sg.master), dataTables.css and
   select2.css, so it can restyle all four.

   Everything is scoped under .stn (the page's content wrapper) EXCEPT the
   rules for markup jQuery plugins append to <body> -- the search autocomplete
   menu (.ui-autocomplete) and select2's dropdown (.select2-drop). Those sit
   outside .stn, so they are matched by their own plugin classes instead.

   Colours come from sg-shell.css's tokens wherever a token exists, so one rule
   serves both themes. Where a value has to differ by theme, the dark twin
   follows it under html.dark.

   v1's site stylesheet is deliberately NOT loaded on this page (see the note at
   the top of sub-tournament-new.aspx); the handful of v1 utility classes the
   page's custom controls still emit are re-declared at the end of this file.
   ========================================================================== */

.stn {
  --stn-link: #2d6cdf;
  --stn-link-hover: #e29025;
  --stn-th-bg: #54688d;
  --stn-th-fg: #ffffff;
  --stn-stripe: var(--surface-2);
  --stn-row-hover: #ebebeb;
  /* PPP badge, not a cardholder (EA view): a couple of shades softer than the
     shell's --muted-foreground (#60646c light / #b7b7b7 dark), Jason 2026-11-10. */
  --stn-ppp-off: #9b9da6;
  /* ⚠ 1200px is repeated in the .sgs-viewtoggle rule just below -- keep them equal. */
  max-width: 1200px;
  margin: 0 auto;
  /* No font-size / line-height: the shell's 18px / 1.5 default (sg-shell.css
     html). This was 16px / 1.45 until 2026-11-13. */
}
html.dark .stn {
  --stn-link: var(--indigo-8);
  --stn-link-hover: #b78628;   /* light keeps #e29025 (Jason, 2026-11-14) */
  --stn-th-bg: #2e3543;
  --stn-row-hover: var(--surface-3);
  --stn-ppp-off: #7d7d7d;
}

/* The shell floats its Admin/Player toggle at <main>'s right edge, but this
   page centres its content in the 1200px .stn column, so on a wide screen the
   toggle sat ~68px outside it. Pull it in by the column's side gutter -- a
   margin percentage is of <main>'s content width, so this is exactly that
   gutter, and 0 once the window is narrower than the column. Its right edge
   then lines up with the column's, where "Redeemable Fees" ends (Jason,
   2026-11-10). This stylesheet loads on this page only, so other v2 pages keep
   the shell's placement. */
.sgs-main > .sgs-viewtoggle { margin-right: max(0px, calc((100% - 1200px) / 2)); }

.stn a { color: var(--stn-link); text-decoration: none; transition: color .1s ease-in-out; }
.stn a:hover { color: var(--stn-link-hover); }

/* sg-bridge.css styles bare h2/h3 (blue h2 with a rule under it); the page
   keeps that look for its section headings and only sets the spacing. */
/* Sizes for h1 (32px / 400 / 42px) and h2 (22px / 400 / 32px) are the shell's,
   sg-shell.css "Content type scale"; only margins and colour live here. */
.stn h1 { margin: 0; color: #55638b; }
html.dark .stn h1 { color: var(--foreground); }
/* No rule under the section headings: sg-bridge.css gives every bare h2 a
   border-bottom (+ 4px padding), and sg-shell.css recolours it in dark. */
.stn h2 { margin: 0; border-bottom: 0; padding-bottom: 0; }

.stn-section { margin: 32px 0; }
.stn-muted { color: var(--muted-foreground); }
.stn .bold { font-weight: 600; }

/* --- Breadcrumbs (controls/BreadCrumbs.ascx) ----------------------------- */
.stn .breadcrumbs {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  /* 15px / 28px (Jason, 2026-11-13; was 14px / 24px). The line height is in px
     rather than a ratio so it holds whatever the font size, and it is roomy on
     purpose: it gives the trail space when it wraps on a phone. */
  font-size: 15px;
  line-height: 28px;
  color: var(--muted-foreground);
}
.stn .breadcrumbs li { display: inline; }
.stn .breadcrumbs li + li::before { content: "/"; margin: 0 .5em; color: var(--border); }
/* --border is #2a2a2a in dark, which all but disappears on #181818. */
html.dark .stn .breadcrumbs li + li::before { color: #4d4d4d; }
.stn .breadcrumbs a { color: var(--muted-foreground); }
.stn .breadcrumbs a[href]:hover { color: var(--stn-link-hover); }
/* The last crumb (the current page) is rendered as an <a> with NO href, so it
   isn't a link: no hover colour, no pointer. */
.stn .breadcrumbs a:not([href]) { cursor: default; }

/* --- Header -------------------------------------------------------------- */
.stn-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 24px;
}
/* 22px / 32px, weight 400 (inherited), the same as the shell's h2 (Jason,
   2026-11-13). Was 1.25em, weight 500. */
.stn-subtitle { margin-top: 6px; font-size: 22px; line-height: 32px; }
/* The date and "Redeemable Fees" line: 16px / 24px (Jason, 2026-11-13). The
   amount itself (.stn-fees) stays bold. */
.stn-meta { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted-foreground); font-size: 16px; line-height: 24px; }
.stn-fees { color: var(--success-fg); font-weight: 600; }

/* Row of links with pipe separators. Separators come from the border on every
   item after the first, so a server control set Visible=False (not rendered at
   all) never leaves a stray pipe behind.
   16px / 28px everywhere, admin links ("Edit Sub Tournament", ...) and the
   links beside section headings alike (Jason, 2026-11-13). Weight 400 is
   inherited; .stn-cta (the Register link) stays bold. */
.stn-links { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; font-size: 16px; line-height: 28px; }
.stn-links > * + * { border-left: 1px solid var(--border); margin-left: 12px; padding-left: 12px; }
.stn-adminlinks { margin-top: 14px; }
/* The admin line uses the footer's disc separators instead of pipes. Same
   "draw it on every item after the first" rule, so hidden links still leave
   no stray separator. */
.stn-adminlinks > * + * { border-left: 0; margin-left: 0; padding-left: 0; }
.stn-adminlinks > * + *::before { content: "\2022"; margin: 0 10px; opacity: .6; color: var(--foreground); }
.stn-cta { font-weight: 600; }

/* --- Registration call-to-action + notices ------------------------------- */
.stn-register { margin: 24px 0 0; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
/* Whole-px line heights here and on the key facts below (2026-11-13): a
   fractional height above the players table (this was 1.2, i.e. 21.6px lines
   at 18px) leaves the table at a fractional position, the suspect for a stray
   line under one frozen Name cell on a phone (Jason). */
.stn .sg-btn { line-height: 22px; }
.stn a.sg-btn-primary,
.stn a.sg-btn-primary:hover { color: #fff; }

.stn-notice { margin: 24px 0; padding: 12px 16px; border-radius: var(--radius); border-left: 1px solid; font-size: 18px; }
/* The payment-deadline notices (the only users of -warn). A red LEFT border
   only (the base .stn-notice rule), colours from Jason's mock-ups
   (2026-11-10). Border matches the text in each theme. Light: pale reddish
   grey, dark red text (~6.0:1). Dark: near-black red, dusty pink text
   (~6.3:1). */
.stn-notice-warn { background: #dbc1c0; color: #77241c; border-left-color: #77241c; }
html.dark .stn-notice-warn { background: #2b1312; color: #bb918c; border-left-color: #bb918c; }
.stn-notice-danger { background: var(--destructive-bg); color: var(--destructive-fg); border-left-color: var(--destructive); text-align: center; }
.stn-register .stn-notice { margin: 0; }
/* Shrinks to its wording and centres on the page, matching the deadline notice
   in .stn-register (which gets that from its flex-column parent). */
.stn-notice-fit { width: fit-content; max-width: 100%; box-sizing: border-box; margin-left: auto; margin-right: auto; text-align: center; }

/* --- Key-facts cards ----------------------------------------------------- */
.stn-facts {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.stn-fact {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
/* Labels 14px, values 18px (Jason, 2026-11-13; were 13px and 1.05em). */
.stn-fact dt { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted-foreground); }
.stn-fact dd { margin: 4px 0 0; font-size: 18px; line-height: 28px; }

/* --- Cards (stream info, extra information, Beasley) --------------------- */
.stn-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--foreground);
}
.stn-card-title { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.stn a.stn-card { color: var(--foreground); }
.stn a.stn-card:hover { border-color: var(--stn-link-hover); color: var(--foreground); }
.stn-beasley p { margin: 8px 0; }
.stn-beasley ul { margin: 8px 0; padding-left: 22px; }

.stn-extrainfo { margin-top: 12px; max-height: 470px; overflow-y: auto; line-height: 1.5; }

/* --- Live stream --------------------------------------------------------- */
.stn-video { position: relative; max-width: 640px; aspect-ratio: 16 / 9; margin: 0 auto; background: var(--muted); border-radius: var(--radius); overflow: hidden; }
.stn-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stn-ls-display { margin: 20px auto 0; max-width: 900px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 40px; }
.stn-ls-admin { margin: 20px auto 0; max-width: 900px; }
/* Floating-label fields (sg-shell.css "Floating-label fields"); only widths
   and spacing live here. The top padding is room for the floated labels. */
.stn-ls-fields { display: flex; flex-wrap: wrap; gap: 20px 16px; align-items: flex-end; padding-top: 10px; }
.stn-ls-fields .stn-num { width: 110px; }
.stn-ls-fields .stn-num input { text-align: center; }
.stn-ls-fields .stn-name { width: 260px; max-width: 100%; }
.stn-ls-actions { margin-top: 14px; justify-content: center; }

/* --- Search --------------------------------------------------------------- */
.stn-search { margin: 32px 0 0; display: flex; justify-content: center; }
.stn-search-fl { width: 340px; max-width: 100%; }
.stn-search + div .stn-tbl { margin-top: 16px; }

/* A field sitting on a card: the floated label's cut-out must match it. */
.stn .stn-card { --sg-fl-bg: var(--card); }

/* --- FargoRate requirements card (controls/FargoRateRequirements.ascx) ---
   Informational, so it wears the shell's .infoContent (sub-tournament.aspx sets
   CardCssClass="infoContent"; Jason, 2026-11-13). The wrapper centres the box
   and the box shrinks to its wording. */
.stn-fr { margin: 32px 0; text-align: center; }
.stn-fr .infoContent { display: inline-block; }

/* PoolPlayer Perks info card (PppInfoLit), below the deadline notice: the
   badge on the left in the cardholder colour it explains, then one line. */
.stn-ppp-info-wrap { margin: 24px 0; text-align: center; }
.stn-ppp-info-wrap .ppp-info { display: inline-flex; align-items: center; gap: 12px; }
.stn-ppp-info-wrap .ppp-info-icon { display: flex; color: var(--stn-link); }
.stn-ppp-info-wrap .ppp-icon { display: block; width: 28px; height: 28px; }

/* The caution panel, for content that warns. Rethemed with the warn tokens so
   it follows dark mode; v1's own .caution / .cautionNotice rules live in v1's
   stylesheet, which this page doesn't load. */
.stn .cautionNotice {
  display: inline-block;
  text-align: left;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-left: 1px solid var(--warn-fg);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 18px;
}
.stn .cautionNotice ol { margin: 6px 0 0 22px; padding: 0; }
.stn .cautionNotice ol li { margin: 3px 0; }

/* --- Section headings ---------------------------------------------------- */
.stn-sechead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 12px; }
.stn-sechead h2 { flex: 0 0 auto; }

/* --- Brackets (two columns, stacked when narrow) ------------------------- */
.stn-brackets { margin: 32px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
/* No finals column (FinalsBracketDIV not rendered): let Bracket(s) take the row. */
.stn-brackets > .stn-col:only-child { grid-column: 1 / -1; }
@media (max-width: 899.98px) {
  .stn-brackets { grid-template-columns: minmax(0, 1fr); }
}

/* --- DataDisplay tables -------------------------------------------------
   ppmu:DataDisplay renders <table class="dataTbl"> with inline widths and
   paddings on every cell, plus "fade" overlay images (white/grey gradient
   PNGs) at the right edge of long text. Restyled here to the sg-table look.
   ⚠ The padding needs !important: DataDisplay writes padding-left/right
   INLINE on every cell (mostly 0px), and only !important outranks inline. */
/* Every table box is capped at 60vh and scrolls inside, with its header row
   pinned -- the v2 standard, same as .sg-tbl-scroll in sg-bridge.css and mfg
   v2's .dataTblScroll (Jason, 2026-11-10). overflow: auto, so a table shorter
   than the cap shows no scrollbar and looks exactly as before; only one that
   grows past it gets capped. Taller on a phone, where 60vh is a cramped box
   inside a scrolling page; no cap when printing. The "1-25 of N" line and the
   pager are moved OUT of the table, above and below the box, by the
   stn-tbl-lift script at the foot of the page, so neither scrolls away. */
.stn-tbl {
  max-height: 60vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 599.98px) {
  .stn-tbl { max-height: 75vh; }
}
@media print {
  .stn-tbl { max-height: none !important; overflow: visible !important; }
  /* Unpin the header row and the frozen Name column on paper. Left sticky, the
     header printed partway down the table, on top of whatever row the box had
     been scrolled to (found by Jason, 2026-11-11). */
  .stn .stn-tbl .dataTbl tr.header th,
  .stn .dataTbl.stn-players .stn-freeze { position: static !important; box-shadow: none; }
}
.stn .stn-tbl .dataTbl tr.header th { position: sticky; top: 0; z-index: 2; }
/* On a phone the 7-8 column tables would squeeze until the headers (which
   carry inline widths and don't wrap) run into each other. Hold a minimum
   width instead and let .stn-tbl scroll sideways. */
@media (max-width: 699.98px) {
  .stn-tbl .dataTbl { min-width: 800px; } /* ~ the player table's column widths summed */
  /* ...but not an EMPTY one. With no rows DataDisplay renders a one-cell table
     holding its NoDataMessage ("0 brackets") and no header row; held at 800px
     it scrolled sideways, and the phone drew that scrollbar as a grey line
     under the message (found by Jason, 2026-11-11). */
  .stn-tbl .dataTbl:not(:has(tr.header)) { min-width: 0; }
}
/* Players table: Name is FROZEN and the rest scrolls sideways inside .stn-tbl
   when the page is narrower than the table (Jason, 2026-11-10). The PPP
   script reorders the columns and adds .stn-players / .stn-freeze. The Teams
   tables get the same classes from their own script (Team Name frozen,
   2026-11-13), so these rules serve both.
   ⚠ Cells don't wrap, so the table keeps its natural width and scrolls rather
   than squeezing. The frozen cell needs no background of its own: every td
   already carries an opaque one (card / stripe / hover). */
.stn .dataTbl.stn-players td,
.stn .dataTbl.stn-players tr.header th { white-space: nowrap; }
.stn .dataTbl.stn-players .stn-freeze {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: inset -1px 0 0 var(--border);
}
/* The header's Name cell is pinned both ways (top and left), so it must sit
   above the frozen Name cells scrolling up under it AND the header cells
   scrolling left under it. */
.stn .dataTbl.stn-players tr.header th.stn-freeze { z-index: 3; }
/* Bracket(s) and Finals Bracket tables: the first column (Bracket) frozen the
   same way (Jason, 2026-11-13). CSS only: it is already the first column, so
   nothing needs moving, and a class on the .stn-tbl box survives the
   UpdatePanel re-renders. :has(tr.header) skips an empty "0 brackets" table,
   which is a single cell and would otherwise get the divider line. */
.stn .stn-tbl-freeze1 .dataTbl td,
.stn .stn-tbl-freeze1 .dataTbl tr.header th { white-space: nowrap; }
.stn .stn-tbl-freeze1 .dataTbl:has(tr.header) tr > :first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: inset -1px 0 0 var(--border);
}
.stn .stn-tbl-freeze1 .dataTbl tr.header > th:first-child { z-index: 3; }
@media print {
  .stn .stn-tbl-freeze1 .dataTbl:has(tr.header) tr > :first-child { position: static !important; box-shadow: none; }
}
/* Teams table action columns (Pay / Edit / Unregister): a fixed comfortable
   width, so a mid-width window can't squeeze them to their text and crowd
   "$2320.00 Edit Unregister" together; the table scrolls sideways instead
   (Jason, 2026-11-13). Set by the Teams script. !important beats DataDisplay's
   INLINE width / max-width (54 / 46 / 72px). */
.stn .dataTbl .stn-act-pay,
.stn .dataTbl .stn-act-edit { width: 64px !important; min-width: 64px; max-width: none !important; }
.stn .dataTbl .stn-act-unreg { width: 104px !important; min-width: 104px; max-width: none !important; }
/* "1-25 of 38   View: 25 50 100", lifted out of the table to just above the
   scroll box (stn-tbl-lift script), so it never scrolls in either direction.
   A flex row: v1 floats the two halves, and flex ignores floats. */
.stn .stn-itemcount .itemCount { display: flex; justify-content: space-between; align-items: baseline; overflow: visible; }
/* The pager is lifted out of the table to just below the scroll box, so the
   sideways scrollbar sits right under the rows and the pager is centred on
   the page width rather than the scrolled table. Outside the table it loses
   dataTables.css's `.dataTbl tr.pagination` link colours, so they're restated
   (otherwise `.stn a` turns the page numbers link-blue). */
.stn .stn-pager { padding: 8px 10px; text-align: center; }
/* The pager's buttons themselves (round, themed, no orange hover) are styled
   for every v2 page in sg-shell.css, "Table pager". */
/* On a phone a 225px frozen Name would leave little room to scroll; narrow
   it and let long names wrap instead. */
@media (max-width: 599.98px) {
  .stn .dataTbl.stn-players .stn-freeze {
    width: 140px !important;
    min-width: 140px;
    max-width: 140px !important;
    white-space: normal;
  }
}
/* The card fill goes on the cells, not the table, so the "1-16 of 16" pager
   line above the header row sits on the page background. */
/* ⚠ separate + zero spacing, not collapse: a collapsed border belongs to the
   TABLE, so it stays put while a pinned header or frozen cell moves -- the
   header would leave its bottom rule behind on scroll. Renders identically. */
.stn .dataTbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 16px;   /* every table is 16px (Jason, 2026-11-13); was 15px */
  /* A WHOLE-pixel line height, so every row is a whole number of pixels.
     The page's 1.45 gave 21.75px lines and 38.75px rows; the frozen column is
     drawn on its own layer and rounded its row lines differently from the rest
     of the row, so every fourth or so line looked doubled and the next one
     vanished (Jason, 2026-11-13). Keep it in px. 23px = 40px rows (8 + 23 + 8
     padding/line + the 1px row line), Jason's choice the same day. */
  line-height: 23px;
}
.stn .dataTbl td { background: var(--card); }
.stn .dataTbl td,
.stn .dataTbl tr.header th {
  padding: 8px 10px !important;
  max-width: none !important; /* DataDisplay's inline max-width clips "City/Town/Village" and "St/Pr" */
  border-top: 0;
  border-bottom: 1px solid var(--border);
  white-space: normal;
  vertical-align: middle;
}
.stn .dataTbl tr.header th {
  background: var(--stn-th-bg);
  color: var(--stn-th-fg);
  font-weight: 600;
  white-space: nowrap;
}
.stn .dataTbl tr.header th a:link,
.stn .dataTbl tr.header th a:visited { color: var(--stn-th-fg); }
.stn .dataTbl tr.header th a:hover { color: #ffd59e; }
.stn .dataTbl tr.altRow td { background: var(--stn-stripe); }
.stn .dataTbl tr:hover td { background: var(--stn-row-hover); }
.stn .dataTbl td { transition: background .16s ease-in-out; }
/* Empty state ("0 brackets"): DataDisplay renders its NoDataMessage as a
   one-cell table with NO header row. Sits on the page background as plain
   text, aligned with the section heading, rather than as a card row. */
.stn .dataTbl:not(:has(tr.header)) td,
.stn .dataTbl:not(:has(tr.header)) tr:hover td {
  background: transparent;
  border-bottom: 0;
  height: auto;
  padding: 8px 0 !important;
}

/* Links and link-buttons in a cell: the shell's table-link look (see
   "Links inside table cells" in sg-shell.css) -- the link FILLS its cell and
   hover changes only the background, never the text colour. The shell's own
   rule can't reach these: DataDisplay wraps most links in a .fadeWrapper div
   beside a hidden .fadeRight anchor, so the link is never the cell's only
   child. Same values, matched to this markup.
   ⚠ The colour is set per CELL as a custom property and applied to the link
   with !important. dataTables.css paints hover amber at up to (0,4,1)
   (`.dataTbl tr .natural :link:hover`), so a plain rule loses the moment
   the pointer arrives; the variable keeps one place per colour instead of
   a specificity race per column.
   ⚠ The pager row (tr.pagination) keeps plain links. */
.stn .dataTbl td { --stn-cell-link: var(--stn-link); }
/* LinkColorClass columns (Manage / Edit / Delete / Pay). */
.stn .dataTbl td.green { --stn-cell-link: var(--success-fg); }
.stn .dataTbl td.orange { --stn-cell-link: var(--warn-fg); }
/* PoolPlayer Perks column (added client-side, see the PppPh block). The badge
   is an SVG in currentColor: grey for a non-cardholder (EAs only ever see that
   state), the Name / Unregister link colour for a cardholder. Non-EAs get a
   plain span -- no link, so none of the cell-link hover rules reach it. */
.stn .dataTbl td.stn-ppp { --stn-cell-link: var(--stn-ppp-off); width: 56px; }
/* The header cell needs the width too: it's the only column without an inline
   DataDisplay width, so a 100%-wide table hands it all the spare room. */
.stn .dataTbl tr.header th.stn-ppp-h { width: 56px; }
.stn .dataTbl td.stn-ppp.is-on { --stn-cell-link: var(--stn-link); }
/* display: flex, not inline-flex: an inline icon sat on the text line and
   stretched its row to 40.17px, putting the row lines back out of step (see
   the line-height note on .dataTbl). Centred by justify-content instead. */
.stn .dataTbl td.stn-ppp .stn-ppp-badge { color: var(--stn-link); display: flex; justify-content: center; }
/* Not clickable (non-EA view): plain arrow across the cell. Without it the
   badge's SVG "P" shows a text I-beam. cursor inherits down into the <text>. */
.stn .dataTbl td.stn-ppp:not(:has(a[data-ppp-pid])) { cursor: default; }
.stn .dataTbl td.stn-ppp .ppp-icon { display: block; width: 22px; height: 22px; }
.stn-modal .stn-ppp-who { font-weight: 700; margin-bottom: 4px; }
.stn .dataTbl tr:not(.pagination) td a[href] { color: var(--stn-cell-link) !important; }

/* `height: 1px` + the 100% heights: the .fr-action trick (a percentage
   height needs a definite parent height), carried down through .fadeWrapper. */
.stn .dataTbl tr:not(.pagination) td:has(a[href]:not(.fadeRight)) { padding: 0 !important; height: 1px; }
.stn .dataTbl tr:not(.pagination) td:has(a[href]:not(.fadeRight)) > .fadeWrapper { height: 100%; }
.stn .dataTbl tr:not(.pagination) td a[href]:not(.fadeRight) {
  display: flex;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  transition: background-color .12s ease-in-out;
}
.stn .dataTbl tr:not(.pagination) td[align="center"] a[href]:not(.fadeRight) { justify-content: center; }
.stn .dataTbl tr:not(.pagination) td[align="right"] a[href]:not(.fadeRight) { justify-content: flex-end; }
.stn .dataTbl tr:not(.pagination) td a[href]:not(.fadeRight):hover { background-color: rgba(127, 127, 127, 0.22); }

/* The fade overlays are images painted for a white or #f2f2f2 row; on any
   other background (stripes, hover, dark mode) they show as pale blocks.
   Cells wrap instead, which the v2 tables do too. */
.stn .dataTbl .fadeRight { display: none; }
.stn .dataTbl .fadeWrapper { position: static; }

/* "1-16 of 16  View: 25 50 100" line above a paged table. Not scoped to
   .dataTbl: the stn-tbl-lift script moves it out of the table. */
.stn .itemCount { color: var(--muted-foreground); font-size: 16px; margin-bottom: 10px; }
.stn .itemCount a:link,
.stn .itemCount a:visited { color: var(--muted-foreground); }
/* DataDisplay marks the current page size with an INLINE color: Orange. */
.stn .itemCount a.num[style*="Orange"] { color: var(--stn-link-hover) !important; font-weight: 600; }

/* Pager row (before the stn-tbl-lift script moves its contents out). The
   buttons are styled in sg-shell.css, "Table pager". */
.stn .dataTbl tr.pagination td,
.stn .dataTbl tr.pagination:hover td { background: transparent; border-bottom: 0; }

/* --- Modals (the admin/registration popups) -----------------------------
   Shown and hidden server-side (Visible on the popup and on its .greyout). A
   click on the backdrop clicks the popup's own Close button (the "backdrop
   closes the popup" script at the foot of sub-tournament.aspx). */
.stn .greyout {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(20, 28, 48, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
html.dark .stn .greyout { background: rgba(0, 0, 0, 0.6); }

.stn .stn-modal {
  position: fixed;
  z-index: 501;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  padding: 22px 26px;
  text-align: left;
}
.stn .stn-modal-sm { max-width: 560px; }
.stn .stn-modal-md { max-width: 640px; }
.stn .stn-modal-lg { max-width: 780px; }
/* Set by the "Back never reopens a popup" script in sub-tournament.aspx while
   it fetches the page again, so the stale popup doesn't flash first. */
html.stn-reloading .stn-modal,
html.stn-reloading .greyout { display: none !important; }
.stn .stn-modal h3 { margin: 0 0 16px; font-size: 26px; font-weight: 400; line-height: 39px; color: var(--foreground); border: 0; padding: 0; }
.stn .stn-mnote { margin: -6px 0 16px; color: var(--muted-foreground); }
.stn .stn-mdivider { height: 1px; background: var(--border); margin: 22px 0; }

/* One field/error row. The field is a floating-label field (sg-shell.css),
   its label inside the box, so a row is just the field, then its error
   message. The top margin is room for the floated label. */
.stn .stn-frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 22px 0 0; }
.stn .stn-frow:first-of-type { margin-top: 10px; }
.stn .stn-fw-sm { width: 200px; max-width: 100%; }
.stn .stn-fw-md { width: 340px; max-width: 100%; }
.stn .stn-fw-lg { width: 400px; max-width: 100%; }
.stn .stn-fw-xl { width: 100%; max-width: 520px; }
/* A checkbox row: the box, then its own text as the clickable label. */
.stn .stn-fcheck { margin-top: 18px; }
.stn .stn-fcheck label { cursor: pointer; }

/* A popup whose fields are CENTRED (Add Player; Jason, 2026-11-12). Each row
   is a three-column grid: the field in the middle column, its error marker in
   the right one, so a marker appearing never pushes the field off centre (as
   it would as a flex sibling). The left column holds an error that belongs
   beside the field's LEFT edge (Gender's, next to the Gender/Suffix pair).
   Below 600px the side columns have no room, so markers drop under the field. */
.stn .stn-fcenter .stn-frow { display: grid; grid-template-columns: 1fr minmax(0, max-content) 1fr; align-items: center; gap: 0 8px; }
.stn .stn-fcenter .stn-frow > .sg-fl,
.stn .stn-fcenter .stn-frow > .stn-fpair { grid-column: 2; grid-row: 1; }
.stn .stn-fcenter .stn-frow > .stn-ferr { grid-column: 3; grid-row: 1; justify-self: start; }
.stn .stn-fcenter .stn-frow > .stn-ferr-start { grid-column: 1; grid-row: 1; justify-self: end; }
/* Explicit px widths: a percentage width can't size a max-content track. */
.stn .stn-fcenter .stn-fw-xl { width: 520px; max-width: 100%; }
/* Gender + Suffix: side by side, together exactly as wide as a name field;
   they stack once each would be narrower than 160px. */
.stn .stn-fpair { display: flex; flex-wrap: wrap; gap: 22px 12px; width: 400px; max-width: 100%; }
.stn .stn-fpair > .sg-fl { flex: 1 1 160px; width: auto; min-width: 0; }
@media (max-width: 599.98px) {
  .stn .stn-fcenter .stn-frow > .stn-ferr,
  .stn .stn-fcenter .stn-frow > .stn-ferr-start { grid-column: 2; grid-row: 2; justify-self: center; }
  .stn .stn-fcenter .stn-frow > :is(.stn-ferr, .stn-ferr-start):has(span:not(:empty)) { margin-top: 4px; }
}

/* Popup button rows are CENTRED: the house rule for popups on the v2-shell
   pages (Jason, 2026-11-11), unless a popup says otherwise. Same rule as
   .sg-modal-actions in sg-bridge.css. */
.stn .stn-mactions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.stn .stn-mactions-start { margin: 22px 0 4px; }
.stn .stn-merr { margin-top: 14px; text-align: center; font-weight: 600; }

/* Register popup (2026-11-12): "Back" above the heading on its search screen,
   the event on its self screen, and the centred "Register a different player"
   below the buttons. */
.stn .stn-mback { margin: -6px 0 10px; }
.stn .stn-reg-event { margin: 0; display: grid; gap: 6px; }
.stn .stn-reg-event > div { display: flex; flex-wrap: wrap; gap: 0 6px; }
.stn .stn-reg-event dt { color: var(--muted-foreground); }
.stn .stn-reg-event dd { margin: 0; font-weight: 600; }
.stn .stn-reg-already { margin: 14px 0 0; }
.stn .stn-reg-other { margin-top: 18px; text-align: center; }

/* Possible-duplicate panel in the add-a-player popups (2026-11-12). The form it
   replaces is hidden with .stn-hide rather than removed, so its fields still
   post their values for "Add as a new player". */
.stn .stn-hide { display: none !important; }
.stn .stn-match-warn {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-left: 1px solid var(--warn-fg);
  border-radius: var(--radius);
  font-weight: 600;
}
.stn .stn-match-adding { margin: 0 0 12px; }
.stn .stn-match-strong { font-weight: 700; }
.stn .stn-match-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.stn .stn-match-item { display: flex; align-items: center; gap: 8px 14px; padding: 12px 14px; }
.stn .stn-match-item + .stn-match-item { border-top: 1px solid var(--border); }
.stn .stn-match-main { flex: 1 1 auto; min-width: 0; }
.stn .stn-match-name { font-weight: 600; }
.stn .stn-match-meta { margin-top: 2px; color: var(--muted-foreground); font-size: 15px; }
.stn .stn-match-why { display: block; margin-top: 2px; font-style: italic; }
.stn .stn-match-btn { flex: 0 0 auto; white-space: nowrap; }
.stn .stn-match-more { margin: 10px 0 0; color: var(--muted-foreground); font-size: 15px; text-align: center; }
@media (max-width: 599.98px) {
  .stn .stn-match-item { flex-wrap: wrap; }
  .stn .stn-match-btn { width: 100%; text-align: center; }
}

/* Refund popup's label/value table. */
.stn .stn-kv { border-collapse: collapse; width: 100%; }
.stn .stn-kv th { width: 150px; padding: 4px 12px 4px 0; text-align: right; font-weight: normal; color: var(--muted-foreground); white-space: nowrap; vertical-align: top; }
.stn .stn-kv td { padding: 4px 0; vertical-align: top; }
.stn .stn-kv tr.stn-kv-break th,
.stn .stn-kv tr.stn-kv-break td { border-top: 1px solid var(--border); padding-top: 10px; }
/* Pay / Undo popup: the question between the details and the buttons. */
.stn .stn-pay-q { margin: 18px 0 0; text-align: center; font-weight: 500; }
.stn .stn-refund-entry { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }.stn .stn-notice-danger { margin: 18px 0 0; }

/* controls/AddPlayerPopup.ascx -- its own popup, styled inline in v1 terms
   (fixed position, #f2f2f2 background, float rows). Only the surface and the
   rows are rethemed; its inline position/size are left alone, hence the
   !important on the colours. */
.stn .boxShad00443 {
  background: var(--card) !important;
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.stn .boxShad00443 div.h30 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 14px; }
.stn .boxShad00443 .lblLt { flex: 0 0 150px; text-align: right; color: var(--muted-foreground); }
.stn .boxShad00443 .lblRt { color: var(--muted-foreground); }

/* --- Form controls -------------------------------------------------------
   Text inputs from ppmu:TextBox (class "input"), ppmu:SearchControl and plain
   asp:TextBox. Widths stay whatever the control writes inline; max-width keeps
   them inside a narrow modal. */
.stn input.input,
.stn input[type="text"] {
  height: 36px;
  max-width: 100%;
  padding: 0 10px;
  font: inherit;
  font-size: 15px;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: 6px;
  box-shadow: none;
}
.stn input.input:focus,
.stn input[type="text"]:focus { outline: 2px solid var(--ring); outline-offset: 1px; }
/* The search boxes show their prompt as a real value in grey (g_b7) until
   focused; inputNormal is the typed-text state. */
.stn input.g_b7 { color: var(--muted-foreground); }
.stn input.successBg { background: var(--success-bg); color: var(--success-fg); }
.stn input.attentionBg { background: var(--destructive-bg); color: var(--destructive-fg); }
/* The floating-label field rule (html .sg-fl ..., sg-shell.css) outranks the
   two above, so a field flagged good or bad restates them at its weight. */
html .stn .sg-fl input.successBg { background: var(--success-bg); color: var(--success-fg); }
html .stn .sg-fl input.attentionBg { background: var(--destructive-bg); color: var(--destructive-fg); }
.stn input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; vertical-align: middle; }

/* select2 (ppmu:DropDownList). */
.stn .select2-container .select2-choice {
  height: 36px;
  line-height: 34px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: 6px;
  box-shadow: none;
  background-image: none;
}
.stn .select2-container .select2-choice .select2-arrow { background: transparent; border-left: 0; }
.stn .select2-container .select2-choice .select2-arrow b { background-position: 0 4px; }
.stn .select2-container.select2-dropdown-open .select2-choice { border-radius: 6px 6px 0 0; }
.stn .select2-default { color: var(--muted-foreground) !important; }
/* select2's menu, appended to <body> (so matched by its own classes, not under
   .stn). Themed like the player-search menu below: card surface, muted
   highlight, in both themes. Its border takes the open field's focus colour
   (sg-shell.css) so the menu reads as part of the field. select2.css paints the
   "No matches found" / "Searching..." / disabled rows #f4f4f4, which in dark
   was a white bar, so those are restated too. */
.select2-drop,
.select2-drop.select2-drop-active {
  background: var(--card);
  color: var(--foreground);
  border-color: #1a5289;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
html.dark .select2-drop,
html.dark .select2-drop.select2-drop-active { border-color: #6a8aaf; }
.select2-results { margin: 4px; padding: 0; }
.select2-results .select2-result-label { padding: 6px 10px; border-radius: 4px; }
.select2-results .select2-highlighted { background: var(--muted); color: var(--foreground); }
.select2-results .select2-no-results,
.select2-results .select2-searching,
.select2-results .select2-ajax-error,
.select2-results .select2-selection-limit,
.select2-results .select2-disabled,
.select2-results .select2-disabled.select2-highlighted {
  background: transparent;
  color: var(--muted-foreground);
  padding: 6px 10px;
}

/* jQuery UI autocomplete menu (ppmu:SearchControl). It sits in a .ui-front
   wrapper beside its box, or in <body> when the box is in a popup (see
   .stn-ac-float), so it is matched by its own classes rather than under .stn. */
.ui-autocomplete {
  position: absolute;
  z-index: 560;
  list-style: none;
  margin: 2px 0 0;
  padding: 4px;
  font-size: 15px;
  cursor: default;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.ui-autocomplete .ui-menu-item a { display: block; padding: 6px 8px; border-radius: 4px; color: var(--foreground); text-decoration: none; }
.ui-autocomplete .ui-menu-item a.ui-state-focus,
.ui-autocomplete .ui-menu-item a.ui-state-active { background: var(--muted); color: var(--foreground); }
/* A search box's menu inside a popup, moved to <body> by the page script so
   the popup's scroll box can't clip it; fixed, like the popup it belongs to;
   border-box so the max-height the script sets on a short window includes
   the menu's padding and border. */
.ui-autocomplete.stn-ac-float { position: fixed; box-sizing: border-box; }
.ui-helper-hidden-accessible { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.searchControlsHiddenIDBox { display: none; }

/* --- v1 utility classes still emitted by the page's controls ------------
   (DataDisplay's column alignment uses attributes, not these.) */
.stn .attention { color: var(--destructive-fg); }
.stn .success { color: var(--success-fg); }
.stn .tc { text-align: center; }
