:root {
  --red: #ba0c2f;
  --red-dark: #7a0a20;
  --black: #0a0a0a;
  --ink: #14110f;
  --paper: #f6f1ea;
  --paper-2: #efe7dc;
  --muted: #6e675f;
  --line: #d9d0c4;
  --win: #1a7a3c;
  --loss: #9a1028;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
}

body {
  min-height: 100vh;
}

.mast {
  background: var(--black);
  color: var(--paper);
  border-bottom: 8px solid var(--red);
  padding: 1.75rem 1.25rem 1.5rem;
}

.mast-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.kicker {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e8b3be;
  margin: 0 0 0.45rem;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 0.95;
  margin: 0 0 0.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: #cfc6bb;
  font-size: 1.05rem;
}

.record-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.record {
  background: var(--red);
  color: white;
  padding: 0.7rem 1rem 0.65rem;
  min-width: 9.5rem;
}

.record.sec {
  background: #1a1513;
  box-shadow: inset 0 0 0 1px #3a3330;
}

.record dt {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 0.15rem;
  opacity: 0.85;
}

.record dd {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.next {
  background: var(--ink);
  color: var(--paper);
  padding: 1.1rem 1.2rem;
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-left: 8px solid var(--red);
}

.next .label {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e8b3be;
}

.next h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.next p {
  margin: 0.15rem 0 0;
  color: #d4ccc3;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}

.card {
  background: white;
  border: 1px solid var(--line);
  padding: 1rem 1rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 11.5rem;
}

.card.loss {
  background: #f8ecec;
  border-color: #e3c4c8;
}

.card.upcoming {
  background: var(--paper-2);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 0.18rem 0.4rem;
  color: white;
  background: #444;
}

.badge.w { background: var(--win); }
.badge.l { background: var(--loss); }
.badge.up { background: var(--ink); }

.opponent {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  line-height: 1.15;
}

.place {
  margin: 0;
  color: #4a453f;
  font-size: 0.98rem;
}

.score {
  margin-top: auto;
  padding-top: 0.55rem;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.score.pending {
  font-size: 1.05rem;
  font-weight: 400;
  color: #4a453f;
}

.meta {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: #4a453f;
  font-size: 0.92rem;
}

footer h2 {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

footer a {
  color: var(--red-dark);
}

footer ul {
  margin: 0.3rem 0 1rem;
  padding-left: 1.1rem;
}

footer li { margin: 0.2rem 0; }

.asof {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.error {
  background: #f8ecec;
  border: 1px solid var(--loss);
  padding: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .record { flex: 1 1 40%; }
  .card { min-height: 0; }
}

.hint {
  margin: 0 0 1rem;
  color: #4a453f;
  font-size: 0.98rem;
}

.card {
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(186, 12, 47, 0.2);
}

.card:focus {
  outline: none;
}

.card:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.card-hint {
  margin: 0.15rem 0 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-dark);
}

#game-detail {
  margin: auto;
  width: min(36rem, calc(100% - 2rem));
  max-height: min(90vh, 48rem);
  padding: 1.15rem 1.2rem 1.3rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

#game-detail::backdrop {
  background: rgba(10, 10, 10, 0.62);
}

.detail-close {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  float: right;
  margin: 0 0 0.6rem 0.8rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.detail-close:hover,
.detail-close:focus-visible {
  border-color: var(--red);
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.detail-body {
  clear: both;
}

.detail-body h2 {
  margin: 0 2.5rem 0.15rem 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.1;
}

.detail-result {
  margin: 0 0 1rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.detail-result.win { color: var(--win); }
.detail-result.loss { color: var(--loss); }
.detail-result.upcoming { color: var(--muted); }

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem 1rem;
  margin: 0 0 1.1rem;
}

.detail-facts div {
  margin: 0;
}

.detail-facts dt {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.15rem;
}

.detail-facts dd {
  margin: 0;
  font-size: 1.02rem;
}

.detail-block {
  margin: 0 0 1.1rem;
}

.detail-block h3 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 0.45rem;
}

.detail-block p {
  margin: 0;
  line-height: 1.45;
}

.line-score {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  background: white;
  border: 1px solid var(--line);
}

.line-score th,
.line-score td {
  padding: 0.4rem 0.45rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.line-score th[scope="row"] {
  text-align: left;
  padding-left: 0.6rem;
}

.line-score thead th {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: var(--paper-2);
}

.line-score tbody tr:last-child th,
.line-score tbody tr:last-child td {
  border-bottom: 0;
}

.line-score td:last-child,
.line-score th:last-child {
  font-weight: 700;
}

.detail-links {
  margin: 0;
  padding-left: 1.1rem;
}

.detail-links li {
  margin: 0.3rem 0;
}

.detail-links a {
  color: var(--red-dark);
}

.detail-blank {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
