:root {
  color-scheme: dark;
  --black: #111116;
  --surface: #19191f;
  --panel: #212128;
  --ink: #faf8f4;
  --muted: #c0bdc6;
  --line: #413d45;
  --gold: #edc57b;
  --red: #c7293e;
  --blue: #a8c7ff;
  font: 16px/1.45 system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--black); color: var(--ink); }
h1, h2, p { margin: 0; }
a { color: inherit; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .46; cursor: default; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(1160px, calc(100% - 56px)); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 4; padding: 12px; background: var(--surface); transform: translateY(-150%); }
.skip:focus { transform: none; }
.site-header { border-bottom: 3px solid var(--red); background: #0a0a0e; }
.header-inner { display: flex; flex-wrap: wrap; min-height: 74px; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: grid; justify-items: start; padding: 10px 0 9px; text-decoration: none; white-space: nowrap; }
.brand-line { display: flex; align-items: center; gap: 8px; }
.brand-wordmark { font-size: 1.35rem; font-style: italic; font-weight: 900; line-height: 1; letter-spacing: -.035em; text-transform: uppercase; }
.brand small { color: var(--muted); font-size: .64rem; font-weight: 750; letter-spacing: .1em; }
.brand-accent { color: var(--gold); }
.brand-mark { display: block; width: 64px; height: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 5px; }
.site-nav a { padding: 8px 12px; font-size: .95rem; font-weight: 700; text-decoration: none; white-space: nowrap; border-radius: 6px; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--gold); background: #252029; }
.site-nav .crew-chief-link { color: var(--gold); }
main { padding-block: 24px 40px; min-height: 80vh; }
.page-heading { position: relative; display: grid; isolation: isolate; align-content: end; min-height: 190px; padding: clamp(20px, 5vw, 44px); overflow: hidden; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 12px; margin-bottom: 17px; background: #17171c; }
.page-heading::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(95deg, #0a0a0df5 4%, #121216aa 60%, #0d0d118c), url('arena.webp') center 60% / cover; filter: grayscale(1); }
.page-heading h1 { max-width: 24ch; font-size: clamp(2.25rem, 6.2vw, 4.6rem); font-weight: 900; line-height: .98; letter-spacing: -.07em; text-wrap: balance; }
.page-heading p { margin-top: 10px; color: var(--gold); font-weight: 700; }
.schedule-bulletin {
  margin-bottom: 17px;
  border: 1px solid #c8b18d;
  border-left: 5px solid var(--red);
  border-radius: 7px;
  background: #f8efd9;
  color: #211b19;
}
.schedule-bulletin summary {
  padding: 11px clamp(13px, 3vw, 22px);
  cursor: pointer;
}
.schedule-bulletin summary::marker { color: #85263a; }
.schedule-bulletin summary:focus-visible { outline-color: #85263a; outline-offset: -4px; }
.bulletin-title {
  font: bold clamp(1.1rem, 2.4vw, 1.5rem)/1.35 'Courier New', Courier, monospace;
  text-transform: uppercase;
}
.bulletin-edition {
  display: inline-block;
  margin-left: .65em;
  font: bold .87rem/1.4 'Courier New', Courier, monospace;
  color: #752637;
}
.bulletin-body {
  margin-inline: clamp(13px, 3vw, 22px);
  padding-block: 7px 12px;
  border-top: 3px double #a48b72;
}
.bulletin-comparison { color: #634a40; font-size: .83rem; }
.bulletin-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 15px 25px; }
.bulletin-columns h3 {
  margin: 9px 0 5px;
  color: #752637;
  font: bold .9rem/1.4 'Courier New', Courier, monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.bulletin-columns ul { display: grid; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
#bulletin-added + ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bulletin-columns li { border-top: 1px solid #d3bfa0; padding-top: 5px; font-size: .88rem; }
.bulletin-columns li > strong { display: block; }
.bulletin-columns li p { color: #4e3d33; }
.bulletin-game-date { display: block; color: #634a40; font: .8rem/1.4 'Courier New', Courier, monospace; }
@media (max-width: 720px) {
  .bulletin-columns { grid-template-columns: minmax(0, 1fr); gap: 7px; }
}
@media (max-width: 480px) {
  .bulletin-edition { display: block; margin: 3px 0 0; }
  #bulletin-added + ul { grid-template-columns: minmax(0, 1fr); }
}
.filters-panel { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 14px; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.date-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.date-tabs button, .calendar-link { background: none; border: 1px solid transparent; border-radius: 7px; padding: 8px 10px; color: var(--muted); font-weight: 730; min-height: 42px; }
.date-tabs button:hover, .date-tabs button[aria-pressed='true'] { color: var(--gold); background: #2f2420; border-color: #765b38; }
.calendar-link { display: inline-flex; align-items: center; color: var(--gold); text-decoration: none; }
.calendar-link:hover { border-color: #765b38; background: #2f2420; }
.filter-fields { display: flex; gap: 10px; }
.filter-fields label { flex: 1 1 0; width: 165px; }
label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: .9rem; font-weight: 700; }
select, input { width: 100%; min-width: 0; height: 42px; border: 1px solid #615964; border-radius: 7px; background-color: #141419; color: var(--ink); padding: 7px 10px; }
select { appearance: none; padding-right: 29px; background-image: linear-gradient(45deg, transparent 49%, var(--gold) 51%), linear-gradient(135deg, var(--gold) 49%, transparent 51%); background-position: calc(100% - 15px) 53%, calc(100% - 10px) 53%; background-size: 5px 5px; background-repeat: no-repeat; }
.results { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-block: 17px 9px; color: var(--muted); font-size: .9rem; }
.results span:first-child { color: var(--gold); font-weight: 750; }
.game-list, .crew-list { display: grid; gap: 11px; padding: 0; margin: 0; list-style: none; }
.game-card, .crew-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.game-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.game-head > div { min-width: 0; overflow-wrap: anywhere; }
.game-head time { color: var(--gold); font-size: .9rem; font-weight: 800; margin-right: 8px; }
.game-details, .staff-note, .empty-staff { color: var(--muted); font-size: .9rem; }
.game-head h2, .crew-card h2 { margin-top: 4px; font-size: clamp(1.16rem, 3vw, 1.45rem); line-height: 1.18; letter-spacing: -.025em; }
.game-head h2 { display: flex; align-items: center; gap: 8px; }
.game-head h2 .team-logo { width: 34px; height: 34px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag { background: #22283a; color: var(--blue); border-radius: 4px; padding: 2px 7px; font-size: .85rem; font-weight: 680; }
.tag.status { background: #40212c; color: #ffc0c8; }
.staff-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.staff-list li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; padding: 4px 8px; border: 1px solid #3b3540; border-radius: 5px; background: var(--panel); font-size: .88rem; overflow-wrap: anywhere; }
.staff-list span { color: var(--muted); }
.staff-list .selected-member { border-color: #ad8850; background: #30251f; }
.staff-list .selected-member strong, .staff-list small, .pending-role { color: var(--gold); }
.empty-staff, .staff-note { margin-top: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 7px 12px; border: 1px solid #5e5460; border-radius: 7px; background: #1e1c24; color: var(--ink); font-size: .9rem; font-weight: 750; white-space: nowrap; }
.button:hover:enabled { background: #302833; border-color: var(--gold); }
.button.manage { color: var(--gold); border-color: #8e7149; }
.button.primary { background: var(--gold); color: #20160c; border-color: var(--gold); }
.button.primary:hover:enabled { background: #ffda9c; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 15px; }
.pagination span, .empty { color: var(--muted); }
.empty { padding: 16px 0; }
.crew-list { grid-template-columns: repeat(auto-fit, minmax(min(255px, 100%), 1fr)); }
.crew-card { display: grid; gap: 9px; justify-items: start; align-content: start; }
.crew-card p { color: var(--muted); font-size: .9rem; }
.crew-card button span { color: var(--gold); }
.crew-card-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.crew-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; margin-bottom: 14px; }
.crew-toolbar p { color: var(--muted); font-size: .9rem; }
.crew-contact-access { justify-content: space-between; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.crew-contact-access a { color: var(--gold); text-decoration: none; }
.crew-profile-details { width: 100%; display: grid; gap: 6px; margin: 2px 0; }
.crew-profile-details div { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.crew-profile-details dt { color: var(--muted); font-size: .85rem; font-weight: 700; }
.crew-profile-details dd { margin: 0; overflow-wrap: anywhere; }
.crew-profile-form { display: grid; gap: 10px; }
.crew-profile-form .dialog-footer { margin-top: 4px; }
.about-panel { padding: clamp(16px, 3vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.about-panel h2 { font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -.035em; }
.about-panel h3 { margin: 0 0 5px; font-size: 1.08rem; }
.about-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 13px; }
.about-guide > div { padding: 13px 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.about-intro, .about-guide p { color: var(--muted); max-width: 72ch; }
.about-intro { margin-top: 5px; }
.about-panel a { color: var(--gold); text-underline-offset: 3px; }
.site-footer { padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
dialog { width: min(690px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: clamp(13px, 3vw, 24px); background: var(--surface); color: var(--ink); border: 1px solid #756045; border-top: 4px solid var(--red); border-radius: 11px; }
dialog::backdrop { background: #08080cbb; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 14px; }
.dialog-head h2 { font-size: 1.75rem; letter-spacing: -.04em; line-height: 1.1; }
.dialog-head p { margin-top: 5px; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.game-edit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; margin-bottom: 16px; }
.game-edit-fields p { grid-column: 1 / -1; }
.game-edit-fields input { display: block; }
.assignment-heading { margin: 0 0 5px; font-size: 1rem; }
.assignment { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 5px 9px; align-items: end; padding: 11px 0; border-top: 1px solid var(--line); }
.assignment .new-name, .pending-role { grid-column: 2 / -1; }
.pending-role { font-size: .86rem; }
.assignment .remove { color: #ffc1cb; }
.dialog-footer { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; margin-top: 15px; }
.dialog-footer a { text-decoration: none; }
.load-error { padding: 9px 12px; margin-block: 8px; border-left: 3px solid var(--red); background: #311c26; color: #ffd6dc; }
.load-error .button { margin-left: 5px; }
.toast { position: fixed; inset: auto 14px 14px auto; z-index: 2; padding: 12px 15px; background: var(--gold); color: #20160c; border-radius: 7px; font-weight: 760; }
.calendar-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.calendar-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 15px; }
.calendar-toolbar h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); letter-spacing: -.035em; }
.calendar-count, .calendar-no-games { color: var(--muted); font-size: .9rem; }
.calendar-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.date-range-form {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) repeat(2, 165px) max-content;
  align-items: end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.date-range-title { align-self: center; color: var(--muted); font-size: .9rem; font-weight: 700; }
.date-range-form label { grid-template-columns: minmax(0, 1fr); }
.date-range-form input[type='date'] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
}
.date-range-form input[type='date']::-webkit-date-and-time-value { margin: 0; text-align: left; }
.date-range-actions { display: flex; gap: 8px; }
.date-range-actions button[type='submit'] { color: var(--gold); border-color: #765b38; }
.calendar-outside-range { background: var(--black); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); border-radius: 0 0 9px 9px; }
.calendar-weekday { padding: 8px; color: var(--muted); background: var(--panel); font-size: .85rem; font-weight: 750; text-align: center; }
.calendar-cell, .calendar-blank { min-width: 0; min-height: 92px; padding: 5px; background: var(--surface); }
.calendar-blank { background: var(--black); }
.calendar-today { background: #26212a; }
.calendar-grid > :nth-last-child(7) { border-bottom-left-radius: 9px; }
.calendar-grid > :last-child { border-bottom-right-radius: 9px; }
.calendar-day-button { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 4px 7px; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--ink); font-size: .9rem; font-weight: 750; }
.calendar-day-button[aria-current='date'] { background: #2f2420; border-color: #765b38; color: var(--gold); }
.calendar-day-button:hover { background: var(--panel); border-color: var(--muted); }
.calendar-day-marks { display: none; }
.calendar-events { display: grid; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; }
.calendar-event { display: flex; align-items: start; gap: 5px; width: 100%; padding: 5px 6px; border: 1px solid #514958; border-radius: 5px; background: var(--panel); color: var(--ink); text-align: left; }
.calendar-event:hover { border-color: var(--gold); }
.calendar-event-text { display: grid; min-width: 0; font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; }
.calendar-event-time, .calendar-event-note { color: var(--muted); font-size: .81rem; }
.calendar-event-note { margin-top: 2px; }
.team-logo { flex-shrink: 0; width: 22px; height: 22px; object-fit: contain; border-radius: 4px; background: #faf8f4; }
.calendar-event .team-logo { margin-top: 2px; }
.calendar-week .calendar-day-button { justify-content: start; width: 100%; text-align: left; }
.calendar-no-games { padding: 3px 5px; }
.calendar-agenda { margin: 0 15px 15px; }
@media (max-width: 850px) {
  .calendar-week { grid-template-columns: 1fr; }
  .calendar-week > :nth-last-child(7) { border-bottom-left-radius: 0; }
  .calendar-week > :last-child { border-bottom-left-radius: 9px; }
  .calendar-week .calendar-cell { min-height: auto; padding: 6px 10px; }
  .calendar-week .calendar-events { grid-template-columns: repeat(auto-fit, minmax(min(215px, 100%), 1fr)); margin-bottom: 4px; }
}
@media (max-width: 760px) {
  .date-range-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-range-title, .date-range-actions { grid-column: 1 / -1; }
  .date-range-form input[type='date'] { font-size: 1rem; }
  .date-range-actions { flex-wrap: wrap; }
  .date-range-actions .button { flex: 1 1 auto; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 24px); }
  .header-inner { min-height: 62px; }
  .brand-wordmark { font-size: 1.2rem; }
  .brand small { font-size: .59rem; }
  .brand-mark { width: 54px; }
  .site-nav a { padding-inline: 6px; font-size: .88rem; }
  main { padding-top: 13px; }
  .page-heading { min-height: 145px; }
  .filter-fields { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-fields label { width: auto; }
  .game-card { padding: 12px; }
  .assignment { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment .new-name, .pending-role { grid-column: 1 / -1; }
  .assignment .remove { grid-row: 3; grid-column: 2; justify-self: end; }
  .calendar-month .calendar-cell, .calendar-month .calendar-blank { min-height: 64px; padding: 2px; }
  .calendar-month .calendar-events { display: none; }
  .calendar-month .calendar-day-button { flex-direction: column; justify-content: start; gap: 4px; min-width: 0; min-height: 58px; width: 100%; padding: 4px 2px; }
  .calendar-day-marks { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; }
  .calendar-day-marks .team-logo { width: 14px; height: 14px; border-radius: 2px; }
  .calendar-event-dot { width: 6px; height: 6px; margin: 4px; border-radius: 50%; background: var(--muted); }
  .calendar-weekday { padding: 6px 0; }
}
@media (max-width: 510px) {
  .header-inner { gap: 4px; padding-block: 8px; }
  .site-nav { width: 100%; flex-wrap: wrap; }
}
@media (max-width: 345px) {
  .filter-fields, .date-range-form, .game-edit-fields { grid-template-columns: minmax(0, 1fr); }
}

.print-button { width: 44px; min-height: 44px; padding: 0; margin-inline-start: auto; text-decoration: none; }
#print-schedule, #print-toolbar { display: none; }

#print-schedule { font: 10pt/1.35 system-ui, sans-serif; }
body.print-preview, body.printing-schedule { color-scheme: light; color: #111; background: #fff; }

.print-heading { border-bottom: 2px solid; margin-bottom: 10pt; padding-bottom: 6pt; break-after: avoid; }
.print-brand { font-weight: bold; text-transform: uppercase; letter-spacing: .08em; }
.print-heading h1 { margin: 3pt 0; font-size: 19pt; }
.print-game h2 { font-size: 11pt; }
.print-game p { margin-block: 2pt; }
.print-game-date { font-weight: bold; text-transform: uppercase; }

.print-box-scores { font-family: 'Courier New', Courier, monospace; }
.print-box-scores .print-heading { border-bottom: 3px double; }
.print-box-scores h1, .print-assignments th { text-transform: uppercase; }
.print-scorecard { border-bottom: 1px solid; padding-bottom: 6pt; margin-bottom: 8pt; break-inside: avoid; }

.print-assignments { width: 100%; border-collapse: collapse; margin-block: 4pt; }
.print-assignments :is(th, td) { border-bottom: 1px dotted #777; padding: 1pt 5pt; text-align: left; }
.print-assignments caption { font-weight: bold; text-align: left; padding-block: 3pt; }
.print-assignments thead th { border-block: 1px solid; }
.print-assignments tbody th { width: 41%; font-weight: normal; }

.print-calendar-grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8.5pt; }
.print-calendar-grid :is(th, td) { border: 1px solid #777; padding: 4pt; vertical-align: top; }
.print-calendar-grid tr { break-inside: avoid; }
.print-calendar-grid time { display: block; font-weight: bold; }
.print-month td { height: .65in; }
.print-week td { height: 2in; }
.print-calendar-event { border-top: 1px solid #aaa; padding-top: 2pt; margin-top: 3pt; overflow-wrap: anywhere; }

.print-agenda-row {
  display: grid;
  grid-template-columns: minmax(76pt, 16%) 1fr;
  gap: 9pt;
  border-bottom: 1px solid #777;
  padding: 7pt 0;
  break-inside: avoid;
}
.print-agenda-time { font-weight: bold; overflow-wrap: anywhere; }

@media screen {
  body.print-preview { background: #edece8; }
  body.print-preview > :not(#print-toolbar, #print-schedule) { display: none; }
  body.print-preview > #print-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: min(68rem, calc(100% - 24px));
    margin: 14px auto;
  }
  body.print-preview > #print-schedule {
    display: block;
    width: min(68rem, calc(100% - 24px));
    margin: 0 auto 20px;
    padding: clamp(12px, 4vw, 36px);
    background: #fff;
    border: 1px solid #d7d6d2;
    overflow-x: auto;
  }
  .print-calendar-grid { min-width: 36rem; }
}

@media print {
  @page { margin: 0.5in; }
  @page crew-calendar { size: landscape; }

  body:is(.printing-schedule, .print-preview) > :not(#print-schedule) { display: none !important; }
  body:is(.printing-schedule, .print-preview) > #print-schedule { display: block; }
  .print-calendar { page: crew-calendar; }
}
