/* Project-specific styling for Badmubble. Shared styling belongs in blood-bowl-nl-assets. */

/* Palette sampled from images/badmubble-logo-512.jpg */
:root {
  --color-background: #0a0a0a;
  --color-surface: #161616;
  --color-surface-raised: #1f1f1f;
  --color-border: #333333;
  --color-text: #f2f2f2;
  --color-text-muted: #a8a8a8;
  --color-gold: #f0c018;
  --color-gold-deep: #d8a800;
  --color-red: #c01818;
  --color-red-light: #ff6b6b;
  --color-blue: #0050b0;

  --font-display: "Graduate", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-background);
}

a {
  color: var(--color-gold);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
  border-bottom: 2px solid var(--color-gold);
}

.site-logo {
  width: 6rem;
  height: auto;
}

.site-title {
  flex: 1;
  min-width: 12rem;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  margin: 0;
  color: var(--color-gold);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
}

.language-switch {
  display: flex;
  gap: 0.25rem;
}

.language-switch button,
.button {
  font: inherit;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: var(--color-background);
  background: var(--color-gold);
  border-color: var(--color-gold);
}

.language-switch button:focus-visible,
.button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Main */

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
}

h2 {
  color: var(--color-gold);
  font-size: 1.6rem;
  margin: 0.5rem 0 1rem;
}

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

.notice--error {
  color: var(--color-red-light);
}

/* Schedule */

.round {
  margin-bottom: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.round-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  padding: 0.6rem 1rem;
  font-size: 1.1rem;
  color: var(--color-background);
  background: var(--color-gold);
}

.round-month {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
}

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

.match {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
}

.match:first-child {
  border-top: none;
}

.match--invalid {
  border-left: 4px solid var(--color-red);
}

.match-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.participant {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.participant--home {
  text-align: right;
}

.coach {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.coach--unknown {
  font-weight: 400;
  font-style: italic;
  color: var(--color-text-muted);
}

.race,
.slot {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.outcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 6.5rem;
  text-align: center;
}

.score {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-gold);
}

.casualties {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.outcome--pending {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.outcome--invalid {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-red-light);
}

.match-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Standings */

.table-scroll {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
}

.table-scroll:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.standings {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.standings th,
.standings td {
  padding: 0.5rem 0.6rem;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.standings thead th {
  font-size: 0.85rem;
  color: var(--color-background);
  background: var(--color-gold);
  border-top: none;
}

.standings abbr {
  text-decoration: none;
  cursor: help;
}

.standings .col-coach {
  text-align: left;
  font-weight: 600;
  width: 100%;
}

.standings tbody .col-position,
.standings tbody .col-pair {
  color: var(--color-text-muted);
}

.standings tbody .col-points {
  font-weight: 700;
  color: var(--color-gold);
}

.standings-progress {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.standings-note {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

main > section + section {
  margin-top: 2rem;
}

/* Data issues */

.issues {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-red);
  border-radius: 0.5rem;
  background: var(--color-surface);
}

.issues summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-red-light);
}

.issues ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

/* Footer */

.site-footer {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 30rem) {
  /* Keep points and net visible without scrolling; the for/against detail is
     summarised by the net column. */
  .standings .col-pair {
    display: none;
  }

  .standings th,
  .standings td {
    padding: 0.5rem 0.4rem;
  }

  .match-line {
    gap: 0.5rem;
  }

  .outcome {
    min-width: 5rem;
  }
}
