/* kino.bohdan.red — тёмная монтажная. Свет, стекло, янтарь. */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@300;400;500;600;700&family=Unbounded:wght@400;600;700&display=swap');

:root {
  color-scheme: dark;

  --ink:        #07080b;
  --ink-2:      #0c0e13;
  --panel:      rgba(21, 24, 31, .78);
  --panel-hi:   rgba(30, 34, 43, .82);
  --edge:       rgba(255, 255, 255, .085);
  --edge-hi:    rgba(255, 255, 255, .17);

  --text:       rgba(244, 246, 251, .93);
  --muted:      rgba(238, 242, 250, .62);
  --faint:      rgba(232, 238, 250, .38);

  --amber:      #ffab3d;
  --amber-deep: #f0851a;
  --amber-wash: rgba(255, 171, 61, .13);
  --good:       #7de2a8;
  --bad:        #ff8080;

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 13px;
  --r-sm: 9px;

  --shadow-lift: 0 26px 70px rgba(0, 0, 0, .55), 0 6px 16px rgba(0, 0, 0, .38);
  --shadow-card: 0 14px 38px rgba(0, 0, 0, .42), 0 2px 5px rgba(0, 0, 0, .32);

  --e-display: cubic-bezier(.16, 1, .3, 1);
  --e-body:    cubic-bezier(.25, .46, .45, .94);
  --e-ui:      cubic-bezier(.4, 0, .2, 1);

  --rail: 396px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: Onest, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Свет неровный: два тёплых очага и один холодный, поверх — зерно. */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: 0;
  background:
    radial-gradient(38vmax 30vmax at 24% 14%, rgba(255, 156, 52, .34), transparent 58%),
    radial-gradient(34vmax 26vmax at 82% 26%, rgba(96, 140, 255, .20), transparent 62%),
    radial-gradient(46vmax 38vmax at 58% 96%, rgba(255, 120, 40, .18), transparent 58%),
    radial-gradient(18vmax 14vmax at 8% 78%, rgba(255, 190, 120, .10), transparent 60%),
    var(--ink);
  filter: saturate(118%);
  animation: driftLight 46s var(--e-body) infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

@keyframes driftLight {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2.5%, -1.6%, 0) scale(1.06); }
}

::selection { background: rgba(255, 171, 61, .3); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 171, 61, .42); background-clip: content-box; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

input, textarea, button, select { font: inherit; color: inherit; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ─────────────────────────────────────────────────────────── вход */

.gate {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(20px, 4vw, 52px);
}

.gate-body {
  align-self: end;
  max-width: 720px;
}

.gate h1 {
  margin: 0 0 26px;
  font-family: Unbounded, Onest, sans-serif;
  font-weight: 700;
  font-size: clamp(46px, 9vw, 118px);
  line-height: .88;
  letter-spacing: -.038em;
  text-wrap: balance;
}

.gate h1 span { color: var(--amber); }

.gate form {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 460px;
}

.gate input {
  flex: 1;
  height: 54px;
  padding: 0 18px;
  font-size: 16px;
  background: rgba(12, 14, 19, .8);
  border: 1px solid var(--edge);
  border-radius: 99px;
  backdrop-filter: blur(18px);
  transition: border-color .3s var(--e-ui), background .3s var(--e-ui);
}

.gate input:focus { border-color: var(--edge-hi); background: rgba(16, 19, 25, .92); }
.gate input::placeholder { color: var(--faint); }

.gate-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 44ch;
}

.gate-error { color: var(--bad); min-height: 21px; margin: 14px 0 0; font-size: 14px; }

.go.passport {
  width: auto;
  padding: 0 28px;
  margin-bottom: 14px;
  text-decoration: none;
}

.gate-foot {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 13px;
  padding-top: 32px;
}

/* ──────────────────────────────────────────────────────── каркас */

.shell {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 30px);
  padding: clamp(14px, 1.8vw, 26px);
}

/* ───────────────────────────────────────────────────────── пульт */

