@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --wine: #64151e;
  --ink: #2d2925;
  --paper: #f7f3ea;
  --line: #d9d1c2;
  --muted: #675e52;
  --display: 'Barlow Condensed', 'Franklin Gothic Medium', sans-serif;
  --body: 'Source Sans 3', 'Trebuchet MS', sans-serif;
  color-scheme: light;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(ellipse at 95% 1%, #e9d7b96b, transparent 40%), var(--paper); }
button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #2074a8; outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; background: white; padding: 12px; z-index: 5; }
.skip-link:focus { top: 12px; }
.section-nav { max-width: 1440px; margin: auto; padding: 16px 48px 0; font-size: 14px; color: var(--wine); display: flex; gap: 24px; align-items: center; }
.section-nav [aria-current="page"] { font-weight: 700; text-decoration-thickness: 2px; }
.section-nav a { display: inline-block; padding: 5px 0; text-underline-offset: 3px; }
.masthead { max-width: 1440px; margin: auto; padding: 24px 48px; display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); }
.brand { display: block; flex-shrink: 0; }
.brand img { display: block; object-fit: contain; background: white; border-radius: 50%; padding: 4px; }
.heading { flex: 1; }
h1 { font: normal clamp(28px, 3.3vw, 44px)/1.1 Georgia, serif; letter-spacing: -1.5px; margin: 0; color: var(--wine); }
.heading p { font-size: 14px; color: var(--muted); margin: 9px 0 0; }
.print-button { border: 1px solid var(--wine); padding: 10px 22px; color: var(--wine); background: transparent; font-weight: 600; border-radius: 4px; }
.print-button:hover { background: #64151e0a; }
main { max-width: 1440px; margin: auto; }
.schedule-section { padding: 26px 48px 8px; }
.data-status { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); margin: 10px 0 20px; }
.data-status span::before { content: ''; width: 7px; height: 7px; background: #8d8374; display: inline-block; border-radius: 50%; margin-right: 7px; }
.data-status.verified span::before { background: #337047; }
.data-status button, .text-button { border: 0; background: transparent; color: var(--wine); text-decoration: underline; text-underline-offset: 3px; padding: 8px; font-weight: 600; }
.filters { margin: 0 0 22px; display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.filters label { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 150px; font: 600 13px var(--display); letter-spacing: 1px; }
.filters .search-label { flex: 1.6; }
.filters select, .filters input { padding: 12px; background: #fffdf8; border: 1px solid #c6bdad; border-radius: 4px; width: 100%; min-height: 47px; font: 16px var(--body); color: var(--ink); letter-spacing: 0; }
.filters .text-button { margin-bottom: 5px; font-size: 14px; }
.day-picker { display: flex; gap: 5px; border-bottom: 1px solid var(--line); padding-bottom: 10px; flex-wrap: wrap; }
.day-picker button { background: transparent; border: 0; border-radius: 4px; padding: 10px 17px; font-weight: 600; color: var(--muted); }
.day-picker button[aria-pressed=true] { background: var(--wine); color: white; }
.field-section { margin: 0 0 24px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; animation: reveal .3s ease both; }
.field-heading { background: #e9e1d3; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.field-heading h2 { font: 600 28px/1 var(--display); margin: 0; color: var(--wine); }
.week-grid { display: grid; grid-template-columns: repeat(var(--days, 6), minmax(0, 1fr)); background: #fffcf5; }
.day-column { padding: 12px 10px; border-right: 1px solid var(--line); min-width: 0; }
.day-column:last-child { border-right: 0; }
.day-column h3 { font: 600 15px var(--display); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0 0 14px; }
.slot { border: 1px solid #d7c8af; border-left: 3px solid var(--accent, #a3773a); background: var(--tint, #faf0d9); padding: 10px; margin-bottom: 10px; border-radius: 3px; overflow-wrap: anywhere; }
.slot:last-child { margin-bottom: 0; }
.slot time { display: block; font-size: 12px; line-height: 1.4; font-weight: 700; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.team { margin: 8px 0 0; }
.team strong { display: block; font-size: 15px; line-height: 1.2; font-weight: 700; }
.team .division { font: 600 12px var(--display); letter-spacing: .6px; text-transform: uppercase; display: block; margin-bottom: 4px; }
.coach-name { font-size: 12px; display: block; margin-top: 4px; }
.slot-status { font-size: 11px; line-height: 1.4; margin: 9px 0 0; color: #625749; }
.slot.external { --accent: #8c8c87; background: repeating-linear-gradient(135deg, #ebebe7 0 5px, #e5e5e0 5px 6px); border-color: #cbcbc4; }
.slot.external strong { font-size: 15px; line-height: 1.2; display: block; }
.slot.match { outline: 2px solid var(--wine); outline-offset: 1px; box-shadow: 0 3px 8px #64151e12; }
.slot.context .team { color: #655e52; }
.slot.shared .team + .team { border-top: 1px solid #0002; padding-top: 8px; }
.empty-state, .loading, .error { padding: 24px; border: 1px dashed var(--line); background: #fffdf7; line-height: 1.5; }
.error { margin: 0 0 18px; border: 1px solid #a3452b; background: #fff1df; color: #7b2b17; }
footer { max-width: 1440px; margin: auto; padding: 18px 48px 26px; font-size: 12px; color: var(--muted); }
footer a { text-underline-offset: 3px; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1051px) {
  .week-grid[data-single=true] .day-column { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .week-grid[data-single=true] h3 { grid-column: 1 / -1; margin: 0; }
  .week-grid[data-single=true] .slot { margin: 0; }
}
@media (max-width: 1050px) {
  .section-nav { padding-left: 28px; padding-right: 28px; }
  .masthead { padding: 22px 28px; }
  .schedule-section { padding: 24px 24px 8px; }
  .week-grid { grid-template-columns: repeat(min(3, var(--days)), minmax(0, 1fr)); }
  .day-column:nth-child(3n) { border-right: 0; }
  .day-column:nth-child(n+4) { border-top: 1px solid var(--line); }
  footer { padding-left: 24px; }
}
@media (max-width: 600px) {
  .section-nav { padding: 12px 16px 0; }
  .masthead { padding: 18px 16px; gap: 12px; flex-wrap: wrap; }
  .brand img { width: 58px; height: 58px; }
  h1 { font-size: 28px; letter-spacing: -.8px; }
  .heading { min-width: 0; }
  .heading p { font-size: 12px; margin-top: 6px; }
  .print-button { font-size: 12px; padding: 7px 14px; margin-left: auto; }
  .schedule-section { padding: 22px 16px 4px; }
  .filters { gap: 12px; margin-bottom: 16px; }
  .filters label { min-width: 40%; font-size: 12px; }
  .filters .search-label { min-width: 70%; }
  .filters .text-button { padding: 7px 0; margin: 0; }
  .data-status { gap: 6px; font-size: 12px; margin-bottom: 16px; }
  .day-picker { gap: 3px; }
  .day-picker button { font-size: 13px; padding: 9px 11px; }
  .week-grid { grid-template-columns: 1fr; }
  .day-column { border: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .day-column:last-child { border-bottom: 0; }
  .day-column:nth-child(n+4) { border-top: 0; }
  .day-column h3 { font-size: 18px; margin-bottom: 12px; color: var(--wine); }
  .slot { display: grid; grid-template-columns: minmax(100px, 42%) minmax(0, 1fr); gap: 0 12px; padding: 12px; }
  .slot time { grid-column: 1; grid-row: 1 / 5; margin: 0; font-size: 13px; }
  .slot .team, .slot > strong { grid-column: 2; margin: 0; }
  .slot .slot-status { grid-column: 2; margin: 7px 0 0; }
  .slot.shared .team + .team { margin-top: 8px; }
  .slot .team strong { font-size: 16px; }
  .field-heading { padding: 14px; }
  footer { padding: 12px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .field-section { animation: none; }
}
@page { size: landscape; margin: 10mm; }
@media print {
  body { background: white; color: #222; font-size: 10pt; }
  .filters, .day-picker, footer, #refresh, #print, .skip-link, .section-nav { display: none; }
  .masthead { padding: 0 0 12px; gap: 12px; }
  .brand img { width: 48px; height: 48px; }
  h1 { font-size: 24px; }
  .heading p { font-size: 10px; }
  .schedule-section { padding: 0; }
  .data-status { margin: 6px 0 12px; font-size: 10px; }
  .field-section { break-inside: avoid; break-after: page; margin: 0; border-radius: 0; animation: none; }
  .field-section:last-child { break-after: auto; }
  .field-heading { padding: 9px; }
  .field-heading h2 { font-size: 24px; }
  .week-grid { grid-template-columns: repeat(var(--days, 6), minmax(0, 1fr)) !important; }
  .day-column { padding: 6px !important; border: 0; border-right: 1px solid #ccc !important; display: block !important; }
  .day-column h3 { font-size: 12px; margin: 0 0 8px; }
  .slot { display: block !important; padding: 6px !important; margin: 0 0 6px !important; border: 1px solid #ccc; box-shadow: none !important; outline: none !important; break-inside: avoid; }
  .slot time { font-size: 10px !important; margin: 0 0 5px !important; }
  .team { margin: 3px 0 !important; }
  .team strong, .slot.external strong { font-size: 11px !important; }
  .team .division, .slot-status, .coach-name { font-size: 9px !important; }
  .slot-status { margin-top: 4px !important; }
  .error { padding: 12px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
