*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --chrome-bg: rgba(18, 16, 17, 0.88);
  --chrome-text: #f2f0ee;
  --chrome-dim: #a19d99;
  --chrome-line: rgba(255, 255, 255, 0.12);
  --chrome-accent: #e20000;
}

html, body {
  width: 100%; height: 100%;
  background: #000;               /* the kiosk's pillarbox bars are opaque black */
  overflow: hidden;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--chrome-text);
}

/* ── Kiosk frame ─────────────────────────────────────────────────────────
   Fixed aspect (set from the site profile in main.js), centred, never
   reflowed: the pages lay themselves out in vw/vh of THIS box, so they look
   exactly as they do in the kiosk at any window size. */
#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#frame { position: relative; overflow: hidden; background: #000; }

.state {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  isolation: isolate;
}
.state.on { visibility: visible; }
.state > * { position: absolute; inset: 0; width: 100%; height: 100%; }

.overlay {
  border: 0; background: transparent;
  color-scheme: normal;
}
.state:not(.current) .overlay { pointer-events: none; }

.grad-mirror, .menu-bg canvas { display: block; }
.menu-bg { background: linear-gradient(135deg, #f5f6fb 0%, #aeb2c1 100%); }  /* replaced by the native render */
.menu-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.vertical-bg { object-fit: cover; background: #000; }
.attract-bg { object-fit: cover; }
.attract-bg[hidden] { display: none; }
.film { object-fit: contain; }

/* Callout cards: geometry from each state's modal_place (fractions of the frame). */
.callout { pointer-events: none; opacity: 0; }
.callout video { position: absolute; object-fit: fill; visibility: hidden; }
.detect-callout video { left: 36.6276%; top: 37.6095%; width: 26.7448%; height: 24.7811%; }
.menu-callout video   { left: 36.9792%; top: 72.0697%; width: 26.0417%; height: 10.6061%; }

#mouse-hand { display: none; position: absolute; inset: 0; z-index: 50; cursor: crosshair; }
body.mouse-hand #mouse-hand { display: block; }

/* ── Prototype chrome ───────────────────────────────────────────────────── */
#hud {
  position: fixed; left: 12px; bottom: 12px; z-index: 100;
  width: 252px; padding: 12px;
  background: var(--chrome-bg); border: 1px solid var(--chrome-line); border-radius: 10px;
  font-size: 12px; line-height: 1.45;
  backdrop-filter: blur(8px);
  transition: opacity 0.2s, transform 0.2s;
}
#hud.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.hud-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.hud-title { font-weight: 700; letter-spacing: 0.02em; }
#hud-site { color: var(--chrome-dim); font-size: 11px; }
.hud-cam { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.hud-cam video, .hud-cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.hud-rows div { display: flex; justify-content: space-between; padding: 2px 0; border-bottom: 1px solid var(--chrome-line); }
.hud-rows span { color: var(--chrome-dim); }
.hud-rows b { font-weight: 600; }
.hud-rows b.on { color: #6fdc8c; }
.hud-keys { margin-top: 8px; color: var(--chrome-dim); }
.hud-keys .dev { margin-top: 4px; font-size: 11px; opacity: 0.8; }
kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; text-align: center;
  border: 1px solid var(--chrome-line); border-radius: 4px; background: rgba(255,255,255,0.06);
  font: 600 11px/18px 'Helvetica Neue', Helvetica, Arial, sans-serif; color: var(--chrome-text);
}

#toast {
  position: fixed; top: 14px; left: 50%; transform: translate(-50%, -8px); z-index: 120;
  padding: 7px 14px; border-radius: 999px; background: var(--chrome-bg); border: 1px solid var(--chrome-line);
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#start {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.72);
}
#start.gone { display: none; }
.start-card {
  width: min(520px, calc(100vw - 32px));
  padding: 28px; border-radius: 14px;
  background: #151314; border: 1px solid var(--chrome-line);
}
.start-title { font-size: 30px; font-weight: 300; letter-spacing: -0.01em; }
.start-sub { color: var(--chrome-dim); margin: 2px 0 18px; }
.start-card ul { padding-left: 18px; color: #d8d4d0; font-size: 14px; line-height: 1.55; }
.start-card li { margin-bottom: 6px; }
#start-status { margin: 16px 0 12px; font-size: 13px; color: var(--chrome-dim); min-height: 18px; }
#start-status.error { color: #ff6b6b; }
#start-btn {
  width: 100%; padding: 12px; border: 0; border-radius: 8px;
  background: var(--chrome-accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
#start-btn:disabled { opacity: 0.45; cursor: default; }
