/*
 * Stripes website: the one stylesheet.
 *
 * Phone first: every layout starts at 320 px wide and grows. Phones get a bottom tab bar; from 760 px the top nav
 * takes over. Colors are tokens on :root (the site is dark only: the bot's palette is a dark one). The HTML carries no
 * style attributes (the Content-Security-Policy allows only this file), so anything per element, like a bar's width,
 * is set from the page scripts through element.style.
 */

/* ------------------------------------------------------------------------------------------------------------------
 * Fonts: self hosted (font-src 'self'), latin only. Names in other scripts fall back to the system font.
 * ---------------------------------------------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
}

/* ------------------------------------------------------------------------------------------------------------------
 * Tokens
 * ---------------------------------------------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  --page: #0A0F1C;
  --header: #0C1322;
  --surface: #111A2C;
  --raised: #17223A;
  --border: #22304A;
  --rule: #1C2740;
  --track: #26324A;
  --axis: #34425E;

  --text: #EEF2F8;
  --text-2: #C5CEDD;
  --muted: #8E9BB3;
  --faint: #4B5873; /* decoration only (a score's colon, a former member's avatar): below 3:1 on the surface */

  --gold: #FFB81C; /* the UI accent: buttons, focus rings, the current page */
  --rangers: #0038A8;
  --in: #3987e5; /* chips in */
  --out: #e66767; /* chips out */

  /* Chart categorical order (validated against --surface in dark mode: see charts.js). */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-ref: #8E9BB3; /* a reference line (the group average), drawn dashed */

  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --radius-card: 16px;
  --radius-control: 10px;
  --gutter: 16px;
  --tab-bar: 60px;
  --tap: 44px;
}

/* ------------------------------------------------------------------------------------------------------------------
 * Base
 * ---------------------------------------------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere; /* a long name without spaces wraps instead of widening the page */
  /* room for the fixed tab bar on phones */
  padding-bottom: calc(var(--tab-bar) + env(safe-area-inset-bottom, 0px));
}

a {
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--axis);
  text-underline-offset: 3px;
}

a:hover {
  color: #FFFFFF;
  text-decoration-color: currentColor;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--gold);
  color: var(--page);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: var(--page);
}

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------------------------------------------------------
 * Header, nav and the phone tab bar
 * ---------------------------------------------------------------------------------------------------------------- */

.site-header {
  background: var(--header);
  border-bottom: 1px solid var(--rule);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  flex: none; /* the wordmark never gives way: a long name in the account chip shortens instead */
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  overflow: hidden;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.brand-server {
  display: none;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18ch;
}

.top-nav {
  display: none;
}

.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  background: var(--header);
  border-top: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-bar a {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tab-bar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}

.tab-bar a svg {
  width: 22px;
  height: 22px;
}

.tab-bar a[aria-current="page"] {
  color: #FFFFFF;
}

/* the current tab is marked by shape as well as color */
.tab-bar a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--gold);
}

.tab-bar a:focus-visible {
  outline-offset: -3px;
}

@media (min-width: 420px) {
  .brand-server {
    display: inline;
  }
}

@media (min-width: 760px) {
  :root {
    --gutter: 24px;
  }

  body {
    padding-bottom: 0;
  }

  .tab-bar {
    display: none;
  }

  .header-row {
    flex-wrap: wrap;
    gap: 8px 28px;
  }

  .top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 6px;
    flex: 1 1 320px;
    font-size: 14px;
    font-weight: 500;
  }

  .top-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 10px;
    color: var(--text-2);
    text-decoration: none;
  }

  .top-nav a:hover {
    color: #FFFFFF;
  }

  .top-nav a[aria-current="page"] {
    color: #FFFFFF;
  }

  .top-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold);
  }

  .account {
    margin-left: 0;
  }
}

/* The logged in member's menu: a <details>, so it opens with a keyboard and a screen reader as it is. */

.account-menu {
  position: relative;
}

