:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: #111317;
  --line: rgba(255,255,255,.11);
  --text: #f4f4f2;
  --muted: #8b9099;
  --accent: #ff496d;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background:
    radial-gradient(circle at 50% -20%, rgba(255,73,109,.16), transparent 38%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(20px, 4vw, 30px); letter-spacing: -.035em; }
.lock {
  min-height: 100vh; display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.lock-card {
  width: min(100%, 360px); padding: 34px 30px 30px; text-align: center;
  border: 1px solid var(--line); border-radius: 28px;
  background: rgba(17,19,23,.88); backdrop-filter: blur(22px);
  box-shadow: 0 30px 90px rgba(0,0,0,.48);
}
.mark {
  display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 22px;
  border-radius: 18px; background: var(--accent); color: white;
  font: 800 25px/1 Georgia, serif; box-shadow: 0 12px 36px rgba(255,73,109,.3);
}
.hint { margin: 10px 0 25px; color: var(--muted); }
.dots { height: 18px; display: flex; justify-content: center; gap: 13px; margin-bottom: 25px; }
.dots i {
  width: 10px; height: 10px; border-radius: 50%; border: 1px solid #61656d;
  transition: .16s ease;
}
.dots i.filled { border-color: var(--accent); background: var(--accent); transform: scale(1.12); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key, .control, .ghost {
  border: 1px solid var(--line); background: rgba(255,255,255,.045); cursor: pointer;
}
.key {
  height: 58px; border-radius: 18px; font-size: 20px; font-weight: 650;
}
.key:active, .control:active { transform: scale(.94); background: rgba(255,73,109,.18); }
.error { min-height: 22px; margin: 15px 0 -8px; color: #ff7892; font-size: 13px; }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

main { width: min(100%, 1240px); margin: 0 auto; padding: 18px 18px 110px; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(4px, env(safe-area-inset-top)) 2px 16px;
}
.ghost {
  display: flex; align-items: center; gap: 7px;
  border-radius: 12px; padding: 9px 13px; color: #b7bbc2;
}
.ghost svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.controls {
  display: grid; justify-items: center; gap: 18px; margin-top: 25px; padding: 22px;
  border: 1px solid var(--line); border-radius: 22px; background: var(--panel);
}
.control {
  width: 58px; height: 58px; border-radius: 18px; font-size: 23px;
  transition: transform .1s, background .1s;
}
.control:disabled {
  opacity: .38; cursor: wait; transform: none; background: rgba(255,255,255,.025);
}
.control.protected {
  opacity: .32; cursor: not-allowed; color: #8b9099;
  background: rgba(255,255,255,.02);
}
.control.protected:active { transform: none; background: rgba(255,255,255,.04); }
.dpad { display: grid; grid-template: repeat(3, 58px) / repeat(3, 58px); gap: 7px; }
.up { grid-area: 1 / 2; } .left { grid-area: 2 / 1; } .center { grid-area: 2 / 2; }
.right { grid-area: 2 / 3; } .down { grid-area: 3 / 2; }
.center { margin: 14px; border: 1px solid var(--line); border-radius: 50%; background: var(--accent); opacity: .75; }
#ptzStatus { margin: -3px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 600px) {
  main { padding: 12px 10px 100px; }
  .stage, .controls { border-radius: 17px; }
  .controls { margin-top: 12px; padding: 16px; }
}
@media (min-width: 900px) {
  main {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    grid-template-rows: auto auto;
    align-content: center;
    gap: 18px;
    padding: 24px;
  }
  header { grid-column: 1 / -1; padding: 0 2px 2px; }
  .stage { grid-column: 1; align-self: start; }
  .controls {
    grid-column: 2; align-self: stretch;
    align-content: center; margin-top: 0; padding: 28px 20px;
  }
  .dpad { grid-template: repeat(3, 64px) / repeat(3, 64px); gap: 9px; }
  .control { width: 64px; height: 64px; border-radius: 20px; }
}
