
/* ─── ПЕРЕМЕННЫЕ ─────────────────────────────────────────── */
:root {
  --bg:      #0d1117;
  --bg2:     #111820;
  --bg3:     #161d27;
  --accent:  #ff6b35;
  --accent2: #ff9a6c;
  --text:    #e8eaf0;
  --text2:   #8892a4;
  --text3:   #5a6478;
  --card:    #131b24;
  --card2:   #1a2332;
  --border:  rgba(255,107,53,0.18);
  --border2: rgba(255,255,255,0.07);
  --glow:    rgba(255,107,53,0.28);
  --grad:    linear-gradient(135deg, #ff6b35 0%, #ff9a6c 50%, #ffb347 100%);
}

/* ─── СБРОС И BASE ───────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── АНИМИРОВАННЫЙ ФОН ──────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Градиентные пятна */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.07;
}
.bg-blob:nth-child(1) {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #ff6b35, transparent 70%);
  top: -100px; left: -150px;
}
.bg-blob:nth-child(2) {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #ff9a6c, transparent 70%);
  bottom: 10%; right: -100px;
}
.bg-blob:nth-child(3) {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #c864ff, transparent 70%);
  top: 40%; left: 30%;
  opacity: 0.04;
}

/* Плавающие иконки */
.bg-icon {
  position: absolute;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
  opacity: 0;
}

/* Всё содержимое поверх фона */
#appHeader, .app-layout, .modal-overlay, .io-btns, .toast {
  position: relative;
  z-index: 1;
}
#appHeader { z-index: 100; }
.modal-overlay { z-index: 500; }
.io-btns { z-index: 200; }
.toast { z-index: 1000; }

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ─── HEADER ─────────────────────────────────────────────── */
#appHeader {
  position: static;
  z-index: 100;
  padding: 0 16px;
  background: transparent;
  border-bottom: 1px solid var(--border2);
}

.hdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 10px;
}

.logo-wrap { display: flex; align-items: center; gap: 10px; }

.logo-pill {
  background: var(--grad);
  border-radius: 50px;
  padding: 8px 20px;
  box-shadow: 0 0 12px var(--glow), 0 4px 12px rgba(0,0,0,.3);
  cursor: pointer;
  position: relative;
  z-index: 10;
  transition: border-radius .3s ease, box-shadow .3s ease, padding .3s ease;
  text-align: center;
  display: inline-block;
}
.logo-pill:hover, .logo-pill.expanded {
  border-radius: 16px;
  padding: 8px 20px 12px;
  box-shadow: 0 0 22px var(--glow), 0 6px 20px rgba(0,0,0,.4);
}
.logo-title {
  font-family: 'Bebas Neue', cursive, sans-serif;
  font-size: 28px;
  color: #0d1117;
  letter-spacing: 2.5px;
  line-height: 1.3;
  display: block;
  white-space: nowrap;
}
.logo-tagline {
  font-family: 'Syne', sans-serif;
  font-size: 8px;
  font-weight: 500;
  color: rgba(13,17,23,0.65);
  letter-spacing: 1px;
  white-space: nowrap;
  display: block;
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height .3s ease, opacity .25s ease .05s, margin-top .3s ease;
  margin-top: 0;
}
.logo-pill:hover .logo-tagline,
.logo-pill.expanded .logo-tagline {
  height: 14px;
  opacity: 1;
  margin-top: 3px;
}
.logo-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  color: #0d1117;
  letter-spacing: 2.5px;
  line-height: 1;
  display: block;
  position: relative;
  top: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}


.logo-by {
  font-size: 11px;
  color: rgba(255,255,255,.22);
  font-weight: 300;
  letter-spacing: .8px;
  transition: opacity .18s ease;
}

.hdr-cnt {
  font-size: 11px;
  color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 4px 11px;
  transition: opacity .18s ease;
}

/* ─── КАРУСЕЛЬ ───────────────────────────────────────────── */
.car-section {
  overflow: hidden;
  padding: 14px 0 0;
  background: transparent;
}

