/* The web player. Sizes inside the canvas are layout pixels; the whole canvas is scaled to the display. */
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: 'Roboto', Arial, sans-serif;
  cursor: none;
  user-select: none;
}

#player {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Pairing */
.pairing {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #10162f;
}

.pairing-title { font-size: 3.5vmin; opacity: 0.85; }
.pairing-code { font-size: 16vmin; font-weight: 700; letter-spacing: 0.15em; margin: 2vmin 0; font-family: 'Roboto Mono', monospace; }
.pairing-help { font-size: 2.6vmin; opacity: 0.75; max-width: 80vw; }
.pairing-qr { margin-top: 4vmin; background: #fff; padding: 1.5vmin; border-radius: 1vmin; }
.pairing-qr svg { display: block; width: 24vmin; height: 24vmin; }

/* Stage */
.canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  overflow: hidden;
}

.canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #10162f;
  font-size: 4vmin;
}

.empty-note { font-size: 2.5vmin; opacity: 0.7; margin-top: 1vmin; }

.zone {
  position: absolute;
  overflow: hidden;
}

.item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
  box-sizing: border-box;
  overflow: hidden;
}

.item.item-in { opacity: 1; }
.item.item-out { opacity: 0; }

.media { display: block; object-fit: contain; background: transparent; }

/* Widgets */
.w-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.w-clock-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.w-clock-date { font-size: 0.35em; margin-top: 0.3em; }

.w-header {
  display: flex;
  align-items: center;
  padding: 0 0.4em;
  gap: 0.6em;
}

.w-header-text { flex: 1; min-width: 0; }
.w-header-clock { font-weight: 700; font-variant-numeric: tabular-nums; }

.w-infobox { padding: 0.5em 0.7em; }
.w-infobox-text { position: relative; }

.w-rich p, .w-rich h1, .w-rich h2, .w-rich h3, .w-rich ul, .w-rich ol, .w-rich blockquote { margin: 0 0 0.4em; }
.w-rich h1 { font-size: 2em; }
.w-rich h2 { font-size: 1.5em; }
.w-rich h3 { font-size: 1.17em; }

