/* ======================================================================
   GLANCE Zone — browser player.
   A dumb display device: it shows the engine's rendered zone full-screen,
   set-and-forget. No app chrome. Mirrors the Roku PlayerScene look.
   ====================================================================== */

:root { --gz-ink: #e9edf2; --gz-dim: #8b93a1; --gz-accent: #4cc2ff; }

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%; width: 100%;
  background: #000; color: var(--gz-ink); overflow: hidden;
  font-family: "Inter Tight", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; cursor: none;
}
body.gz-paused { cursor: default; }      /* show cursor in pairing/diag */

/* ---------- the display stage (letterboxed to the engine aspect) ------ */
#gzStage {
  position: fixed; inset: 0; margin: auto;
  /* size + offset set inline by JS so the 1280x720 surface scales to fit */
  background: #000; overflow: hidden;
}

/* a single card box on the grid; clips its content (scroll / crossfade) */
.gz-card { position: absolute; overflow: hidden; background: #000; }

/* static-card page images stacked + crossfaded by opacity */
.gz-page {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: fill; opacity: 0; transition: opacity var(--fade, 350ms) ease-in-out;
}
.gz-page.gz-on { opacity: 1; }

/* scrolling-card marquee: a track of chips translated left, wrapped seamlessly */
.gz-track { position: absolute; top: 0; left: 0; height: 100%; display: flex; will-change: transform; }
.gz-chip  { height: 100%; flex: 0 0 auto; }
.gz-chip img { display: block; height: 100%; width: 100%; object-fit: fill; }

/* ---------- pairing / status screens (centered card on black) --------- */
#gzOverlay {
  position: fixed; inset: 0; display: none; place-items: center;
  background: radial-gradient(120% 120% at 50% 0%, #0c1118 0%, #000 70%);
  z-index: 10; padding: 6vmin; text-align: center;
}
#gzOverlay.gz-show { display: grid; }

.gz-panel { max-width: min(720px, 88vw); }
.gz-brand { font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
            font-size: clamp(13px, 1.6vw, 18px); color: var(--gz-dim); margin-bottom: 3vmin; }
.gz-brand b { color: var(--gz-accent); }
.gz-title { font-size: clamp(20px, 3.2vw, 34px); font-weight: 700; margin: 0 0 1.5vmin; }
.gz-sub   { font-size: clamp(14px, 1.8vw, 19px); color: var(--gz-dim); line-height: 1.5; margin: 0 0 4vmin; }
.gz-sub a { color: var(--gz-accent); text-decoration: none; }

.gz-code {
  display: inline-flex; gap: clamp(8px, 1.4vw, 16px); margin: 1vmin 0 3vmin;
}
.gz-code span {
  font-variant-numeric: tabular-nums; font-weight: 800;
  font-size: clamp(40px, 9vw, 96px); line-height: 1;
  padding: clamp(10px, 1.8vw, 22px) clamp(12px, 2vw, 26px);
  border-radius: 14px; background: #11161e; border: 1px solid #1e2530;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.4);
}
.gz-hint { font-size: clamp(12px, 1.5vw, 16px); color: var(--gz-dim); }

/* sign-in form (the browser pairs by username) */
.gz-login { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 1vmin 0 2vmin; }
.gz-input {
  flex: 1 1 220px; max-width: 320px; padding: 14px 16px; font-size: 17px; color: var(--gz-ink);
  background: #11161e; border: 1px solid #1e2530; border-radius: 12px; outline: none;
}
.gz-input:focus { border-color: var(--gz-accent); }
.gz-btn {
  padding: 14px 22px; font-size: 16px; font-weight: 700; cursor: pointer;
  color: #04121b; background: var(--gz-accent); border: 0; border-radius: 12px;
}
.gz-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.gz-chip-btn {
  padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--gz-ink);
  background: #11161e; border: 1px solid #1e2530; border-radius: 999px;
}
.gz-chip-btn:hover { border-color: var(--gz-accent); color: var(--gz-accent); }
.gz-msg { margin-top: 16px; font-size: 14px; color: var(--gz-dim); min-height: 1.2em; }
.gz-msg.gz-err { color: #ff8a8a; }
.gz-spin { margin-top: 4vmin; width: 26px; height: 26px; display: inline-block;
           border: 3px solid #1e2530; border-top-color: var(--gz-accent);
           border-radius: 50%; animation: gz-rot 900ms linear infinite; }
@keyframes gz-rot { to { transform: rotate(360deg); } }
.gz-err { color: #ff8a8a; }

/* ---------- top control bar (fades in on mouse move while playing) ----- */
#gzBar {
  position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 25;
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,.62) 0%, rgba(0,0,0,0) 100%);
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
body.gz-active #gzBar { opacity: 1; pointer-events: auto; }
body.gz-active { cursor: default; }                 /* reveal the cursor with the bar */
.gz-bar-user { font-size: 13px; color: #b9c0cc; letter-spacing: .02em;
               text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.gz-bar-user b { color: #e9edf2; }
.gz-bar-out {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 8px 0 14px; border: 0; border-radius: 10px;
  background: transparent; color: #9aa0ab; cursor: pointer;
  font: inherit; font-size: 14px; transition: color .15s, background .15s;
}
.gz-bar-out:hover { color: #fff; background: rgba(255,255,255,.08); }
.gz-bar-x { font-size: 24px; line-height: 1; font-weight: 400; }

/* ---------- diagnostics strip (toggle with the ? key) ----------------- */
#gzDiag {
  position: fixed; left: 0; bottom: 0; z-index: 20; display: none;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #9fe7ff; background: rgba(0,0,0,.72); padding: 8px 12px;
  max-width: 100vw; white-space: pre-wrap;
}
#gzDiag.gz-show { display: block; }
