:root {
  color-scheme: light;
  --brand-navy: #1c2335;
  --brand-cream: #feebbf;
  --brand-magenta: #c63176;
  --background: #fff8e8;
  --text: var(--brand-navy);
  --muted: #50566a;
  --accent: var(--brand-magenta);
  --accent-hover: #a32360;
  --border: #7f7b7c;
  --control-border: #65616b;
  --info-bg: var(--brand-cream);
  --success-bg: #def2da;
  --success-text: #194b24;
  --error-bg: #fde6e9;
  --error-text: #9b1627;
  --radius: 5px;
  font-family: system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.container {
  width: min(100% - 40px, 1160px);
  margin-inline: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

/* Running-text links (T46). min-height is the 24px floor, independent of
   which fonts are installed. line-height is unitless so the hit box grows
   with the font: a fixed 24px line-height capped the box at 24px while
   body type at the 760px breakpoint is 26px. :where() keeps this weaker
   than nav, .button, .brand, and .skip-link, which size themselves.
   .link-row is the 44px standalone row. */
:where(main, .site-footer) a:where(:not(.button, .brand, .skip-link, .link-row)) {
  display: inline-block;
  max-width: 100%;
  min-width: 24px;
  min-height: 24px;
  line-height: 1.2;
}

/* Standalone link rows (T46). An explicit class, not `p > a:only-child`:
   :only-child ignores text, so that selector also matched links in the
   middle of a sentence and turned them into 44px boxes. */
.link-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  line-height: 1.2;
  padding-inline: 4px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible,
[tabindex='-1']:focus {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 20px;
  z-index: 1;
  padding: 12px;
  background: var(--background);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 12px;
  border-bottom: 3px solid var(--brand-magenta);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--accent);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1.2px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
}

nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
}

nav a,
.jump-link a,
.error-summary a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

nav a[aria-current='page'] {
  font-weight: 700;
  text-decoration-thickness: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
}

h1 {
  font-size: clamp(40px, 5.6vw, 68px);
  font-weight: 800;
}

h2 {
  margin-bottom: 12px;
  font-size: 30px;
}

h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.page-intro {
  padding-block: 40px 32px;
  text-align: center;
}

.page-intro p {
  margin-top: 14px;
  font-size: 20px;
}

.notice {
  margin-block: 16px;
  padding: 16px 20px;
  border-radius: 2px;
  overflow-wrap: anywhere;
}

.notice--info {
  color: var(--text);
  background: var(--info-bg);
}

.notice--success {
  color: var(--success-text);
  background: var(--success-bg);
}

.notice--error {
  color: var(--error-text);
  background: var(--error-bg);
}

.demo-columns {
  display: grid;
  gap: 40px;
  margin-block: 36px 64px;
}

.demo-columns > * {
  min-width: 0;
}

.field {
  margin-block: 28px;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--background);
  font: inherit;
  font-size: 18px;
}

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

input[aria-invalid='true'],
select[aria-invalid='true'] {
  border: 2px solid var(--error-text);
}

.field-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 16px;
}

.field-error {
  margin-top: 8px;
  color: var(--error-text);
  font-weight: 700;
}

/* Player pickers (trades): one row per player, a 44px checkbox so the
   row is a touch target and the label text toggles it. */
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.check-list li {
  margin-top: 8px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 0;
  font-weight: 400;
}

