
:root{
  color-scheme:dark;
  --bg:#070b14;--panel:#0d1422;--line:#253148;--muted:#8e9bb1;
  --text:#f7f9fc;--accent:#65e6b4;--danger:#ff7272;--blue:#79a8ff;
}
*{box-sizing:border-box}
body{
  margin:0;min-height:100vh;font-family:Inter,ui-sans-serif,system-ui,-apple-system,
  BlinkMacSystemFont,"Segoe UI",sans-serif;background:
  radial-gradient(circle at 15% 0%,#112746 0,transparent 37%),
  radial-gradient(circle at 100% 100%,#112c27 0,transparent 35%),var(--bg);
  color:var(--text)
}
.wrap{width:min(900px,calc(100% - 28px));margin:0 auto;padding:70px 0}
.card{
  border:1px solid var(--line);border-radius:24px;background:rgba(13,20,34,.94);
  box-shadow:0 30px 100px rgba(0,0,0,.4);padding:36px
}
.eyebrow{font-size:12px;letter-spacing:.16em;color:var(--accent);font-weight:800}
h1{font-size:clamp(32px,7vw,58px);line-height:.95;margin:12px 0 18px}
h1 span{color:var(--accent)}
.lead{max-width:680px;color:var(--muted);font-size:16px;line-height:1.65;margin-bottom:32px}
label{font-size:12px;font-weight:800;letter-spacing:.06em;display:block;margin:0 0 8px}
.inputrow,.outputrow{display:flex;gap:10px}
input,textarea{
  width:100%;border:1px solid var(--line);background:#070c16;color:var(--text);
  border-radius:13px;outline:none;padding:15px;font:inherit
}
input:focus,textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(121,168,255,.12)}
textarea{min-height:94px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}
button{
  border:0;border-radius:13px;padding:0 22px;font-weight:900;cursor:pointer;
  background:var(--accent);color:#062118;min-height:51px
}
button:disabled{opacity:.55;cursor:wait}
.loading,.error,.result{margin-top:24px;border:1px solid var(--line);border-radius:16px;padding:18px}
.loading{display:flex;align-items:center;gap:14px;color:var(--muted)}
.loading strong,.loading span{display:block}.loading strong{color:var(--text);margin-bottom:3px}
.spinner{width:30px;height:30px;border-radius:50%;border:3px solid #26344d;border-top-color:var(--accent);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.error{border-color:rgba(255,114,114,.45);background:rgba(255,114,114,.06);color:#ffb4b4;line-height:1.5}
.statusline{display:flex;gap:11px;align-items:center;margin-bottom:17px}
.statusline small,.statusline strong{display:block}
.statusline small{font-size:10px;color:var(--muted);letter-spacing:.12em;margin-bottom:2px}
.dot{width:13px;height:13px;border-radius:50%;background:var(--accent);box-shadow:0 0 22px var(--accent)}
.metricgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:20px}
.metricgrid div{border:1px solid var(--line);background:#090f1a;border-radius:12px;padding:12px}
.metricgrid span,.metricgrid strong{display:block}.metricgrid span{color:var(--muted);font-size:11px;margin-bottom:4px}
.metricgrid strong{font-size:17px}
.note{color:var(--muted);line-height:1.5;margin-bottom:0;font-size:13px}
details{margin-top:24px;color:var(--muted);font-size:13px;line-height:1.55}
summary{color:#cdd5e3;cursor:pointer;font-weight:700}
code{color:var(--accent)}
.hidden{display:none!important}
@media(max-width:640px){
  .wrap{padding:20px 0}.card{padding:22px 16px;border-radius:18px}
  .inputrow,.outputrow{display:block}
  button{width:100%;margin-top:9px}
  .metricgrid{grid-template-columns:1fr}
}

pre{
  white-space:pre-wrap;word-break:break-word;background:#070c16;color:#cbd5e1;
  border:1px solid var(--line);padding:14px;border-radius:12px;max-height:420px;
  overflow:auto;font-size:11px;line-height:1.45
}


.player-wrap{
  margin-top:20px;
  border:1px solid var(--line);
  background:#070c16;
  border-radius:16px;
  padding:14px;
}
.player-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}
.player-head span{
  color:var(--accent);
  font-size:12px;
  font-weight:800;
}
#videoPlayer{
  display:block;
  width:100%;
  max-height:520px;
  background:#000;
  border-radius:12px;
}
.player-actions,
.technical-actions{
  display:flex;
  gap:10px;
  margin-top:10px;
}
.secondary-btn{
  background:#182235;
  color:#dbe5f4;
  border:1px solid var(--line);
}
.technical-actions{
  margin:10px 0;
}
.technical-actions button{
  min-height:40px;
  padding:8px 14px;
}
@media(max-width:640px){
  .player-actions{
    display:block;
  }
  .player-actions button{
    width:100%;
  }
}


.play-modes{
  margin-top:18px;
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  background:#090f1b;
}
.play-modes-title{
  font-weight:900;
  margin-bottom:10px;
}
.play-mode-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.mode-btn{
  text-align:left;
  min-height:92px;
  padding:12px;
  border-radius:13px;
  border:1px solid var(--line);
  background:#131d2e;
  color:#e9f0fb;
}
.mode-btn strong,
.mode-btn span{
  display:block;
}
.mode-btn span{
  margin-top:6px;
  font-size:12px;
  line-height:1.35;
  opacity:.78;
}
.primary-mode{
  border-color:#45d7a4;
}
.warning-mode{
  border-color:#f0a34b;
}
.capability-box{
  margin-top:10px;
  font-size:12px;
  line-height:1.45;
  color:#b7c5d9;
}
.voe-embed-wrap{
  margin-top:18px;
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  background:#070c16;
}
#voeEmbed{
  display:block;
  width:100%;
  aspect-ratio:16/9;
  min-height:260px;
  background:#000;
  border-radius:12px;
}
@media(max-width:760px){
  .play-mode-grid{
    grid-template-columns:1fr;
  }
}


