@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");
@font-face { font-family: "Paperlogy"; font-weight: 700; font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-7Bold.woff2") format("woff2"); }
@font-face { font-family: "Paperlogy"; font-weight: 500; font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-5Medium.woff2") format("woff2"); }

:root {
  --teal: #176C86; --teal-d: #1C6077; --ivory: #FAF9F5; --ink: #212326;
  --coral: #E84958; --apricot: #FFB098; --ok: #1f9d6b; --warn: #d98a00;
  --dark: #0E1315; --dark2: #172024; --dark3: #22303a; --line: rgba(255,255,255,.12);
  --r: 14px;
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ivory); color: var(--ink); -webkit-font-smoothing: antialiased; word-break: keep-all; }
body.dark { background: var(--dark); color: #eef2f3; }
h1, h2, h3, .ttl { font-family: "Paperlogy", "Pretendard Variable", sans-serif; font-weight: 700; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.hide { display: none !important; }
.muted { opacity: .7; }
.small { font-size: 13px; }

/* ── 버튼 ── */
.btn { appearance: none; border: 0; border-radius: 12px; padding: 13px 20px; font-weight: 700; font-size: 16px;
  background: var(--teal); color: #fff; cursor: pointer; display: inline-flex; text-decoration: none; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s, background .15s, opacity .15s; }
.btn:hover { background: var(--teal-d); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.ghost:hover { background: rgba(127,127,127,.12); }
.btn.coral { background: var(--coral); }
.btn.coral:hover { background: #cf3a48; }
.btn.light { background: #fff; color: var(--ink); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* ── 입장 카드 ── */
.gate { min-height: 100%; display: grid; place-items: center; padding: 28px 18px; }
.card { width: 100%; max-width: 460px; background: #fff; border-radius: 22px; padding: 30px 26px; box-shadow: 0 10px 40px rgba(23,108,134,.10); }
body.dark .card { background: var(--dark2); box-shadow: none; border: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--teal); font-weight: 700; font-size: 13px; letter-spacing: .02em; margin-bottom: 14px; }
body.dark .brand { color: #8fd0e3; }
.brand i { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); display: inline-block; }
.card h1 { font-size: 26px; line-height: 1.3; margin: 0 0 6px; }
.card p.lead { margin: 0 0 22px; line-height: 1.6; color: #555; font-size: 15px; }
body.dark .card p.lead { color: #b9c6cb; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #444; }
body.dark .field span { color: #b9c6cb; }
.field input, .field select { width: 100%; padding: 13px 14px; border-radius: 11px; border: 1.5px solid #d9dedf; background: #fff; color: var(--ink); font-size: 16px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--teal); }
body.dark .field input, body.dark .field select { background: var(--dark3); border-color: transparent; color: #fff; }
.prefix { display: flex; align-items: stretch; }
.prefix b { display: grid; place-items: center; padding: 0 12px; background: #eef4f6; border: 1.5px solid #d9dedf; border-right: 0; border-radius: 11px 0 0 11px; color: var(--teal); font-size: 15px; }
.prefix input { border-radius: 0 11px 11px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.55; background: #f4f7f8; padding: 13px 14px; border-radius: 12px; margin: 6px 0 18px; cursor: pointer; }
body.dark .check { background: var(--dark3); }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--teal); flex: none; }
.err { color: var(--coral); font-size: 14px; min-height: 20px; margin: 4px 0 8px; font-weight: 600; }
.note { font-size: 13px; color: #6b7477; line-height: 1.6; margin-top: 16px; }
body.dark .note { color: #93a2a8; }

/* ── 장치 점검 ── */
.preview { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 16/10; margin-bottom: 14px; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.meter { height: 8px; border-radius: 4px; background: #e6ebec; overflow: hidden; margin: 2px 0 14px; }
body.dark .meter { background: var(--dark3); }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), #4fc3a1); transition: width .08s; }
.tips { margin: 0 0 16px; padding: 0; list-style: none; font-size: 14px; line-height: 1.6; }
.tips li { padding-left: 18px; position: relative; margin-bottom: 4px; }
.tips li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--apricot); }

/* ── 상태 표시 ── */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(127,127,127,.16); white-space: nowrap; }
.chip.ok { background: rgba(31,157,107,.16); color: #1f9d6b; }
.chip.warn { background: rgba(217,138,0,.16); color: #d98a00; }
.chip.bad { background: rgba(232,73,88,.16); color: var(--coral); }
.chip.on { background: var(--coral); color: #fff; }
.chip.teal { background: rgba(23,108,134,.16); color: #5cb8d4; }
body:not(.dark) .chip.teal { color: var(--teal); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); display: inline-block; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ── 영상 무대 ── */
.stage { position: fixed; inset: 0; background: var(--dark); display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(0,0,0,.35); z-index: 3; }
.topbar .ttl { font-size: 17px; }
.topbar .sp { flex: 1; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; padding: 4px 12px; border-radius: 10px; background: rgba(255,255,255,.08); }
.timer.q { background: rgba(255,176,152,.22); color: var(--apricot); }
.timer.over { background: var(--coral); color: #fff; }
.vbox { position: relative; flex: 1; min-height: 0; }
.vbox video.main { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.pip { position: absolute; right: 14px; bottom: 96px; width: 26%; max-width: 260px; min-width: 110px; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; background: #111; box-shadow: 0 6px 24px rgba(0,0,0,.5); border: 2px solid rgba(255,255,255,.18); z-index: 2; }
.pip video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.label { position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; border-radius: 8px; background: rgba(0,0,0,.55); font-size: 13px; font-weight: 700; z-index: 2; }
.ctrls { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 12px; z-index: 3; }
.cbtn { width: 58px; height: 58px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(6px); }
.cbtn svg { width: 24px; height: 24px; }
.cbtn.off { background: var(--coral); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; z-index: 1; color: #cfd8db; }
.overlay h2 { color: #fff; margin: 0 0 8px; font-size: 24px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: #8fd0e3; animation: spin 1s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.netbar { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); background: var(--coral); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; z-index: 50; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 60; box-shadow: 0 6px 24px rgba(0,0,0,.3); }

@media (max-width: 640px) {
  .card { padding: 24px 20px; border-radius: 18px; }
  .card h1 { font-size: 22px; }
  .pip { bottom: 92px; width: 30%; }
  .cbtn { width: 52px; height: 52px; }
}
