:root {
  --teal: #0ea5a4;
  --teal-dark: #0b807f;
  --bg: #0f1720;
  --panel: #1a2430;
  --panel-2: #222f3d;
  --text: #e6edf3;
  --muted: #8ba0b2;
  --danger: #e05260;
  --ok: #3ad29f;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--panel); border-bottom: 1px solid #0006;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; }
.logo circle { fill: var(--teal); }
.logo path { stroke: var(--teal); }
.brand-name { font-weight: 800; letter-spacing: 1px; }
.brand-tag { color: var(--muted); font-size: 12px; }
.status { font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.status--off { background: #4a2328; color: #ff9aa5; }
.status--on { background: #11362e; color: var(--ok); }

.home {
  max-width: 820px; margin: 36px auto; padding: 0 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
@media (max-width: 680px) { .home { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border-radius: var(--radius); padding: 24px;
  border: 1px solid #ffffff0d;
}
.card h2 { margin: 0 0 14px; font-size: 16px; }
.id-big {
  font-size: 34px; font-weight: 800; letter-spacing: 2px; color: var(--teal);
  font-variant-numeric: tabular-nums; margin-bottom: 12px;
}
.muted { color: var(--muted); font-size: 13px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .dialog input[type=text] {
  width: 100%; padding: 12px 14px; font-size: 18px; border-radius: 10px;
  border: 1px solid #ffffff1a; background: var(--panel-2); color: var(--text);
  letter-spacing: 1px;
}
.btn {
  border: none; cursor: pointer; font-size: 15px; font-weight: 600;
  padding: 11px 18px; border-radius: 10px; transition: .15s; color: #fff;
}
.btn--primary { background: var(--teal); }
.btn--primary:hover { background: var(--teal-dark); }
.btn--ghost { background: var(--panel-2); color: var(--text); }
.btn--danger { background: var(--danger); }
.btn--small { padding: 7px 12px; font-size: 13px; }
.hint { font-size: 13px; margin-top: 10px; min-height: 18px; }
.hint.err { color: #ff9aa5; }

.overlay {
  position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 50;
}
.dialog {
  background: var(--panel); padding: 26px; border-radius: var(--radius);
  width: min(420px, 92vw); border: 1px solid #ffffff14;
}
.dialog h3 { margin: 0 0 12px; }
.check, .switch { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 14px 0; }
.countdown { font-size: 13px; color: var(--muted); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.session { position: fixed; inset: 0; background: #0a0f14; display: flex; flex-direction: column; z-index: 40; }
.session-bar {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: var(--panel); font-size: 14px; border-bottom: 1px solid #0006;
}
.spacer { flex: 1; }
.switch input { width: auto; }
.screen-wrap { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; }
#remote-video { max-width: 100%; max-height: 100%; background: #000; }
.screen-msg {
  position: absolute; color: var(--muted); font-size: 15px; pointer-events: none;
}

.host-indicator {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--teal); border-radius: 999px;
  padding: 8px 14px; display: flex; align-items: center; gap: 10px; font-size: 13px; z-index: 45;
}
.host-indicator .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.remote-cursor {
  position: fixed; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--teal); background: #0ea5a455; pointer-events: none; z-index: 60;
  transform: translate(-50%, -50%); transition: left .03s linear, top .03s linear;
}
.key-feed {
  position: fixed; bottom: 60px; right: 18px; background: #000c; color: var(--teal);
  font-family: monospace; font-size: 13px; padding: 8px 12px; border-radius: 8px; z-index: 60;
  max-width: 260px;
}
.hidden { display: none !important; }
