/* CamWifi — styles communs (PC + téléphone) */
:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-2: #232733;
  --line: #2c3140;
  --txt: #e8eaf0;
  --muted: #8b92a3;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --rec: #ff4d5e;
  --warn: #f5b84b;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
h2 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.card { background: var(--panel); border-radius: var(--radius); padding: 16px; }

.state { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.rec { background: var(--rec); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.sub { color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 6px; }
.sub.err { color: var(--rec); }

button, select {
  font: inherit;
  color: var(--txt);
}

button {
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 12px 14px;
  font-weight: 600;
  background: var(--panel-2);
  cursor: pointer;
  text-align: left;
  transition: filter .15s, opacity .15s;
}
button:hover:not(:disabled) { filter: brightness(1.15); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--accent); color: #fff; }
button.danger { background: var(--rec); color: #fff; }

select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
}

label.field { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

/* ---------------- Page PC ---------------- */
.pc {
  display: grid;
  grid-template-columns: 1fr 340px;
  height: 100vh;
  height: 100dvh;
}

.stage {
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage .overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 10px;
  color: var(--muted); font-size: 16px; line-height: 1.5;
  background: #000;
}
.stage .overlay.hidden { display: none; }
.stage .badge {
  position: absolute; top: 14px; left: 14px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 13px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; display: none; align-items: center; gap: 8px;
}
.stage .badge.show { display: flex; }

.side {
  background: var(--panel);
  overflow-y: auto;
  padding: 18px 18px 24px;
  display: flex; flex-direction: column; gap: 18px;
  border-left: 1px solid var(--line);
}
.side .stack { display: flex; flex-direction: column; gap: 8px; }

.qr {
  background: #fff; border-radius: 12px; padding: 12px;
  display: flex; align-items: center; justify-content: center;
}
.qr img, .qr svg { width: 100%; height: auto; display: block; image-rendering: pixelated; }

.link {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  color: var(--accent); word-break: break-all; cursor: pointer; margin-top: 8px;
  background: none; padding: 0; text-align: left; font-weight: 400;
}

.info { font-size: 13px; color: var(--muted); line-height: 1.55; }
.info b { color: var(--txt); font-weight: 600; }

kbd {
  font-family: inherit; font-size: 12px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); color: var(--txt); padding: 10px 16px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 820px) {
  .pc { grid-template-columns: 1fr; grid-template-rows: 56vh auto; height: auto; }
  .side { border-left: 0; }
}

/* ---------------- Page téléphone ---------------- */
.phone {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
}
.phone button { padding: 15px; font-size: 16px; text-align: center; }
.phone video { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16 / 9; object-fit: contain; }
