html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
:root { --foot: 28px; }                 /* space reserved for the one-line footer */
html.kiosk { --foot: 0px; }
body { display: flex; flex-direction: column; align-items: center; justify-content: center; }
#tv {
  /* keep 4:3, as large as the viewport allows, leaving room for the footer */
  width: min(100vw, calc((100vh - var(--foot)) * 4 / 3));
  height: min(calc(100vh - var(--foot)), calc(100vw * 3 / 4));
  display: block; flex: none;
  image-rendering: auto;
}
#disclaimer {
  flex: none; box-sizing: border-box; width: 100%; max-width: 1240px;
  height: var(--foot); overflow: hidden; padding: 0 12px; display: flex; align-items: center; justify-content: center;
  font: 12px/1.4 Arial, Helvetica, sans-serif; letter-spacing: .02em; text-align: center;
  color: #777; cursor: auto;
}
#disclaimer p { margin: 0; }
#disclaimer a { color: #999; }
#musicbtn, #fsbtn, #retrobtn { font: inherit; letter-spacing: inherit; color: #999; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
#musicbtn[aria-pressed="true"], #retrobtn[aria-pressed="true"] { color: #bbb; }
.fs { display: none; } .fs.fs-ok { display: inline; }
html.kiosk #disclaimer { display: none; }
@media (max-aspect-ratio: 1/1) {       /* portrait / narrow: plenty of letterbox below the picture */
  :root { --foot: 0px; }
  #disclaimer { height: auto; overflow: visible; padding: 8px 14px; }
}
#ind {
  position: fixed; right: 12px; bottom: 10px; padding: 4px 8px;
  font: bold 14px monospace; color: #0f0; background: rgba(0,0,0,.6);
  opacity: 0; transition: opacity .4s; pointer-events: none;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only:focus-within { position: fixed; left: 8px; top: 8px; width: auto; height: auto; clip: auto; background: #000; color: #ccc; padding: 8px; z-index: 5; }
.sr-only a { color: #ccc; }

/* aspect=fill (default): the canvas takes all the space above the footer; main.js centres the 4:3 picture
   inside it and extends the bars edge to edge, so there is no letterboxing */
html.fill body { justify-content: flex-start; }
html.fill #tv { width: 100%; height: auto; flex: 1 1 0; min-height: 0; }
/* browser fullscreen: picture only */
:root:fullscreen { --foot: 0px; }
:root:fullscreen #disclaimer { display: none; }

/* mouse cursor hides over the picture only while the mouse is idle (main.js toggles html.idle) */
html.idle body, html.idle #tv { cursor: none; }
/* retro mode: strict 4:3 "old TV" picture in a black surround with rounded tube corners */
html.retro #tv {
  width: min(92vw, calc((100vh - var(--foot)) * 0.92 * 4 / 3));
  height: min(calc((100vh - var(--foot)) * 0.92), calc(92vw * 3 / 4));
  margin: auto 0; border-radius: 3.2% / 4.2%;
  box-shadow: 0 0 0 2px #0b0b0b, 0 0 28px 6px rgba(120, 160, 140, 0.06);
}
html.retro.kiosk #tv { margin: auto 0; }
