/* Magpie: app layer on top of the 钻瓷 design system (ds/tokens.css + ds/bundle.css).
   Scene: the remote screen itself (black stage, no frame). Hands and panel are 钻瓷. */

html, body { margin: 0; height: 100%; }
body { background: var(--ds-bg-low); color: var(--ds-ink); font-family: var(--font-ds-ui); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.95em; }

/* ---------- login ---------- */
.screen-login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.login-col { width: 100%; max-width: 380px; box-sizing: border-box; padding: var(--ds-space-page-24) var(--ds-space-page-20); }
.login-col h1 { margin: 0; color: var(--ds-ink); }
.login-card { display: flex; flex-direction: column; gap: 18px; }
.field-row { display: block; }
.field-label { display: block; margin-bottom: 6px; color: var(--ds-ink-caption); }
.ds-field { width: 100%; box-sizing: border-box; }
.login-hint { margin: -6px 0 0; text-align: center; color: var(--ds-ink-caption); }
.login-foot a { color: inherit; }
.login-foot { margin-top: var(--ds-space-section-24); color: var(--ds-ink-caption); }

/* ---------- viewer ---------- */
#viewer { position: fixed; inset: 0; background: #000; overflow: hidden; touch-action: none; }
#stage { position: absolute; inset: 0; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; }
#fc { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; } /* covers the video, bars included */
#fc[hidden] { display: none; }

/* hands: a row of 钻瓷 buttons at the top; tucked away while you work */
.hands { position: absolute; left: 0; right: 0; top: var(--ds-hand-top); z-index: var(--ds-z-hand); display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-in-8); padding: 0 var(--ds-hand-side); transition: transform var(--ds-duration) var(--ds-ease), opacity var(--ds-duration) var(--ds-ease); }
.hands.tucked { transform: translateY(calc(-100% - var(--ds-hand-top) - 8px)); opacity: 0; pointer-events: none; }
.hands-right { display: flex; gap: var(--ds-space-in-8); }
.hands .ds-text-btn { min-width: 76px; }

.status-line { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: var(--ds-z-hand); max-width: calc(100% - 40px); box-sizing: border-box; padding: 9px 16px; border-radius: var(--ds-radius-pill); background: var(--ds-surface); box-shadow: var(--ds-shadow-raised); color: var(--ds-ink-secondary); text-align: center; }

/* AX's pointer when it is not your own (relative mouse, phone): drawn over the video */
.remote-cursor { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; image-rendering: pixelated; z-index: 1; }

/* soft keyboard sink for phones: focusable, invisible */
.kbd-sink { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; font-size: 16px; }

/* panel */
/* Rounded at the bottom too, with those corners hidden below the screen's edge: pulling the panel
   up shows them, as if the sheet went on under the edge. */
#panel { max-height: calc(86vh + var(--ds-radius-sheet)); overflow-y: auto; border-radius: var(--ds-radius-sheet);
  bottom: calc(-1 * var(--ds-radius-sheet)); padding-bottom: calc(var(--ds-pad-page) + var(--ds-radius-sheet)); }
#panel::after { display: none; }
.panel-sub { margin: 6px 0 18px; color: var(--ds-ink-caption); overflow-wrap: anywhere; }
.panel-group { margin-bottom: 18px; }
.panel-group .ds-section-head { margin-bottom: 8px; }
.panel-actions { display: flex; flex-direction: column; gap: var(--ds-gap-cta); }
.net-result { margin: 12px 0 0; white-space: pre; overflow-x: auto; color: var(--ds-ink-secondary); font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; line-height: 1.5; }
.panel-deep { display: flex; justify-content: center; margin-top: 22px; padding-bottom: 6px; }
