/* Киноочередь — тёмная «киношная» тема из макета. Цвета свои, не из темы Telegram. */
:root {
  --ink: #15120f;
  --surface: #221d18;
  --surface-2: #1f1a16;
  --surface-3: #2c2620;
  --line: #3b332b;
  --line-soft: #2f2822;
  --line-dash: #4a4036;
  --paper: #f4ecdc;
  --paper-hi: #fffaf0;
  --paper-2: #ebe1cc;
  --text-2: #bfb39c;
  --muted: #9a8f7d;
  --muted-2: #8a7f6e;
  --muted-3: #7d7262;
  --ink-muted: #6b5f4d;
  --ink-muted-2: #8a7a62;
  --ink-line: #cdbfa5;
  --red: #ff5b3a;
  --red-deep: #d9442a;
  --red-shadow: #9c2f17;
  --yellow: #ffd447;
  --yellow-shadow: #a8862a;
  --film: #0c0a08;
  --sprocket: #2e2720;

  --f-display: 'Unbounded', system-ui, sans-serif;
  --f-ui: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-hand: 'Caveat', 'Comic Sans MS', cursive;
  --f-mono: ui-monospace, Menlo, Consolas, monospace;
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));

  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
*::-webkit-scrollbar { display: none; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--ink); }
body { font-family: var(--f-ui); color: var(--paper); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
input { font: inherit; }
input::placeholder { color: var(--muted-3); }
h1, p { margin: 0; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* ---------- каркас ---------- */
.app {
  position: fixed; inset: 0; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--ink); color: var(--paper);
}
.scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  overscroll-behavior: contain;
  padding: 14px 16px calc(110px + var(--safe-b));
}

.kicker { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 6px; }
.h1 {
  font-family: var(--f-display); font-weight: 800; font-size: 30px; line-height: 1.02;
  letter-spacing: -.01em; text-transform: uppercase; min-width: 0; overflow-wrap: anywhere;
}
.lead { font-size: 14px; color: var(--text-2); text-wrap: pretty; }
.hand { font-family: var(--f-hand); font-weight: 700; }
.section { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section::after { content: ""; flex: 1; height: 1.5px; background: var(--surface-3); }
.section span { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); }

/* ---------- переключатель списков ---------- */
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 18px; padding: 2px 16px; }
.pill {
  --ring: var(--surface);
  flex: none; height: 40px; padding: 0 14px 0 6px; display: flex; align-items: center; gap: 8px;
  border-radius: 20px; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--text-2); border: 1.5px solid var(--line-soft);
}
.pill.on { --ring: var(--paper); background: var(--paper); color: var(--ink); border-color: var(--paper); }
.pill:disabled { opacity: .55; }
.pill-name { white-space: nowrap; }
.stack { display: flex; padding-right: 8px; }
.pill-add {
  flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 20px; border: 1.5px dashed var(--line-dash); background: transparent; color: var(--muted); font-size: 16px;
}

.ava {
  position: relative; flex: none; width: 26px; height: 26px; border-radius: 13px; margin-right: -8px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 11px; font-weight: 700; color: var(--ink); background: var(--c);
  box-shadow: 0 0 0 2px var(--ring, var(--surface));
}
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.ava img.loaded { opacity: 1; }

