:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: rgba(20, 21, 28, .82);
  --panel-strong: #14151c;
  --line: rgba(255, 255, 255, .09);
  --muted: #9699a8;
  --text: #f7f7fb;
  --red: #ff3d4f;
  --red-deep: #d71932;
  --green: #41d890;
  --radius: 22px;
  --shadow: 0 30px 90px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 61, 79, .12), transparent 34rem),
    linear-gradient(180deg, #0b0c11 0%, var(--bg) 70%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.ambient {
  position: fixed;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .1;
  pointer-events: none;
}
.ambient-one { top: 15rem; left: -15rem; background: #ff2847; }
.ambient-two { top: 34rem; right: -18rem; background: #7045ff; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: white;
  text-decoration: none;
  font-weight: 780;
  letter-spacing: -.03em;
  font-size: 18px;
}
.brand-mark {
  width: 31px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff5665, var(--red-deep));
  box-shadow: 0 8px 24px rgba(255, 61, 79, .3);
}
.brand-mark span {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid white;
}
.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b7bac7;
  background: rgba(255,255,255,.025);
  font-size: 12px;
}
.header-pill i, .status-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(65,216,144,.1);
}

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.intro { padding: 74px 0 38px; text-align: center; }
.eyebrow {
  margin: 0 0 15px;
  color: #ff7b87;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .19em;
}
h1 {
  max-width: 850px;
  margin: 0 auto;
  font-size: clamp(42px, 7vw, 76px);
  line-height: .99;
  letter-spacing: -.065em;
  font-weight: 830;
}
h1 span {
  background: linear-gradient(90deg, #ff6b78, #ff2d4b 58%, #ff817b);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.lede {
  max-width: 670px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.workspace { max-width: 1050px; margin: 0 auto; }
.control-card {
  position: relative;
  z-index: 3;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 19, 25, .82);
  box-shadow: 0 20px 70px rgba(0,0,0,.24);
  backdrop-filter: blur(22px);
}
.control-card label[for="telegram-url"] {
  display: block;
  margin: 0 0 10px 3px;
  color: #d5d7df;
  font-size: 12px;
  font-weight: 700;
}
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) 154px; gap: 10px; }
.url-field {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 0 15px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 13px;
  background: #0d0e13;
  transition: border-color .2s, box-shadow .2s;
}
.url-field:focus-within { border-color: rgba(255,61,79,.75); box-shadow: 0 0 0 4px rgba(255,61,79,.08); }
.url-field svg { width: 20px; flex: 0 0 auto; fill: none; stroke: #777b8d; stroke-width: 1.8; stroke-linecap: round; }
.url-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  font-size: 14px;
}
.url-field input::placeholder { color: #606373; }
.paste-button {
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(255,255,255,.07);
  color: #c8cad4;
  font-size: 11px;
  font-weight: 700;
}
.paste-button:hover { background: rgba(255,255,255,.11); }
select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 13px;
  padding: 0 13px;
  outline: 0;
  background: #0d0e13;
  color: #d8dae2;
  font-size: 12px;
}
.load-button {
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 13px;
  color: white;
  background: linear-gradient(135deg, #ff5262, #e11c39);
  box-shadow: 0 14px 34px rgba(225,28,57,.24);
  font-size: 13px;
  font-weight: 760;
  transition: transform .2s, filter .2s;
}
.load-button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.load-button:disabled { cursor: progress; opacity: .65; transform: none; }
.load-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.form-footer { min-height: 24px; margin: 11px 3px -2px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #6f7281; font-size: 11px; }
.mute-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.mute-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mute-toggle span { width: 28px; height: 16px; position: relative; border-radius: 999px; background: #30323d; transition: .2s; }
.mute-toggle span::after { content: ""; position: absolute; width: 10px; height: 10px; top: 3px; left: 3px; border-radius: 50%; background: #868999; transition: .2s; }
.mute-toggle input:checked + span { background: rgba(255,61,79,.32); }
.mute-toggle input:checked + span::after { left: 15px; background: #ff6876; }

.player-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.video-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 43%, rgba(255,61,79,.08), transparent 40%),
    #050609;
}
.video-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px rgba(0,0,0,.24); }
video { width: 100%; height: 100%; display: none; background: black; object-fit: contain; }
.player-card.has-video video { display: block; }
.empty-state { display: grid; place-items: center; gap: 9px; text-align: center; color: #d0d2dc; }
.empty-state p { margin: 0; color: #696c7a; font-size: 13px; }
.empty-icon { width: 62px; height: 47px; display: grid; place-items: center; margin-bottom: 5px; border: 1px solid rgba(255,255,255,.1); border-radius: 15px; background: rgba(255,255,255,.04); }
.empty-icon span { width: 0; height: 0; margin-left: 4px; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 13px solid #707383; }
.loader { z-index: 2; position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(5,6,9,.88); backdrop-filter: blur(14px); }
.loader[hidden] { display: none; }
.spinner { width: 42px; height: 42px; margin-bottom: 18px; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
.loader strong { font-size: 15px; }
.loader span { margin-top: 7px; color: #7f8291; font-size: 12px; }
.loading-track { width: min(260px, 55%); height: 3px; margin-top: 22px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.loading-track span { display: block; width: 28%; height: 100%; margin: 0; border-radius: inherit; background: linear-gradient(90deg, #ff6674, #ff2a48); animation: loading 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loading { 0% { transform: translateX(-110%); } 100% { transform: translateX(420%); } }

.unmute-button {
  z-index: 4;
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  color: white;
  background: rgba(13,14,19,.82);
  backdrop-filter: blur(15px);
  font-size: 11px;
  font-weight: 700;
}
.unmute-button[hidden] { display: none; }
.unmute-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.player-info { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 21px 23px 23px; }
.video-copy { min-width: 0; }
.status-row { min-height: 24px; display: flex; align-items: center; gap: 8px; }
.status-badge, .resolution-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 999px; color: #aeb1bd; background: rgba(255,255,255,.05); font-size: 10px; font-weight: 720; text-transform: uppercase; letter-spacing: .05em; }
.status-badge i { width: 6px; height: 6px; background: #747786; box-shadow: none; }
.status-badge.is-live i { background: var(--green); box-shadow: 0 0 0 4px rgba(65,216,144,.09); }
.status-badge.is-busy i { background: #ffb14a; box-shadow: 0 0 0 4px rgba(255,177,74,.09); }
.resolution-badge { color: #ff7b87; background: rgba(255,61,79,.09); }
.video-copy h2 { max-width: 620px; margin: 10px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; letter-spacing: -.025em; }
.video-copy p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #777a89; font-size: 12px; }
.timings { flex: 0 0 auto; display: flex; gap: 8px; }
.timings div { min-width: 86px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.06); border-radius: 12px; background: rgba(255,255,255,.025); }
.timings span { display: block; margin-bottom: 4px; color: #686b79; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.timings strong { color: #d9dbe4; font-size: 12px; }
.error-message { margin: 14px 0 0; padding: 13px 15px; border: 1px solid rgba(255,77,96,.25); border-radius: 13px; color: #ff98a2; background: rgba(255,61,79,.07); font-size: 12px; }

.how-it-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; max-width: 1050px; margin: 18px auto 0; }
.how-it-works article { display: flex; gap: 13px; padding: 18px; border: 1px solid rgba(255,255,255,.065); border-radius: 16px; background: rgba(255,255,255,.018); }
.how-it-works article > span { color: #ff6876; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.how-it-works strong { display: block; margin-bottom: 5px; font-size: 12px; }
.how-it-works p { margin: 0; color: #6f7280; font-size: 11px; line-height: 1.55; }
footer { padding: 54px 20px 30px; color: #4f515d; text-align: center; font-size: 10px; }

@media (max-width: 860px) {
  .input-row { grid-template-columns: 1fr; }
  .url-field { grid-column: auto; }
  .player-info { align-items: flex-start; flex-direction: column; }
  .timings { width: 100%; }
  .timings div { flex: 1; }
  .how-it-works { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .site-header, .page-shell { width: min(100% - 24px, 1180px); }
  .site-header { height: 68px; }
  .header-pill { display: none; }
  .intro { padding: 54px 0 29px; }
  .lede { font-size: 14px; }
  .control-card { padding: 12px; border-radius: 17px; }
  .input-row { grid-template-columns: 1fr; }
  .url-field { grid-column: auto; }
  select, .load-button { height: 48px; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .player-card { border-radius: 18px; }
  .player-info { padding: 17px; }
  .timings { gap: 5px; }
  .timings div { min-width: 0; padding: 9px 8px; }
  .video-copy h2 { font-size: 15px; }
}
