@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* Everything inside the board is sized in cqw (a percent of the board's width),
   so a phone, a laptop and a 1080p stream all show the same picture. */
.player {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.board, .board * { box-sizing: border-box; }

/* Each town overrides these with its school district's colors (see themes.ts).
   These are the ETX Connect brand, for any town without its own. */
.board {
  --team: #0b3b24;
  --panel: #062a19;
  --accent: #f5a623;
  --bar: #f5a623;
  --bar-text: #2c1e12;
  --paper: #fffdf8;

  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  outline: none;
  color: #fff;
  background-color: var(--team);
  background-image: url('/brand/board-dawn.webp');
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply;
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 500;
  display: grid;
  grid-template-columns: 17fr 33fr 50fr;
  grid-template-rows: 9.6fr 39.6fr 19.4fr 20.4fr 8.3fr 2.7fr;
  gap: .55cqw;
  padding: .55cqw;
}
.board:focus-visible { box-shadow: inset 0 0 0 .25cqw var(--accent); }
.z { min-width: 0; min-height: 0; overflow: hidden; position: relative; border-radius: .7cqw; }

/* Top row */
.z-town {
  grid-area: 1 / 1 / 2 / 2; background: var(--team); color: #fff; padding: 0 .8cqw;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; text-align: center;
}
.town-title { font: 700 3.3cqw/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .01em; }
.town-title-long { font-size: 2.6cqw; }
.town-sub { font: 600 1.15cqw/1.1 'Barlow Condensed', sans-serif; margin-top: .3cqw; letter-spacing: .05em; text-transform: uppercase; opacity: .9; }

.z-sponsors { grid-area: 1 / 2 / 2 / 4; background: var(--bar); color: var(--bar-text); display: flex; align-items: center; }
.tick-label {
  flex: none; align-self: stretch; display: flex; align-items: center; padding: 0 1.2cqw;
  font: 700 1.45cqw/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .04em;
  background: var(--panel); color: var(--accent); white-space: nowrap;
}
.tick { flex: 1; min-width: 0; overflow: hidden; height: 100%; display: flex; align-items: center; }
.tick-track { display: flex; flex: none; width: max-content; animation: tick linear infinite; will-change: transform; }
.tick-group { display: flex; flex: none; }
.tick-item { font: 600 2.35cqw/1.1 'Barlow Condensed', sans-serif; white-space: nowrap; padding-right: 3.5cqw; }
.tick-item b { font-weight: 700; }
.tick-house { opacity: .85; }
@keyframes tick { to { transform: translateX(-50%); } }

/* Shared panel heading */
.z-title {
  flex: none; margin: 0; display: flex; align-items: center; justify-content: space-between;
  padding: .7cqw 1.7cqw .2cqw; color: var(--accent);
  font: 700 2.2cqw/1.1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .03em;
}
.pager { display: flex; gap: .45cqw; }
.pager i { width: .62cqw; height: .62cqw; border-radius: 50%; background: currentColor; opacity: .3; }
.pager i.on { opacity: 1; }
.z-body { flex: 1; min-height: 0; padding: 0 1.7cqw .3cqw; overflow: hidden; }
.page { animation: page .45s ease-out; }
@keyframes page { from { opacity: 0; transform: translateY(.4cqw); } to { opacity: 1; transform: none; } }

/* Neighbor messages */
.z-messages { grid-area: 2 / 1 / 3 / 3; background: var(--panel); }
.z-messages.on-air { background: var(--paper); color: var(--panel); }

.idle { height: 100%; display: flex; align-items: center; gap: 2cqw; padding: 1.4cqw 2.2cqw; }
.idle-copy { flex: 1; min-width: 0; }
.idle-title { margin: 0 0 1cqw; font: 700 4cqw/1 'Barlow Condensed', sans-serif; color: var(--accent); }
.idle-list { list-style: none; margin: 0 0 1.1cqw; padding: 0; font-size: 1.65cqw; line-height: 1.5; }
.idle-url { font: 600 1.6cqw/1.1 'Barlow Condensed', sans-serif; color: var(--accent); overflow-wrap: anywhere; }
.idle-qr { flex: none; width: 13.5cqw; height: 13.5cqw; border-radius: .6cqw; display: block; }

.msg { height: 100%; display: flex; flex-direction: column; padding: 1.4cqw 2.2cqw 1.3cqw; }
.msg-kicker { font: 700 1.5cqw/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--team); }
.msg-text { flex: 1; min-height: 0; display: flex; align-items: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; line-height: 1.04; overflow-wrap: anywhere; }
.msg-xl { font-size: 5.4cqw; }
.msg-lg { font-size: 4.2cqw; }
.msg-md { font-size: 3cqw; line-height: 1.1; }
.msg-signed { font-size: 1.8cqw; font-weight: 700; margin-bottom: .8cqw; }
.msg-bar { flex: none; height: .4cqw; background: rgba(0, 0, 0, .14); border-radius: 1cqw; overflow: hidden; }
.msg-fill { display: block; height: 100%; width: 0; background: var(--team); }

/* Town and school panels */
.z-school { grid-area: 3 / 1 / 5 / 3; background: var(--panel); display: flex; flex-direction: column; }
.z-events { grid-area: 2 / 3 / 4 / 4; background: var(--panel); display: flex; flex-direction: column; }

.row-head { font: 700 1.4cqw/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin: .8cqw 0 .3cqw; }
.row-note { font-size: 1.6cqw; opacity: .88; padding: .5cqw 0; }

.ev { display: flex; gap: 1.2cqw; padding: .5cqw 0; border-top: .08cqw solid rgba(255, 255, 255, .2); }
.ev-when { flex: none; width: 6.4cqw; }
.ev-date { font: 700 1.62cqw/1.12 'Barlow Condensed', sans-serif; color: var(--accent); }
.ev-time { font: 600 1.3cqw/1.2 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums; }
.ev-pill {
  display: inline-block; margin-top: .12cqw; padding: .1cqw .5cqw; border-radius: 1cqw; white-space: nowrap;
  background: var(--accent); color: var(--panel);
  font: 700 1cqw/1.25 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .04em;
}
.ev-main { min-width: 0; flex: 1; }
.ev-title {
  font-size: 1.62cqw; font-weight: 700; line-height: 1.17;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.ev-meta { font-size: 1.14cqw; opacity: .8; margin-top: .15cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.z-farm { grid-area: 4 / 3 / 5 / 4; background: var(--panel); display: flex; flex-direction: column; }
.z-farm .z-body { display: flex; align-items: center; }
.z-farm .page { width: 100%; }
.farm-row { padding: .22cqw 0; border-top: .08cqw solid rgba(255, 255, 255, .2); }
.farm-product { font: 700 1.75cqw/1.12 'Barlow Condensed', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.farm-meta { font-size: 1.14cqw; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-farm .row-note { font-size: 1.5cqw; line-height: 1.3; padding: 0; }

/* Bottom row: the clock, then weather that holds still so only the ticker moves. */
.z-weather { grid-area: 5 / 1 / 6 / 4; background: var(--panel); display: flex; align-items: stretch; }
.wx-clock { flex: none; min-width: 11cqw; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 1.1cqw; background: var(--paper); color: var(--panel); }
.clock-time { font: 700 2.5cqw/1 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-date { font: 600 1.1cqw/1.1 'Barlow Condensed', sans-serif; margin-top: .1cqw; white-space: nowrap; }
.wx-cells { flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.wx-cell { min-width: 0; padding: 0 1cqw; display: flex; flex-direction: column; justify-content: center; border-left: .08cqw solid rgba(255, 255, 255, .18); }
.wx-head { display: flex; align-items: baseline; gap: .6cqw; white-space: nowrap; }
.wx-label { font: 600 1.28cqw/1.1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .03em; opacity: .88; overflow: hidden; text-overflow: ellipsis; }
.wx-temp { font: 700 1.85cqw/1 'Barlow Condensed', sans-serif; color: var(--accent); }
.wx-text { font: 600 1.32cqw/1.15 'Barlow Condensed', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-alert { background: #a32a12; }
.wx-alert .wx-label { opacity: 1; }
.wx-logo { flex: none; height: 2.5cqw; align-self: center; margin: 0 1.2cqw 0 .8cqw; width: auto; display: block; }

/* Says on every board and stream that this is not an official channel. */
.z-notice { grid-area: 6 / 1 / 7 / 4; align-self: center; text-align: center; font-size: 1.02cqw; line-height: 1; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Video player controls */
.controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 26px 12px 8px; color: #fff; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: linear-gradient(to top, rgba(0, 0, 0, .86), rgba(0, 0, 0, 0));
}
.controls.show { opacity: 1; pointer-events: auto; }
.live { display: inline-flex; align-items: center; gap: 6px; font: 700 13px/1 'Barlow Condensed', sans-serif; letter-spacing: .08em; background: #b5301a; padding: 5px 8px; border-radius: 3px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
.live.stale { background: #666; }
.live.stale i { animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.controls-title { font: 600 16px/1 'Barlow Condensed', sans-serif; white-space: nowrap; }
.spacer { flex: 1; }
.ctl { appearance: none; border: 0; background: transparent; color: #fff; width: 40px; height: 40px; padding: 8px; cursor: pointer; border-radius: 6px; }
.ctl:hover { background: rgba(255, 255, 255, .18); }
.ctl:focus-visible { outline: 2px solid #fff; }
.ctl svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ctl .fs-off { display: none; }
.is-full .ctl .fs-on { display: none; }
.is-full .ctl .fs-off { display: block; }
.hide-cursor { cursor: none; }

/* Full screen: letterbox on anything that isn't 16:9. */
.player:fullscreen, .player.pseudo-fs, .player-live {
  display: flex; align-items: center; justify-content: center; border-radius: 0; background: #000;
}
.player:fullscreen .board, .player.pseudo-fs .board, .player-live .board {
  width: min(100vw, calc(100vh * 16 / 9)); width: min(100dvw, calc(100dvh * 16 / 9));
}
.player.pseudo-fs { position: fixed; inset: 0; z-index: 100; width: 100vw; height: 100vh; height: 100dvh; }
.no-scroll, .no-scroll body { overflow: hidden; }

.live-body { margin: 0; background: #000; overflow: hidden; cursor: none; }
.player-live { width: 100vw; height: 100vh; height: 100dvh; }

@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
  .live i { animation: none; }
  .tick { overflow-x: auto; }
  .tick-track { animation-play-state: paused; }
}