/* ---------- вкладка «Список» ---------- */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.btn-add-sq {
  width: 48px; height: 48px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; border: 0; background: var(--yellow); color: var(--ink); font-size: 22px;
  box-shadow: 0 4px 0 var(--yellow-shadow); transform: rotate(4deg);
}
.btn-add-sq:active { transform: rotate(4deg) translateY(3px); box-shadow: 0 1px 0 var(--yellow-shadow); }
.runtime { margin: 10px 0 16px; font-size: 14px; line-height: 1.45; color: var(--text-2); text-wrap: pretty; }
.runtime mark { background: var(--yellow); color: var(--ink); padding: 1px 5px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.list-gap { height: 16px; }

.members {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 8px 8px 8px 12px;
  border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft);
}
.members .stack { padding: 0 0 0 4px; }
.members .ava { --ring: var(--surface-2); width: 30px; height: 30px; border-radius: 15px; margin: 0 0 0 -6px; font-size: 12px; }
.members-label { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-invite {
  flex: none; height: 36px; padding: 0 12px; display: flex; align-items: center; gap: 6px;
  border-radius: 10px; border: 1.5px solid var(--line-dash); background: transparent; color: var(--paper);
  font-size: 13px; font-weight: 600; transition: border-color .15s, color .15s;
}
.btn-invite:hover, .btn-invite:active { border-color: var(--yellow); color: var(--yellow); }
.btn-dots {
  flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 20px;
}

.segs { display: flex; gap: 6px; margin-bottom: 12px; }
.seg {
  flex: 1; height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; font-size: 14px; font-weight: 700;
  background: transparent; color: var(--text-2); border: 1.5px solid var(--line);
}
.seg.on { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.seg i { font-size: 16px; }
.seg .cnt {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; background: var(--surface-3); color: var(--muted);
}
.seg.on .cnt { background: var(--ink); color: var(--yellow); }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 20px; padding: 0 16px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: none; height: 34px; padding: 0 13px; border-radius: 17px; font-size: 13px; font-weight: 600;
  background: transparent; color: var(--text-2); border: 1.5px solid var(--line);
}
.chip.genre { font-weight: 500; }
.chip.big { height: 36px; padding: 0 14px; border-radius: 18px; }
.chip.on { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.chips .sep { flex: none; width: 1.5px; margin: 7px 3px; background: var(--line); }

/* постер: настоящая картинка поверх градиента-заглушки */
.poster {
  --h: 40;
  position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  background: linear-gradient(165deg, hsl(var(--h) 45% 46%) 0%, hsl(var(--h) 35% 25%) 60%, hsl(var(--h) 25% 13%) 100%);
}
@supports (color: oklch(0 0 0)) {
  .poster { background: linear-gradient(165deg, oklch(0.58 0.13 var(--h)) 0%, oklch(0.34 0.08 var(--h)) 60%, oklch(0.22 0.04 var(--h)) 100%); }
}
.poster::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: repeating-linear-gradient(135deg, rgba(244, 236, 220, .06) 0 6px, transparent 6px 12px);
}
.poster-label { position: absolute; top: 6px; left: 6px; z-index: 0; font-family: var(--f-mono); font-size: 9px; color: rgba(244, 236, 220, .6); }
.poster img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.poster img.loaded { opacity: 1; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 12px; }
.pola {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 5px 5px 7px;
  background: var(--paper); border: 0; border-radius: 4px; text-align: left; color: var(--ink);
  box-shadow: 0 8px 16px rgba(0, 0, 0, .45); transition: transform .2s;
}
.pola:active { transform: scale(.97); }
.pola .poster { width: 100%; border-radius: 2px; }
.stamp-score {
  position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%) rotate(-14deg);
  padding: 3px 8px; border: 2.5px solid var(--red); border-radius: 6px; white-space: nowrap;
  font-family: var(--f-display); font-size: 13px; font-weight: 800; color: var(--red); background: rgba(21, 18, 15, .55);
}
.sticker {
  position: absolute; top: -6px; right: -6px; z-index: 3; padding: 2px 6px; border-radius: 3px;
  background: var(--yellow); color: var(--ink); font-size: 9px; font-weight: 800; letter-spacing: .08em;
  transform: rotate(8deg); box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
}
.pola-cap { padding: 6px 2px 0; min-width: 0; }
.pola-title { font-size: 12px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pola-meta { font-size: 11px; color: var(--ink-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pola-by { font-family: var(--f-hand); font-size: 16px; font-weight: 700; line-height: 1; color: var(--red-deep); margin-top: 3px; }

.empty { padding: 30px 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.empty-title { font-family: var(--f-hand); font-size: 30px; font-weight: 700; line-height: 1.05; color: var(--yellow); transform: rotate(-2deg); max-width: 300px; }
.empty-text { font-size: 14px; color: var(--muted); max-width: 290px; }
.btn-yellow {
  margin-top: 8px; height: 46px; padding: 0 18px; display: flex; align-items: center; gap: 8px;
  border-radius: 12px; border: 0; background: var(--yellow); color: var(--ink); font-weight: 700;
  box-shadow: 0 4px 0 var(--yellow-shadow);
}
.btn-yellow:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--yellow-shadow); }

/* ---------- вкладка «Добавить» ---------- */
.add-title { margin-bottom: 8px; }
.add-lead { margin-bottom: 16px; }
.search { position: relative; margin-bottom: 20px; }
.search > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--muted-2); pointer-events: none; }
.search input {
  width: 100%; height: 54px; padding: 0 46px 0 44px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface-2); color: var(--paper); font-size: 15px; outline: none; transition: border-color .15s;
}
.search input:focus { border-color: var(--yellow); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 5px; top: 5px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--muted-2); font-size: 20px;
}
.skeletons { display: flex; flex-direction: column; gap: 14px; }
.skel { display: flex; gap: 12px; align-items: center; }
.skel-poster { width: 52px; aspect-ratio: 2 / 3; border-radius: 6px; background: var(--surface); }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skel-lines b { height: 12px; width: 60%; border-radius: 6px; background: var(--surface-3); }
.skel-lines b + b { height: 10px; width: 40%; background: var(--surface); }
.skel-note { font-family: var(--f-hand); font-size: 20px; font-weight: 700; color: var(--muted-2); }
.rows { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 14px; cursor: pointer; }
.row:hover, .row:active { background: var(--surface-2); }
.row .poster { flex: none; width: 52px; border-radius: 6px; }
.row .poster-label { display: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.row-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.row-genres { font-size: 12px; color: var(--muted-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-btn {
  flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; border: 0; background: var(--yellow); color: var(--ink); font-size: 20px;
  box-shadow: 0 3px 0 var(--yellow-shadow); transition: transform .15s;
}
.row-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--yellow-shadow); }
.row-btn.added { background: var(--surface-3); color: var(--yellow); box-shadow: none; transform: rotate(-6deg); }
.not-found { padding: 20px 0; display: flex; flex-direction: column; gap: 6px; }
.not-found-title { font-family: var(--f-hand); font-size: 28px; font-weight: 700; line-height: 1.05; color: var(--yellow); transform: rotate(-1.5deg); overflow-wrap: anywhere; }
.not-found-text { font-size: 14px; color: var(--muted); }
.spin-icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- рулетка ---------- */
.modes { display: flex; align-items: center; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 12px; border: 1.5px dashed var(--line); }
.modes-label { font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-3); padding: 0 6px; }
.mode {
  flex: 1; height: 32px; display: flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700;
}
.mode.on { background: var(--paper); color: var(--ink); }
.mode b { font-family: var(--f-mono); font-weight: 400; opacity: .6; }
.r-title { margin-bottom: 8px; }
.r-lead { margin-bottom: 14px; }
.stage { margin: 0 -16px; }