.rail {
  position: sticky;
  top: clamp(14px, 1.8vw, 26px);
  height: calc(100svh - 2 * clamp(14px, 1.8vw, 26px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--edge);
  border-radius: var(--r-xl);
  background: linear-gradient(168deg, var(--panel-hi), var(--panel) 42%, rgba(14, 16, 21, .88));
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(26px) saturate(130%);
  overflow: hidden;
  animation: railIn .8s var(--e-display) both;
}

@keyframes railIn {
  from { opacity: 0; transform: translate3d(-26px, 0, 0); filter: blur(9px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.rail-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--edge);
}

.mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--amber), var(--amber-deep));
  color: #1a1104;
  box-shadow: 0 8px 22px rgba(240, 133, 26, .35);
}

.rail-head b {
  font-family: Unbounded, Onest, sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
}

.rail-head small { display: block; color: var(--faint); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }

.rail-scroll { flex: 1; overflow-y: auto; padding: 18px 20px 4px; scrollbar-gutter: stable; }

.field { margin-bottom: 20px; }

.field > label,
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .02em;
}

.field-label i { font-style: normal; color: var(--faint); font-size: 11.5px; }

textarea.prompt {
  width: 100%;
  min-height: 132px;
  padding: 14px 15px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.45;
  background: rgba(9, 11, 15, .72);
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  transition: border-color .3s var(--e-ui), box-shadow .3s var(--e-ui);
}

textarea.prompt:focus {
  border-color: rgba(255, 171, 61, .45);
  box-shadow: 0 0 0 3px rgba(255, 171, 61, .1);
}

textarea.prompt::placeholder { color: var(--faint); }

/* сегменты и пилюли */

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  background: rgba(9, 11, 15, .7);
  border: 1px solid var(--edge);
  border-radius: 99px;
}

.seg button {
  position: relative;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color .25s var(--e-ui), background .25s var(--e-ui);
}

.seg button:hover { color: var(--text); }

.seg button[aria-pressed="true"] {
  background: linear-gradient(150deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 4px 14px rgba(0, 0, 0, .3);
}

.seg.accent button[aria-pressed="true"] {
  background: linear-gradient(150deg, var(--amber), var(--amber-deep));
  color: #1c1205;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(240, 133, 26, .3);
}

.seg .ratio { display: inline-flex; align-items: center; gap: 7px; justify-content: center; }
.seg .ratio em { display: block; border: 1.6px solid currentColor; border-radius: 3px; opacity: .85; }
.ratio-169 em { width: 17px; height: 10px; }
.ratio-916 em { width: 10px; height: 17px; }
.ratio-11  em { width: 13px; height: 13px; }

/* длительность */

.dur {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dur output {
  font-family: Unbounded, Onest, sans-serif;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.03em;
  min-width: 62px;
}

.dur output i { font-style: normal; font-size: 14px; color: var(--faint); margin-left: 3px; }

input[type="range"] {
  flex: 1;
  appearance: none;
  height: 30px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--amber) var(--fill, 20%), rgba(255, 255, 255, .12) var(--fill, 20%));
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
  transition: transform .22s var(--e-ui);
}

input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(.96); }

input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .12); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--amber); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; }

/* тумблеры */

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 8px 14px;
  margin-bottom: 9px;
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  background: rgba(9, 11, 15, .58);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .25s var(--e-ui), background .25s var(--e-ui);
}

.switch:hover { border-color: var(--edge-hi); background: rgba(14, 17, 23, .72); }

.switch .lab { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.switch .lab small { display: block; color: var(--faint); font-size: 11.5px; font-weight: 400; }
.switch .lab svg { color: var(--faint); flex: none; }
.switch[aria-pressed="true"] .lab svg { color: var(--amber); }

.knob {
  flex: none;
  width: 44px;
  height: 26px;
  padding: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  transition: background .3s var(--e-ui);
}

.knob i {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  transition: transform .34s var(--e-display), background .3s var(--e-ui);
}

.switch[aria-pressed="true"] .knob { background: rgba(255, 171, 61, .4); }
.switch[aria-pressed="true"] .knob i { transform: translateX(18px); background: var(--amber); }

/* кадры */

.frames { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.drop {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: var(--r-md);
  background: rgba(9, 11, 15, .6);
  color: var(--faint);
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .25s var(--e-ui), color .25s var(--e-ui), transform .25s var(--e-ui);
}

.drop:hover { border-color: rgba(255, 171, 61, .5); color: var(--muted); transform: translateY(-2px); }
.drop.is-over { border-color: var(--amber); background: var(--amber-wash); }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.drop .tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(6, 7, 10, .78);
  color: var(--text);
  font-size: 11px;
  backdrop-filter: blur(8px);
}

.drop .clear {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  display: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 7, 10, .8);
  color: #fff;
  cursor: pointer;
}