.w-ticker {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.w-ticker-line { position: absolute; will-change: transform; }

.w-ticker-roll {
  width: 100%;
  padding: 0 0.4em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w-ticker-in { animation: noir-roll-in 0.6s ease-out; }

.w-slideshow .w-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.w-transition-none .w-slide-in { opacity: 1; }
.w-transition-none .w-slide-out { opacity: 0; }
.w-transition-fade .w-slide { transition: opacity 1s ease; }
.w-transition-fade .w-slide-in { opacity: 1; }
.w-transition-fade .w-slide-out { opacity: 0; }
.w-transition-slide .w-slide { opacity: 1; transform: translateX(100%); transition: transform 1s ease; }
.w-transition-slide .w-slide-in { transform: translateX(0); }
.w-transition-slide .w-slide-out { transform: translateX(-100%); }

.w-webimage .media {
  width: 100%;
  height: 100%;
}

.w-webpage iframe {
  border: 0;
  transform-origin: 0 0;
  background: #fff;
}

@keyframes noir-run-left {
  from { transform: translateX(var(--from)); }
  to { transform: translateX(var(--to)); }
}

@keyframes noir-scroll-up {
  from { transform: translateY(var(--from)); }
  to { transform: translateY(var(--to)); }
}

@keyframes noir-roll-in {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Identify: the screen's name above everything, blinking border so it is seen from across a room. */
.identify {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 3vmin solid #ffcc00;
  background: rgba(16, 22, 47, 0.85);
  animation: identify-blink 1s step-end infinite;
}

.identify-name {
  max-width: 90vmin;
  font-size: 12vmin;
  font-weight: 700;
  text-align: center;
  overflow-wrap: break-word;
}

@keyframes identify-blink {
  50% { border-color: transparent; }
}

/* The personal screen URL after pairing (ADR-0023): along the bottom, over the content, for a minute. */
.screen-url {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  padding: 2vmin 4vmin;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  text-align: center;
}

.screen-url-title {
  font-size: 2.4vmin;
  opacity: 0.8;
}

.screen-url-address {
  font-family: monospace;
  font-size: 5vmin;
  font-weight: 700;
  letter-spacing: 0.05em;
  overflow-wrap: break-word;
}

.screen-url-help {
  font-size: 2.4vmin;
  opacity: 0.8;
}

/* Power schedule off (ADR-0026): shells turn the display off as well; a browser can only show black. */
.power-off {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: #000;
  cursor: none;
}

/* Override message (ADR-0027): full screen, text only. */
.message {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 6vmin;
  background: #10162f;
  color: #fff;
  text-align: center;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.message-alert {
  background: #b71c1c;
}

.message-title {
  font-weight: 700;
  line-height: 1.15;
}

.message-text {
  margin-top: 0.6em;
  white-space: pre-line;
  line-height: 1.3;
  max-width: 90%;
}

/* QR code (ADR-0037): the code fills what the caption leaves. */
.w-qr { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4%; box-sizing: border-box; }
.w-qr-code { flex: 1 1 auto; min-height: 0; max-width: 100%; object-fit: contain; image-rendering: pixelated; }
.w-qr-caption { flex: 0 0 auto; margin-top: 0.3em; text-align: center; line-height: 1.2; }

/* Countdown (ADR-0037). */
.w-countdown { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.w-countdown-title { font-size: 0.45em; margin-bottom: 0.4em; }
.w-countdown-value { display: flex; gap: 0.6em; justify-content: center; flex-wrap: wrap; }
.w-countdown-part { display: flex; flex-direction: column; align-items: center; }
.w-countdown-number { font-weight: 700; font-variant-numeric: tabular-nums; }
.w-countdown-unit { font-size: 0.3em; text-transform: uppercase; letter-spacing: 0.05em; }
.w-countdown-done { font-weight: 700; padding: 0 0.3em; }

/* YouTube (ADR-0037): the frame fills the zone; clicks are not needed on a screen. */
.w-youtube { position: absolute; inset: 0; background: #000; }
.w-youtube iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }

/* News feed (ADR-0037): picture on the left of landscape zones, above in tall ones. */
.w-rss { position: absolute; inset: 0; overflow: hidden; }
.w-rss-item { position: absolute; inset: 0; display: flex; gap: 0.6em; padding: 0.5em; box-sizing: border-box; align-items: center; }
.w-rss-image { flex: 0 0 40%; max-width: 40%; height: 100%; object-fit: cover; border-radius: 0.15em; }
.w-rss-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.25em; overflow: hidden; }
.w-rss-title { font-weight: 700; line-height: 1.15; }
.w-rss-date { font-size: 0.5em; opacity: 0.8; }
.w-rss-summary { font-size: 0.6em; line-height: 1.3; overflow: hidden; }
.w-rss-item.tall { flex-direction: column; align-items: stretch; }
.w-rss-item.tall .w-rss-image { flex-basis: 45%; max-width: 100%; height: auto; min-height: 0; }

/* Weather (ADR-0037). MET's terms ask for the credit. */
.w-weather { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; overflow: hidden; }
.w-weather-now, .w-weather-block { display: flex; flex-direction: column; align-items: center; gap: 0.2em; }
.w-weather-place { font-size: 0.45em; opacity: 0.9; }
.w-weather-row { display: flex; align-items: center; gap: 0.3em; }
.w-weather-temp { font-weight: 700; font-variant-numeric: tabular-nums; }
.w-weather-words { font-size: 0.4em; }
.w-weather-list { display: flex; gap: 0.6em; justify-content: center; }
.w-weather-cell { display: flex; flex-direction: column; align-items: center; gap: 0.15em; font-size: 0.6em; }
.w-weather-label { font-size: 0.6em; text-transform: capitalize; }
.w-weather-range { font-variant-numeric: tabular-nums; }
.w-weather-icon { display: block; }
.w-weather-credit { position: absolute; right: 0.5em; bottom: 0.3em; font-size: 16px; opacity: 0.6; }

/* News and weather: the news card (as the feed widget's) with the weather panel beside or under it. */
.w-newsweather { position: absolute; inset: 0; display: flex; overflow: hidden; }
.w-newsweather.below { flex-direction: column; }
.w-nw-news { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; }
.w-nw-weather { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2em; padding: 0.3em 0.3em 0.6em; box-sizing: border-box; text-align: center; line-height: 1.1; overflow: hidden; }
.w-nw-place { font-size: 0.6em; opacity: 0.9; margin-bottom: 0.2em; }
.w-nw-days { display: flex; gap: 0.8em; justify-content: center; }
.w-nw-days.column { flex-direction: column; gap: 0.6em; }
.w-nw-day { display: flex; flex-direction: column; align-items: center; gap: 0.1em; }
.w-nw-label { font-weight: 700; font-size: 0.7em; }
.w-nw-words { font-size: 0.55em; opacity: 0.9; }
.w-nw-range { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.9em; }
.w-nw-credit { position: absolute; right: 0.5em; bottom: 0.2em; font-size: 14px; opacity: 0.6; }

/* Website content (ADR-0050): cards from the server, one at a time or as a list. */
.w-site { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; padding: 0.4em; box-sizing: border-box; }
.w-site-heading { font-weight: 700; font-size: 0.75em; opacity: 0.9; margin-bottom: 0.3em; text-transform: uppercase; letter-spacing: 0.04em; }
.w-site-body { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.w-site-body.list { display: flex; flex-direction: column; gap: 0.35em; }
.w-site-empty { opacity: 0.8; font-size: 0.7em; }
.w-site-card { position: absolute; inset: 0; display: flex; gap: 0.6em; align-items: center; }
.w-site-card.tall { flex-direction: column; align-items: stretch; }
.w-site-card.compact { position: static; flex: 0 0 auto; align-items: flex-start; }
.w-site-image { flex: 0 0 40%; max-width: 40%; height: 100%; object-fit: cover; border-radius: 0.15em; }
.w-site-card.tall .w-site-image { flex-basis: 45%; max-width: 100%; height: auto; min-height: 0; }
.w-site-card.compact .w-site-image { flex: 0 0 4em; max-width: 4em; height: 3em; }
.w-site-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.25em; overflow: hidden; }
.w-site-title { font-weight: 700; line-height: 1.15; }
.w-site-subtitle { font-size: 0.55em; opacity: 0.85; }
.w-site-summary { font-size: 0.6em; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.w-site-card.compact .w-site-summary { -webkit-line-clamp: 2; }
.w-site-line { display: flex; justify-content: space-between; gap: 1em; font-size: 0.6em; }
.w-site-line-note { flex: 0 0 auto; opacity: 0.85; }
.w-site-line-detail { font-size: 0.45em; opacity: 0.8; margin-top: -0.2em; }
.w-site-bar { display: grid; grid-template-columns: 1fr auto; gap: 0.15em 0.5em; font-size: 0.6em; }
.w-site-bar-track { grid-column: 1 / -1; height: 0.35em; border-radius: 999px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.w-site-bar-fill { height: 100%; background: currentColor; }
.w-site-qr { flex: 0 0 auto; width: 3.5em; height: 3.5em; align-self: flex-end; background: #fff; padding: 0.1em; border-radius: 0.1em; }
.w-site-card.compact .w-site-qr { width: 2em; height: 2em; }
/* In a list the card is already smaller: its parts shrink less (sizes are em of em). */
.w-site-card.compact { font-size: 0.8em; }
.w-site-card.compact .w-site-subtitle { font-size: 0.7em; }
.w-site-card.compact .w-site-summary,
.w-site-card.compact .w-site-line,
.w-site-card.compact .w-site-bar { font-size: 0.75em; }
.w-site-card.compact .w-site-line-detail { font-size: 0.8em; }

/* Bookings (ADR-0054): a table page by page, or a room sign. */
.w-booking { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; padding: 0.4em; box-sizing: border-box; }
.w-booking-heading { font-weight: 700; font-size: 0.8em; margin-bottom: 0.3em; }
.w-booking-empty { opacity: 0.8; font-size: 0.7em; }
.w-booking-table { width: 100%; border-collapse: collapse; font-size: 0.8em; table-layout: auto; }
.w-booking-table th { text-align: left; font-weight: 700; opacity: 0.8; padding: 0.2em 0.4em; border-bottom: 2px solid currentColor; white-space: nowrap; }
.w-booking-table td { padding: 0.25em 0.4em; border-bottom: 1px solid rgba(255, 255, 255, 0.2); vertical-align: top; }
.w-booking-table tr.w-booking-now td { font-weight: 700; }
.w-booking-table tr.w-booking-group td { font-weight: 700; padding-top: 0.5em; border-bottom: none; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.8em; opacity: 0.9; }
.w-booking-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.w-booking-title { font-weight: 600; }
.w-booking-notes { opacity: 0.8; font-size: 0.85em; }
.w-booking-page { margin-top: auto; align-self: flex-end; font-size: 0.5em; opacity: 0.7; }
.w-booking.w-booking-sign { padding: 0; }
.w-booking-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.w-booking-status { padding: 0.5em 0.6em; display: flex; flex-direction: column; gap: 0.15em; transition: background-color 0.6s; }
.w-booking-room { font-size: 0.8em; font-weight: 700; opacity: 0.9; }
.w-booking-state { font-size: 2em; font-weight: 800; line-height: 1; }
.w-booking-until { font-size: 0.9em; }
.w-booking-agenda { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 0.4em 0.6em; display: flex; flex-direction: column; gap: 0.25em; }
.w-booking-label { font-size: 0.55em; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.75; margin-top: 0.3em; }
.w-booking-meeting { display: grid; grid-template-columns: auto 1fr; gap: 0 0.6em; font-size: 0.8em; align-items: baseline; }
.w-booking-meeting-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-booking-meeting-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-booking-meeting-by { grid-column: 2; font-size: 0.8em; opacity: 0.8; }
.w-booking-current { font-size: 0.9em; margin-top: 0.3em; }
.w-booking-later { font-size: 0.65em; opacity: 0.9; }
/* The QR code sits in the corner below the status band, which spans the whole width. */
.w-booking-qr { position: absolute; right: 0.6em; bottom: 0.6em; display: flex; flex-direction: column; align-items: center; gap: 0.2em; }
.w-booking-qr img { width: 4.5em; height: 4.5em; background: #fff; }
.w-booking-qr-caption { font-size: 0.5em; text-align: center; max-width: 9em; }