.film { position: relative; overflow: hidden; padding: 22px 0; margin: 10px 0; background: var(--film); }
.film::before, .film::after {
  content: ""; position: absolute; left: 0; right: 0; height: 10px; z-index: 1;
  background: repeating-linear-gradient(90deg, transparent 0 6px, var(--sprocket) 6px 16px);
}
.film::before { top: 5px; }
.film::after { bottom: 5px; }
.reel-strip { display: flex; gap: 10px; width: max-content; will-change: transform; }
.reel-card { position: relative; flex: none; width: 112px; height: 168px; border-radius: 4px; overflow: hidden; transition: opacity .4s; }
.reel-card .poster { position: absolute; inset: 0; aspect-ratio: auto; }
.reel-card.dim { opacity: .3; }
.card-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 24px 8px 8px;
  background: linear-gradient(180deg, transparent, rgba(12, 10, 8, .85));
  font-size: 12px; font-weight: 700; line-height: 1.15; color: var(--paper); text-align: left;
}
.frame { position: absolute; top: 16px; bottom: 16px; left: 50%; width: 126px; margin-left: -63px; border-radius: 8px; border: 3px solid var(--yellow); pointer-events: none; z-index: 2; }
.pointer {
  position: absolute; top: 2px; left: 50%; width: 0; height: 0; margin-left: -9px; z-index: 3; pointer-events: none;
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 13px solid var(--red);
}
.fade-l, .fade-r { position: absolute; top: 0; bottom: 0; width: 60px; z-index: 2; pointer-events: none; }
.fade-l { left: 0; background: linear-gradient(90deg, var(--ink), transparent); }
.fade-r { right: 0; background: linear-gradient(270deg, var(--ink), transparent); }

