@font-face {
  font-family: "Unbounded";
  src: url("fonts/unbounded-cyrillic-wght-normal.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  src: url("fonts/unbounded-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  src: url("fonts/onest-cyrillic-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("fonts/onest-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #121a2c;
  --bg-deep: #0b111f;
  --panel: #18223a;
  --panel-2: #1e2a47;
  --line: #2a3756;
  --text: #e9edf6;
  --muted: #98a5c0;
  --amber: #ffb347;
  --amber-ink: #2a1a00;
  --cyan: #5fd3c4;
  --coral: #ff6b5e;
  --display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --body: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--body);
  min-height: 100vh;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.15rem/1 var(--display); letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 28px; flex: none; }
.nav { display: flex; gap: 6px; }
.nav a { white-space: nowrap; text-decoration: none; padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--panel); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: #ffc16a; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; }
.hero h1 {
  font: 600 clamp(1.9rem, 4.6vw, 3.5rem)/1.12 var(--display);
  letter-spacing: -0.02em; margin: 0 0 22px; max-width: 18ch;
}
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 56ch; margin: 0 0 30px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- timeline scrubber ---------- */
.scrub { padding: 8px 0 72px; }
.scrub-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px 26px 22px; }
.scrub-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 22px; }
.scrub-head h2 { font: 600 1.1rem/1.3 var(--display); margin: 0; }
.scrub-head .facts { display: flex; gap: 20px; color: var(--muted); }
.scrub-head .facts b { color: var(--text); font-weight: 600; }

.strip {
  position: relative; height: 112px; border-radius: 10px; background: var(--bg-deep);
  overflow: hidden; cursor: ew-resize; touch-action: none; user-select: none;
}
.segs { position: absolute; inset: 0 0 34px 0; }
.seg {
  position: absolute; top: 12px; bottom: 0; padding: 8px 10px; font-size: 0.8rem; font-weight: 500;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--bg-deep);
}
.seg.talk { background: var(--cyan); }
.seg.game { background: var(--amber); }
.seg.pause { background: #6f7c99; }
.seg.final { background: var(--coral); }
.seg + .seg { box-shadow: -2px 0 0 var(--bg-deep); }
.ruler { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; border-top: 1px solid var(--line); }
.tick { position: absolute; top: 0; width: 1px; height: 8px; background: var(--muted); }
.tick.big { height: 14px; }
.tick-label { position: absolute; top: 14px; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted); }
.head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); left: 0; pointer-events: none; }
.head::before {
  content: ""; position: absolute; top: -1px; left: -5px; width: 12px; height: 12px;
  background: var(--text); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.tip {
  position: absolute; top: 50px; left: 8px; background: var(--text); color: var(--bg-deep);
  font: 600 0.8rem/1 var(--display); padding: 6px 8px; border-radius: 6px; white-space: nowrap;
}
.head.flip .tip { left: auto; right: 8px; }

.scrub-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 20px; }
.scrub-foot p { margin: 0; color: var(--muted); max-width: 60ch; }
.scrub-foot strong { color: var(--text); font-weight: 600; }

/* ---------- feature rows ---------- */
.features { padding: 24px 0 72px; }
.features h2, .faq h2 { font: 600 1.6rem/1.2 var(--display); letter-spacing: -0.015em; margin: 0 0 28px; }
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px 40px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.row h3 { font: 600 1.05rem/1.4 var(--display); margin: 0; }
.row p { margin: 0; color: var(--muted); max-width: 62ch; }

.faq { padding: 0 0 80px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--amber); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 20px; color: var(--muted); max-width: 62ch; }

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }

/* ---------- watch page ---------- */
.watch { padding: 28px 0 64px; }
.watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.player { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #000; cursor: pointer; }
.stage canvas { width: 100%; height: 100%; }
.stage .overlay {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 12, 22, 0.55);
  font: 600 1rem/1.4 var(--display); text-align: center; padding: 20px;
}
.stage .overlay[hidden] { display: none; }
.big-play {
  width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--amber); color: var(--amber-ink);
  display: grid; place-items: center; cursor: pointer;
}
.big-play svg { width: 34px; height: 34px; margin-left: 4px; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: var(--amber); border-radius: 50%; margin: 0 auto 14px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.controls { padding: 14px 18px 16px; display: grid; gap: 12px; }
.seek { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.seek .rail { position: absolute; left: 0; right: 0; top: 9px; height: 5px; background: var(--line); border-radius: 3px; }
.seek .buf, .seek .played { position: absolute; left: 0; top: 9px; height: 5px; border-radius: 3px; width: 0; }
.seek .buf { background: var(--cyan); opacity: 0.55; }
.seek .played { background: var(--amber); }
.seek .knob { position: absolute; top: 4px; width: 15px; height: 15px; margin-left: -7px; border-radius: 50%; background: var(--text); left: 0; }
.seek .mark { position: absolute; top: 6px; width: 2px; height: 11px; background: var(--bg-deep); }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--panel); }
.icon-btn svg { width: 18px; height: 18px; }
.time { font: 500 0.9rem/1 var(--display); letter-spacing: -0.01em; }
.time span { color: var(--muted); }
.spacer { flex: 1; }
.sel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }

