:root {
  color-scheme: dark;
  --ink: #f7f4ff;
  --muted: #aaa4ba;
  --surface: rgba(24, 21, 34, 0.88);
  --surface-2: #242031;
  --line: rgba(255, 255, 255, 0.1);
  --violet: #8c6cff;
  --violet-soft: #b7a5ff;
  --coral: #ff6e71;
  --yellow: #ffd166;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0910;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 50% 0%, #1c1530 0, #0a0910 48%); }
button, input { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; border-radius: 50%; filter: blur(100px); opacity: .23; pointer-events: none; }
.ambient-one { width: 38vw; height: 38vw; background: #6545ff; top: -24vw; left: 10vw; }
.ambient-two { width: 30vw; height: 30vw; background: #d74269; right: -20vw; bottom: -10vw; }
.topbar { width: min(1180px, calc(100% - 40px)); height: 92px; margin: auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.brand { appearance: none; border: 0; background: none; display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .14em; cursor: pointer; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; }
.brand-logo { display: block; width: 52px; height: 52px; object-fit: contain; }
.mode-pill { color: var(--muted); font-size: 12px; letter-spacing: .12em; font-weight: 700; }
.mode-pill span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #52e1a3; margin-right: 7px; box-shadow: 0 0 12px #52e1a3; }
#app { width: min(1180px, calc(100% - 40px)); margin: auto; min-height: calc(100vh - 92px); position: relative; z-index: 1; }
.hero { min-height: calc(100vh - 92px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 70px 0 110px; }
.eyebrow { margin: 0 0 22px; color: var(--violet-soft); letter-spacing: .22em; font-size: 12px; font-weight: 800; }
h1 { margin: 0; max-width: 900px; font-size: clamp(54px, 9vw, 112px); letter-spacing: -.065em; line-height: .86; font-weight: 800; }
h1 em { color: transparent; background: linear-gradient(90deg, #ad96ff, #ff7e92); background-clip: text; -webkit-background-clip: text; font-style: normal; }
.hero-copy { max-width: 650px; margin: 34px auto 30px; color: var(--muted); font-size: clamp(17px, 2vw, 21px); line-height: 1.55; }
.primary, .secondary { border: 0; border-radius: 14px; padding: 15px 22px; cursor: pointer; font-weight: 750; transition: transform .18s ease, background .18s ease, opacity .18s ease; }
.primary { background: linear-gradient(135deg, var(--violet), #7454e8); box-shadow: 0 12px 36px rgba(118,84,232,.3); }
.secondary { background: var(--surface-2); border: 1px solid var(--line); }
.primary:hover, .secondary:hover { transform: translateY(-2px); }
.primary:disabled, .secondary:disabled { cursor: not-allowed; opacity: .42; transform: none; }
.hero-action { min-width: 220px; padding: 18px 25px; display: flex; justify-content: space-between; gap: 40px; }
.telegram-entry { margin-top: 20px; color: var(--violet-soft); text-decoration: none; font-weight: 650; }
.telegram-entry:hover { color: var(--ink); text-decoration: underline; }
.quick-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-top: 36px; color: #817b90; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); padding: 12px 18px; border: 1px solid rgba(255,209,102,.25); border-radius: 12px; background: rgba(28,24,35,.96); color: var(--yellow); opacity: 0; pointer-events: none; transition: .2s ease; z-index: 50; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.screen-enter { animation: enter .45s cubic-bezier(.2,.7,.2,1) both; }
.flow-screen { width: min(920px, 100%); margin: auto; padding: 58px 0 80px; }
.screen-head { margin-bottom: 34px; }
.step { color: var(--violet-soft) !important; font-size: 11px !important; font-weight: 850; letter-spacing: .2em; text-transform: uppercase; }
h2 { margin: 7px 0 12px; font-size: clamp(38px, 6vw, 66px); line-height: 1; letter-spacing: -.045em; }
h2 em { color: var(--violet-soft); font-style: normal; }
.screen-head > p:last-child { color: var(--muted); font-size: 18px; }
.form-card, .roles-card, .line-card { padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); backdrop-filter: blur(20px); box-shadow: 0 30px 80px rgba(0,0,0,.22); }
.form-card { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: end; }
.form-card label { display: grid; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.form-card input { width: 100%; padding: 17px 18px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #0e0c16; color: var(--ink); font-size: 20px; text-transform: none; }
.form-card input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(140,108,255,.16); }
.versus { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; color: var(--coral); font-weight: 850; }
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.actions.centered { justify-content: center; }
.pack-grid { display: grid; gap: 14px; }
.pack-card { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 24px; padding: 0; overflow: hidden; text-align: left; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); cursor: pointer; transition: .2s ease; }
.pack-card:hover { border-color: rgba(140,108,255,.7); transform: translateY(-2px); background: #1d1928; }
.pack-card > b { padding-right: 25px; color: var(--violet-soft); font-size: 24px; }
.pack-poster { height: 120px; position: relative; overflow: hidden; background: linear-gradient(135deg, #32265d, #572638); }
.pack-poster img { width: 100%; height: 100%; object-fit: cover; }
.pack-poster img.missing { display: none; }
.pack-poster span { position: absolute; left: 12px; bottom: 10px; font-size: 28px; font-weight: 900; opacity: .65; }
.pack-info small, .role-row small { color: var(--violet-soft); font-size: 10px; letter-spacing: .16em; font-weight: 800; }
.pack-info h3 { margin: 7px 0 4px; font-size: 24px; }
.pack-info p { margin: 0; color: var(--muted); font-size: 14px; }
.empty-state { padding: 50px; text-align: center; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); }
.roles-card { display: grid; gap: 12px; }
.role-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 20px; border-radius: 15px; background: rgba(255,255,255,.035); }
.role-row div { display: grid; gap: 5px; }
.role-row strong { font-size: 23px; }
.role-row > span { color: var(--muted); font-size: 13px; }
.role-row > b { color: var(--violet-soft); text-align: right; font-size: 23px; }
.shuffle, .text-button { justify-self: center; border: 0; background: none; color: var(--violet-soft); cursor: pointer; padding: 12px; }
.record-head { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
.record-head h2 { font-size: clamp(31px, 5vw, 49px); margin-bottom: 0; }
.record-head h2 span { color: var(--muted); font-size: .48em; font-weight: 500; letter-spacing: 0; }
progress { appearance: none; -webkit-appearance: none; overflow: hidden; border: 0; border-radius: 99px; background: #252131; }
progress::-webkit-progress-bar { background: #252131; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--violet), var(--coral)); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--violet), var(--coral)); border-radius: 99px; }
.line-progress { width: 230px; height: 8px; margin-bottom: 7px; }
.line-card { min-height: 355px; display: flex; flex-direction: column; justify-content: space-between; text-align: center; }
.timecode { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; letter-spacing: .1em; }
.timecode span { color: var(--yellow); margin-left: 14px; }
blockquote { margin: 32px auto; max-width: 750px; font-size: clamp(30px, 5vw, 52px); line-height: 1.08; letter-spacing: -.035em; font-weight: 750; }
.record-status { color: var(--muted); font-variant-numeric: tabular-nums; }
.record-status.ready { color: #62e6ac; }
.record-status.live { color: #ff7578; animation: pulse 1s ease infinite; }
.record-tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.record-button { min-width: 170px; padding: 15px 22px; border: 0; border-radius: 14px; background: var(--coral); color: white; font-weight: 800; cursor: pointer; box-shadow: 0 12px 32px rgba(255,110,113,.2); }
.record-button:disabled { opacity: .45; }
.premiere-ready { min-height: calc(100vh - 220px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.premiere-ready p:not(.eyebrow) { max-width: 600px; color: var(--muted); font-size: 19px; }
.premiere-ready small { margin-top: 20px; color: #716b7e; }
.clapper { font-size: 76px; filter: drop-shadow(0 15px 25px rgba(140,108,255,.3)); }
.premiere-button { margin-top: 18px; padding: 18px 28px; font-size: 18px; }
.cinema { padding: 25px 0 50px; }
.cinema-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: #000; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.cinema-frame video { width: 100%; height: 100%; object-fit: contain; }
.cinema-overlay { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; background: rgba(4,3,7,.78); transition: opacity .25s ease; }
.cinema-overlay.hidden { opacity: 0; pointer-events: none; }
.cinema-overlay span { color: var(--violet-soft); font-size: 11px; letter-spacing: .2em; font-weight: 850; }
.cinema-overlay strong { font-size: 80px; }
.premiere-meta { display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; margin-top: 17px; color: var(--muted); font-size: 12px; }
.premiere-progress { width: 100%; height: 5px; }
@keyframes pulse { 50% { opacity: .5; } }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 640px) {
  .topbar, #app { width: min(100% - 28px, 1180px); }
  .mode-pill { display: none; }
  .hero { padding-bottom: 70px; }
  .quick-facts { flex-direction: column; gap: 10px; }
  .flow-screen { padding-top: 35px; }
  .form-card { grid-template-columns: 1fr; }
  .versus { margin: auto; }
  .pack-card { grid-template-columns: 95px 1fr; gap: 15px; }
  .pack-card > b { display: none; }
  .pack-poster { height: 110px; }
  .role-row { grid-template-columns: 1fr; gap: 7px; text-align: center; }
  .role-row > b { text-align: center; }
  .record-head { display: block; }
  .line-progress { width: 100%; margin-top: 15px; }
  .line-card { padding: 20px 15px; }
  .actions { flex-wrap: wrap; }
  .actions > button { flex: 1; }
  .premiere-meta b { display: none; }
}

.sound-mixer { display: grid; gap: 12px; max-width: 540px; margin: 20px auto; padding: 20px; border: 1px solid #ffffff20; border-radius: 16px; }
.sound-mixer label { display: flex; justify-content: space-between; gap: 12px; }
.sound-mixer input { width: 100%; min-height: 32px; accent-color: #d5ff5f; }
.sound-mixer output { font-variant-numeric: tabular-nums; }