.account-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  max-width: 220px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 759px) {
  /* On a phone the chip shrinks to the room left beside the wordmark, and the name ellipsizes. */
  .account-menu {
    min-width: 0;
    max-width: 100%;
  }

  .account-menu > summary {
    max-width: min(220px, 100%);
  }
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

.account-menu > summary:hover {
  background: var(--raised);
}

.account-menu[open] > summary {
  background: var(--raised);
}

.account-menu .account-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.account-menu .chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: min(280px, calc(100vw - 2 * var(--gutter)));
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.menu-panel .menu-who {
  padding: 4px 6px 10px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.menu-panel .menu-who strong {
  color: var(--text);
  font-weight: 600;
}

.menu-panel a,
.menu-panel button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--tap);
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}

.menu-panel a:hover,
.menu-panel button:hover {
  background: var(--surface);
  color: #FFFFFF;
}

.menu-panel .menu-hint {
  padding: 0 8px 4px;
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------------------------------------------------------------
 * Buttons and controls
 * ---------------------------------------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: var(--radius-control);
  background: var(--raised);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  color: #FFFFFF;
  border-color: var(--axis);
}

.btn svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--gold);
  color: var(--page);
}

.btn-primary:hover {
  color: var(--page);
  border-color: #FFFFFF;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
}

.btn-danger {
  background: transparent;
  border-color: #6b3540;
  color: #F3B4B4;
}

.btn-danger:hover {
  border-color: var(--out);
  color: #FFFFFF;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-large {
  min-height: 52px;
  padding: 0 22px;
  font-size: 16px;
}

.login-short {
  display: inline;
}

.login-long {
  display: none;
}

