*{box-sizing:border-box}
:root{color-scheme:dark}
html,body{margin:0;min-height:100%;background:#080b10;color:#edf2f7;font-family:Segoe UI,Arial,sans-serif}
body{display:flex;justify-content:center}
.page{width:min(1500px,100%);padding:22px}
.header{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:16px}
.kicker{font-size:11px;letter-spacing:.2em;color:#8995a5}
h1{margin:4px 0 7px;font-size:29px;font-weight:600}
.status{display:flex;align-items:center;gap:8px;font-size:13px;color:#aeb8c5}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:#788391}
.dot.online{background:#39d17d;box-shadow:0 0 10px rgba(57,209,125,.65)}
.dot.error{background:#ff5b63}
.station{text-align:right;line-height:1.15}
.station strong{display:block;font-size:24px;letter-spacing:.11em}
.station span{display:block;margin-top:4px;font-size:12px;letter-spacing:.08em;color:#9ba6b4}
.viewer-card{padding:10px;border:1px solid #242c38;border-radius:14px;background:#10151d;box-shadow:0 18px 55px rgba(0,0,0,.35)}
.viewer{position:relative;width:100%;height:min(72vh,820px);min-height:430px;overflow:hidden;border-radius:9px;background:#020407;cursor:grab;touch-action:none}
.viewer:active{cursor:grabbing}
#sourceVideo{position:absolute;width:2px;height:2px;opacity:.001;pointer-events:none}
#canvas{display:block;width:100%;height:100%}
.overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;background:radial-gradient(circle at center,#141c26,#040609 72%);text-align:center;padding:20px}
.overlay.hidden{display:none}
.overlay strong{font-size:20px}
.overlay span{font-size:13px;color:#aeb8c5;max-width:650px}
.spinner{width:34px;height:34px;border:3px solid #313a47;border-top-color:#e8edf4;border-radius:50%;animation:spin .9s linear infinite;margin-bottom:6px}
@keyframes spin{to{transform:rotate(360deg)}}
.live-badge{position:absolute;top:16px;left:16px;padding:7px 10px;border-radius:7px;background:rgba(5,8,12,.68);backdrop-filter:blur(5px);font-size:11px;font-weight:700;letter-spacing:.08em}
.live-badge span{display:inline-block;width:7px;height:7px;border-radius:50%;background:#ff4d57;margin-right:6px;box-shadow:0 0 8px rgba(255,77,87,.7)}
.help{position:absolute;left:16px;bottom:16px;padding:8px 11px;border-radius:8px;background:rgba(5,8,12,.68);font-size:12px;color:#d4dbe4;pointer-events:none}
.controls{position:absolute;right:16px;bottom:16px;display:flex;gap:6px;z-index:20;pointer-events:auto}
.controls button{width:42px;height:42px;pointer-events:auto;touch-action:manipulation;border:1px solid #3b4654;border-radius:8px;background:rgba(8,12,18,.78);color:#fff;font-size:20px;cursor:pointer}
.controls button:hover{background:#222b36}
.info{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}
.info div{padding:13px 15px;background:#10151d;border:1px solid #242c38;border-radius:10px}
.info b{display:block;margin-bottom:5px;font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:#7f8997}
.info span{font-size:13px;color:#dce2e9}
footer{display:flex;justify-content:space-between;padding:13px 4px 0;font-size:11px;color:#697586}
@media(max-width:800px){
  .page{padding:10px}
  h1{font-size:23px}
  .station strong{font-size:19px}
  .viewer{height:65vh;min-height:320px}
  .info{grid-template-columns:1fr}
  .help{display:none}
}