.car-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  padding: 0 16px 8px;
  opacity: .85;
}

.car-track {
  display: flex;
  gap: 10px;
  padding: 0 16px 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.car-track::-webkit-scrollbar { display: none; }

.c-card {
  flex: 0 0 100px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  scroll-snap-align: start;
  border: 1px solid var(--border2);
  transition: transform .25s;
  background: var(--card2);
}
.c-card:hover { transform: scale(1.04); }
.c-card img { width: 100%; height: 100%; object-fit: cover; }
.c-card .ci {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.9) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 7px;
}
.c-card .ct { font-size: 10px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-card .cs { font-size: 9px; color: var(--accent); }
.c-empty { color: var(--text3); font-size: 12px; padding: 0 16px 14px; font-style: italic; }

/* ─── СТРОКА ПОИСКА ──────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  background: transparent;
  border-bottom: 1px solid var(--border2);
  transform: translateZ(0);
}

.sw { flex: 1; position: relative; }
.sw input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 10px 14px 10px 38px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s;
}
.sw input:focus { border-color: var(--accent); }
.sw input::placeholder { color: var(--text3); }

.si {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 15px;
  pointer-events: none;
}

.filter-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.filter-btn:hover, .filter-btn.active {
  background: rgba(255,107,53,.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── СЕТКА ──────────────────────────────────────────────── */
.grid-section { padding: 0 16px 100px; }
.grid-label {
  display: inline-block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 4px 13px;
  margin: 8px 0 12px;
  border-radius: 50px;
  background: var(--grad);
  color: #0d1117;
  box-shadow: 0 0 8px var(--glow), 0 3px 8px rgba(0,0,0,.3);
  line-height: 1;
  position: relative;
  top: 1px;
}
.film-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── КАРТОЧКА ДОБАВИТЬ ──────────────────────────────────── */
.add-card {
  aspect-ratio: 2/3;
  border-radius: 16px;
  border: 2px dashed rgba(255,107,53,.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  background: rgba(255,107,53,.03);
  position: relative;
  overflow: hidden;
  transition: all .3s;
}
.add-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,107,53,.07) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .3s;
}
.add-card:hover { border-color: var(--accent); transform: scale(.98); }
.add-card:hover::before { opacity: 1; }

.add-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #0d1117;
  font-weight: 700;
  box-shadow: 0 0 22px var(--glow);
  position: relative;
  overflow: visible;
  transition: transform .2s;
}
.add-card:active .add-icon { transform: scale(.92); }
.add-label { font-size: 12px; color: var(--text3); text-align: center; line-height: 1.4; }

