:root { color-scheme: dark; --bg: #000; --fg: #fff; --accent: #00e5ff; }
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100dvh; overflow: hidden;
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none;
}
body { position: fixed; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; }
.media { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; object-fit: cover; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; background: #000; touch-action: none; }
.ver {
  position: absolute; z-index: 2; left: 50%; transform: translateX(-50%);
  top: calc(4px + env(safe-area-inset-top)); font-size: 10px; color: rgba(255,255,255,0.55);
  font-family: ui-monospace, Menlo, monospace; pointer-events: none; white-space: nowrap;
}
.toast {
  position: absolute; z-index: 3; left: 50%; top: 42%; transform: translate(-50%, -50%);
  background: rgba(14,17,22,0.86); border: 1px solid rgba(255,255,255,0.35); border-radius: 14px;
  padding: 14px 20px; font-size: 18px; font-weight: 700; white-space: nowrap;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.gate { position: absolute; inset: 0; z-index: 4; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); }
.gate.show { display: flex; }
.gateBtn { font: inherit; font-size: 20px; font-weight: 700; padding: 16px 28px; border-radius: 14px; border: 0; background: var(--accent); color: #06222a; }
.debug {
  position: absolute; z-index: 2; left: 50%; transform: translateX(-50%);
  top: calc(18px + env(safe-area-inset-top)); font-size: 11px; color: #fff; background: rgba(0,0,0,0.55);
  padding: 2px 6px; border-radius: 6px; font-family: ui-monospace, Menlo, monospace; pointer-events: none; display: none;
}
.debug.show { display: block; }
.gearBtn {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%);
  top: calc(6.2vh + env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.35); background: rgba(14,17,22,0.66); color: #fff; font-size: 22px; line-height: 1;
}
.sheet {
  position: absolute; z-index: 5; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  background: rgba(14,17,22,0.94); border: 1px solid rgba(255,255,255,0.3); border-radius: 16px;
  padding: 14px 16px; display: none; flex-direction: column; gap: 12px; touch-action: manipulation;
}
.sheet.show { display: flex; }
.srow { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; }
.srow input[type="range"] { width: 100%; height: 32px; accent-color: var(--accent); touch-action: pan-x; }
.stoggles, .sactions { display: flex; gap: 10px; }
.stoggle, .sbtn {
  flex: 1; font: inherit; font-size: 15px; font-weight: 700; padding: 12px 8px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.08); color: #fff;
}
.stoggle[aria-pressed="true"] { background: #fff; color: #0b0d10; }
.sbtn.primary { background: var(--accent); color: #06222a; border-color: var(--accent); }
.recBadge {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); top: calc(5vh + env(safe-area-inset-top));
  display: none; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  background: rgba(14,17,22,0.8); border: 1px solid rgba(255,255,255,0.35); font-size: 18px; font-weight: 700;
}
.recBadge::before { content: ""; width: 12px; height: 12px; border-radius: 6px; background: #e0333a; }
body.mode-recording .recBadge { display: flex; }
body.mode-recording .gearBtn, body.mode-compare .gearBtn, body.mode-compare .ver { display: none; }
.compare { position: absolute; inset: 0; z-index: 4; display: none; pointer-events: none; }
body.mode-compare .compare { display: block; }
.compare > * { pointer-events: auto; }
.cmpRow { display: flex; gap: 10px; }
.cmpTop { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 12px; right: 12px; }
.cmpTop .sbtn { padding-top: 10px; padding-bottom: 10px; }
.cmpBottom {
  position: absolute; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px;
  background: rgba(14,17,22,0.9); border: 1px solid rgba(255,255,255,0.3); touch-action: manipulation;
}
.cmpPos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.cpos {
  font: inherit; font-size: 15px; font-weight: 700; min-height: 44px; padding: 0; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.08); color: #fff;
}
.cpos[aria-pressed="true"] { background: #fff; color: #0b0d10; }
.cmpRow .sbtn { flex: 1; }
.cmpCtl { align-items: stretch; gap: 6px; }
.cmpCtl .sbtn { flex: 0 0 auto; min-height: 44px; padding: 0 10px; font-size: 14px; white-space: nowrap; }
.cmpAlpha { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; font-size: 12px; color: rgba(255,255,255,0.85); }
.cmpAlpha input { width: 100%; min-height: 28px; margin: 0; }
.cmpNote { margin: 0; font-size: 11px; line-height: 1.3; color: rgba(255,255,255,0.75); text-align: center; }