.check-list input[type='checkbox'] {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  flex: none;
  accent-color: var(--accent);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 10px 24px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  color: var(--background);
  background: var(--accent);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.button:hover {
  color: var(--background);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button--secondary {
  color: var(--accent);
  background: var(--background);
}

.button--secondary:hover {
  color: var(--accent);
  background: var(--info-bg);
  border-color: var(--accent);
}

.messages,
.preview {
  margin-top: 40px;
}

.jump-link {
  margin-block: 20px 12px;
}

.empty-state {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.muted {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
}

.error-summary {
  margin-top: 24px;
  padding: 20px;
  border: 2px solid var(--error-text);
  color: var(--error-text);
}

.error-summary h2 {
  font-size: 22px;
}

.error-summary ul {
  margin: 0;
  padding-left: 24px;
}

.error-summary a {
  color: var(--error-text);
}

.page-intro:has(.signup) {
  padding-block: 12px 8px;
}

.signup {
  position: relative;
  max-width: 40rem;
  margin: 16px auto 0;
  text-align: left;
}

.signup h2 {
  margin-bottom: 4px;
  text-align: center;
}

.signup > p {
  margin-top: 8px;
}

.signup .field {
  margin-block: 12px 8px;
}

.landing-section {
  margin-bottom: 48px;
}

.point-list,
.step-list {
  margin: 16px 0 0;
}

.point-list {
  display: grid;
  gap: 16px;
  padding: 0;
  list-style: none;
}

.point-list li,
.step-list li {
  overflow-wrap: anywhere;
}

.point-list li {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-list {
  padding-left: 1.4em;
}

.step-list li + li {
  margin-top: 12px;
}

.faq-list {
  display: grid;
  gap: 28px;
  margin: 8px 0 48px;
}

.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
  border-top: 1px solid var(--border);
  font-size: 16px;
}

.site-footer p {
  flex-basis: 100%;
  margin: 0;
  overflow-wrap: anywhere;
}

.site-footer .brand {
  font-size: 24px;
}

@media (min-width: 760px) {
  :root {
    font-size: 26px;
  }

  .site-header {
    padding-block: 14px;
  }

  .site-header .brand {
    font-size: 48px;
    line-height: 1.25;
  }

  nav {
    column-gap: 32px;
  }

  .brand-logo {
    width: 96px;
    height: 96px;
  }

  .page-intro {
    padding-block: 56px 14px;
  }

  h1 {
    font-size: 72px;
  }

  .page-intro p {
    font-size: 34px;
  }

  h2 {
    font-size: 46px;
  }

  .demo-columns {
    grid-template-columns: 1.17fr 1fr;
    column-gap: 80px;
    margin-top: 44px;
  }

  input,
  select,
  .button {
    font-size: 26px;
  }

  .button {
    padding-inline: 40px;
  }

  .actions {
    gap: 28px;
  }

  .messages h2 {
    margin-bottom: 24px;
  }

  .messages .notice + .notice {
    margin-top: 22px;
  }

  .jump-link {
    margin-bottom: 28px;
  }

  .empty-state {
    margin-top: 53px;
    padding-top: 36px;
  }

  .empty-state h2 {
    margin-bottom: 20px;
  }

  .point-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .notice {
    padding: 14px 28px;
  }

  .field-hint,
  .muted {
    font-size: 22px;
  }

  .site-footer {
    font-size: 24px;
  }

  .site-footer .brand {
    font-size: 32px;
  }
}

/* Account pages (T08): left-aligned, one readable column. */
.account-page {
  max-width: 36rem;
  padding-block: 32px 24px;
}

.account-page .actions {
  margin-top: 20px;
}

.account-page + .account-page {
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.account-page h1 {
  font-size: clamp(34px, 5vw, 48px);
}

.account-page p {
  margin-top: 12px;
}

.code-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 8px 24px;
  margin-block: 24px;
  padding-left: 2rem;
}

.code-list code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 18px;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

/* Admin status page (T30). States reuse the semantic notice colors. */
.status-page {
  padding-block: 32px;
}

.status-signal {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.status-signal h2 {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid currentcolor;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
}

.status-badge--ok {
  color: var(--success-text);
  background: var(--success-bg);
}

.status-badge--idle {
  color: var(--muted);
  background: transparent;
}

.status-badge--warn {
  color: var(--text);
  background: var(--info-bg);
}

.status-badge--alert {
  color: var(--error-text);
  background: var(--error-bg);
}

.status-details dl {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-left: 3px solid var(--border);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.status-details dl > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-details dt {
  font-weight: 700;
}

.status-details dd {
  margin: 0;
}

.lineup-slot {
  margin-block: 12px;
}

.lineup-games {
  margin: 4px 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

/* Matchups and standings (T16): cards and lists, no tables, so the pages
   fit a phone without horizontal scrolling. */
.period-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 16px;
  margin-block: 20px 24px;
}

.period-picker label {
  margin-bottom: 0;
}

.period-picker select {
  flex: 1 1 16rem;
}

.matchup-list {
  display: grid;
  gap: 16px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.matchup-card {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.matchup-team {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-block: 6px;
}

.matchup-winner {
  font-weight: 700;
}

.matchup-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.matchup-points {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.matchup-state {
  margin-top: 8px;
}

.standings-list {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.standings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.standings-playoff {
  border-left: 4px solid var(--accent);
}

.standings-seed {
  min-width: 2ch;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.standings-team {
  flex: 1 1 10rem;
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.standings-record {
  font-variant-numeric: tabular-nums;
}

.standings-points {
  color: var(--muted);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

/* Draft room (T14): single column on phones, board + pool side by side
   on wider screens. Nothing here may overflow at 390 px. */
.draft-order {
  padding-left: 1.5rem;
}

.pick-list {
  padding-left: 1.5rem;
}

.pick-list li {
  overflow-wrap: anywhere;
}

.roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.roster-list h4 {
  margin: 0 0 0.25rem;
}

.roster-list ul {
  margin: 0;
  padding-left: 1.25rem;
}

.pool-filters {
  display: grid;
  gap: 0.75rem;
}

.position-filter {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.position-filter legend {
  padding: 0 0.25rem;
  font-size: 16px;
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.player-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

#draft-room [hidden] {
  display: none;
}

.player-row .actions {
  justify-content: flex-end;
  gap: 0.5rem;
}

.player-row .button {
  padding-inline: 0.75rem;
}

#clock {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 760px) {
  .roster-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Score breakdown, freshness stamp, player pages (T20). */

.freshness {
  margin-top: 4px;
}

.breakdown-side {
  margin-top: 24px;
}

.breakdown-players {
  display: grid;
  gap: 16px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.breakdown-player {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.breakdown-player-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.breakdown-games {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.breakdown-game {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  font-size: 15px;
}

.breakdown-categories {
  min-width: 0;
  overflow-wrap: anywhere;
}

.breakdown-total {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.matchup-adjustments {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 15px;
}

.player-search {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  margin-top: 12px;
}

.player-search label {
  flex-basis: 100%;
}

.player-search input {
  flex: 1 1 220px;
  min-width: 0;
}

.player-results,
.player-games {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

/* Playoff bracket (T39): rounds stack on a phone and sit side by side on
   a wide screen. The bracket never scrolls horizontally on a phone. */
.bracket {
  display: grid;
  gap: 32px;
  margin-top: 20px;
}

.bracket-round {
  min-width: 0;
}

.bracket-champion {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--success-bg);
  color: var(--success-text);
}

.bracket-champion h2 {
  margin-top: 0;
}

.bracket-champion p {
  margin-bottom: 0;
}

.bracket-bye {
  border-style: dashed;
}

@media (min-width: 900px) {
  .bracket {
    gap: 24px;
  }

  .bracket--rounds-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .bracket--rounds-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Corrections (T19): admin form pickers, stat grid, matchup adjustments. */
.picker-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.picker-results:empty {
  display: none;
}

.picker-results button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--background);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.picker-results li:last-child button {
  border-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-grid .field {
  margin-block: 0;
}

@media (max-width: 560px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.matchup-adjustments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.matchup-adjustments h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.matchup-adjustments ul {
  margin: 0;
  padding-left: 20px;
}

.override-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.override-form summary {
  min-height: 44px;
  cursor: pointer;
}
