/* Public event page (/e/{slug}, D-30 to D-32, D-16, D-22). Player-facing scale
   (body.player-page, 17/1.55) already set by app.css; chip, rating and copy-field rules already
   set by components.css. Light only, no dark mode (CLAUDE.md). */

.event-page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* The page renders into #event-panel, the only child of main, so main's gap never reaches the
   cards; each card spaces itself instead, as the settings page does. */
.event-page .panel {
  margin-bottom: var(--space-lg);
}

.own-registration-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.own-registration-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.event-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-md);
  row-gap: var(--space-sm);
  margin: 0 0 var(--space-md);
}

.event-facts dt {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.event-facts dd {
  margin: 0;
}

.venue-fact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.venue-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  color: var(--accent);
  text-decoration: none;
}

.venue-link:hover {
  text-decoration: underline;
}

.waiver-body {
  white-space: pre-wrap;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  max-height: 320px;
  overflow-y: auto;
  margin: var(--space-sm) 0 0;
  padding: var(--space-md);
  background: var(--tint);
  border-radius: 8px;
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.event-details .copy-field-wrap {
  margin-top: var(--space-md);
}

.division-card h3 {
  margin-top: 0;
}

.division-field {
  margin-top: var(--space-lg);
}

.field-list,
.looking-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.field-row,
.looking-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--line);
}

.field-row:last-child,
.looking-list li:last-child {
  border-bottom: none;
}

.field-row-name {
  font-weight: 500;
}

.looking-list .error-message {
  flex-basis: 100%;
}

/* ---- game day: the player's next match card (04-09, D-42, D-43) ----
   The .own-registration-card shell with a state variant. Once the call is confirmed the card turns
   into a bold banner, the one thing on the page that asks for attention. Tint fill and ink border
   carry the state, the words say it too, never color alone. Light only. */

.next-match-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.next-match + .next-match,
.next-match + .next-match-last {
  border-top: 1px solid var(--line);
  padding-top: var(--space-md);
}

.next-match p {
  margin: 0 0 var(--space-xs);
}

.next-match-heading {
  margin: 0 0 var(--space-sm);
}

.next-match-kicker {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.next-match-where {
  color: var(--muted);
}

.next-match-teams {
  font-weight: 600;
}

.next-match-card.is-called {
  background: var(--tint);
  border: 2px solid var(--ink);
}

.next-match-card.is-called .next-match-heading {
  font-family: "Stick No Bills", system-ui, sans-serif;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--ink);
}

.next-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.next-match-actions[hidden] {
  display: none;
}

.next-match-actions .btnp,
.next-match-actions .btn {
  min-height: 44px;
  min-width: 44px;
}

.next-match-card .btn-danger {
  color: var(--error);
  border-color: var(--error);
}

.next-match-disputed,
.next-match-corrected {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.next-match-disputed {
  color: var(--error);
  font-weight: 600;
}

.next-match-corrected {
  font-size: 14px;
  color: var(--muted);
}

.next-match-disputed svg,
.next-match-corrected svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.score-readonly .score-readonly-value {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  min-width: 44px;
}

.next-match-card .score-panel {
  background: var(--paper);
}

/* ---- live pools, standings and bracket (04-15, D-44, pulled forward from PUB-04) ----
   Reuses .standings-table/.standings-ties/.standings-winner from score-entry.css and
   .bracket-view/.bracket-scroll from bracket.css (both already linked on this page); these rules
   cover only what's new here: the pool's played-match list and spacing. Light only, no dark mode. */

.live-division {
  margin-top: var(--space-lg);
}

.live-pools {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.live-pool h4 {
  margin: 0 0 var(--space-xs);
}

.live-pool .standings-table {
  margin-top: var(--space-sm);
}

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

.live-winner svg {
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
}

.live-match-list {
  list-style: none;
  margin: var(--space-sm) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.live-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.live-match:last-child {
  border-bottom: none;
}

.live-match-vs {
  color: var(--subtle);
}

.live-match-score {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-left: auto;
}

.live-match-forfeit {
  color: var(--error);
  margin-left: auto;
}

.live-match-corrected {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 14px;
  color: var(--muted);
  flex-basis: 100%;
}

.live-match-corrected svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* ---- phone-first division view (06-02, PUB-03, PUB-04) ----
   Division picker, section tabs, round picker, status line, the opt-in full bracket region and
   the row fade. Light only. Targets are 44px; tab lists wrap and never scroll sideways, so a page
   at 200% text still reflows. The one contained scroll area is the full bracket region. */

.live-view-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.live-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.live-tab {
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-sm) var(--space-md);
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--line);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
}

.live-tab:hover {
  background: var(--tint);
}

.live-tab.is-selected,
.live-tab[aria-selected="true"] {
  background: var(--tint);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.live-division-select {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.live-division-select select {
  width: 100%;
  min-height: 44px;
  font: inherit;
}

.live-status {
  margin: 0;
  font-size: 14px;
  color: var(--subtle);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-xs);
  font: inherit;
  color: var(--accent);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
}

.live-section-tabs,
.live-round-picker {
  margin-bottom: var(--space-md);
}

.live-device {
  font-weight: 600;
  margin-right: var(--space-xs);
}

/* A match row: two stacked team lines, scores in mono at the right, a status line under them. */
.live-division .live-match {
  display: block;
  font-size: 16px;
  padding: var(--space-sm) 0;
}

.live-match-team {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.live-match-team .live-match-score {
  margin-left: auto;
}

.live-match-team.live-winner {
  font-weight: 600;
}

.live-match-status {
  margin: var(--space-xs) 0 0;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
}

.live-you {
  flex: none;
}

.live-num {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.live-pool .standings-ties {
  margin-top: var(--space-sm);
  font-size: 14px;
}

.live-pool .standings-table td svg {
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
  margin-right: var(--space-xs);
}

/* Bracket: a round at a time on a phone; the full bracket by default from 768px. */
.live-bracket-full {
  display: none;
}

.live-bracket[data-full="true"] .live-bracket-full {
  display: block;
  margin-top: var(--space-sm);
}

.live-bracket[data-full="true"] .live-bracket-phone {
  display: none;
}

.live-bracket-full .bracket-scroll {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: var(--space-sm);
}

.live-bracket-full .bracket-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.live-bracket-full .bracket-page-title {
  display: none;
}

@media (min-width: 768px) {
  .live-bracket-phone,
  .live-full-toggle {
    display: none;
  }

  .live-bracket-full,
  .live-bracket[data-full="true"] .live-bracket-full {
    display: block;
  }
}

/* A row whose result just changed fades in from the tint once. Removed for reduced motion. */
@keyframes live-row-swap {
  from {
    background-color: var(--tint);
  }
  to {
    background-color: transparent;
  }
}

.live-row-swapped {
  animation: live-row-swap 300ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .live-row-swapped {
    animation: none;
  }
}