/* ─── КАРТОЧКА ФИЛЬМА ────────────────────────────────────── */
.film-card {
  aspect-ratio: 2/3;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border2);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  transform: translateZ(0); /* GPU-слой */
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.film-card:active { transform: scale(.97); }
.film-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.film-card .co {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.95) 0%, rgba(0,0,0,.25) 55%, transparent 100%);
}
.film-card .cscore {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,.85);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(255,107,53,.3);
}
.film-card .ctype {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .8px;
  padding: 3px 7px;
  border-radius: 20px;
  text-transform: uppercase;
}
.film-card .cinfo { position: absolute; bottom: 0; left: 0; right: 0; padding: 9px; }
.film-card .ctitle { font-size: 12px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.film-card .cyear  { font-size: 10px; color: var(--text3); margin-top: 2px; }
.film-card .cviews { font-size: 9px; color: var(--accent2); margin-top: 3px; display: flex; align-items: center; gap: 3px; }

.bm { background: rgba(255,107,53,.22); color: var(--accent); }
.bs { background: rgba(100,180,255,.18); color: #64b4ff; }
.ba { background: rgba(200,100,255,.18); color: #c864ff; }
.bc { background: rgba(100,255,150,.18); color: #64ff96; }

/* ─── ПУСТОЕ СОСТОЯНИЕ ───────────────────────────────────── */
.empty-state { grid-column: 1/-1; text-align: center; padding: 40px 20px; color: var(--text3); }
.empty-state .ei { font-size: 44px; margin-bottom: 10px; opacity: .35; }
.empty-state p { font-size: 13px; line-height: 1.7; }

/* ─── ОВЕРЛЕЙ МОДАЛОК ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

/* ─── МОДАЛКА ДОБАВИТЬ ───────────────────────────────────── */
.add-modal {
  background: var(--card2);
  border-radius: 22px;
  width: calc(100% - 24px);
  max-width: 420px;
  padding: 20px;
  border: 1px solid var(--border);
  transform: translateY(28px);
  transition: transform .35s cubic-bezier(.34,1.2,.64,1);
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.modal-overlay.open .add-modal { transform: translateY(0); }

.modal-title { font-family: 'Syne', sans-serif; font-size: 19px; font-weight: 800; margin-bottom: 16px; }

.type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ttab {
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text3);
  transition: all .2s;
  user-select: none;
}
.ttab.active { background: rgba(255,107,53,.15); border-color: var(--accent); color: var(--accent); }

.asw { position: relative; margin-bottom: 8px; }
.asi {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 11px 14px 11px 38px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s;
}
.asi:focus { border-color: var(--accent); }
.asi::placeholder { color: var(--text3); }

.asr {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border2);
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  display: none;
  margin-bottom: 10px;
}
.asr.open { display: block; }

.ari {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border2);
  transition: background .15s;
}
.ari:hover { background: rgba(255,107,53,.09); }
.ari:last-child { border-bottom: none; }
.ari img { width: 34px; height: 50px; border-radius: 6px; object-fit: cover; background: var(--bg3); flex-shrink: 0; }
.ari-info { flex: 1; min-width: 0; }
.ari-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ari-meta  { font-size: 10px; color: var(--text3); margin-top: 2px; }
.ari-badge { font-size: 9px; font-weight: 700; letter-spacing: .8px; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; flex-shrink: 0; }

/* ─── РУЧНОЕ ДОБАВЛЕНИЕ ──────────────────────────────────── */
.manual-form {
  background: var(--bg3);
  border-radius: 12px;
  padding: 14px;
  margin-top: 8px;
  border: 1px solid var(--border2);
}
.mf-lbl { font-size: 11px; color: var(--text3); display: block; margin-bottom: 4px; margin-top: 10px; }
.mf-lbl:first-child { margin-top: 0; }
.mf-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s;
}
.mf-input:focus { border-color: var(--accent); }
.mf-input::placeholder { color: var(--text3); }
.mf-row { display: flex; gap: 8px; }
.mf-row > div { flex: 1; }

.add-manual-btn {
  width: 100%;
  margin-top: 12px;
  padding: 11px;
  border-radius: 11px;
  background: var(--grad);
  color: #0d1117;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: opacity .2s;
}
.add-manual-btn:hover { opacity: .88; }

.manual-toggle {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: 6px;
  display: inline-block;
}

.modal-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn-cancel {
  flex: 1;
  padding: 11px;
  border-radius: 11px;
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border2);
  transition: all .2s;
}
.btn-cancel:hover { border-color: var(--text2); }

/* ─── МОДАЛКА ФИЛЬТРОВ ───────────────────────────────────── */
.filter-modal {
  background: var(--card2);
  border-radius: 22px;
  width: calc(100% - 30px);
  max-width: 400px;
  padding: 20px;
  border: 1px solid var(--border);
  transform: translateY(20px);
  transition: transform .3s;
  max-height: 86vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.modal-overlay.open .filter-modal { transform: translateY(0); }

.fg { margin-bottom: 16px; }
.fgl { font-size: 10px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; margin-bottom: 8px; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  transition: all .18s;
  user-select: none;
}
.chip.active { background: rgba(255,107,53,.15); border-color: var(--accent); color: var(--accent); }

.filter-actions { display: flex; gap: 8px; margin-top: 16px; }
.btn-primary {
  flex: 1;
  padding: 11px;
  border-radius: 11px;
  background: var(--grad);
  color: #0d1117;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: opacity .2s;
}
.btn-primary:hover { opacity: .9; }
.btn-secondary {
  padding: 11px 18px;
  border-radius: 11px;
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border2);
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--text2); }

