/* Светлая тема — те же токены, что в VOKI Grades. */
:root {
  --bg: #f5f4f8;
  --surface: #ffffff;
  --surface-2: #f0eef5;
  --line: #e4e1ec;
  --text: #1c1830;
  --muted: #6d6886;
  --accent: #8b3dff;
  --accent-2: #e2338f;
  --accent-soft: #f1e8ff;
  --ok: #12a36b;
  --ok-soft: #e1f6ec;
  --danger: #d6324f;
  --danger-soft: #fde2e6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(28, 24, 48, .06), 0 8px 24px rgba(28, 24, 48, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 Manrope, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; padding: 12px 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; white-space: nowrap; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.brand-text { font-size: 17px; font-weight: 800; letter-spacing: .02em; }
.brand-text .accent { color: var(--accent-2); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.count:not(:empty) { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; display: inline-grid; place-items: center; }
.me { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
.demo-banner { background: #fff4d6; color: #6a4b00; text-align: center; padding: 8px 16px; font-size: 13px; }

.app { max-width: 1120px; margin: 0 auto; padding: 28px 24px 80px; }
.loading, .empty { color: var(--muted); text-align: center; padding: 50px 0; }
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 6px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 800; }
.sub { color: var(--muted); margin: 0 0 22px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  padding: 10px 18px; border-radius: 999px; font-weight: 700; transition: transform .08s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 14px 26px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

/* ---------- показ ---------- */
.show-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.show-head .pos { color: var(--muted); font-weight: 700; }
.stage { display: flex; justify-content: center; align-items: center; gap: 22px; }
.video-col { display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 0 1 auto; }
.video-col .player:not(.vertical) { width: min(1012px, calc(100vw - 180px)); }
.player {
  background: #000; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px -28px rgba(28, 24, 48, .5);
  width: min(100%, 1012px); aspect-ratio: 16 / 9;
}
.player.vertical { width: auto; height: min(calc(100vh - 190px), 874px); aspect-ratio: 9 / 16; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.controls { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.ctrl {
  width: 76px; height: 76px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  font-size: 32px; display: grid; place-items: center; transition: transform .1s, box-shadow .15s, border-color .15s, background .15s;
}
.ctrl:hover { transform: translateY(-2px); }
.ctrl:active { transform: scale(.94); }
.ctrl.like:hover { border-color: var(--ok); background: var(--ok-soft); }
.ctrl.dislike:hover { border-color: var(--danger); background: var(--danger-soft); }
.ctrl.back { width: 58px; height: 58px; font-size: 24px; }
.ctrl.yt { width: 58px; height: 58px; }
.ctrl.yt:hover { border-color: #ff0000; }
.ctrl:disabled { opacity: .35; cursor: default; transform: none; }
.ctrl-label { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: -10px; text-align: center; }
/* Подпись под видео: по ширине плеера, не расширяет колонку длинным текстом. */
.show-info { margin-top: 14px; text-align: center; width: 0; min-width: 100%; }
.show-title { font-size: 20px; font-weight: 800; }
.yt-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 13px; transition: border-color .15s, transform .08s;
}
.yt-btn:hover { border-color: #ff0000; }
.yt-btn:active { transform: scale(.96); }
.yt-btn svg { display: block; }
.show-note { color: var(--muted); margin-top: 6px; white-space: pre-wrap; }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 14px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font: 600 11px Manrope, sans-serif; background: var(--surface); }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 30; display: grid; place-items: center; font-size: 160px; animation: pop .6s ease-out forwards; }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: 1; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1.2); } }
.done-panel { text-align: center; padding: 60px 24px; }
.done-panel .big { font-size: 64px; }

/* ---------- списки ---------- */
.add-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.add-form input { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 11px 14px; outline: none; }
.add-form input:focus { border-color: var(--accent); }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
.item img { width: 120px; height: 68px; object-fit: cover; border-radius: 10px; background: var(--surface-2); display: block; }
.item .t { font-weight: 800; }
.item .n { color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.item .meta { color: var(--text); font-size: 12px; font-weight: 700; margin-top: 4px; }
.item .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); }
.tabs button.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.asana-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.notice { background: #fff4d6; color: #6a4b00; border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--ok-soft); color: var(--ok); }

.login { max-width: 420px; margin: 60px auto; text-align: center; padding: 36px 28px; }
.gbtn { display: flex; justify-content: center; margin-top: 22px; min-height: 44px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 14px 0 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--text); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; transition: all .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .topbar { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .me { display: none; }
  .app { padding: 20px 16px 60px; }
  .stage { flex-direction: column; }
  .controls { flex-direction: row; }
  .ctrl-label { display: none; }
  .add-form { grid-template-columns: 1fr; }
  .item { grid-template-columns: 90px 1fr; }
  .item img { width: 90px; height: 52px; }
  .item .acts { grid-column: 1 / -1; justify-content: flex-start; }
}