.elim { padding: 6px 16px 0; }
.elim-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.elim-hint { font-family: var(--f-hand); font-size: 20px; font-weight: 700; line-height: 1.1; color: var(--text-2); transform: rotate(-1deg); }
.badge-y {
  flex: none; height: 26px; padding: 0 10px; display: flex; align-items: center; border-radius: 13px;
  background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 800; white-space: nowrap;
}
.elim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.ecard {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: none;
  aspect-ratio: 2 / 3; perspective: 800px; transform: rotate(var(--tilt, 0deg));
}
.ecard-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.35, .5, 1); }
.ecard.open .ecard-inner { transform: rotateY(180deg); }
.ecard-face { position: absolute; inset: 0; border-radius: 8px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ecard-back {
  display: flex; align-items: center; justify-content: center;
  background: var(--red); border: 3px solid var(--paper); box-shadow: 0 6px 14px rgba(0, 0, 0, .45);
}
.ecard-back::before {
  content: ""; position: absolute; inset: 5px; border-radius: 4px; border: 1.5px dashed rgba(21, 18, 15, .45);
  background: repeating-linear-gradient(45deg, rgba(255, 212, 71, .22) 0 6px, transparent 6px 12px);
}
.ecard-num { position: relative; font-family: var(--f-display); font-size: 30px; font-weight: 800; color: var(--ink); }
.ecard-front {
  transform: rotateY(180deg); background: var(--ink); border: 3px solid var(--paper);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45); transition: border-color .3s, box-shadow .3s;
}
.ecard-front .poster { position: absolute; inset: 0; aspect-ratio: auto; transition: filter .4s .3s; }
.ecard-front .poster-label { display: none; }
.ecard-front .card-cap { padding: 22px 6px 6px; font-size: 11px; background: linear-gradient(180deg, transparent, rgba(12, 10, 8, .9)); }
.ecard.out .ecard-front .poster { filter: grayscale(.9) brightness(.55); }
.ecard.win .ecard-front { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--ink), 0 0 26px rgba(255, 212, 71, .6); }
.estamp {
  display: none; position: absolute; left: 50%; top: 40%; z-index: 3; white-space: nowrap;
  border-radius: 6px; font-family: var(--f-display); font-weight: 800;
}
.estamp-out { transform: translate(-50%, -50%) rotate(-16deg); padding: 2px 8px; border: 2.5px solid var(--red); font-size: 13px; color: var(--red); background: rgba(21, 18, 15, .6); }
.estamp-win { transform: translate(-50%, -50%) rotate(-12deg); padding: 3px 7px; border: 2.5px solid var(--yellow); font-size: 11px; color: var(--yellow); background: rgba(21, 18, 15, .65); }
.ecard.out .estamp-out, .ecard.win .estamp-win { display: block; }
.elim-note { margin-top: 14px; min-height: 0; font-family: var(--f-hand); font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--yellow); text-align: center; transform: rotate(-1deg); }