@media (min-width: 420px) {
  .login-short {
    display: none;
  }

  .login-long {
    display: inline;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label,
.field .label {
  font-size: 13px;
  color: var(--muted);
}

.select,
.search {
  min-height: var(--tap);
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

.select {
  padding-right: 36px;
  appearance: none;
  background-image: url("/static/img/chevron.svg");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

.select:hover,
.search:hover {
  border-color: var(--axis);
}

.search::placeholder {
  color: var(--muted);
  opacity: 1;
}

.pill {
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
}

.pill:hover {
  border-color: var(--axis);
  color: #FFFFFF;
}

/* pressed is shown by a check mark and a light border, not only a color */
.pill[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--raised);
  color: var(--text);
}

.pill[aria-pressed="true"]::before {
  content: "\2713\00a0";
}

/* ------------------------------------------------------------------------------------------------------------------
 * Page layout
 * ---------------------------------------------------------------------------------------------------------------- */

.page {
  padding-top: 24px;
  padding-bottom: 48px;
}

.page:focus {
  outline: none;
}

#view {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}

.page-head.spread {
  justify-content: space-between;
  align-items: flex-end;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.page-sub {
  font-size: 14px;
  color: var(--muted);
}

.section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.section-note {
  font-size: 13px;
  color: var(--muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.row > * {
  flex: 1 1 320px;
  min-width: 0;
}

.row > .wide {
  flex: 1.4 1 420px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.row.top {
  align-items: flex-start;
}

.toolbar.bottom {
  align-items: flex-end;
}

@media (min-width: 760px) {
  .page {
    padding-top: 28px;
    padding-bottom: 64px;
  }

  #view {
    gap: 36px;
  }

  .page-title {
    font-size: 44px;
  }

  .section-title {
    font-size: 32px;
  }
}

/* ------------------------------------------------------------------------------------------------------------------
 * Cards, tiles, notes
 * ---------------------------------------------------------------------------------------------------------------- */

.card {
  min-width: 0;
  margin: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.card-note {
  font-size: 13px;
  color: var(--muted);
}

@media (min-width: 760px) {
  .card {
    padding: 18px 20px;
  }
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.tiles.single {
  grid-template-columns: minmax(0, 340px);
}

.tile {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.tile-label {
  font-size: 13px;
  color: var(--muted);
}

.tile-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 38px;
  line-height: 1.1;
}

.tile-sub {
  font-size: 13px;
  color: var(--text-2);
}

@media (min-width: 760px) {
  .tiles {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
  }

  .tile {
    padding: 18px 20px;
  }

  .tile-value {
    font-size: 42px;
  }
}

.note {
  font-size: 13px;
  color: var(--muted);
}

.money-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-2);
}

.money-note svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--muted);
}

.badge-sample {
  font-size: 12px;
  font-weight: 600;
  color: var(--page);
  background: var(--text-2);
  border-radius: 999px;
  padding: 2px 10px;
}

.empty {
  padding: 18px 16px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--text-2);
  font-size: 14px;
}

/* Friendly states: loading, not a member, no access, an error */

.notice {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.notice h1,
.notice h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.notice p {
  color: var(--text-2);
}

.notice .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-line {
  color: var(--muted);
  font-size: 14px;
}

.loading-dots::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

.flash {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--raised);
  border: 1px solid var(--border);
  font-size: 14px;
}

.flash.bad {
  border-color: #6b3540;
}

/* ------------------------------------------------------------------------------------------------------------------
 * Landing (logged out)
 * ---------------------------------------------------------------------------------------------------------------- */

.landing {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.landing-mark {
  width: 64px;
  height: 64px;
  border-radius: 17px;
  overflow: hidden;
}

.landing-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  line-height: 0.95;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.landing-lead {
  font-size: 17px;
  color: var(--text-2);
  max-width: 52ch;
}

.landing-small {
  font-size: 13px;
  color: var(--muted);
  max-width: 60ch;
}

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.features svg {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--gold);
  margin-top: 1px;
}

.features strong {
  display: block;
  font-weight: 600;
}

.features span {
  font-size: 14px;
  color: var(--text-2);
}

.landing-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 14px;
}

.landing-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

@media (min-width: 640px) {
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .landing-hero {
    padding: 32px 32px;
  }

  .landing-title {
    font-size: 64px;
  }
}

/* ------------------------------------------------------------------------------------------------------------------
 * People: avatar, name, "you"
 * ---------------------------------------------------------------------------------------------------------------- */

.person {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.person-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person.former .person-name {
  color: var(--muted);
  font-style: italic;
}

.you-tag {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--page);
  background: var(--gold);
  border-radius: 999px;
  padding: 1px 7px;
}

.avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  background: var(--track);
  color: var(--text-2);
}

.avatar.big {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.names {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 14px;
}

/* ------------------------------------------------------------------------------------------------------------------
 * Tonight: game cards
 * ---------------------------------------------------------------------------------------------------------------- */

.games {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .games {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

.game {
  container-type: inline-size;
  gap: 16px;
}

.game-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-2);
}

.status-tag.live {
  color: var(--gold);
}

.status-tag.final {
  color: var(--text);
}

.live-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

@media (prefers-reduced-motion: no-preference) {
  .live-dot {
    animation: pulse 2s ease-in-out infinite;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.status-aside {
  font-size: 12px;
  color: var(--muted);
}

.matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.team-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
}

.team-badge {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.3px;
  background: var(--raised);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.team-badge.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 15px;
}

.score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 46px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.score .colon {
  color: var(--faint);
  padding: 0 6px;
}

.score.versus {
  font-weight: 600;
  font-size: 28px;
  color: var(--muted);
}

@container (min-width: 440px) {
  .matchup {
    gap: 16px;
  }

  .team {
    flex-direction: row;
    gap: 14px;
    text-align: left;
  }

  .team.home {
    flex-direction: row-reverse;
    text-align: right;
  }

  .team-name {
    font-size: 15px;
  }

  .team-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 20px;
  }

  .score {
    font-size: 56px;
  }

  .score .colon {
    padding: 0 10px;
  }

  .score.versus {
    font-size: 30px;
  }
}

.picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}

.split-bar {
  display: flex;
  gap: 2px;
  height: 10px;
}

.split-bar > span {
  min-width: 4px;
  height: 100%;
}

.split-bar > span:first-child {
  border-radius: 4px 0 0 4px;
}

.split-bar > span:last-child {
  border-radius: 0 4px 4px 0;
}

.split-bar > span:only-child {
  border-radius: 4px;
}

.seg-away { background: var(--series-1); }
.seg-home { background: var(--series-4); }
.seg-done { background: var(--series-4); }
.seg-left { background: var(--track); }

.picks-line {
  font-size: 13px;
  color: var(--text-2);
}

.picks-line strong {
  color: var(--text);
  font-weight: 600;
}

.who-picked > summary,
.table-view > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
}

.who-picked > summary::-webkit-details-marker,
.table-view > summary::-webkit-details-marker {
  display: none;
}

.who-picked > summary::before,
.table-view > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-right: 4px;
}

.who-picked[open] > summary::before,
.table-view[open] > summary::before {
  transform: rotate(45deg);
}

