:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #1c2128;
  --muted: #66707a;
  --line: #e3e6ea;
  --accent: #0f6e6b;
  --accent-ink: #ffffff;
  --ok: #1f9d55;
  --no: #d64545;
  --blue: #2f6fc4;
  --shadow: 0 10px 30px rgba(20, 24, 28, 0.12);
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { min-height: 100dvh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.screen { min-height: 100dvh; }
header.bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 8px;
}
header.bar strong { font-size: 18px; letter-spacing: 0.02em; }
header.bar .spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card);
}
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.off { background: var(--no); }
.you, .block { padding: 8px 20px; }
.label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.id { font-size: 34px; font-weight: 650; letter-spacing: 0.04em; }
.field {
  margin: 16px 20px;
  display: flex; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
}
.field input {
  flex: 1; border: 0; background: transparent; padding: 16px;
  font-size: 17px; outline: none;
}
.field button, #go {
  width: 48px; height: 48px; margin-right: 6px; border: 0; border-radius: 12px;
  background: var(--accent); color: white; font-size: 22px;
}
.pc-card, .recent button {
  width: 100%; text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
}
.pc-card b { display: block; font-size: 20px; margin-top: 4px; }
.hint { color: var(--muted); font-size: 14px; padding: 0 20px 12px; }
.hint a { color: var(--accent); }
#recent { list-style: none; margin: 0; padding: 0 20px 20px; display: grid; gap: 8px; }
.side {
  position: fixed; inset: 0; background: rgba(20, 24, 28, 0.35);
  display: flex; align-items: flex-start; justify-content: flex-start;
}
.side nav {
  background: white; min-width: 240px; min-height: 100%; padding: 24px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.side button { text-align: left; border: 0; background: transparent; padding: 12px; border-radius: 10px; }
.side button:hover, .side button:focus { background: #e7f3f2; }
#wait, #pair, #password { padding: 28px 20px 40px; }
#wait h1, #pair h1, #password h1 { font-size: 26px; margin: 0 0 8px; }
#password input[type="password"], #pair-code {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 18px; margin: 8px 0 12px;
}
.fp { font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.45; word-break: break-all; }
.chat {
  background: white; border: 1px solid var(--line); border-radius: 14px;
  min-height: 140px; max-height: 240px; overflow: auto; padding: 10px 12px; margin: 12px 0;
}
.chat p { margin: 6px 0; }
.chat .who { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; background: var(--accent); color: white;
}
.btn.ghost { background: #e6e8eb; color: var(--ink); }
.btn.no { background: var(--no); }
#stage { position: fixed; inset: 0; background: #111; overflow: hidden; touch-action: none; }
#video { width: 100%; height: 100%; background: #111; }
#stage[data-fit="shrink"] #video { object-fit: contain; }
#stage[data-fit="stretch"] #video { object-fit: fill; }
#stage[data-fit="original"] #video { object-fit: none; width: auto; height: auto; max-width: none; }
#cursor {
  position: absolute; width: 14px; height: 14px; margin: -2px 0 0 -2px;
  border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px #111;
  pointer-events: none; z-index: 3;
}
.tag {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: white; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; z-index: 4;
}
#nub {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid white;
  background: rgba(15, 110, 107, 0.9); color: transparent; z-index: 5;
}
#pie {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px; z-index: 6;
}
#pie button {
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--accent); color: white;
  display: grid; place-items: center; padding: 0;
}
#pie button svg { width: 26px; height: 26px; }
#pie .gear { width: 64px; height: 64px; background: transparent; border: 3px solid white; }
#pie .close { background: var(--no); }
#sheet {
  position: absolute; left: 12px; right: 84px; bottom: 12px; z-index: 6;
  background: rgba(255, 255, 255, 0.96); color: var(--ink);
  border-radius: 16px; padding: 14px; max-height: 70%; overflow: auto;
}
#sheet h2 { margin: 0 0 10px; font-size: 16px; }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; gap: 12px; }
.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.keys button, .choice button {
  border: 1px solid var(--line); background: white; border-radius: 10px; padding: 10px 6px;
}
.keys button.on, .choice button.on { background: var(--accent); color: white; border-color: var(--accent); }
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
#keys {
  position: absolute; left: 12px; right: 84px; bottom: 8px; z-index: 4;
  border-radius: 12px; border: 0; padding: 12px; font-size: 16px;
}
.banner-note { font-size: 13px; color: var(--muted); }
#shot {
  position: absolute; inset: 24px; z-index: 8; background: rgba(0,0,0,.72);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
#shot img { max-width: 100%; max-height: 70%; }
