/* Plexiglass TV player. Same palette and rounded shapes as the admin, sized in vmin so it reads from across a room. */
:root {
  --ink: #f2f7f4;
  --muted: rgb(226 240 232 / 0.66);
  --surface: rgb(16 28 21 / 0.86);
  --surface-solid: #13211a;
  --line: rgb(255 255 255 / 0.1);
  --accent: #3dbb7a;
  --accent-dark: #0c4228;
  --accent-soft: rgb(61 187 122 / 0.18);
  --bad: #f87171;
  --safe: 5vmin; /* keep text inside TV overscan */
  --r-lg: 3.2vmin;
  --r-md: 2vmin;
  font-family: ui-sans-serif, Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); overflow: hidden; cursor: none; -webkit-font-smoothing: antialiased; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body.pointer-awake, body.pointer-awake * { cursor: default; }
[hidden] { display: none !important; }
#app, #stage { position: fixed; inset: 0; }
h1, h2, p { margin: 0; }
.eyebrow { font-size: 2.2vmin; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }

/* ---------- full-screen states: pairing, empty, nothing scheduled ---------- */
.backdrop {
  background:
    radial-gradient(90vmax 70vmax at 100% 0%, rgb(31 143 88 / 0.35), transparent 60%),
    radial-gradient(70vmax 60vmax at 0% 100%, rgb(31 143 88 / 0.18), transparent 60%),
    #07100b;
}
.screen { position: fixed; inset: 0; padding: var(--safe); display: grid; place-items: center; text-align: center; }
.brand { position: absolute; top: var(--safe); left: var(--safe); display: flex; align-items: center; gap: 1.6vmin; font-size: 3vmin; font-weight: 700; letter-spacing: -0.02em; }
.mark { width: 5.2vmin; height: 5.2vmin; border-radius: 1.6vmin; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2e9d66, var(--accent-dark)); }
.mark svg { width: 3vmin; height: 3vmin; }
.pair-card, .idle-card {
  display: grid; gap: 3vmin; justify-items: center; padding: 6vmin 8vmin; border-radius: 4vmin;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 4vmin 10vmin rgb(0 0 0 / 0.35);
}
.code { display: flex; gap: 1.4vmin; font-size: 11vmin; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.code .digit { display: grid; place-items: center; width: 10vmin; height: 14vmin; border-radius: 2.4vmin; background: rgb(255 255 255 / 0.07); border: 1px solid var(--line); }
.code .sep { width: 2.4vmin; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 1.4vmin; text-align: left; font-size: 2.8vmin; color: var(--muted); }
.steps li { counter-increment: step; display: flex; gap: 1.6vmin; align-items: center; }
.steps li::before { content: counter(step); flex: 0 0 auto; width: 4vmin; height: 4vmin; border-radius: 50%; display: grid; place-items: center; font-size: 2vmin; font-weight: 700; color: #07100b; background: var(--accent); }
.hint { font-size: 2.6vmin; color: var(--muted); max-width: 70ch; line-height: 1.4; }
.hint:empty { display: none; }
#pair .hint { position: absolute; bottom: var(--safe); left: 0; right: 0; margin: auto; }
.idle-card { min-width: 70vmin; }
.idle-clock { font-size: 16vmin; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
#idle-title { font-size: 3vmin; }

/* ---------- slides ---------- */
#slide-img, #slide-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: var(--fit, contain); background: var(--bg, #000); }
/* The YouTube frame never takes focus or clicks, so the remote keeps controlling our page. */
#slide-yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; pointer-events: none; }
.count {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 2.4vmin; text-align: center;
  background: radial-gradient(80vmax 60vmax at 50% 0%, rgb(31 143 88 / 0.32), transparent 65%), #07100b;
}
.count-label { font-size: 5.4vmin; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); max-width: 80vw; }
.count-label:empty { display: none; }
.count-time { font-size: 30vmin; font-weight: 700; line-height: 0.95; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.count-sub { font-size: 3vmin; font-weight: 600; color: var(--muted); }
.count-sub:empty { display: none; }
.count.done .count-time { color: var(--accent); }

.text-slide {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4vmin; padding: 10vmin 12vmin; text-align: center;
}
.text-slide h1 { font-size: 12vmin; line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; max-width: 90vw; overflow-wrap: anywhere; }
.text-slide.medium h1 { font-size: 9vmin; }
.text-slide.long h1 { font-size: 7vmin; }
.text-slide p { font-size: 4.2vmin; line-height: 1.35; max-width: 70ch; white-space: pre-line; font-weight: 500; }
.text-slide p:empty { display: none; }
.text-slide.theme-green { color: #fff; background: radial-gradient(110vmax 90vmax at 0% 100%, #2fa468 0%, transparent 55%), linear-gradient(150deg, #136b40, #0a3b23); }
.text-slide.theme-green p { color: #d6f1e2; }
.text-slide.theme-dark { color: var(--ink); background: radial-gradient(80vmax 60vmax at 100% 0%, rgb(31 143 88 / 0.25), transparent 60%), #07100b; }
.text-slide.theme-dark p { color: var(--muted); }
.text-slide.theme-light { color: #0e1a13; background: #f3f5f3; }
.text-slide.theme-light p { color: #3b4a41; }

/* ---------- little feedback pill ---------- */
.hud {
  position: absolute; top: var(--safe); right: var(--safe); z-index: 6;
  padding: 1.4vmin 2.8vmin; border-radius: 99px; background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 2.6vmin; font-weight: 600; font-variant-numeric: tabular-nums;
  opacity: 0; transform: translateY(-1vmin); transition: opacity 0.2s, transform 0.2s;
}
.hud.show { opacity: 1; transform: none; }
/* Same pill as above, kept on screen (top centre) until the page is full screen. */
.hud.fs-hint { right: 0; left: 0; margin: 0 auto; width: fit-content; z-index: 5; }

/* ---------- now-playing card: appears on any remote press ---------- */
.nowbar {
  position: absolute; left: var(--safe); right: var(--safe); bottom: var(--safe); z-index: 4;
  opacity: 0; transform: translateY(2vmin); transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none;
}
.nowbar.show { opacity: 1; transform: none; }
.nb-card {
  padding: 3vmin 3.6vmin 2.6vmin; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 3vmin 8vmin rgb(0 0 0 / 0.35);
}
.nb-top { display: flex; align-items: center; gap: 1.8vmin; font-size: 2.2vmin; font-weight: 600; color: var(--muted); }
.nb-chip { background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 0.5vmin 1.6vmin; letter-spacing: 0.08em; text-transform: uppercase; font-size: 1.8vmin; font-weight: 700; }
.nb-pos { font-variant-numeric: tabular-nums; }
.nb-clock { margin-left: auto; font-size: 2.6vmin; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
#nb-title { margin-top: 1.4vmin; font-size: 4.8vmin; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
#nb-note { margin-top: 0.8vmin; font-size: 2.6vmin; color: var(--muted); max-width: 90ch; }
#nb-note:empty { display: none; }
.nb-bar { margin-top: 2.4vmin; height: 0.8vmin; border-radius: 99px; background: rgb(255 255 255 / 0.14); overflow: hidden; }
.nb-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #2e9d66, var(--accent)); transition: width 0.25s linear; }
.nb-times { display: flex; justify-content: space-between; margin-top: 1vmin; font-size: 2vmin; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.2em; }

/* ---------- room menu ---------- */
.menu { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; background: rgb(3 8 5 / 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.menu-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4vmin; align-items: start;
  width: min(118vmin, 92vw); max-height: 88vh; overflow: hidden; padding: 4.4vmin;
  background: var(--surface-solid); border: 1px solid var(--line); border-radius: 4vmin; box-shadow: 0 4vmin 12vmin rgb(0 0 0 / 0.5);
}
.menu-card h2 { margin-top: 0.8vmin; font-size: 4.8vmin; letter-spacing: -0.02em; }
.info { list-style: none; margin: 1.6vmin 0 3vmin; padding: 0; color: var(--muted); font-size: 2.4vmin; line-height: 1.6; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 1vmin; }
.items li { padding: 1.8vmin 2.6vmin; border-radius: var(--r-md); font-size: 3vmin; font-weight: 600; color: var(--muted); }
.items li[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, #1b7a4b, var(--accent-dark)); }
.items li.danger { color: var(--bad); }
.items li.danger[aria-selected="true"] { color: #fff; background: #b42318; }
.menu-hint { margin-top: 2.6vmin; font-size: 2vmin; color: var(--muted); }
.menu-qr { display: grid; justify-items: center; gap: 1.6vmin; width: 30vmin; padding: 3vmin; border-radius: var(--r-lg); background: rgb(255 255 255 / 0.05); border: 1px solid var(--line); text-align: center; }
.menu-qr svg { width: 24vmin; height: 24vmin; background: #fff; border-radius: 1.6vmin; padding: 1.2vmin; }
.menu-qr strong { font-size: 2.6vmin; }
.menu-qr p { font-size: 2vmin; color: var(--muted); line-height: 1.35; }

#black, .sleep { position: fixed; inset: 0; background: #000; z-index: 7; }
.offline { position: fixed; top: 2.4vmin; left: 2.4vmin; z-index: 9; width: 1.6vmin; height: 1.6vmin; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 0.6vmin rgb(245 158 11 / 0.25); }

/* ---------- screen brightness, clock, message from the admin ---------- */
.dim { position: fixed; inset: 0; background: #000; z-index: 6; pointer-events: none; }
.corner-clock {
  position: fixed; z-index: 5; padding: 1vmin 2.2vmin; border-radius: 99px; background: rgb(0 0 0 / 0.45); color: #fff;
  font-size: 3vmin; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none;
  top: var(--safe); bottom: auto; left: auto; right: auto;
}
.corner-clock[data-pos="top-left"] { left: var(--safe); }
.corner-clock[data-pos="top-right"] { right: var(--safe); }
.corner-clock[data-pos="bottom-left"] { left: var(--safe); top: auto; bottom: var(--safe); }
.corner-clock[data-pos="bottom-right"] { right: var(--safe); top: auto; bottom: var(--safe); }
.message {
  position: fixed; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 11; display: grid; place-items: center;
  padding: 5vmin 8vmin; background: linear-gradient(135deg, #136b40, #0a3b23); border-block: 0.5vmin solid var(--accent); box-shadow: 0 4vmin 14vmin rgb(0 0 0 / 0.6);
}
.message p { font-size: 9vmin; line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; text-align: center; max-width: 90vw; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- phone-remote code, shown for 30 seconds ---------- */
.qr-overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgb(3 8 5 / 0.8); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.qr-card { display: grid; justify-items: center; gap: 2.4vmin; padding: 5vmin 7vmin; border-radius: 4vmin; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: 0 4vmin 12vmin rgb(0 0 0 / 0.5); text-align: center; }
.qr-box svg { width: 44vmin; height: 44vmin; background: #fff; border-radius: 2.4vmin; padding: 2vmin; display: block; }
.qr-line { font-size: 3vmin; font-weight: 600; max-width: 44vmin; line-height: 1.3; }
.qr-count { font-size: 2.2vmin; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- on-screen buttons for mouse and touch (left edge; shown when the pointer moves or the screen is tapped) ---------- */
.ui-buttons { position: fixed; z-index: 9; left: var(--safe); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-start; gap: 1.4vmin; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.ui-buttons.show { opacity: 1; pointer-events: auto; }
.ui-buttons button {
  display: inline-flex; align-items: center; gap: 1.2vmin; min-height: 7vmin; padding: 0 2.4vmin; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 2.4vmin/1 inherit; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.ui-buttons button:hover { background: var(--surface-solid); }
.ui-buttons button svg { width: 3.2vmin; height: 3.2vmin; }
.ui-buttons button[hidden] { display: none; }
body.pointer-awake .ui-buttons button { cursor: pointer; }

/* ---------- timeline: the lower half of the screen, what played and what is next ---------- */
.timeline { position: fixed; left: 0; right: 0; bottom: 0; height: 52vh; z-index: 8; padding: 0 var(--safe) var(--safe); display: grid; align-items: end; }
.tl-card {
  display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; padding: 3vmin 3.6vmin; border-radius: var(--r-lg);
  background: var(--surface-solid); border: 1px solid var(--line); box-shadow: 0 -3vmin 10vmin rgb(0 0 0 / 0.5); overflow: hidden;
}
.tl-head { display: flex; align-items: end; justify-content: space-between; gap: 3vmin; margin-bottom: 1.6vmin; }
.tl-head h2 { font-size: 4vmin; letter-spacing: -0.02em; margin-top: 0.4vmin; }
.tl-hint { font-size: 1.9vmin; color: var(--muted); text-align: right; }
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8vmin; overflow-y: auto; align-content: start; scroll-behavior: smooth; }
.tl-row { display: grid; grid-template-columns: 5vmin minmax(0, 1fr) auto; align-items: center; gap: 2vmin; padding: 1.2vmin 2vmin; border-radius: var(--r-md); font-size: 2.8vmin; font-weight: 600; color: var(--muted); cursor: pointer; }
.tl-row .num { font-variant-numeric: tabular-nums; opacity: 0.7; text-align: center; }
.tl-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-row .tag { font-size: 1.7vmin; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.4vmin 1.4vmin; border-radius: 99px; background: rgb(255 255 255 / 0.08); }
.tl-row.past { opacity: 0.55; }
.tl-row.now { color: #fff; background: var(--accent-soft); }
.tl-row.now .tag { background: var(--accent); color: #07100b; }
.tl-row.next .tag { background: var(--accent-soft); color: var(--accent); }
.tl-row.later { opacity: 0.45; }
.tl-row[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, #1b7a4b, var(--accent-dark)); opacity: 1; }