.who-picked > summary:hover,
.table-view > summary:hover {
  color: #FFFFFF;
}

.who-picked-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-bottom: 4px;
}

@container (min-width: 440px) {
  .who-picked-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.who-picked-body h3 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 14px;
  background: var(--raised);
  border-radius: 12px;
}

/* May shrink below its widest line (a flex item would not), so a long leader name ends in "..." instead of
   pushing the row past a 320 px screen. */
.extra-body {
  min-width: 0;
}

.extra-title {
  font-weight: 600;
}

.extra-sub {
  font-size: 13px;
  color: var(--text-2);
}

.leaders-inline {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--text-2);
}

.leaders-inline li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.leaders-inline .chips-count {
  flex: none;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.live-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.live-state .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.live-state.on .dot {
  background: var(--series-3);
}

.next-game {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

/* ------------------------------------------------------------------------------------------------------------------
 * Tables
 * ---------------------------------------------------------------------------------------------------------------- */

.table-wrap {
  /* positioned, so a visually hidden header stays inside the scroll box instead of widening the page */
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
}

.table-card {
  padding: 4px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.data-table caption {
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 10px 6px;
  text-align: right;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 14px;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 14px;
}

.data-table thead th {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.data-table tbody tr {
  border-top: 1px solid var(--rule);
}

.data-table .left {
  text-align: left;
}

.data-table .rank {
  color: var(--muted);
  width: 2.5em;
}

.data-table .strong {
  font-weight: 600;
}

.data-table .soft {
  color: var(--text-2);
}

.data-table .name-cell .person {
  max-width: min(15em, 40vw);
}

.data-table tr.is-you {
  background: rgba(255, 184, 28, 0.07);
}

.standings-table .name-cell {
  font-weight: 500;
}

@media (max-width: 479px) {
  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 9px 4px;
  }

  .data-table .rank {
    width: auto;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    padding-left: 10px;
  }

  .data-table th:last-child,
  .data-table td:last-child {
    padding-right: 10px;
  }

  .data-table .name-cell .person {
    max-width: 25vw;
  }

  /* on a phone the avatar's room goes to the name */
  .data-table .avatar {
    display: none;
  }
}

.table-view {
  border-top: 1px solid var(--rule);
  padding-top: 2px;
}

.table-view .table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 4px;
}

.table-view .data-table {
  font-size: 13px;
}

.table-view .data-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
}

/* ------------------------------------------------------------------------------------------------------------------
 * Charts and CSS bars
 * ---------------------------------------------------------------------------------------------------------------- */

.chart-card {
  gap: 10px;
}

.chart {
  width: 100%;
  height: 260px;
  min-width: 0;
}

@media (min-width: 760px) {
  .chart {
    height: 300px;
  }
}

.legend {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--text-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.legend .legend-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend .legend-value {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.key-line {
  flex: none;
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 3px solid currentColor;
  border-radius: 2px;
}

.key-line.dashed {
  border-top-style: dashed;
  border-top-width: 2px;
}

.key-box {
  flex: none;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.key-in { background: var(--in); }
.key-out { background: var(--out); }

/* The chart tooltip: built by charts.js with textContent, inside the chart's own box. */
.chart-tip {
  min-width: 140px;
  max-width: 240px;
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
}

.chart-tip-title {
  margin-bottom: 6px;
  color: var(--text-2);
  font-weight: 600;
  white-space: normal;
}

.chart-tip-row {
  display: grid;
  grid-template-columns: 14px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.chart-tip-row .key-line {
  width: 12px;
}

.chart-tip-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.chart-tip-name {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bars drawn in CSS: one row per member, the value always written next to the bar. */
.bars {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-row .bar-name {
  position: relative;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

.bar-row.is-you .bar-name {
  color: var(--text);
  font-weight: 600;
}

.bar-row .bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 3.5em;
}

.bar-track {
  display: block;
  height: 14px;
  background: var(--raised);
  border-radius: 0 4px 4px 0;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  background: var(--series-1);
  border-radius: 0 4px 4px 0;
}

.bar-row.is-you .bar-fill {
  background: var(--gold);
}

@media (min-width: 760px) {
  .bar-row {
    grid-template-columns: minmax(0, 10em) minmax(0, 1fr) auto;
  }
}

/* Diverging bars: chips in to the right of the middle line, chips out to the left. */
.div-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label value" "bar bar";
  align-items: center;
  gap: 4px 10px;
  font-size: 13px;
}

.div-row .div-label {
  grid-area: label;
  color: var(--text-2);
  min-width: 0;
}

.div-row .div-value {
  grid-area: value;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.div-bar {
  grid-area: bar;
  display: flex;
  height: 14px;
}

.div-half {
  flex: 1 1 0;
  display: flex;
}

.div-half.neg {
  justify-content: flex-end;
  border-right: 1px solid var(--axis);
}

.div-fill {
  height: 100%;
}

.div-half.neg .div-fill {
  background: var(--out);
  border-radius: 4px 0 0 4px;
}

.div-half.pos .div-fill {
  background: var(--in);
  border-radius: 0 4px 4px 0;
}

@media (min-width: 560px) {
  .div-row {
    grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 4.5em;
    grid-template-areas: "label bar value";
    gap: 10px;
  }
}

/* Leader lists (Goal Draw, quiz, rivalry) */

.leaders {
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaders li {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  border-top: 1px solid var(--rule);
  font-size: 14px;
}

.leaders li:first-child {
  border-top: 0;
}

.leaders .rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.leaders .value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rivalry-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rivalry-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.rivalry-line .value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rivalry-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Recent results */

.results {
  margin: 0;
  padding: 4px 16px;
  gap: 0;
  list-style: none;
}

.results li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}

.results li:first-child {
  border-top: 0;
}

.result-score {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  min-width: 9em;
}

.result-when {
  font-size: 13px;
  color: var(--muted);
  min-width: 5em;
}

.result-note {
  flex: 1 1 260px;
  font-size: 14px;
  color: var(--text-2);
}

@media (min-width: 760px) {
  .results {
    padding: 4px 20px;
  }
}

/* My bets */

.bets {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bets li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}

.bet-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 10px;
  font-size: 12px;
  color: var(--muted);
}

.bet-detail {
  font-size: 14px;
}

.at-stake {
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--text-2);
}

/* ------------------------------------------------------------------------------------------------------------------
 * Commands
 * ---------------------------------------------------------------------------------------------------------------- */

.lead {
  max-width: 72ch;
  color: var(--text-2);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--text);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar .search {
  flex: 1 1 260px;
}

.toolbar .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.command-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1100px) {
  .command-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
  }
}

.command-group h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.commands {
  margin: 0;
  padding: 0;
  list-style: none;
}

.commands li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
}

.command-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.command-name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
}

.command-usage {
  color: var(--muted);
}

.command-desc {
  font-size: 14px;
  color: var(--text-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--page);
  background: var(--text-2);
  text-decoration: none;
}

a.tag {
  position: relative;
  min-height: 24px;
}

a.tag::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: -10px;
  bottom: -10px;
}

