@charset "UTF-8";
/* ============================================================
   DORAE — core tokens & shared components
   Тёмная тема, единственная. Акцент: #52e2ff, тёплый: #e0ab7c
   ============================================================ */

:root {
  --bg: #10100f;
  --surface: #181816;
  --surface-2: #20201d;
  --surface-3: #292925;
  --line: #2f2f2a;
  --text: #f5f3ed;
  --muted: #a6a399;
  --soft: #75726a;

  --accent: #52e2ff;
  --accent-soft: rgba(82, 226, 255, .14);
  --accent-line: rgba(82, 226, 255, .32);
  --on-accent: #06181e;
  --accent-2: #ff8474;
  --accent-3: #9e8cff;
  --success: #e0ab7c;
  --success-soft: rgba(224, 171, 124, .15);
  --warning: #ffc867;
  --danger: #ff7d83;
  --danger-soft: rgba(255, 125, 131, .14);

  --radius: 8px;
  --radius-lg: 12px;
  --sidebar: 228px;
  --content: 1440px;
  --trans: 180ms ease;

  --shadow-1: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-2: 0 24px 70px rgba(0, 0, 0, .55);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3, h4 { font-weight: 900; }
::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Скроллбары в стиле интерфейса */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #3a3a34; background-clip: content-box; }

/* ---------- утилиты ---------- */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.accent { color: var(--accent); }
/* Кнопки и карточки объявляют свой display, из-за чего атрибут hidden
   переставал работать — например, «Показать ещё» висела всегда. */
[hidden] { display: none !important; }

.danger { color: var(--danger); }
.success { color: var(--success); }
.warning { color: var(--warning); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-18 { margin-top: 18px; }
.mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace; font-size: 12px; }

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: .14em;
  font-size: 11px;
}

/* ---------- кнопки ---------- */
.icon-button, .primary-button, .ghost-button, .chip, .tab-button, .quiet-button, .danger-button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--trans), background var(--trans), color var(--trans), opacity var(--trans);
}

.icon-button:hover, .primary-button:hover, .ghost-button:hover,
.chip:hover, .tab-button:hover, .quiet-button:hover, .danger-button:hover { transform: translateY(-1px); }

.icon-button:active, .primary-button:active, .ghost-button:active { transform: translateY(0); }

.icon-button {
  width: 42px;
  height: 42px;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: 0 0 auto;
}
.icon-button:hover { color: var(--text); background: var(--surface-2); }
.icon-button svg { width: 19px; height: 19px; }
.icon-button.small { width: 34px; height: 34px; }
.icon-button.small svg { width: 16px; height: 16px; }

.primary-button {
  background: var(--accent);
  color: var(--on-accent);
  padding: 11px 16px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary-button svg { width: 17px; height: 17px; }

.ghost-button {
  background: var(--surface-2);
  color: var(--text);
  padding: 11px 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ghost-button svg { width: 17px; height: 17px; }
.ghost-button:hover { background: var(--surface-3); }

.quiet-button {
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  font-weight: 800;
}
.quiet-button:hover { background: var(--surface-2); color: var(--text); }

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 11px 15px;
  font-weight: 800;
}
.danger-button:hover { background: var(--danger); color: #1a0e0f; }

.mini-button { padding: 8px 11px; font-size: 12px; }
.tiny-button { padding: 6px 9px; font-size: 11px; border-radius: 6px; }

button[disabled], .primary-button[disabled], .ghost-button[disabled] {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

.chip {
  flex: 0 0 auto;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}
.chip.active { background: var(--accent); color: var(--on-accent); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-button { flex: 0 0 auto; background: var(--surface); color: var(--muted); padding: 10px 13px; font-weight: 800; }
.tab-button.active { background: var(--accent); color: var(--on-accent); }

/* ---------- поля ввода ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--soft);
}
.field-hint { font-size: 12px; color: var(--soft); }

.input, .textarea, select.input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid transparent;
  outline: 0;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  transition: border-color var(--trans), background var(--trans);
}
.textarea { padding: 11px 12px; line-height: 1.5; resize: vertical; min-height: 96px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.input:hover, .textarea:hover { background: var(--surface-3); }
.input:focus, .textarea:focus { border-color: var(--accent-line); background: var(--surface-2); }
.input::placeholder, .textarea::placeholder { color: var(--soft); }
.input:disabled { opacity: .5; }

.input-group { display: flex; gap: 8px; align-items: center; }

/* Нативный select — стилизуем и сам список опций (fallback, если JS выключен) */
select.input, select.filter-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a6a399' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
}
select option,
select optgroup {
  background: #1b1b18;
  color: var(--text);
  font-weight: 600;
}
select option:checked { background: var(--accent); color: var(--on-accent); }

/* ---------- кастомный select (ui-select) ---------- */
.ui-select { position: relative; min-width: 0; }
.ui-select-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 34px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  transition: background var(--trans), border-color var(--trans);
}
.ui-select-button:hover { background: var(--surface-3); }
.ui-select.open .ui-select-button { border-color: var(--accent-line); background: var(--surface-2); }
.ui-select-button .ui-select-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select-button .ui-select-caret {
  position: absolute;
  right: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  transition: transform var(--trans);
  pointer-events: none;
}
.ui-select.open .ui-select-caret { transform: rotate(180deg); color: var(--accent); }
.ui-select.on-surface .ui-select-button { background: var(--surface); }
.ui-select.on-surface .ui-select-button:hover { background: var(--surface-2); }

.ui-select-menu {
  position: absolute;
  z-index: 240;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  background: #1b1b18;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  display: none;
  animation: uiSelectIn 140ms ease;
}
.ui-select.open .ui-select-menu { display: block; }
.ui-select.drop-up .ui-select-menu { top: auto; bottom: calc(100% + 6px); }
@keyframes uiSelectIn { from { opacity: 0; transform: translateY(-4px); } }

.ui-select-group {
  padding: 9px 10px 5px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--soft);
}
.ui-select-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 120ms ease, color 120ms ease;
}
.ui-select-option:hover, .ui-select-option.cursor { background: var(--surface-2); color: var(--text); }
.ui-select-option[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.ui-select-option[aria-selected="true"]::after {
  content: "";
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}
.ui-select-option[disabled] { opacity: .4; cursor: not-allowed; }
.ui-select-empty { padding: 14px 10px; color: var(--soft); text-align: center; }

/* чекбоксы и переключатели */
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-weight: 700;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background var(--trans);
}
.check-box svg { width: 13px; height: 13px; color: var(--on-accent); opacity: 0; transform: scale(.6); transition: var(--trans); }
.check input:checked + .check-box { background: var(--accent); }
.check input:checked + .check-box svg { opacity: 1; transform: none; }
.check input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check input:checked ~ .check-text { color: var(--text); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 40px;
  height: 23px;
  border-radius: 20px;
  background: var(--surface-3);
  padding: 3px;
  transition: background var(--trans);
  flex: 0 0 auto;
}
.switch-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--soft);
  transition: transform var(--trans), background var(--trans);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(17px); background: var(--on-accent); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* сегментированный переключатель */
