/* ==========================================================================
   production.css — доводка интерфейса до продакшна.
   Сохраняем фирменный стиль клуба, но чистим мелочи, фокус, адаптив и т.п.
   ========================================================================== */

/* --- фокус с клавиатуры --- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 10px;
}

/* --- аккуратные полосы прокрутки --- */
* { scrollbar-width: thin; scrollbar-color: #3b4b6b transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #3b4b6b;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #4d6189; background-clip: content-box; }

/* --- верхняя панель --- */
.topbar { position: relative; z-index: 5; }
.brand h1 { letter-spacing: -.02em; }
.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* --- навигация: активная вкладка читается сразу --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 26px -18px #000c;
}
.nav button.active {
  background: var(--gold) !important;
  color: #1c1408 !important;
  border-color: var(--gold) !important;
  box-shadow: 0 6px 18px -8px #ffb36aa8;
  font-weight: 800;
}

/* --- панели: единый ритм --- */
.panel { transition: border-color .18s ease, box-shadow .18s ease; }
.panel:hover { border-color: #4a5e7d; }

/* --- кнопки --- */
button { font-weight: 650; }
button.primary {
  box-shadow: 0 10px 24px -14px #ffb36ac0;
}
button.tiny { padding: 6px 10px; font-size: 12px; }

/* ==========================================================================
   Вкладка «Сюжеты»
   ========================================================================== */
.story-hub { display: grid; gap: 18px; }

.story-hub-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 0% 0%, #2b3b6059, transparent 58%),
    linear-gradient(150deg, var(--surface2), var(--surface));
  box-shadow: var(--shadow);
}
.story-hub-head h2 { margin: 4px 0 6px; font-size: clamp(24px, 3vw, 34px); }
.story-hub-head p { margin: 0; max-width: 72ch; color: var(--muted); line-height: 1.55; }

.story-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.story-mode-btn {
  position: relative;
  display: grid;
  gap: 8px;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #131c30;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.story-mode-btn:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 18px 38px -22px #ffb36aaa;
}
.story-mode-btn.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 18px 40px -24px #ffb36aaa;
}
.story-mode-btn b { font-size: 15px; letter-spacing: -.01em; }
.story-mode-btn small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.story-mode-art {
  height: 96px;
  border-radius: 11px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}
.story-mode-art-alliance { background-image: url('../assets/img/ef065565a2.webp'); }
.story-mode-art-fishka { background-image: url('../assets/img/37eb7b1fc3.webp'); }
.story-mode-art-halloween { background-image: url('../assets/img/2115095755.webp'); }

.story-stage { min-height: 180px; }
.story-panel { animation: fadeInUp .4s ease both; }
.story-panel > * { margin-top: 16px; }
.story-panel .fishka-lore { margin-top: 0; }

/* ==========================================================================
   Резерв раунда
   ========================================================================== */
.reserve-list { display: grid; gap: 9px; }
.reserve-empty {
  padding: 14px;
  border-radius: 13px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  background: #131b2b;
}
.reserve-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #162033;
}
.reserve-person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.reserve-meta { display: grid; min-width: 0; }
.reserve-meta strong { font-size: 14px; }
.reserve-meta small { color: var(--muted); font-size: 11.5px; }
.reserve-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.reserve-label { font-size: 11px; color: var(--muted); margin-right: 2px; }
.reserve-btn {
  width: 32px;
  padding: 6px 0 !important;
  text-align: center;
  font-weight: 800;
}
.reserve-btn:hover { border-color: var(--gold) !important; color: var(--gold) !important; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1080px) {
  .story-hub-head { padding: 18px; }
}
@media (max-width: 720px) {
  .top-actions { gap: 6px; }
  .top-actions button { flex: 1 1 auto; }
  .story-switch { grid-template-columns: 1fr; }
  .story-mode-art { height: 120px; }
  .reserve-row { align-items: flex-start; }
  .reserve-actions { width: 100%; }
  .reserve-label { width: 100%; }
  .reserve-btn { flex: 1; }
}