.cand { display: flex; justify-content: center; margin: 8px 0 14px; }
.cand span { font-family: var(--f-hand); font-size: 20px; font-weight: 700; color: var(--muted); transform: rotate(-2deg); }
.btn-spin {
  width: 100%; height: 62px; display: flex; align-items: center; justify-content: center; gap: 12px;
  border-radius: 18px; border: 0; background: var(--red); color: var(--ink);
  font-family: var(--f-display); font-size: 17px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
  box-shadow: 0 6px 0 var(--red-shadow); transition: transform .1s, box-shadow .1s;
}
.btn-spin i { font-size: 22px; }
.btn-spin:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--red-shadow); }
.btn-spin.pressed { transform: translateY(4px); box-shadow: 0 2px 0 var(--red-shadow); }
.reroll { margin-top: 12px; font-family: var(--f-hand); font-size: 21px; font-weight: 700; line-height: 1.1; color: var(--yellow); text-align: center; transform: rotate(1.5deg); }
.cant { margin-top: 8px; padding: 20px 16px; border-radius: 16px; border: 2px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.cant-title { font-family: var(--f-hand); font-size: 26px; font-weight: 700; line-height: 1.05; color: var(--yellow); }
.cant-text { font-size: 14px; color: var(--muted); }

.result { margin-top: 26px; animation: rise .45s cubic-bezier(.3, 1.4, .5, 1); scroll-margin-bottom: calc(96px + var(--safe-b)); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.verdict { font-family: var(--f-hand); font-size: 28px; font-weight: 700; line-height: 1; color: var(--yellow); transform: rotate(-2deg); margin: 0 0 10px 6px; }
.ticket { position: relative; display: flex; background: var(--paper); color: var(--ink); border-radius: 14px; transform: rotate(-1deg); box-shadow: 0 12px 26px rgba(0, 0, 0, .5); }
.ticket-main { flex: 1; min-width: 0; padding: 14px 12px 14px 16px; }
.ticket-kicker { font-size: 10px; font-weight: 700; letter-spacing: .18em; color: var(--ink-muted-2); }
.ticket-title { font-family: var(--f-display); font-size: 19px; font-weight: 800; line-height: 1.1; text-transform: uppercase; margin: 6px 0 4px; text-wrap: balance; overflow-wrap: anywhere; }
.ticket-meta { font-size: 12px; color: var(--ink-muted); }
.ticket-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1.5px dashed var(--ink-line); }
.tf-l { font-size: 9px; font-weight: 700; letter-spacing: .14em; color: var(--ink-muted-2); }
.tf-v { font-size: 13px; font-weight: 700; margin-top: 1px; }
.perf { position: relative; flex: none; width: 2px; margin: 14px 0; background: repeating-linear-gradient(180deg, var(--ink-line) 0 6px, transparent 6px 11px); }
.perf::before, .perf::after { content: ""; position: absolute; left: -11px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); }
.perf::before { top: -24px; }
.perf::after { bottom: -24px; }
.stub { flex: none; width: 72px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px; }
.stub-no { font-family: var(--f-mono); font-size: 10px; color: var(--ink-muted); }
.barcode {
  width: 42px; flex: 1; min-height: 56px;
  background: repeating-linear-gradient(90deg, #15120f 0 2px, transparent 2px 4px, #15120f 4px 5px, transparent 5px 8px, #15120f 8px 11px, transparent 11px 13px);
}
.stamp-ok { font-size: 9px; font-weight: 700; letter-spacing: .1em; color: var(--red-deep); transform: rotate(-6deg); border: 1.5px solid var(--red-deep); border-radius: 3px; padding: 1px 4px; }
.ticket-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.btn-outline {
  flex: 1; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--paper);
  background: transparent; color: var(--paper); font-size: 14px; font-weight: 700; transition: background .15s, color .15s;
}
.btn-outline:hover, .btn-outline:active { background: var(--paper); color: var(--ink); }
.btn-chat {
  flex: 1; height: 44px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 12px; border: 0; background: var(--yellow); color: var(--ink); font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 0 var(--yellow-shadow);
}
.btn-chat:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--yellow-shadow); }
.btn-text { height: 44px; padding: 0 12px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font-size: 14px; }
.btn-text:hover, .btn-text:active { color: var(--paper); }