.segment { display: inline-flex; background: var(--surface-2); border-radius: var(--radius); padding: 3px; gap: 3px; }
.segment button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
}
.segment button.active { background: var(--accent); color: var(--on-accent); }

/* ---------- бейджи ---------- */
.pill, .score, .status, .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, .09);
  color: #f6f3ec;
  white-space: nowrap;
}
.pill.accented { background: var(--accent); color: var(--on-accent); }
.pill.outline { background: var(--surface-2); color: var(--muted); }
.score { background: var(--accent); color: var(--on-accent); }
.score.dim { background: var(--surface-3); color: var(--text); }
.status.ongoing { background: var(--success-soft); color: var(--success); }
.status.completed { background: rgba(158, 140, 255, .15); color: var(--accent-3); }
.status.soon { background: rgba(255, 200, 103, .16); color: var(--warning); }
.status.canceled { background: var(--danger-soft); color: var(--danger); }
.status.draft { background: var(--surface-3); color: var(--soft); }

/* Поверх постера полупрозрачная подложка теряется на светлых кадрах,
   поэтому там ставим плотный тёмный фон, а цветом остаётся только текст. */
.poster-top .status, .hero-kicker .status, .detail-hero .status {
  background: rgba(10, 10, 10, .74);
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.poster-top .status.ongoing, .hero-kicker .status.ongoing, .detail-hero .status.ongoing { color: #6ff0c0; }
.poster-top .status.completed, .hero-kicker .status.completed, .detail-hero .status.completed { color: #cdc0ff; }
.poster-top .status.soon, .hero-kicker .status.soon, .detail-hero .status.soon { color: #ffd484; }
.poster-top .status.canceled, .hero-kicker .status.canceled, .detail-hero .status.canceled { color: #ff9a9a; }
.tag { background: var(--surface-2); color: var(--muted); font-size: 11px; padding: 5px 8px; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--soft); flex: 0 0 auto; }
.dot.on { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.dot.wait { background: var(--warning); box-shadow: 0 0 0 4px rgba(255, 200, 103, .16); }

/* ---------- прогресс ---------- */
.line-progress { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.line-progress span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 300ms ease; }
.line-progress.warm span { background: var(--success); }

/* ---------- модалки ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 8, .74);
  backdrop-filter: blur(10px);
  display: none;
  padding: 24px;
  overflow-y: auto;
}
.overlay.open { display: grid; place-items: center; animation: fadeIn 160ms ease; }
.overlay.top.open { place-items: start center; }
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  width: min(560px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-2);
  animation: modalIn 200ms ease;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.modal.wide { width: min(940px, 100%); }
.modal.xwide { width: min(1180px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* ---------- тосты ---------- */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 400;
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100vw - 36px));
}
.toast {
  background: var(--accent);
  color: var(--on-accent);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-weight: 900;
  box-shadow: var(--shadow-1);
  animation: toastIn .22s ease;
  display: flex;
  gap: 9px;
  align-items: center;
}
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; }
.toast.warn { background: var(--warning); color: #241a05; }
.toast.error { background: var(--danger); color: #240d0f; }
.toast.plain { background: var(--surface-3); color: var(--text); }
.toast.leaving { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------- пустые состояния и загрузка ---------- */
.empty {
  padding: 44px 24px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.empty svg { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--soft); }
.empty h3 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0 auto 16px; color: var(--muted); max-width: 420px; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%);
  background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -300% 0; } }

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
  flex: 0 0 auto;
}
.spinner.on-accent { border-color: rgba(6, 24, 30, .25); border-top-color: var(--on-accent); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
