/*
 * Layout is drawn on a fixed 1920×1080 "stage" (the same proportions the
 * Tkinter version computed for a 1080p TV) and scaled to fit any screen.
 */
:root {
  --red: #ff0000;
  --orange: #ffa500;
  --green: #008000;
  --gray: #808080;
  --ink: #000;
  --heavy: "Arial Black", "Arial Bold", Arial, Helvetica, sans-serif;
  --plain: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
  cursor: none; /* hide the mouse on the TV */
}

.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: center;
  color: var(--ink);
  font-family: var(--plain);
  background: #fff url("assets/background.jpg") center / 100% 100% no-repeat;
}
/* 90% white wash over the photo, like Image.blend(white, bg, 0.1) */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
}
.stage > * { position: absolute; }

/* ── Left panel (633px wide) ─────────────────────────────── */
.left { left: 0; top: 0; width: 633px; height: 1080px; }

.logo {
  position: absolute;
  left: 25px;
  top: 23px;
  width: 455px;
  height: auto;
}

.title {
  position: absolute;
  left: 0;
  width: 633px;
  top: 262px;
  text-align: center;
  font-family: var(--heavy);
  font-weight: 900;
  font-size: 128px;
  line-height: 1.05;
  letter-spacing: 1px;
}

.legend {
  position: absolute;
  left: 31px;
  top: 560px;
  list-style: none;
}
.legend li {
  display: flex;
  align-items: center;
  height: 48px;
  margin-bottom: 20px;
  font-family: var(--plain);
  font-weight: 700;
  font-size: 40px;
}
.swatch {
  width: 48px;
  height: 48px;
  margin-right: 14px;
  border: 2px solid #000;
}
.swatch.red { background: var(--red); }
.swatch.orange { background: var(--orange); }
.swatch.green { background: var(--green); }

.washroom-left {
  position: absolute;
  left: 348px;
  top: 790px;
  text-align: center;
}
.washroom-left img { width: 95px; height: 95px; display: block; margin: 0 auto 6px; }
.washroom-left figcaption,
.court-label,
.facility span {
  font-family: var(--heavy);
  font-weight: 900;
  font-size: 36px;
}

/* ── Courts (right of the panel) ─────────────────────────── */
.courts {
  left: 656px;
  top: 23px;
  width: 1241px;
  height: 1034px;
  display: grid;
  grid-template-columns: 609px 609px;
  grid-template-rows: 588px 446px; /* court + 69px label band */
  column-gap: 23px;
}

.court { display: flex; flex-direction: column; }
.court-img { position: relative; flex: 1; display: flex; flex-direction: column; }
.court-label {
  height: 69px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.half {
  position: relative;
  flex: 1;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-color: var(--gray);
}
.top-half { background-image: url("assets/halfcourt_top.png"); }
.bottom-half { background-image: url("assets/halfcourt_bottom.png"); }

/* Colour wash over the court drawing (alpha 200/255, like the Tk version) */
.half::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.784;
  background: var(--gray);
  transition: background-color 0.6s ease;
}
.half.red::after { background: var(--red); }
.half.orange::after { background: var(--orange); }
.half.green::after { background: var(--green); }
.half.gray::after { background: var(--gray); }
.half.red, .half.orange, .half.green, .half.gray { background-color: transparent; }

/* ── Facilities panel (bottom-right cell) ────────────────── */
.facilities {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 83px;
  padding: 23px 0 0 37px;
}
.facility { display: flex; align-items: center; gap: 37px; }
.facility img { width: 105px; height: 105px; }

/* ── Status corner ───────────────────────────────────────── */
.status-corner {
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.updated { font-size: 22px; font-weight: 700; color: #333; }
.wifi { width: 64px; height: 64px; }

.stale {
  left: 656px;
  right: 23px;
  top: 0;
  padding: 8px 16px;
  background: #b00020;
  color: #fff;
  font-weight: 700;
  font-size: 26px;
  text-align: center;
  z-index: 2;
}

.loading {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2c3e50;
  color: #fff;
  font-weight: 700;
  font-size: 54px;
  z-index: 3;
}
.loading[hidden], .stale[hidden] { display: none; }