.drop.has-file .clear { display: grid; }
.drop.has-file { border-style: solid; border-color: var(--edge); }

/* подвал пульта: цена и кнопка */

.rail-foot {
  padding: 16px 20px 18px;
  border-top: 1px solid var(--edge);
  background: linear-gradient(180deg, rgba(10, 12, 16, .2), rgba(10, 12, 16, .55));
}

.price {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.price .amount {
  font-family: Unbounded, Onest, sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.04em;
  color: var(--amber);
  transition: opacity .2s var(--e-ui), filter .2s var(--e-ui);
}

.price .amount.is-swap { opacity: .2; filter: blur(6px); }
.price .meta { color: var(--faint); font-size: 12px; text-align: right; line-height: 1.45; }

.go {
  position: relative;
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 99px;
  background: linear-gradient(140deg, var(--amber), var(--amber-deep));
  color: #1b1104;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(240, 133, 26, .32);
  transition: transform .26s var(--e-display), box-shadow .26s var(--e-ui), filter .26s var(--e-ui);
}

.go::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, .5) 50%, transparent 66%);
  transform: translateX(-120%);
}

.go:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(240, 133, 26, .42); }
.go:hover::after { animation: sheen 1.05s var(--e-body); }
.go:active { transform: translateY(0) scale(.99); }
.go:disabled { filter: grayscale(.6) brightness(.75); cursor: not-allowed; box-shadow: none; }

@keyframes sheen { to { transform: translateX(120%); } }

.rail-error { margin: 10px 0 0; color: var(--bad); font-size: 13px; line-height: 1.4; }

/* ─────────────────────────────────────────────────────── главная */

.stage { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 4px 4px 0;
  animation: fadeUp .7s var(--e-display) both .08s;
}

.wallet {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 13px 20px;
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
}

.wallet .cell small {
  display: block;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.wallet .cell b {
  font-family: Unbounded, Onest, sans-serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.wallet .cell b em { font-style: normal; font-size: 13px; color: var(--faint); font-weight: 400; }
.wallet .cell .hint { display: block; margin-top: 2px; color: var(--faint); font-size: 11.5px; }
.wallet .sep { width: 1px; height: 30px; background: var(--edge); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.ghost {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--edge);
  border-radius: 99px;
  background: rgba(16, 19, 25, .6);
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: color .25s var(--e-ui), border-color .25s var(--e-ui), transform .25s var(--e-ui);
}

.ghost:hover { color: var(--text); border-color: var(--edge-hi); transform: translateY(-1px); }

/* лента */

.library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 16px;
  padding-bottom: 30px;
}

.card {
  position: relative;
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: fadeUp .66s var(--e-display) both;
  animation-delay: calc(var(--i, 0) * 42ms + .12s);
  transition: transform .4s var(--e-display), border-color .3s var(--e-ui), box-shadow .4s var(--e-body);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--edge-hi);
  box-shadow: 0 30px 66px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 171, 61, .1);
}

.card .screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05060a;
  overflow: hidden;
}

.card.is-portrait .screen { aspect-ratio: 3 / 4; }
.card.is-square .screen { aspect-ratio: 1 / 1; }

.card .screen img,
.card .screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .45s var(--e-body), transform .8s var(--e-display);
}

.card .screen video { opacity: 0; }
.card:hover .screen img { opacity: 0; transform: scale(1.04); }
.card:hover .screen video { opacity: 1; }

.card .badges {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(6, 7, 10, .74);
  border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .88);
  font-size: 11.5px;
  backdrop-filter: blur(10px);
}