/* --- печать: краткий протокол --- */
@media print {
  .nav, .top-actions, .sync-badge, .toolbar, .timerbox { display: none !important; }
  body { background: #fff; color: #000; }
}

/* --- пустое состояние вкладки «Сюжеты» --- */
.story-empty {
  display: grid;
  justify-items: center;
  gap: 9px;
  text-align: center;
  padding: 46px 24px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  background: radial-gradient(ellipse at 50% 0%, #24344f66, transparent 62%), #141c2e;
}
.story-empty-mark { font-size: 40px; filter: saturate(.9); }
.story-empty h3 { margin: 0; font-size: 20px; }
.story-empty p { margin: 0; max-width: 56ch; color: var(--muted); line-height: 1.6; font-size: 13px; }
.story-empty-note { font-size: 12px; }
.story-empty-note b { color: var(--gold); }

/* ==========================================================================
   главная панель
   ========================================================================== */
.dash-head { align-items: center; }
.dash-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dash-title { margin: 4px 0 0; min-width: 0; }
.dash-rename-input {
  width: min(420px, 62vw);
  margin-top: 4px;
  padding: 7px 11px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.dash-sub { margin: 7px 0 0; }
.dash-head-tools { align-self: center; }
.dash-stats { margin-bottom: 4px; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.dash-wide { grid-column: 1 / -1; }

.dash-situation {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, #1d2a44, #172033);
}
.dash-situation::first-letter { color: var(--gold); }

.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
}
.dash-action {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface2);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.dash-action:hover { border-color: var(--gold); background: var(--surface3); transform: translateY(-2px); }
.dash-action-ico { font-size: 20px; line-height: 1; flex: 0 0 auto; }
.dash-action-txt { display: grid; gap: 2px; min-width: 0; }
.dash-action-txt b { font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.dash-action-txt small { font-size: 11px; color: var(--muted); line-height: 1.35; }

.dash-kv { display: grid; gap: 7px; }
.dash-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #17151a;
  font-size: 12.5px;
}
.dash-kv-row > span { color: var(--muted); flex: 0 0 auto; }
.dash-kv-row > b {
  font-weight: 750;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-note { margin-top: 11px; }

.dash-status--ok { background: #244130; color: #c1efd0; }
.dash-status--sync { background: #473825; color: #f2d6a3; }
.dash-status--off { background: #38313b; color: #d7cdd8; }
.dash-status--err { background: #492832; color: #ffc2c8; }

.dash-hosts { display: grid; gap: 7px; }
.dash-host {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #17151a;
}
.dash-host-name { font-weight: 750; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-host-name i { color: var(--gold); font-style: normal; font-size: 11px; }
.dash-host-channel { flex: 0 0 auto; }

.dash-tasks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.dash-task {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface2);
  transition: border-color .18s ease, transform .18s ease;
}
.dash-task:hover { border-color: var(--gold); transform: translateX(2px); }
.dash-task b { font-size: 12.5px; font-weight: 800; }
.dash-task small { font-size: 11px; color: var(--muted); }
.dash-ok {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #16283a;
  color: #bdf2e4;
  font-size: 12.5px;
}

@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   центр уведомлений
   ========================================================================== */
@keyframes ntfnIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ntfnOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(26px); }
}
@keyframes ntfnAttention {
  0%, 100% { box-shadow: 0 0 0 0 #ffb36a00; }
  50% { box-shadow: 0 0 0 3px #ffb36a2e; }
}

.ntfn-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 42px !important;
  padding: 9px 10px !important;
  border-radius: 999px !important;
}
.ntfn-bell-ico { font-size: 15px; line-height: 1; filter: saturate(.85); }
.ntfn-bell.has-unread { border-color: var(--gold) !important; background: #2d3550 !important; }
.ntfn-bell-count {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #241a0d;
  font-size: 10px;
  font-weight: 900;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 4px 12px #ffb36a55;
}
.ntfn-bell-count.hidden { display: none !important; }

.ntfn-stack {
  position: fixed;
  top: calc(var(--ntfn-top, 176px) + var(--ntfn-offset, 0px));
  right: 18px;
  z-index: 900;
  width: min(365px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  transition: top .2s ease;
}
.ntfn-stack.is-quiet {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}
.ntfn-toast {
  pointer-events: auto;
  border-radius: 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  background: linear-gradient(150deg, #22314b, #172239);
  box-shadow: var(--shadow);
  padding: 11px 13px 12px;
  animation: ntfnIn .28s cubic-bezier(.2, .9, .3, 1) both;
}
.ntfn-toast.is-out { animation: ntfnOut .3s ease forwards; }
.ntfn-toast--success { border-left-color: var(--green); }
.ntfn-toast--warning {
  border-left-color: var(--gold);
  animation: ntfnIn .28s cubic-bezier(.2, .9, .3, 1) both, ntfnAttention 1.6s ease-in-out 1;
}
.ntfn-toast--error {
  border-left-color: var(--red);
  animation: ntfnIn .28s cubic-bezier(.2, .9, .3, 1) both, ntfnAttention 1.3s ease-in-out 1;
}
.ntfn-toast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.ntfn-level {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  background: #2b3a52;
  color: #c7dcff;
}
.ntfn-level--success { background: #244130; color: #c1efd0; }
.ntfn-level--warning { background: #473825; color: #f2d6a3; }
.ntfn-level--error { background: #492832; color: #ffc2c8; }
.ntfn-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 7px;
}
.ntfn-close:hover { color: var(--ink); background: #ffffff14; }
.ntfn-toast-title { font-weight: 800; font-size: 13px; margin-bottom: 3px; }
.ntfn-toast-text { font-size: 12.5px; line-height: 1.5; color: #d5dcec; }
.ntfn-toast-action {
  margin-top: 9px;
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 999px;
  border-color: var(--gold);
  color: var(--gold2);
}

.ntfn-panel {
  position: fixed;
  top: var(--ntfn-top, 176px);
  right: 18px;
  z-index: 960;
  width: min(430px, calc(100vw - 36px));
  max-height: min(72vh, 600px);
  display: flex;
  flex-direction: column;
  border-radius: 19px;
  border: 1px solid #3d4e6f;
  background: linear-gradient(155deg, #22314b, #172239);
  box-shadow: 0 26px 70px #040a1766;
  overflow: hidden;
}
.ntfn-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.ntfn-panel-head h3 { margin: 3px 0 0; font-size: 17px; }
.ntfn-list { overflow-y: auto; padding: 12px 14px 15px; display: grid; gap: 8px; }
.ntfn-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #182238;
}
.ntfn-item-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 6px; }
.ntfn-item--success .ntfn-item-dot { background: var(--green); }
.ntfn-item--warning .ntfn-item-dot { background: var(--gold); }
.ntfn-item--error .ntfn-item-dot { background: var(--red); }
.ntfn-item-main { min-width: 0; }
.ntfn-item-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.ntfn-item-top time { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ntfn-item-title { font-weight: 800; font-size: 12.5px; margin-top: 5px; }
.ntfn-item-text { font-size: 12px; line-height: 1.5; color: #cdd7ea; margin-top: 2px; }
.ntfn-item-action {
  margin-top: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 999px;
  border-color: var(--gold);
  color: var(--gold2);
}
.ntfn-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

@media (max-width: 720px) {
  .ntfn-stack, .ntfn-panel { left: 12px; right: 12px; width: auto; }
  .ntfn-bell { width: 38px !important; }
}