.bridge-hero{
  margin-top:20px;
  border:1px solid #314057;
  border-radius:18px;
  padding:18px;
  background:#09111f;
}
.bridge-title{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:18px;
}
.bridge-title small,
.bridge-title strong{
  display:block;
}
.bridge-title small{
  color:#6fe8ba;
  font-size:11px;
  letter-spacing:.13em;
  margin-bottom:5px;
}
.zero-pill{
  border:1px solid #61e5b4;
  color:#7df0c5;
  border-radius:999px;
  padding:7px 10px;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.install-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
}
.install-card{
  border:1px solid #28364d;
  background:#0b1423;
  border-radius:14px;
  padding:14px;
}
.install-card p{
  color:#98a9c1;
  font-size:13px;
  line-height:1.5;
}
.step-number{
  display:block;
  color:#6fe8ba;
  font-size:10px;
  font-weight:900;
  letter-spacing:.11em;
  margin-bottom:5px;
}
.bookmarklet-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:0 16px;
  border-radius:12px;
  background:#63e2b5;
  color:#06120e;
  font-weight:900;
  text-decoration:none;
  margin:4px 0 8px;
  cursor:grab;
}
.small-btn{
  min-height:38px;
  padding:7px 11px;
}
.bridge-status{
  margin-top:10px;
  border-radius:11px;
  padding:11px 12px;
  font-size:13px;
  border:1px solid #314057;
}
.bridge-status.waiting{color:#b5c2d5}
.bridge-status.active{border-color:#e2aa57;color:#ffd18a}
.bridge-status.success{border-color:#61e5b4;color:#7df0c5}
.bridge-status.error{border-color:#e56d72;color:#ff9da2}
.ok-dot{
  background:#61e5b4 !important;
  box-shadow:0 0 12px rgba(97,229,180,.55);
}
#bridgeVideo{
  display:block;
  width:100%;
  max-height:560px;
  background:#000;
  border-radius:12px;
}
#bridgeCandidates{
  max-height:360px;
  overflow:auto;
}
.fallback-details{
  margin-top:18px;
}
@media(max-width:760px){
  .install-grid{grid-template-columns:1fr}
  .bridge-title{display:block}
  .zero-pill{display:inline-block;margin-top:10px}
}