/* ─── МОДАЛКА ДЕТАЛИ ─────────────────────────────────────── */
.detail-modal {
  background: var(--card);
  border-radius: 22px;
  width: calc(100% - 24px);
  max-width: 430px;
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  transform: scale(.93) translateY(24px);
  transition: transform .4s cubic-bezier(.34,1.2,.64,1);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.modal-overlay.open .detail-modal { transform: scale(1) translateY(0); }

.dp-wrap { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 22px 22px 0 0; }
.dp-wrap img { width: 100%; height: 100%; object-fit: cover; }
.dp-grad { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 35%, var(--card) 100%); }

.dp-close, .dp-del {
  position: absolute;
  top: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,.75);
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.dp-close { right: 10px; color: #fff; }
.dp-close:hover { background: rgba(255,107,53,.4); }
.dp-del { left: 10px; color: #ff5555; font-size: 14px; }
.dp-del:hover { background: rgba(255,50,50,.4); }

.stars-row { position: absolute; bottom: 10px; right: 12px; display: flex; gap: 2px; }
.star { font-size: 18px; cursor: pointer; transition: transform .15s, color .15s; line-height: 1; color: var(--text3); }
.star.filled { color: var(--accent); }
.star:hover { transform: scale(1.35); color: var(--accent); }
.cscore::before { content: '★'; color: var(--accent); margin-right: 2px; }

.db { padding: 14px 18px 22px; }
.d-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; margin-bottom: 7px; }
.d-title { font-family: 'Syne', sans-serif; font-size: 21px; font-weight: 800; line-height: 1.2; margin-bottom: 7px; }
.d-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--text3); margin-bottom: 12px; }
.d-meta span { display: flex; align-items: center; gap: 3px; }
.d-desc { font-size: 12px; color: var(--text2); line-height: 1.75; margin-bottom: 14px; }
.d-added { font-size: 10px; color: var(--text3); margin-bottom: 14px; display: flex; align-items: center; gap: 5px; }