.badge.hot { background: rgba(255, 171, 61, .17); border-color: rgba(255, 171, 61, .35); color: #ffd39a; }

.card .body { padding: 13px 15px 15px; }

.card .body p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card .cost {
  font-family: Unbounded, Onest, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.card .when { color: var(--faint); font-size: 12px; }

.card .tools { display: flex; gap: 4px; opacity: 0; transform: translateY(4px); transition: opacity .3s var(--e-ui), transform .3s var(--e-display); }
.card:hover .tools, .card:focus-within .tools { opacity: 1; transform: none; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: rgba(12, 14, 19, .7);
  color: var(--muted);
  cursor: pointer;
  transition: color .22s var(--e-ui), border-color .22s var(--e-ui), background .22s var(--e-ui);
}

.icon-btn:hover { color: var(--text); border-color: var(--edge-hi); background: rgba(22, 26, 33, .85); }
.icon-btn.danger:hover { color: var(--bad); border-color: rgba(255, 128, 128, .4); }

/* карточка в работе */

.card.is-working .screen {
  background:
    linear-gradient(100deg, rgba(255, 255, 255, .02) 30%, rgba(255, 171, 61, .12) 50%, rgba(255, 255, 255, .02) 70%)
    0 0 / 260% 100%;
  animation: pass 2.2s var(--e-body) infinite;
}

@keyframes pass { to { background-position: -180% 0; } }

.card.is-working .screen::after {
  content: attr(data-note);
  position: absolute;
  inset: auto 0 0;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.card.is-failed .screen { display: grid; place-items: center; background: rgba(255, 128, 128, .07); }
.card.is-failed .screen span { color: var(--bad); font-size: 12.5px; padding: 18px; text-align: center; }

.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* пусто */

.empty {
  grid-column: 1 / -1;
  padding: clamp(40px, 9vh, 96px) 26px;
  text-align: center;
  border: 1px dashed var(--edge);
  border-radius: var(--r-xl);
  background: rgba(12, 14, 19, .35);
}

.empty h2 {
  margin: 0 0 10px;
  font-family: Unbounded, Onest, sans-serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -.03em;
}

.empty p { margin: 0 auto; max-width: 46ch; color: var(--muted); font-size: 14.5px; }

.seeds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 720px;
  margin: 24px auto 0;
}

.seed {
  padding: 9px 15px;
  border: 1px solid var(--edge);
  border-radius: 99px;
  background: rgba(16, 19, 25, .6);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: color .25s var(--e-ui), border-color .25s var(--e-ui), transform .25s var(--e-display);
}

.seed:hover { color: var(--text); border-color: rgba(255, 171, 61, .45); transform: translateY(-2px); }

@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: none; }
}

/* просмотр */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 42px);
  background: rgba(4, 5, 8, .78);
  backdrop-filter: blur(16px);
  animation: fade .3s var(--e-body) both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.viewer video {
  max-width: min(1180px, 100%);
  max-height: 82svh;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
  animation: pop .44s var(--e-display) both;
}

@keyframes pop { from { opacity: 0; transform: scale(.965) translateY(10px); } to { opacity: 1; transform: none; } }

.viewer .close { position: absolute; top: 18px; right: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  border: 1px solid var(--edge-hi);
  border-radius: 99px;
  background: rgba(14, 17, 23, .94);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lift);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--e-ui), transform .4s var(--e-display);
}

.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* мобильный вызов пульта */

.compose-fab { display: none; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; padding: 12px; }

  .rail {
    position: fixed;
    inset: auto 0 0;
    height: min(90svh, 720px);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    z-index: 50;
    transform: translateY(101%);
    transition: transform .46s var(--e-display);
    animation: none;
  }

  .rail.open { transform: none; }

  .rail::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .2);
  }

  .rail-head { padding-top: 22px; }

  .compose-fab {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 52px;
    padding: 0 22px;
    border: 0;
    border-radius: 99px;
    background: linear-gradient(140deg, var(--amber), var(--amber-deep));
    color: #1b1104;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 16px 40px rgba(240, 133, 26, .38);
    cursor: pointer;
  }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 44;
    background: rgba(4, 5, 8, .6);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s var(--e-ui);
  }

  .scrim.on { opacity: 1; pointer-events: auto; }

  .library { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); padding-bottom: 96px; }
  .card .tools { opacity: 1; transform: none; }
  .icon-btn { width: 44px; height: 44px; }
  .wallet { width: 100%; justify-content: space-between; gap: 12px; }
  .wallet .cell b { font-size: 19px; }
  body { font-size: 16px; }
  textarea.prompt, .gate input { font-size: 16px; }
}

@media (max-width: 560px) {
  .library { grid-template-columns: 1fr; }
  .wallet { padding: 12px 15px; }
  .wallet .cell b { font-size: 18px; }
  .gate h1 { font-size: clamp(38px, 12vw, 60px); }
}

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