a.tag:hover {
  color: var(--page);
  background: #FFFFFF;
}

.tag.mods {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--axis);
}

.tag.admins {
  background: transparent;
  color: var(--gold);
  border: 1px solid #6b5523;
}

/* ------------------------------------------------------------------------------------------------------------------
 * Plain text pages (privacy) and the server's small message pages (http.html_page)
 * ---------------------------------------------------------------------------------------------------------------- */

.prose {
  max-width: 72ch;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text-2);
}

.prose h2 {
  margin-top: 14px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.prose ul {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.message-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--gutter);
}

.message {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.message h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.message p {
  color: var(--text-2);
}

.message a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 600;
}

/* ------------------------------------------------------------------------------------------------------------------
 * Footer
 * ---------------------------------------------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
  padding-top: 18px;
  padding-bottom: 22px;
  font-size: 13px;
  color: var(--muted);
}

.footer-row a {
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

/* ------------------------------------------------------------------------------------------------------------------
 * Motion, contrast and print
 * ---------------------------------------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .bar-fill,
  .div-fill,
  .split-bar > span,
  .live-dot,
  .key-box {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .seg-left,
  .bar-track {
    forced-color-adjust: none;
    background: Canvas;
    outline: 1px solid CanvasText;
  }

  .tab-bar a[aria-current="page"]::before,
  .top-nav a[aria-current="page"]::after {
    background: Highlight;
  }
}

@media print {
  .tab-bar,
  .site-header .account,
  .skip-link {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}