.wc-row { display: flex; align-items: center; gap: 12px; background: var(--bg3); border-radius: 12px; padding: 11px 14px; margin-bottom: 8px; border: 1px solid var(--border2); }
.wc-lbl { font-size: 12px; color: var(--text2); flex: 1; }
.wc-btn { width: 32px; height: 32px; border-radius: 9px; border: none; background: var(--card2); color: var(--text); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.wc-btn:hover { background: rgba(255,107,53,.2); color: var(--accent); }
.wc-num { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; color: var(--accent); min-width: 38px; text-align: center; cursor: pointer; transition: transform .2s; }
.wc-num:hover { transform: scale(1.12); }

.swipe-hint { text-align: center; font-size: 10px; color: var(--text3); padding: 0 0 12px; }

.wc-picker { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 0 4px; }
.wcp-btn { width: 38px; height: 38px; border-radius: 9px; background: var(--bg3); border: 1px solid var(--border2); color: var(--text2); font-size: 13px; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; }
.wcp-btn:hover { background: rgba(255,107,53,.15); border-color: var(--accent); color: var(--accent); }

.cmt-lbl { font-size: 10px; color: var(--text3); margin-bottom: 5px; display: block; }
.cmt-ta { width: 100%; background: var(--bg3); border: 1px solid var(--border2); border-radius: 11px; padding: 9px 12px; color: var(--text); font-size: 12px; font-family: 'Inter', sans-serif; resize: none; outline: none; transition: border-color .2s; min-height: 65px; }
.cmt-ta:focus { border-color: var(--accent); }


/* ─── ПОДТВЕРЖДЕНИЕ УДАЛЕНИЯ ─────────────────────────────── */
.confirm-modal {
  background: var(--card2);
  border-radius: 20px;
  width: calc(100% - 60px);
  max-width: 300px;
  padding: 22px;
  text-align: center;
  border: 1px solid rgba(255,50,50,.3);
  transform: scale(.9);
  transition: transform .3s;
}
.modal-overlay.open .confirm-modal { transform: scale(1); }
.cm-icon  { font-size: 38px; margin-bottom: 10px; }
.cm-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.cm-text  { font-size: 12px; color: var(--text2); margin-bottom: 18px; line-height: 1.6; }
.cm-actions { display: flex; gap: 8px; }
.btn-danger { flex: 1; padding: 10px; border-radius: 11px; background: rgba(255,60,60,.15); border: 1px solid rgba(255,60,60,.4); color: #ff6060; font-weight: 700; font-size: 13px; cursor: pointer; transition: all .2s; }
.btn-danger:hover { background: rgba(255,60,60,.28); }

/* ─── ЗНАЧОК ВЫСОКОЙ ОЦЕНКИ ─────────────────────────────── */
.film-card .chigh {
  position: absolute;
  bottom: 62px; left: 8px;
  color: #4ade80;
  font-size: 20px;
  filter: drop-shadow(0 0 6px rgba(74,222,128,.6));
  line-height: 1;
  z-index: 2;
}

/* ─── ЗЕЛЁНАЯ КНОПКА СОХРАНИТЬ ──────────────────────────── */
.cmt-save {
  margin-top: 7px;
  float: right;
  padding: 6px 16px;
  border-radius: 9px;
  background: rgba(74,222,128,.15);
  border: 1px solid #4ade80;
  color: #4ade80;
  font-size: 11px;
  cursor: pointer;
  transition: all .2s;
}
.cmt-save:hover { background: rgba(74,222,128,.28); }

/* ─── КНОПКИ ЭКСПОРТ / ИМПОРТ ───────────────────────────── */
.io-btns {
  position: fixed;
  bottom: 28px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.io-btn {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .22s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.io-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
#exportBtn:hover {
  background: rgba(74,222,128,.12);
  border-color: #4ade80;
  color: #4ade80;
}
#importBtn:hover {
  background: rgba(255,107,53,.12);
  border-color: var(--accent);
  color: var(--accent);
}
#exportBtn:active, #importBtn:active {
  transform: scale(.95);
}

/* ─── СПИННЕР ПОИСКА ─────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── ТОСТ ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(110px);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 18px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  z-index: 1000;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ─── НАВИГАЦИЯ КАРУСЕЛИ (ПК) ────────────────────────────── */
.car-nav {
  display: none;
}

@media (min-width: 768px) {
  .car-section { position: relative; }

  .car-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px 10px;
  }

  .car-nav-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
  }
  .car-nav-btn:hover {
    background: rgba(255,107,53,.15);
    border-color: var(--accent);
    color: var(--accent);
  }
  .car-nav-btn:disabled {
    opacity: .25;
    cursor: default;
    pointer-events: none;
  }

  .car-nav-dots {
    display: flex;
    gap: 5px;
    align-items: center;
  }
  .car-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--text3);
    transition: all .25s;
    cursor: pointer;
  }
  .car-dot.active {
    background: var(--accent);
    width: 16px;
    border-radius: 3px;
  }

  .car-track { scroll-behavior: smooth; }
}

