:root {
  --ink: #000000;
  --paper: #ffffff;
  --off: #eb933c;
  --game: #01a31a;
  --grey: #5e5e5e;
  --night: #1d1145;           /* base of the painted background */
  --lavender: #cfc4f2;        /* secondary text on purple */
  --line-on-paint: rgba(255, 255, 255, 0.28);
  --live: #ff3b30;

  --display: "Archivo", system-ui, sans-serif;
  --gutter: 16px;
  --max: 1120px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--paper);
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.5;
}

/* Painted backdrop, pinned so it doesn't scroll (fixed backgrounds are unreliable on phones) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--night) url("images/paint-bg.svg") center / cover no-repeat;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--off);
  outline-offset: 3px;
  border-radius: 4px;
}

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-block: 24px;
}

.wordmark {
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.375rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-on-paint);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 120ms, color 120ms, border-color 120ms;
}

.links a:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}

/* ── Status ─────────────────────────────────────────────── */

.now {
  padding-block: 8px 18px;
}

.status {
  margin: 0;
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.status-detail {
  margin: 6px 0 0;
  max-width: 60ch;
  color: var(--lavender);
  font-size: 1.0625rem;
}

.live-dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.3em;
  border-radius: 50%;
  background: var(--live);
  vertical-align: 0.12em;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

/* ── Schedule strip ─────────────────────────────────────── */

.panel {
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 14px 14px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 8px;
}

.panel-head h2 {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.0625rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.week-of {
  margin: 0;
  color: var(--grey);
  font-size: 0.875rem;
  font-weight: 600;
}

.tz-note { font-weight: 400; }

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto 96px;
  gap: 6px 8px;
}

/* Last week's schedule, still showing because the new one isn't posted yet */
.schedule.is-past .week {
  opacity: 0.5;
  filter: grayscale(0.6);
}

.day-label {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
}

.day-name {
  color: var(--grey);
  font-weight: 600;
  text-transform: uppercase;
}

.day-time {
  font-weight: 700;
  min-height: 1.3em;
}

.day-label.is-today .day-name {
  color: var(--ink);
  font-weight: 800;
  text-decoration: underline 2px var(--game);
  text-underline-offset: 3px;
}

.group {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Only shown in the stacked phone layout */
.group-label { display: none; }

.block {
  position: relative;
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
}

/* Game block: art fills the days, title bar along the bottom */
.block.game {
  background: #1b1b1b;
}

.block.game img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.game-title {
  position: absolute;
  inset: auto 0 0 0;
  margin: 0;
  padding: 6px 12px;
  background: var(--game);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

/* Day-off block: "Day off" in the corner, towel dog peeking in */
.block.off {
  background: var(--off);
  color: var(--paper);
}

.off-letters {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.0625rem;
  line-height: 1;
  text-transform: uppercase;
}

.block.off img {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 100%;
  width: auto;
  max-width: 55%;
  object-fit: cover;
  object-position: top left;
}

.block.off.wide .off-letters {
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 1.75rem;
}

.block.off.wide img {
  height: 100%;
  max-width: 50%;
}


/* ── Player ─────────────────────────────────────────────── */

.player-wrap { padding-top: 18px; }

/* ── Footer ─────────────────────────────────────────────── */

.site-footer {
  padding-block: 32px;
  color: var(--lavender);
  text-align: center;
}

.site-footer a { color: var(--paper); }

.player {
  aspect-ratio: 16 / 9;
  /* Full width, unless that would push the page past the window height.
     700px is everything else on the page, plus a little room; 360px is the smallest it gets. */
  width: min(100%, calc(max(360px, 100svh - 560px) * 16 / 9));
  margin-inline: auto;
  border: 1px solid var(--line-on-paint);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.player-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  color: var(--lavender);
  background: rgba(0, 0, 0, 0.55);
}

.player-fallback p { margin: 0; }

.player-fallback a {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Phones: one row per block ──────────────────────────── */

@media (max-width: 760px) {
  .panel { padding: 14px 12px 12px; border-radius: 18px; }
  .panel-head { padding-inline: 4px; }

  .week {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .day-label { display: none; }

  .group-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 4px 6px;
    font-size: 0.875rem;
  }

  .group-label .days {
    color: var(--grey);
    font-weight: 600;
    text-transform: uppercase;
  }

  .group-label .time { font-weight: 700; }

  .block.game {
    aspect-ratio: 2 / 1;
    flex: none;
  }

  .game-title { padding: 10px 14px; font-size: 0.875rem; }

  .block.off,
  .block.off.wide {
    flex: none;
    height: 72px;
  }

  .block.off .off-letters,
  .block.off.wide .off-letters {
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    flex-direction: row;
    gap: 0.3em;
    font-size: 1.5rem;
  }

  .block.off img,
  .block.off.wide img {
    height: 100%;
    width: 84px;
    max-width: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .links a { transition: none; }
}
