/*
 * Cube Tug-of-War Web — app shell styling.
 *
 * The actual TOY presentation is drawn entirely on #stage in 1920x1080
 * design-space coordinates by js/ui/renderer.js (see that file's header);
 * this stylesheet only has to give #stage a full-viewport black canvas to
 * letterbox into, keep #cam decoding frames while staying off-screen, and
 * register the Jua font for both canvas text (js/ui/design.js sets
 * `ctx.font` to it) and any DOM text the operator overlay adds.
 */

@font-face {
  font-family: "Jua";
  src: url("../assets/fonts/Jua-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Jua", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  background: #000; /* black letterbox shown before the first draw() call / if an asset fails to load */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Operator overlay placeholder — filled by js/ui/operator.js (out of this
 * task's scope). Sits above #stage; pointer-events stay off by default so
 * an empty/closed overlay never blocks input to the canvas underneath. */
#operator {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/*
 * The camera feed must keep decoding frames for renderer.js's
 * drawCameraPreview()/toy.js's vision pipeline to read, which some
 * browsers do not guarantee for a `display:none` video — so instead of
 * relying on the `hidden` attribute's default styling, keep it laid out
 * but visually and interactively invisible.
 */
video#cam[hidden] {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Disabled buttons must LOOK disabled (2026-09-08: a dead 로봇 연결 button looked live). */
#operator button:disabled { opacity: 0.45; cursor: default; }