@media (min-width: 768px) {

  body { max-width: 1400px; margin: 0 auto; }

  /* Header */
  #appHeader { padding: 0 32px; }
  .hdr-top { padding: 16px 0 14px; }
  .logo-title { font-size: 34px; }
  .logo-tagline { font-size: 9px; height: 0; }
  .logo-pill:hover .logo-tagline, .logo-pill.expanded .logo-tagline { height: 16px; }
  .hdr-cnt { font-size: 13px; padding: 6px 16px; }

  /* Карусель сверху — горизонтальная, крупнее */
  .app-layout {
    display: block;
  }

  .car-section {
    padding: 20px 0 0;
  }

  .car-label {
    font-size: 11px;
    padding: 0 28px 12px;
    letter-spacing: 2.5px;
  }

  .car-track {
    flex-direction: row;
    padding: 0 28px 18px;
    gap: 14px;
  }

  .c-card {
    flex: 0 0 150px;
    height: 220px;
    border-radius: 12px;
  }

  .c-card .ct { font-size: 12px; }
  .c-card .cs { font-size: 10px; }
  .c-empty { padding: 0 28px; font-size: 13px; }

  /* Поиск */
  .search-bar {
    padding: 14px 28px;
    top: 73px;
  }

  .sw input { font-size: 15px; padding: 12px 16px 12px 42px; border-radius: 14px; }
  .filter-btn { width: 48px; height: 48px; border-radius: 14px; }

  /* Сетка */
  .grid-section { padding: 0 28px 60px; }
  .grid-label { font-size: 14px; padding: 4px 14px; margin: 10px 0 16px; }

  .film-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .film-card:hover { transform: scale(1.03) translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.6); }
  .film-card:active { transform: scale(1.01); }
  .film-card .ctitle { font-size: 13px; }
  .film-card .cyear  { font-size: 11px; }
  .film-card .cscore { font-size: 13px; padding: 4px 9px; }

  /* Модалки */
  .add-modal    { max-width: 520px; padding: 28px; }
  .filter-modal { max-width: 520px; padding: 28px; }
  .detail-modal { max-width: 600px; max-height: 90vh; }
  .modal-title  { font-size: 22px; }
  .d-title { font-size: 26px; }
  .d-desc  { font-size: 13px; }
  .db { padding: 20px 24px 28px; }

  .toast { font-size: 13px; padding: 11px 22px; border-radius: 14px; }
}

/* ─── WIDE DESKTOP (1100px+) ─────────────────────────────── */
@media (min-width: 1100px) {
  .c-card { flex: 0 0 170px; height: 240px; }
  .film-grid { grid-template-columns: repeat(5, 1fr); gap: 18px; }
  .grid-section { padding: 0 36px 60px; }
  .search-bar   { padding: 14px 36px; }
  .car-track    { padding: 0 36px 20px; }
  .car-label    { padding: 0 36px 12px; }
}

/* ─── ULTRA WIDE (1400px+) ───────────────────────────────── */
@media (min-width: 1400px) {
  .film-grid { grid-template-columns: repeat(6, 1fr); }
  .c-card { flex: 0 0 180px; height: 255px; }
}

/* ─── АНИМАЦИИ ───────────────────────────────────────────── */

/* Кнопка + добавить */
@keyframes plusPop {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.7) rotate(90deg); }
  70%  { transform: scale(.9) rotate(80deg); }
  100% { transform: scale(1) rotate(90deg); }
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}
.btn-plus-icon {
  display: inline-block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.btn-plus-anim .btn-plus-icon {
  animation: plusPop .5s cubic-bezier(.34,1.56,.64,1) forwards;
}
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  transform: scale(0);
  animation: rippleAnim .55s linear forwards;
  pointer-events: none;
}

/* Звёзды */
@keyframes starPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}
.star-pop { animation: starPop .35s cubic-bezier(.34,1.56,.64,1); }

/* Фейерверк */
@keyframes particleFly {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}
.fw-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFly .75s ease-out forwards;
}

/* Иконка часов — прыжок */
@keyframes clockBounce {
  0%   { transform: translateY(0) scale(1); }
  30%  { transform: translateY(-9px) scale(1.2) rotate(-15deg); }
  60%  { transform: translateY(2px) scale(.95) rotate(5deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}
.clock-bounce { animation: clockBounce .5s cubic-bezier(.34,1.56,.64,1); }

/* Карточки — fade + slide */
@keyframes cardAppear {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.film-card-appear {
  animation: cardAppear .4s ease forwards;
  opacity: 0;
}