.source-title { margin: 30px 0 10px; }
.pick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pick-count { font-family: var(--f-hand); font-size: 20px; font-weight: 700; color: var(--text-2); }
.pick-btns { display: flex; gap: 4px; }
.pick-btn { height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--yellow); font-size: 13px; font-weight: 600; }
.pick-btn.muted { color: var(--muted); font-weight: 400; }
.picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
.pick { position: relative; padding: 0; border: 0; background: none; text-align: left; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pick .poster { border-radius: 6px; opacity: .45; transition: opacity .2s, box-shadow .2s; }
.pick .poster-label { display: none; }
.pick.on .poster { opacity: 1; box-shadow: 0 0 0 2.5px var(--yellow); }
.pick-check {
  position: absolute; top: 4px; right: 4px; z-index: 3; width: 22px; height: 22px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  background: rgba(21, 18, 15, .5); border: 1.5px solid var(--text-2); color: var(--ink);
}
.pick.on .pick-check { background: var(--yellow); border-color: var(--yellow); }
.pick-title { font-size: 11px; line-height: 1.2; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- док ---------- */
.dock {
  position: absolute; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 20; height: 66px;
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
}
.dock-btn {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; font-size: 11px; font-weight: 700; color: var(--muted-2);
}
.dock-btn i { font-size: 24px; }
.dock-btn.on { color: var(--yellow); }
.dock-btn.center { justify-content: flex-end; padding-bottom: 9px; }
.dock-wheel {
  width: 58px; height: 58px; margin-top: -30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--red); color: var(--ink); border: 4px solid var(--ink); box-shadow: 0 0 0 1px var(--line);
  transform: rotate(var(--rot, 0deg)); transition: transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.app.kb .dock { display: none; }

/* ---------- шторка ---------- */
.backdrop { position: absolute; inset: 0; z-index: 30; background: rgba(8, 6, 4, .62); opacity: 0; pointer-events: none; transition: opacity .25s; }
.backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 90%;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--ink); border-radius: 22px 22px 0 0;
  /* закрытая шторка уезжает с запасом и прячется после анимации, чтобы не выглядывать и не ловить фокус */
  transform: translateY(calc(105% + 40px)); visibility: hidden;
  transition: transform .34s cubic-bezier(.2, .9, .25, 1.05), visibility 0s linear .34s;
}
.sheet.open { transform: none; visibility: visible; transition: transform .34s cubic-bezier(.2, .9, .25, 1.05), visibility 0s; }
.sheet-grip { position: absolute; top: 8px; left: 50%; z-index: 2; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(244, 236, 220, .6); }
.sheet.plain .sheet-grip { background: rgba(21, 18, 15, .18); }
.sheet-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 19px;
  display: flex; align-items: center; justify-content: center; border: 0; background: var(--ink); color: var(--paper); font-size: 16px;
}
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; padding-bottom: calc(22px + var(--safe-b)); }

