/* xBuzz Show — the display in plain HTML (2026-10-12; was Flutter Web).
   Sizes and colours are the Flutter build's: one unit --u is 1.0 on a
   1080-px-high landscape screen (set by lib/ui/scale.dart).
   Old TV / Android-box browsers (an Android box runs Chrome 79): no
   `inset` property, no flex `gap`, no `aspect-ratio` — offsets and margins. */

:root {
  --u: 1;
  --background: #041f2c;
  --panel: #062e41;
  --row: #0b3a52;
  --text: #ffffff;
  --sub: rgba(255, 255, 255, 0.7);
  --waiting: #ffc107;
  --serving: #ff6b6b;
  --next-up: #2ecc71;
  --booked: #e040fb;
  --eta: #4fc3f7;
  --ending: #ffb74d;
  --free: #2ecc71;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--background);
  color: var(--text);
  font-family: Roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

#app { position: fixed; top: 0; right: 0; bottom: 0; left: 0; }

/* Boot status (index.html) */
#boot {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  text-align: center; z-index: 10; pointer-events: none;
}
.boot-text { color: var(--sub); font-size: 22px; }
.boot-info { color: var(--serving); font-size: 16px; max-width: 900px;
  margin-top: 16px;
  word-break: break-word; }

.u-spinner {
  width: calc(48px * var(--u)); height: calc(48px * var(--u));
  border: calc(5px * var(--u)) solid rgba(0, 0, 0, 0.15);
  border-top-color: #555; border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Pairing page */
.pair {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center;
  justify-content: center; overflow: auto; padding: calc(24px * var(--u));
}
.pair-col { display: flex; flex-direction: column; align-items: center; }
.pair-title { color: var(--sub); font-size: calc(22px * var(--u));
  margin-bottom: calc(28px * var(--u)); }
.pair-qr {
  background: #fff; border-radius: calc(20px * var(--u));
  padding: calc(20px * var(--u)); display: flex; align-items: center;
  justify-content: center;
}
.pair-qr svg { width: 100%; height: 100%; display: block; }
.pair-code { margin-top: calc(20px * var(--u)); }
.pair-code .label { color: var(--sub); font-size: calc(24px * var(--u)); }
.pair-code .code { color: var(--waiting); font-size: calc(40px * var(--u));
  font-weight: bold; letter-spacing: calc(4px * var(--u)); }
.pair-error { color: var(--serving); font-size: calc(20px * var(--u));
  margin-top: calc(16px * var(--u)); text-align: center; }

/* Display page */
.display { position: absolute; top: 0; right: 0; bottom: 0; left: 0; padding: calc(10px * var(--u));
  display: flex; }
.display.landscape { flex-direction: row; }
.display.portrait { flex-direction: column; }
.tables-wrap { display: flex; flex-direction: column; min-width: 0;
  min-height: 0; }
.tables { display: flex; flex: 1; min-width: 0; min-height: 0; }
.tables.side { flex-direction: row; }
.tables.stack { flex-direction: column; }
.tables > * { flex: 1; min-width: 0; min-height: 0; }

.panel {
  margin: calc(10px * var(--u)); padding: calc(10px * var(--u));
  background: var(--panel); border-radius: calc(14px * var(--u));
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
}
.pill-row { display: flex; justify-content: center;
  margin-bottom: calc(10px * var(--u)); }
.pill {
  display: inline-flex; align-items: center;
  padding: calc(8px * var(--u)) calc(22px * var(--u));
  border-radius: 99px; border: calc(2px * var(--u)) solid currentColor;
}
.pill svg { width: calc(30px * var(--u)); height: calc(30px * var(--u));
  fill: currentColor; }
.pill > * + * { margin-left: calc(10px * var(--u)); }
.pill .title { font-weight: 800; font-size: calc(28px * var(--u));
  letter-spacing: calc(1.5px * var(--u)); }
.pill .count { color: rgba(0, 0, 0, 0.87); font-weight: bold;
  font-size: calc(24px * var(--u)); border-radius: 99px;
  padding: calc(2px * var(--u)) calc(12px * var(--u)); }
.waiting-c { color: var(--waiting); }
.waiting-c.pill { background: rgba(255, 193, 7, 0.15); }
.waiting-c .count { background: var(--waiting); }
.serving-c { color: var(--serving); }
.serving-c.pill { background: rgba(255, 107, 107, 0.15); }
.serving-c .count { background: var(--serving); }

.board { flex: 1; display: flex; flex-direction: column; min-height: 0;
  position: relative; }
.rows { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.grid { display: flex; align-items: center;
  padding: calc(4px * var(--u)) calc(10px * var(--u)); }
.grid.head { margin-bottom: calc(4px * var(--u)); }
.row-box { height: calc(96px * var(--u)); }
.grid.row { background: var(--row); border-radius: calc(10px * var(--u));
  height: calc(90px * var(--u)); margin-bottom: calc(6px * var(--u)); }
.grid.row.next {
  box-shadow: inset 0 0 0 calc(3px * var(--u)) var(--next-up); }
.cell { min-width: 0; text-align: center; line-height: 1.15;
  display: flex; flex-direction: column; justify-content: center; }
.cell.left { text-align: left; }
.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; white-space: normal; word-break: break-word; }
.b { font-weight: bold; }
.empty { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center;
  justify-content: center; color: var(--sub);
  font-size: calc(24px * var(--u)); }
.page-no { position: absolute; right: calc(4px * var(--u)); bottom: 0;
  color: var(--sub); font-size: calc(18px * var(--u)); }

.fs-btn {
  position: absolute; left: 0; bottom: 0; z-index: 2; cursor: pointer;
  background: rgba(0, 0, 0, 0.45); border-radius: 50%;
  padding: calc(8px * var(--u)); display: flex; border: none;
}
.fs-btn svg { width: calc(30px * var(--u)); height: calc(30px * var(--u));
  fill: var(--sub); }

.offline-dot { position: absolute; right: 8px; bottom: 8px; width: 14px;
  height: 14px; border-radius: 50%; background: var(--serving);
  display: none; z-index: 3; }
.offline-dot.on { display: block; }

/* Music / video block */
.media { margin: calc(10px * var(--u)); background: #000;
  border-radius: calc(14px * var(--u)); overflow: hidden; position: relative;
  min-width: 0; min-height: 0; }
.media iframe { border: none; width: 100%; height: 100%; display: block;
  pointer-events: none; }
.media .tap { position: absolute; top: 0; right: 0; bottom: 0; left: 0; cursor: pointer; }
.unmute {
  position: absolute; left: 50%; bottom: calc(16px * var(--u));
  transform: translateX(-50%); display: none; align-items: center;
  background: rgba(0, 0, 0, 0.75);
  border-radius: calc(30px * var(--u)); color: #fff;
  padding: calc(10px * var(--u)) calc(18px * var(--u));
  font-size: calc(20px * var(--u)); white-space: nowrap; pointer-events: none;
}
.unmute.on { display: flex; }
.unmute svg { width: calc(26px * var(--u)); height: calc(26px * var(--u));
  fill: #fff; margin-right: calc(10px * var(--u)); }

.video-empty { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex;
  align-items: center; justify-content: center; color: var(--sub);
  font-size: calc(28px * var(--u)); }
.video-blur { position: absolute; top: -40px; right: -40px; bottom: -40px; left: -40px; background-size: cover;
  background-position: center; filter: blur(30px); }
.video-frame { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex;
  align-items: center; justify-content: center; }
.video-frame > div { position: relative; max-width: 100%; max-height: 100%; }

/* KTV strip */
.strip { margin: calc(10px * var(--u)); background: var(--panel);
  border-radius: calc(14px * var(--u)); overflow: hidden; position: relative;
  min-width: 0; min-height: 0; display: flex; align-items: center; }
.strip-track { display: flex; align-items: center; height: 100%; }
.strip-track.center { width: 100%; justify-content: center; }
.strip-track.run { animation: marquee linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
.ktv { position: relative; flex: none; border-radius: 12px; overflow: hidden;
  background: rgba(0, 0, 0, 0.5) center / cover no-repeat; }
.ktv .shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.ktv .dim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, 0.55); }
.ktv .info { position: absolute; left: 4%; right: 4%; bottom: 4%;
  text-align: center; color: #fff; }
.ktv .code { font-weight: bold; text-shadow: 0 0 4px #000; }
.ktv .badge { position: absolute; top: 0; color: #fff; font-weight: 600; }
.ktv .vip { position: absolute; color: #fff; font-weight: bold;
  background: rgba(255, 64, 129, 0.7); text-align: center;
  transform: rotate(-46deg); }
