:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; color: var(--site-text); font: 16px/1.5 var(--site-font); }
a { color: var(--site-accent); }
:focus-visible { outline: 2px solid var(--site-accent); outline-offset: 3px; }

.league-layout {
  width: min(100%, 760px);
  margin-inline: auto;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.league-header {
  display: flex;
  margin-bottom: clamp(24px, 4vw, 36px);
}
.league-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--site-text);
  font-size: clamp(15px, 4.5vw, 19px);
  font-weight: 900;
  letter-spacing: -.7px;
  text-decoration: none;
}
.league-header .brand img {
  display: block;
  flex: none;
  border: 2px solid var(--site-text);
  border-radius: 25%;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(25px, 4vw, 38px);
  line-height: 1.12;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
h1 em { color: var(--site-accent); font-style: normal; }
h2 { margin: 0 0 6px; font-size: clamp(19px, 2.5vw, 24px); line-height: 1.25; letter-spacing: -.02em; }
.lead { margin: 0 0 18px; color: var(--site-text-secondary); font-size: clamp(14px, 1.8vw, 16px); }
main > section, .lg-card {
  border: 1px solid var(--site-surface-border);
  border-radius: var(--site-surface-radius);
  background: var(--site-surface);
  box-shadow: var(--site-surface-shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
main > section { margin-bottom: 14px; padding: clamp(12px, 2.5vw, 22px); }
section p { margin: 0 0 12px; color: var(--site-text-secondary); font-size: 14px; }
section p:last-child { margin-bottom: 0; }

.play, .lg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 800 14px/1.2 var(--site-font);
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.play { background: var(--site-action); color: var(--site-ink); }
.play:hover:not(:disabled) { background: var(--site-action-hover); }
.lg-btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .15); color: var(--site-text); }
.lg-btn:hover:not(:disabled) { border-color: var(--site-accent); }
.play:disabled, .lg-btn:disabled { opacity: .55; cursor: wait; }

.lg-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; }
.lg-form + .lg-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--site-surface-border); }
.lg-form label { grid-column: 1 / -1; color: var(--site-accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.lg-input {
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: var(--site-text);
  font: inherit;
}
.lg-input::placeholder { color: var(--site-text-muted); }
.lg-code { text-transform: uppercase; letter-spacing: .12em; }
.lg-error { margin: 10px 0 0; color: #ffb4a3; font-size: 14px; font-weight: 700; }
.lg-error:empty { display: none; }

.lg-list { margin: 0 0 14px; }
.lg-cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lg-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: clamp(12px, 2.5vw, 18px);
  color: var(--site-text);
  text-decoration: none;
}
.lg-card:hover { border-color: var(--site-accent); }
.lg-card b { display: block; font-size: clamp(15px, 2.2vw, 18px); line-height: 1.25; overflow-wrap: anywhere; }
.lg-card .sub, .lg-card small { display: block; color: var(--site-text-secondary); font-size: 12px; }
.lg-card .pos { color: var(--site-accent); font-size: clamp(14px, 2vw, 18px); font-weight: 800; text-align: right; white-space: nowrap; }
.lg-card small { font-weight: 400; }

.lg-back { display: inline-flex; align-items: center; min-height: 44px; margin: -8px 0 4px; font-size: 14px; font-weight: 700; text-decoration: none; }
.lg-meta, .lg-nudge, .lg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lg-meta { margin: 12px 0 14px; }
.lg-reset, .lg-note { color: var(--site-text-secondary); font-size: 13px; overflow-wrap: anywhere; }
.lg-note, .lg-nudge { margin: 12px 0 0; }
.lg-table { width: 100%; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.lg-table th, .lg-table td { padding: 10px clamp(4px, 1.4vw, 10px); border-bottom: 1px solid var(--site-surface-border); }
.lg-table th { color: var(--site-text-secondary); font-size: 11px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.lg-table th:first-child, .lg-table .num { width: 1%; white-space: nowrap; }
.lg-table .num { text-align: right; }
.lg-table .rank, .lg-table .total { font-weight: 800; }
.lg-table .rank, .lg-table .you { color: var(--site-accent); }
.lg-table .who { overflow-wrap: anywhere; }
.lg-table .you { margin-left: 4px; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.lg-table .pending { color: var(--site-text-muted); font-size: 12px; }
.lg-table .me td { background: rgba(245, 158, 11, .10); }
.lg-foot { justify-content: space-between; }
.lg-link { min-height: 44px; padding: 4px 0; border: 0; background: transparent; color: var(--site-accent); font: 700 14px var(--site-font); text-decoration: underline; cursor: pointer; }
.lg-danger { color: #ffb4a3; }

footer { margin-top: 24px; padding: 12px 0; border-top: 1px solid var(--site-surface-border); color: var(--site-text-muted); font-size: 12px; }
footer strong { color: var(--site-text); }