.d-hero { position: relative; height: 124px; }
.d-hero .poster { position: absolute; inset: 0; aspect-ratio: auto; }
.d-hero .poster img { filter: blur(1px) saturate(1.1); transform: scale(1.04); }
.d-hero .poster-label { display: none; }
.d-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 30%, var(--paper)); }
.d-wrap { padding: 0 18px; }
.d-top { position: relative; z-index: 2; display: flex; gap: 14px; margin-top: -70px; }
.d-poster { position: relative; flex: none; width: 110px; padding: 4px; background: var(--paper-hi); border-radius: 5px; box-shadow: 0 10px 20px rgba(21, 18, 15, .3); transform: rotate(-3deg); }
.d-poster .poster { border-radius: 3px; }
.d-titles { flex: 1; min-width: 0; padding-top: 76px; }
.d-title { font-family: var(--f-display); font-size: 19px; font-weight: 800; line-height: 1.08; text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.d-orig { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--line-dash); }
.d-rating { height: 26px; padding: 0 9px; display: flex; align-items: center; gap: 4px; border-radius: 8px; background: var(--ink); color: var(--yellow); font-weight: 700; }
.d-len { display: flex; align-items: center; gap: 4px; }
.d-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.d-genre { height: 26px; display: flex; align-items: center; padding: 0 9px; border-radius: 6px; border: 1.5px solid var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.d-desc { font-size: 15px; line-height: 1.55; color: #2e2720; margin: 14px 0; text-wrap: pretty; }
.d-desc.empty-desc { color: var(--ink-muted); }
.d-link { display: inline-flex; align-items: center; gap: 5px; margin: -4px 0 14px; padding: 0; border: 0; background: none; color: var(--ink-muted); font-size: 13px; font-weight: 600; }
.d-by { font-family: var(--f-hand); font-size: 21px; font-weight: 700; color: var(--red-deep); margin-bottom: 14px; transform: rotate(-1deg); }
.d-rate { padding: 12px 12px 8px; border-radius: 14px; background: var(--paper-2); margin-bottom: 14px; }
.d-rate-k { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--ink-muted-2); }
.d-pops { display: flex; margin: 2px -6px 0; }
.pop {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border: 0; background: none;
  color: #b9ad96; font-size: 28px; transition: transform .2s cubic-bezier(.3, 1.8, .5, 1), color .15s;
}
.pop.on { color: var(--red-deep); }
.pop.cur { transform: scale(1.18); }
.d-rate-label { font-family: var(--f-hand); font-size: 20px; font-weight: 700; color: var(--line-dash); min-height: 24px; }
.d-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-red, .btn-ink, .btn-ink-outline, .btn-del {
  display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; font-size: 15px;
}
.btn-red { height: 52px; border: 0; background: var(--red); color: var(--ink); font-weight: 800; box-shadow: 0 4px 0 var(--red-shadow); }
.btn-red:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-shadow); }
.btn-ink { height: 52px; border: 0; background: var(--ink); color: var(--paper); font-weight: 700; box-shadow: 0 4px 0 var(--ink-muted); }
.btn-ink:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink-muted); }
.btn-ink-outline { height: 50px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font-weight: 700; }
.btn-del { height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-muted); font-size: 14px; font-weight: 600; transition: color .15s; }
.btn-del:hover, .btn-del:active { color: var(--red-deep); }
.btn-red:disabled, .btn-ink:disabled { opacity: .6; }

/* формы в шторке: новый список и настройки */
.form { padding: 30px 18px 0; }
.form-kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted-2); }
.form-title { font-family: var(--f-display); font-size: 21px; font-weight: 800; line-height: 1.08; text-transform: uppercase; margin: 6px 48px 8px 0; text-wrap: balance; }
.form-lead { font-size: 14px; line-height: 1.45; color: var(--ink-muted); margin-bottom: 16px; }
.field {
  width: 100%; height: 52px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--ink-line);
  background: var(--paper-hi); color: var(--ink); font-size: 15px; outline: none; margin-bottom: 14px; transition: border-color .15s;
}
.field:focus { border-color: var(--ink); }
.field::placeholder { color: var(--ink-muted-2); }
.form-note { font-family: var(--f-hand); font-size: 21px; font-weight: 700; line-height: 1.1; color: var(--red-deep); transform: rotate(-1deg); margin: 4px 0 16px; }
.form-section { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--ink-muted-2); margin: 22px 0 6px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1.5px dashed var(--ink-line); font-size: 15px; font-weight: 600; }
.member-row .ava { --ring: var(--paper); width: 32px; height: 32px; border-radius: 16px; margin: 0; font-size: 13px; }
.member-row small { margin-left: auto; font-family: var(--f-hand); font-size: 18px; font-weight: 700; color: var(--red-deep); }
.form-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* ---------- уведомление ---------- */
.toast {
  position: absolute; left: 50%; bottom: calc(92px + var(--safe-b)); z-index: 40; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 12px;
  background: var(--yellow); color: var(--ink); box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
  font-size: 14px; font-weight: 700; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translateX(-50%) translateY(10px) rotate(-1.5deg);
  transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.toast span { overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0) rotate(-1.5deg); }
.toast.error { white-space: normal; }

/* ---------- загрузка ---------- */
.boot {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; text-align: center; background: var(--ink);
}
.boot-hand { font-family: var(--f-hand); font-size: 30px; font-weight: 700; line-height: 1.05; color: var(--yellow); transform: rotate(-2deg); max-width: 320px; }
.boot-text { font-size: 14px; color: var(--muted); max-width: 300px; }
.boot-reel { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--red); animation: spin .9s linear infinite; margin-bottom: 8px; }

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