/* OneYoga Live — веб-клиент. Бренд-палитра: золото #C4A77D, тёплый фон #F8F5F1. */
:root {
  --gold: #C4A77D;
  --gold-dark: #A88A5E;
  --ink: #4A4035;
  --muted: #7A6F63;
  --faint: #9E9489;
  --bg: #F8F5F1;
  --card: #FDF8F3;
  --line: #E8E0D6;
  --green: #4A8050;
  --red: #E0556A;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(74, 64, 53, 0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 248, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: "Cormorant Garamond", serif; font-size: 26px; font-weight: 700; color: var(--ink); }
.brand-accent { color: var(--gold); }
.brand-sub { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.header-right { display: flex; align-items: center; gap: 14px; }

.lang-switcher { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-btn { border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.lang-btn.active { background: var(--gold); color: #fff; }

.user-box { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 14px; font-weight: 500; color: var(--ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout */
.app-main { max-width: 1180px; margin: 0 auto; padding: 26px 18px 60px; }

/* Buttons */
.btn { font-family: inherit; font-size: 15px; font-weight: 600; border: none; border-radius: 12px; padding: 11px 18px; cursor: pointer; transition: transform .08s, opacity .15s, background .15s; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--muted); padding: 8px 12px; }
.btn-ghost:hover { color: var(--ink); }
.btn-google { background: #fff; color: #3c4043; border: 1px solid var(--line); width: 100%; }
.btn-google:hover { background: #fafafa; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.login-card { max-width: 380px; margin: 6vh auto 0; text-align: center; }
.login-card h1 { font-family: "Cormorant Garamond", serif; font-size: 30px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.login-card .small { margin-top: 18px; }

.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--faint); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.email-form { display: flex; flex-direction: column; gap: 10px; }
.email-form input, .chat-form input { font-family: inherit; font-size: 15px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.email-form input:focus, .chat-form input:focus { outline: none; border-color: var(--gold); }
.error { color: var(--red); font-size: 13px; margin: 10px 0 0; }

/* Streams list */
.screen-title { font-family: "Cormorant Garamond", serif; font-size: 32px; margin: 0 0 18px; }
.streams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.stream-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.card-top { display: flex; align-items: center; gap: 12px; }
.card-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.card-avatar--ph { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.card-meta { min-width: 0; }
.card-title { font-weight: 600; font-size: 16px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-instructor { font-size: 13px; color: var(--muted); }
.card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; }
.badge-live { background: var(--red); color: #fff; }
.badge-scheduled { background: var(--line); color: var(--muted); }
.badge-public { background: rgba(74,128,80,0.14); color: var(--green); }
.badge-private { background: rgba(155,89,182,0.14); color: #8E44AD; }
.viewers { font-size: 12px; color: var(--faint); margin-left: auto; }
.card-join { width: 100%; }
.empty { color: var(--muted); font-size: 15px; padding: 40px 0; text-align: center; }

/* Viewer */
.viewer { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.viewer-main { display: flex; flex-direction: column; gap: 12px; }
.back-btn { align-self: flex-start; }
.video-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #1a1714; border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-placeholder { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #d8cfc4; text-align: center; padding: 20px; }
.fs-btn { position: absolute; right: 12px; bottom: 12px; z-index: 5; width: 40px; height: 40px; border: none; border-radius: 10px; background: rgba(0,0,0,0.5); color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.fs-btn:hover { background: rgba(0,0,0,0.72); }
.sound-btn { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 6; border: none; border-radius: 999px; background: var(--gold); color: #fff; font-size: 14px; font-weight: 600; padding: 10px 18px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
.sound-btn:hover { filter: brightness(1.05); }
.video-stage:fullscreen, .video-stage:-webkit-full-screen { border-radius: 0; width: 100vw; height: 100vh; aspect-ratio: auto; }
.viewer-meta { padding: 2px 4px; }
.vm-title { font-size: 18px; font-weight: 600; }
.vm-instructor { font-size: 14px; color: var(--muted); }

/* Chat */
.chat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; height: 70vh; max-height: 640px; overflow: hidden; }
.chat-head { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { font-size: 14px; line-height: 1.4; }
.msg-name { font-weight: 600; color: var(--gold-dark); margin-right: 6px; }
.msg-text { color: var(--ink); word-break: break-word; }
.msg-mine .msg-name { color: var(--green); }
.msg-private { background: rgba(155,89,182,0.08); border-radius: 8px; padding: 4px 8px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: center; }
.chat-form input { flex: 1 1 auto; min-width: 0; }
.chat-send { flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border-radius: 12px; }
.chat-send svg { display: block; }

/* Waiting */
.waiting-card { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.waiting-card h2 { font-family: "Cormorant Garamond", serif; margin: 14px 0 6px; }

/* Spinner / skeleton */
.spinner { width: 34px; height: 34px; border: 3px solid rgba(196,167,125,0.3); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-row { display: contents; }
.skeleton { height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, #efe7dd 25%, #f6efe6 50%, #efe7dd 75%); background-size: 200% 100%; animation: sk 1.3s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* Create form + host */
.streams-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.streams-head .screen-title { margin: 0; }

.create-wrap { display: flex; justify-content: center; padding: 3vh 0 6vh; }
.create-card { position: relative; width: 100%; max-width: 480px; padding: 30px 30px 32px; }
.create-back { position: absolute; left: 14px; top: 14px; }
.create-hero { text-align: center; margin: 14px 0 24px; }
.create-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; background: linear-gradient(135deg, #FDF8F3, #EDE4DA); border: 1px solid var(--line); }
.create-title { font-family: "Cormorant Garamond", serif; font-size: 30px; margin: 0 0 6px; }
.create-sub { font-size: 14px; margin: 0; }
.create-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.create-form input, .create-form textarea { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 15px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); resize: vertical; transition: border-color .15s, box-shadow .15s; }
.create-form input::placeholder, .create-form textarea::placeholder { color: #b8ad9f; }
.create-form input:focus, .create-form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196,167,125,0.18); }
.hint { font-size: 12.5px; color: var(--faint); margin: 0; }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }

.seg { display: flex; gap: 8px; padding: 0; border: none; background: transparent; }
.seg-btn { flex: 1; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; padding: 13px; border-radius: 12px; cursor: pointer; transition: all .15s; }
.seg-btn:hover { border-color: var(--gold); background: #fffdfa; }
.seg-btn.active { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; box-shadow: 0 3px 10px rgba(168,138,94,0.4); }

.host-bar { display: flex; align-items: center; gap: 10px; }
.host-live { color: var(--red); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.host-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.ctrl-btn { font-family: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 11px 16px; cursor: pointer; }
.ctrl-btn:hover { background: #fff; }
.ctrl-btn.ctrl-muted { background: #f0e6e6; color: var(--red); border-color: #e5cccc; }
.ctrl-end { margin-left: auto; background: var(--red); color: #fff; border-color: var(--red); }
.ctrl-end:hover { filter: brightness(1.05); background: var(--red); }
.local-mirror { transform: scaleX(-1); }

.reqs { display: flex; flex-direction: column; gap: 6px; }
.reqs-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.req-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.req-name { font-size: 14px; font-weight: 500; }
.req-actions { display: flex; gap: 6px; }
.req-ok, .req-no { width: 34px; height: 34px; border: none; border-radius: 9px; font-size: 16px; cursor: pointer; color: #fff; }
.req-ok { background: var(--green); }
.req-no { background: var(--red); }

/* Этап 3A: двусторонний зритель, mute-all, PiP-сетка */
.ctrl-btn.ctrl-on { background: var(--green); color: #fff; border-color: var(--green); }
.self-pip { position: absolute; right: 12px; top: 12px; z-index: 5; width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,0.6); background: #000; transform: scaleX(-1); }
.muteall-banner { background: #f0e6e6; color: var(--red); font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 10px; text-align: center; }

.pip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pip-tile { position: relative; aspect-ratio: 4 / 3; background: #1a1714; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pip-video { position: absolute; inset: 0; }
.pip-video video { width: 100%; height: 100%; object-fit: cover; }
.pip-ph { font-size: 26px; font-weight: 700; color: #fff; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-dark)); display: flex; align-items: center; justify-content: center; }
.pip-tile.has-video .pip-ph { display: none; }
.pip-meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 8px; background: linear-gradient(transparent, rgba(0,0,0,0.6)); }
.pip-name { color: #fff; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pip-badges { color: #fff; font-size: 11px; flex-shrink: 0; }
.pip-kick { position: absolute; right: 6px; top: 6px; z-index: 3; width: 26px; height: 26px; border: none; border-radius: 7px; background: rgba(224,85,106,0.9); color: #fff; font-size: 13px; cursor: pointer; }

/* Этап 3B: виджет дыхания */
.breath-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.breath-panel-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.breath-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.breath-preset { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 12px; padding: 12px 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; }
.breath-preset:hover { border-color: var(--gold); background: #fffdfa; }
.breath-preset small { font-size: 11px; color: var(--faint); font-weight: 500; }
.breath-stop { margin-top: 10px; width: 100%; border: none; background: #f0e6e6; color: var(--red); font-weight: 600; font-size: 14px; padding: 10px; border-radius: 12px; cursor: pointer; }

.breath-overlay { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; pointer-events: none; }
.breath-circle { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(196,167,125,0.85), rgba(155,89,182,0.55)); box-shadow: 0 0 50px rgba(196,167,125,0.6); will-change: transform; }
.breath-text { color: #fff; font-size: 22px; font-weight: 600; letter-spacing: 0.04em; text-shadow: 0 2px 12px rgba(0,0,0,0.5); }

/* Этап 3C: музыка */
.music-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.music-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; align-items: center; }
.music-item { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.music-item:hover { border-color: var(--gold); background: #fffdfa; }
.music-now { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.music-now #musicNowText { font-size: 14px; font-weight: 600; color: var(--gold-dark); }
.music-now input[type=range] { flex: 1; min-width: 120px; accent-color: var(--gold); }
.music-now .breath-stop { width: auto; margin-top: 0; padding: 8px 14px; }
.music-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.music-upload-btn { border: 1px solid var(--gold); background: #fffdfa; color: var(--gold-dark); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.music-upload-btn:hover { background: #fff7ed; }
.music-upload-btn:disabled { opacity: 0.6; cursor: default; }
.music-item-wrap { display: inline-flex; align-items: center; }
.music-item-wrap .music-item { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.music-del { border: 1px solid var(--line); border-left: none; background: #fff; color: var(--red); border-radius: 0 999px 999px 0; padding: 8px 10px; font-size: 12px; cursor: pointer; }
.music-del:hover { background: #fbf0f0; }

/* Responsive */
@media (max-width: 860px) {
  .viewer { grid-template-columns: 1fr; }
  .chat { height: 50vh; }
}