.meta { padding: 22px 4px 0; }
.meta h1 { font: 600 1.4rem/1.3 var(--display); letter-spacing: -0.015em; margin: 0 0 10px; }
.meta .facts { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); }
.meta .facts b { color: var(--text); font-weight: 600; }
.meta .actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }

.chat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; height: 560px; }
.chat h2 { font: 600 0.95rem/1 var(--display); margin: 0; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.chat ol { list-style: none; margin: 0; padding: 12px 18px; overflow: hidden; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 9px; }
.chat li { font-size: 0.9rem; line-height: 1.45; overflow-wrap: anywhere; }
.chat li b { font-weight: 600; margin-right: 6px; }
.chat .empty { color: var(--muted); }

/* ---------- save page ---------- */
.save { padding: 56px 0 72px; }
.save h1 { font: 600 clamp(1.7rem, 3.6vw, 2.6rem)/1.15 var(--display); letter-spacing: -0.02em; margin: 0 0 14px; max-width: 20ch; }
.save .lead { color: var(--muted); max-width: 58ch; margin: 0 0 30px; }
.lookup { display: flex; gap: 10px; flex-wrap: wrap; max-width: 760px; }
.lookup input {
  flex: 1 1 320px; min-width: 0; background: var(--bg-deep); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 16px;
}
.lookup input::placeholder { color: #66738f; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 10px 0 0; }
.hint.err { color: var(--coral); }

.found { margin-top: 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; max-width: 980px; }
.found[hidden] { display: none; }
.thumb { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.thumb canvas { width: 100%; height: 100%; }
.found h2 { font: 600 1.15rem/1.35 var(--display); margin: 0 0 6px; }
.found .by { color: var(--muted); margin: 0 0 18px; }
.opts { display: grid; gap: 8px; margin: 0 0 20px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.opt:hover { background: var(--panel-2); }
.opt input { accent-color: var(--amber); }
.opt .name { font-weight: 600; flex: 1; }
.opt .size { color: var(--muted); }
.opt:has(input:checked) { border-color: var(--amber); }

.job { margin-top: 6px; }
.job[hidden] { display: none; }
.progress { height: 8px; background: var(--bg-deep); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--amber); }
.job .stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 14px; color: var(--muted); }
.job .stats b { color: var(--text); font-weight: 600; }
.job .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.recent { margin-top: 56px; max-width: 980px; }
.recent h2 { font: 600 1.2rem/1.3 var(--display); margin: 0 0 18px; }
.recent-list { border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: minmax(0, 1fr) 190px 150px; gap: 8px 22px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.item .t { font-weight: 600; }
.item .s { color: var(--muted); font-size: 0.9rem; }
.item .progress { height: 6px; }
.item .state { text-align: right; font-size: 0.9rem; color: var(--muted); }
.item .state.warn { color: var(--amber); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .watch-grid { grid-template-columns: 1fr; }
  .chat { height: 340px; }
  .row { grid-template-columns: 1fr; }
  .found { grid-template-columns: 1fr; }
  .thumb { max-width: 360px; }
  .item { grid-template-columns: 1fr; }
  .item .state { text-align: left; }
}
@media (max-width: 560px) {
  .hero { padding-top: 44px; }
  .nav { gap: 0; }
  .nav a { padding: 8px 7px; font-size: 0.82rem; }
  .top .wrap { gap: 6px; }
  .brand { font-size: 1.05rem; gap: 8px; }
  .scrub-box { padding: 18px 16px; }
  .scrub-head .facts { gap: 14px; }
  .tick-label.hide-s { display: none; }
}

@media (max-width: 430px) { .nav .more { display: none; } }
