/* Memory_Save.lv — скелет. Mobile-first. Чёрный фон, пиксельные окна и кнопки, Tiny5 + IBM Plex Mono + Noto Sans */

/* Handjet — пиксельный, но читаемый; узкий, поэтому увеличен на уровне шрифта (size-adjust) */
@font-face { font-family: 'Handjet UI'; src: url(fonts/handjet-cyrillic.woff2) format('woff2'); font-weight: 100 900; font-display: swap; size-adjust: 128%;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Handjet UI'; src: url(fonts/handjet-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; size-adjust: 128%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #000;
  --fg: #F2F2F2;
  --muted: #B4B4BA;
  --line: #2E2E33;
  --tile: #0E0E10;
  --acc: #FFD25A;        /* жёлтый, как папка с воспоминаниями */
  --acc-lo: #D99A1E;
  --acc-hi: #FFE9A6;
  --ok: #3DDC97;
  --f-pix: 'Tiny5', 'Courier New', monospace;
  --f-mono: 'Handjet UI', ui-monospace, monospace;
  --f-read: 'Handjet UI', ui-monospace, monospace;
  --dock-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --n: 3px;              /* размер «ступеньки» в углах */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 500 15px/1.45 var(--f-mono);
  padding-bottom: calc(var(--dock-h) + 24px + var(--safe-b));
  overflow-x: hidden;
}
img, canvas { image-rendering: pixelated; }
a { color: inherit; }
::selection { background: var(--acc); color: #000; }

/* ступенчатые углы для окон, кнопок и плиток */
.btn, .pill, .dock, .finder, .save-win, .dialog, .talk, .qr-card, .phone, .toast, .ach, .pack, .inv button, .faq details, .steps li, .lobby li, .slot-mini, .tape-screen, .phone-screen, .scene:not(.scene-fill), .ba {
  clip-path: polygon(var(--n) 0, calc(100% - var(--n)) 0, calc(100% - var(--n)) var(--n), 100% var(--n), 100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%, var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)), 0 var(--n), var(--n) var(--n));
}

h2 { font: 400 clamp(34px, 10vw, 64px)/1 var(--f-pix); letter-spacing: -.01em; margin: 0 0 24px; }
.sub { display: block; font: 500 17px/1.35 var(--f-mono); color: #C8C8CE; letter-spacing: 0; margin-top: 12px; }
.lead { font: 500 18px/1.4 var(--f-read); margin: 0 0 6px; }
.dim { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.row.end { justify-content: flex-end; }
.row.center, .center { justify-content: center; text-align: center; }
.kicker { font: 15px var(--f-pix); color: var(--acc); margin: 0 0 14px; }
.pix { display: inline-block; line-height: 0; }
.pix svg { display: block; }
.ico { display: block; image-rendering: pixelated; flex: none; }

/* ---------- секции ---------- */
section { position: relative; padding: 64px 0; }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; position: relative; z-index: 1; }
.two { display: grid; gap: 28px; align-items: center; }

/* ---------- окно: рамка и шапка из PixelLab (assets/ui), пиксели ×2 ---------- */
.win {
  position: relative; background: #1A1A1C; color: var(--fg);
  border-style: solid; border-width: 0 16px 20px 16px;
  border-image: url(assets/ui/win-frame.png) 0 8 10 8 / 0 16px 20px 16px stretch;
  image-rendering: pixelated;
}
.win-bar {
  position: relative; height: 46px; margin: 0 -16px; display: flex; align-items: center; justify-content: center; padding: 14px 104px 2px 52px;
  background: url(assets/ui/bar-left.png) left top / 48px 46px no-repeat, url(assets/ui/bar-right.png) right top / 100px 46px no-repeat, url(assets/ui/bar-mid.png) left top / 2px 46px repeat-x;
  image-rendering: pixelated; color: #000; font: 15px/1 var(--f-pix); white-space: nowrap; user-select: none;
}
.wb-title { background: #D6D6DA; padding: 3px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.wb-close, .wb-min { position: absolute; top: 12px; width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.wb-close { left: 18px; }
.wb-min { right: 76px; }
.wb-close:active, .wb-min:active { background: rgba(0,0,0,.25); }
.win.min > :not(.win-bar) { display: none; }
.win.min { border-bottom-width: 20px; }
.save-bar::before, .save-bar::after {
  content: ''; flex: 1; min-width: 12px; height: 9px;
  background: repeating-linear-gradient(0deg, #000 0 1px, transparent 1px 2px);
}
.save-bar {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px;
  background: var(--fg); color: #000; font: 15px/1 var(--f-pix); white-space: nowrap; user-select: none;
}
.win-body { padding: 14px; }
.win-status { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; font-size: 12px; color: var(--muted); border-top: 2px dashed var(--line); }
.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 30px + var(--safe-b)); translate: -50% 0; z-index: 80; background: var(--fg); color: #000; padding: 12px 16px; font: 15px var(--f-pix); width: max-content; max-width: calc(100% - 32px); }

/* плитки внутри окон */
.pack, .inv button, .faq details, .steps li, .lobby li, .slot-mini, .ach { background: var(--tile); border: 2px solid var(--line); color: var(--fg); --n: 2px; }

/* ---------- пиксельные кнопки ---------- */
.btn, .pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  min-height: 50px; padding: 12px 20px; border: 0;
  font: 17px/1 var(--f-pix); background: var(--fg); color: #000;
  box-shadow: inset -3px -3px 0 #9A9AA0, inset 3px 3px 0 #fff;
}
.btn-rec, .pill-rec { background: var(--acc); box-shadow: inset -3px -3px 0 var(--acc-lo), inset 3px 3px 0 var(--acc-hi); }
.btn:active, .pill:active { box-shadow: inset 3px 3px 0 #9A9AA0, inset -3px -3px 0 #fff; translate: 1px 1px; }
.btn-rec:active, .pill-rec:active { box-shadow: inset 3px 3px 0 var(--acc-lo), inset -3px -3px 0 var(--acc-hi); }
.btn-sm, .pill-sm { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px dashed var(--acc); outline-offset: 3px; }
.row-cta .btn { flex: 1 1 100%; }
.link { background: none; border: 0; color: var(--muted); font: 15px var(--f-pix); text-decoration: underline; cursor: pointer; margin-top: 36px; min-height: 44px; }

/* заглушка: только для настоящего фото */
.ph { display: flex; align-items: center; justify-content: center; text-align: center; font: 13px/1.3 var(--f-pix); color: var(--muted); border: 2px dashed var(--line); background: repeating-conic-gradient(rgba(255,255,255,.04) 0 25%, transparent 0 50%) 0 0 / 12px 12px; }

/* живые сценки из спрайтов */
.scene { display: block; width: 100%; aspect-ratio: 16 / 9; background: #050506; border: 2px solid var(--line); margin-bottom: 14px; --n: 2px; }
.scene-fill { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border: 0; margin: 0; background: transparent; }

/* ================= ЗАГРУЗЧИК ================= */
html.booting, html.booting body { overflow: hidden; }
.boot { position: fixed; inset: 0; z-index: 200; background: #000; display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.boot.leaving { background: transparent; }
.boot-static { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; image-rendering: pixelated; z-index: 2; }
.pc { position: relative; opacity: 0; filter: brightness(.45); transition: opacity .6s steps(6), filter .25s steps(2); }
.pc.in { opacity: 1; }
.pc.power { filter: none; }
.pc.zoom { transition: transform .7s cubic-bezier(.7, 0, .9, .4), filter .7s; filter: brightness(1.4); }
.pc-img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.pc-led { position: absolute; background: #2A2A2A; }
.pc.power .pc-led { background: #3DDC97; box-shadow: 0 0 6px 2px rgba(61, 220, 151, .7); }
.pc-screen { position: absolute; overflow: hidden; background: #050806; opacity: 0; }
.pc-screen.on { opacity: 1; animation: crt-boot .6s steps(8) both; }
@keyframes crt-boot { 0% { clip-path: inset(49% 0 49% 0); filter: brightness(5); } 40% { clip-path: inset(49% 0 49% 0); filter: brightness(3); } 100% { clip-path: inset(0); filter: none; } }
.pc-screen { border-radius: 7% / 10%; background: #000; }
.pc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* блик на выпуклом стекле */
.pc-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse 70% 55% at 28% 18%, rgba(255,255,255,.10), transparent 60%), radial-gradient(ellipse at center, transparent 62%, rgba(0,0,0,.6) 100%); }
.boot-skip { position: absolute; bottom: calc(24px + var(--safe-b)); left: 0; right: 0; margin: 0; text-align: center; font: 13px var(--f-pix); color: #55555B; }
.boot.leaving .boot-skip { opacity: 0; }

/* ================= 1. ПЕРВЫЙ ЭКРАН ================= */
.hero { position: relative; height: 100svh; min-height: 600px; padding: 0; overflow: hidden; background: #000; }
.stage { position: absolute; left: 0; top: 0; z-index: 1; }
.hero-top { position: absolute; z-index: 6; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; }
.slogan { margin: 0; font: 17px/1.15 var(--f-pix); color: var(--fg); max-width: 13em; }
.hero-cap { position: absolute; z-index: 6; left: 16px; right: 16px; top: 64px; margin: 0; font-size: 14px; color: var(--muted); max-width: 24em; }
.desk-icons { display: none; }
.desk-icons a { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; padding: 6px 2px; font: 13px/1.2 var(--f-pix); text-decoration: none; text-align: center; }
.desk-icons img { image-rendering: pixelated; }
.desk-icons a:hover span, .desk-icons a:focus-visible { background: var(--fg); color: #000; }
.wordmark {
  position: absolute; z-index: 0; left: 50%; bottom: calc(var(--dock-h) + 20px + var(--safe-b)); translate: -50% 0; white-space: nowrap;
  font: 15.6vw/.8 var(--f-pix); color: #fff; letter-spacing: -.02em; pointer-events: none; user-select: none;
}

/* окно «Сохранить как…» поверх застывшего кадра */
.save-win { position: absolute; z-index: 4; display: flex; flex-direction: column; background: transparent; border: 3px solid var(--fg); transform-origin: center; }
.save-win[hidden] { display: none; }
.save-bar { padding: 5px 6px 7px; font-size: 14px; }
.save-view { flex: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 1px, transparent 1px 3px); }
.save-foot { background: #000; color: var(--fg); padding: 8px 10px 10px; display: grid; gap: 7px; font-size: 12px; }
.save-name { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.save-name b { flex: 1; font: 14px var(--f-pix); font-weight: 400; color: var(--fg); border: 2px solid var(--line); padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-prog { height: 12px; border: 2px solid var(--fg); padding: 1px; }
.save-prog div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--acc) 0 5px, transparent 5px 7px); }
.save-state { font: 13px var(--f-pix); color: var(--muted); }
.save-win.done .save-prog div { background: repeating-linear-gradient(90deg, var(--ok) 0 5px, transparent 5px 7px); }
.save-win.done .save-state { color: var(--ok); }
.save-win.pop { animation: win-pop .32s steps(4); }
@keyframes win-pop { 0% { transform: scale(.6); opacity: 0; filter: drop-shadow(4px 0 #ff3b30) drop-shadow(-4px 0 #00d0ff); } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: none; filter: none; } }
.save-win.shrink { transition: transform .38s steps(6), opacity .38s steps(6); transform: scale(.12); opacity: 0; }

/* папки */
.fold { position: absolute; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--fg); font: 13px/1.2 var(--f-pix); text-align: center; }
.fold[hidden] { display: none; }
.fold > span { background: #000; padding: 2px 6px; max-width: 130px; overflow-wrap: anywhere; }
.fold-ico { display: block; line-height: 0; }
.fold-ico svg { display: block; }
.fold-new { translate: -50% -50%; }
.fold-ico img { display: block; width: 64px; height: 64px; image-rendering: pixelated; }
.fold-new.pop .fold-ico { animation: fold-pop .3s steps(3); }
@keyframes fold-pop { 0% { transform: scale(1.8); } 100% { transform: none; } }
.fold-new.lift .fold-ico { transform: translateY(-4px); filter: drop-shadow(4px 4px 0 #333); }
.fold-new.drop { transition: transform .25s steps(4), opacity .25s; transform: scale(.2); opacity: 0; }
.fold-dest { right: 14px; bottom: calc(var(--dock-h) + 34px + 14vw + var(--safe-b)); cursor: pointer; }
.fold-dest em { position: absolute; top: -8px; right: -10px; min-width: 24px; height: 24px; padding: 0 6px; background: var(--acc); color: #000; font: 15px/24px var(--f-pix); font-style: normal; }
.fold-dest.hot .fold-ico { transform: scale(1.12); filter: brightness(1.15); }
.fold-dest.gulp .fold-ico { animation: gulp .45s steps(5); }
@keyframes gulp { 30% { transform: scale(1.22, .86); } 60% { transform: scale(.94, 1.08); } 100% { transform: none; } }
.plus1 { position: absolute; z-index: 6; font: 20px var(--f-pix); color: var(--acc); pointer-events: none; animation: plus1 .9s steps(6) forwards; }
@keyframes plus1 { to { transform: translateY(-34px); opacity: 0; } }

.cursor { position: absolute; z-index: 7; left: 0; top: 0; pointer-events: none; line-height: 0; }
.cursor svg { display: block; width: 22px; height: 34px; transform-origin: 0 0; }
.cursor[hidden] { display: none; }
.cursor.press svg { transform: scale(.88); }

/* «папка» с сохранёнными моментами */
.finder { position: absolute; z-index: 8; right: 14px; bottom: calc(var(--dock-h) + 160px + 14vw + var(--safe-b)); width: min(300px, calc(100% - 28px)); background: #000; color: var(--fg); border: 3px solid var(--fg); }
.finder[hidden] { display: none; }
.finder ul { list-style: none; margin: 0; padding: 8px; max-height: 40vh; overflow: auto; }
.finder li { display: flex; align-items: center; gap: 10px; padding: 8px; font: 15px var(--f-pix); border-bottom: 2px dashed var(--line); }

.finder .pill { margin: 0 8px 10px; width: calc(100% - 16px); }

/* ---------- 1б. коротко ---------- */
.intro { padding: 56px 0; }
.intro-grid { display: grid; gap: 24px; align-items: center; }
.hello { margin: 0 0 10px; font: 20px/1.2 var(--f-pix); }
.accent { margin: 0 0 14px; font: 700 23px/1.25 var(--f-mono); color: var(--acc); }
.accent b { font: 400 .95em/1 var(--f-pix); background: var(--acc); color: #000; padding: 0 6px; }
.reaction { display: grid; gap: 8px; }
.reaction-cv { display: block; width: 100%; aspect-ratio: 4 / 3; image-rendering: pixelated; }
.reaction-cap { margin: 0; text-align: center; font: 22px/1.2 var(--f-pix); color: var(--fg); min-height: 2.4em; }
.price-chip { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.price-chip b { color: var(--acc); font: 400 19px var(--f-pix); }

/* ---------- ЭЛТ, VHS, шум ---------- */
.crt { overflow: hidden; }
/* развёртка и бегущая полоса — только внутри «экранов», фон блоков остаётся ровным чёрным */
.crt-screen::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.3) 0 1px, transparent 1px 3px);
}
.crt-screen::after {
  content: ''; position: absolute; left: 0; right: 0; height: 60px; top: -60px; pointer-events: none; z-index: 3;
  background: linear-gradient(transparent, rgba(255,255,255,.04), transparent);
  animation: roll 7s linear infinite;
}
@keyframes roll { to { top: 100%; } }
.vhs { position: absolute; z-index: 4; font: 15px var(--f-pix); letter-spacing: 1px; color: #fff; text-shadow: 2px 0 #ff3b30, -2px 0 #00d0ff; pointer-events: none; }
.vhs-tl { left: 12px; top: 8px; }
.vhs-br { right: 12px; bottom: 8px; }
.noise { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; opacity: .05; mix-blend-mode: screen; }
.glitch { animation: glitch .38s steps(3) 1; }
@keyframes glitch {
  0% { transform: none; filter: none; }
  33% { transform: translate(4px, -2px) skewX(-6deg); filter: drop-shadow(3px 0 #ff3b30) drop-shadow(-3px 0 #00d0ff); }
  66% { transform: translate(-4px, 2px) skewX(5deg); filter: drop-shadow(-3px 0 #ff3b30) drop-shadow(3px 0 #00d0ff); }
  100% { transform: none; filter: none; }
}
body.fx-off .crt::before, body.fx-off .crt::after, body.fx-off .crt-screen::before, body.fx-off .crt-screen::after, body.fx-off .noise { display: none; }
body.fx-off .vhs { text-shadow: none; }
body.fx-off .glitch { animation: none; }

/* ---------- 2. демо ---------- */
.screen { position: relative; aspect-ratio: 4 / 5; background: #000; overflow: hidden; }
.win .win-body:has(> .screen) { padding: 0; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; }
.dialog { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 2; width: min(360px, 88%); background: #000; color: var(--fg); padding: 16px 18px; border: 3px solid var(--fg); }
.dialog p { margin: 0; }
.dialog .dim { font-size: 13px; }
.dialog .btn { margin-top: 12px; }
.dlg-title { font: 28px/1.05 var(--f-pix); margin: 6px 0 8px !important; color: var(--acc); }
.demo-note { margin: 12px 2px 0; }
.demo-bar { gap: 8px; }
.demo-bar span { flex: 1 1 100%; }
.demo-bar .btn { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.demo-paused { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; gap: 6px; border: 0; cursor: pointer;
  background: rgba(0,0,0,.72); color: var(--fg); font: 40px/1 var(--f-pix); letter-spacing: 2px; }
.demo-paused span { font: 500 16px var(--f-mono); color: var(--muted); letter-spacing: 0; }
.demo-paused[hidden] { display: none; }
#demo-win { will-change: transform; }

/* ---------- 3. копирование ---------- */
.copy-anim { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.folder { display: flex; flex-direction: column; align-items: center; gap: 8px; font: 13px/1.2 var(--f-pix); width: 96px; text-align: center; }
.flight { position: relative; flex: 1; height: 40px; }
.flight i { position: absolute; left: 0; top: 10px; width: 16px; height: 20px; background: #fff; border: 2px solid #000; border-bottom-width: 5px; animation: fly 2.4s steps(12) infinite; }
.flight i:nth-child(2) { animation-delay: .8s; }
.flight i:nth-child(3) { animation-delay: 1.6s; }
@keyframes fly { 0% { left: 0; top: 16px; opacity: 0; } 10% { opacity: 1; } 50% { top: -4px; } 90% { opacity: 1; } 100% { left: calc(100% - 16px); top: 16px; opacity: 0; } }
.copy-line { font: 15px var(--f-pix); margin: 0 0 8px; }
.bar { height: 16px; border: 2px solid var(--fg); padding: 2px; }
.bar > div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--acc) 0 6px, transparent 6px 8px); transition: width .25s steps(4); }
.dialog .bar { margin: 10px 0 4px; }
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 12px; align-items: baseline; padding: 12px 14px; font-size: 14px; line-height: 1.45; opacity: .4; transition: opacity .2s steps(2); }
.steps li.on { opacity: 1; border-color: var(--fg); }
.steps b { flex: none; width: 3.4em; color: var(--acc); font: 400 19px var(--f-pix); }

/* ---------- 4. фото → пиксель ---------- */
.ba { position: relative; aspect-ratio: 1; width: 100%; overflow: hidden; background: #050506; touch-action: pan-y; cursor: ew-resize; }
.ba-before, .ba-after { position: absolute; inset: 0; }
.ba-after { clip-path: inset(0 0 0 50%); background: #000; }
.ba-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; background: var(--acc); }
.ba-line::after { content: '◂▸'; position: absolute; top: 50%; left: 50%; translate: -50% -50%; background: var(--acc); color: #000; font: 15px var(--f-pix); padding: 8px 6px; }
.win-body input[type=range] { width: 100%; height: 32px; margin-top: 8px; accent-color: var(--acc); }
.pix-try { display: grid; gap: 14px; }
.pix-try canvas { width: 100%; height: auto; background: #000; border: 2px solid var(--line); }
#pix-try { margin-top: 24px; }

/* ---------- 5. инвентарь ---------- */
.inv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.inv button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 2px; font: 600 16px/1.05 var(--f-mono); cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.inv .ico { width: 64px; height: 64px; }
@media (min-width: 400px) { .inv button { font-size: 13px; } }

.inv button.on { border-color: var(--acc); background: #1A1505; }
#inv-info { min-height: 3em; font: 500 18px/1.3 var(--f-mono); color: var(--fg); }

/* ---------- 6. режимы: на телефоне — свайп-карусель ---------- */
.modes { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 24px; margin: 0 -16px; scrollbar-width: none; }
.modes::-webkit-scrollbar { display: none; }
.modes > .win { scroll-snap-align: center; }
.modes p { font: 500 15px/1.5 var(--f-read); margin: 0 0 12px; }
.modes p b { font-weight: 500; }
.modes label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.swipe-hint { margin: -6px 0 14px; font-family: var(--f-pix); }
input[type=date] { font: 500 16px var(--f-mono); min-height: 44px; padding: 6px 10px; border: 2px solid var(--line); background: var(--tile); color: var(--fg); color-scheme: dark; }
.slot-mini { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 12px; }
.slot-name { font: 15px/1.15 var(--f-pix); }
.slot-meta { font-size: 12px; line-height: 1.3; color: var(--muted); }
.slot-mini .slot-meta { font: 16px var(--f-pix); color: var(--acc); }
.lobby { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font: 15px var(--f-pix); }
.lobby li { display: flex; justify-content: space-between; padding: 7px 10px; }
.lobby li.new { animation: join .5s steps(3); }
@keyframes join { from { background: #0D3B27; border-color: var(--ok); } }
.coop-sum { font: 16px var(--f-pix) !important; margin: 4px 0 0 !important; }
.coop-sum b { color: var(--acc); font-weight: 400; }
.files { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font: 15px var(--f-pix); }
.files li { display: flex; align-items: center; gap: 10px; }


/* ---------- 7. вручение ---------- */
.phone { width: 100%; }
.phone-screen { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #050506; border: 3px solid var(--fg); }
.qr-card { display: flex; gap: 14px; align-items: center; width: max-content; max-width: 100%; margin: 18px 0 0 4px; padding: 14px; background: #000; border: 3px solid var(--fg); rotate: -3deg; }
.qr-card div { display: grid; gap: 4px; justify-items: start; }
.qr-card b { font: 400 17px var(--f-pix); }
.qr-card span { font-size: 12px; color: var(--muted); }

.flow { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 6px; }
.flow li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 2px solid var(--line); background: var(--tile); font: 600 18px var(--f-mono); color: var(--muted); transition: color .2s steps(2), border-color .2s steps(2); }
.flow li .ico { width: 32px; height: 32px; }
.flow li.on { color: var(--fg); border-color: var(--acc); }
.gift-stage canvas { display: block; width: 100%; aspect-ratio: 1; image-rendering: pixelated; }

/* ---------- 8. калькулятор ---------- */
.packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pack { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px 8px; cursor: pointer; font: inherit; }

.pack .slot-meta { font-size: 11px; }
.pack-price { font: 17px var(--f-pix); color: var(--acc); margin-top: auto; }
.pack.on { border-color: var(--acc); background: #1A1505; }
.check { display: flex; gap: 10px; align-items: center; margin: 14px 0 0; font-size: 14px; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--acc); }
.calc-foot { margin-top: 6px; }
.calc-total { font: 21px var(--f-pix); margin: 0; }
.calc-total b { color: var(--acc); font-weight: 400; }

.calc-h { font: 15px var(--f-pix); color: var(--muted); margin: 0 0 10px; }
.calc-h + .packs + .calc-h, .packs + .calc-h { margin-top: 24px; }
.calc-grid { display: grid; gap: 16px; }
.calc-rows { display: grid; gap: 6px; align-content: start; }
.calc-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 10px; row-gap: 3px; padding: 10px; background: var(--tile); border: 2px solid var(--line); --n: 2px;
  clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px), 0 2px, 2px 2px); }
.calc-row .ico { width: 32px; height: 32px; }
.calc-row > .ico { grid-row: span 2; }
.calc-lab { display: contents; }
.calc-lab b { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
.calc-lab span { grid-column: 2 / 4; grid-row: 2; }
.calc-row .stepper, .calc-row .tick { grid-column: 3; grid-row: 1; }
.calc-lab b { font: 400 15px/1.15 var(--f-pix); }
.calc-lab span { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 36px; height: 36px; padding: 0; border: 0; cursor: pointer; font: 22px/1 var(--f-pix); background: var(--fg); color: #000; box-shadow: inset -3px -3px 0 #9A9AA0, inset 3px 3px 0 #fff; }
.stepper button:active { box-shadow: inset 3px 3px 0 #9A9AA0, inset -3px -3px 0 #fff; }
.stepper output { min-width: 2em; text-align: center; font: 22px var(--f-pix); color: var(--acc); }
.calc-tog { cursor: pointer; }
.calc-tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick { flex: none; width: 30px; height: 30px; border: 3px solid var(--fg); display: grid; place-items: center; font: 20px/1 var(--f-pix); color: #000; }
.calc-tog input:checked + .tick { background: var(--acc); }
.calc-tog input:checked + .tick::after { content: '✓'; }
.calc-tog input:focus-visible + .tick { outline: 2px dashed var(--acc); outline-offset: 3px; }
.calc-tog:has(input:checked) { border-color: var(--acc); }
.party-box { background: #050506; border: 2px solid var(--line); padding: 8px 8px 6px; }
.party { display: block; width: 100%; height: 148px; image-rendering: pixelated; }
.party-cap { margin: 4px 0 0; text-align: center; font: 13px var(--f-pix); color: var(--muted); }
.receipt { list-style: none; margin: 12px 0 0; padding: 10px 12px; border: 2px dashed var(--line); font-size: 13px; display: grid; gap: 4px; }
.receipt li { display: flex; justify-content: space-between; gap: 10px; }
.receipt b { font-weight: 500; white-space: nowrap; }
.calc-sum { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding: 0 2px; }
.calc-sum span { font: 20px var(--f-pix); color: var(--muted); }
.calc-sum b { font: 400 36px/1 var(--f-pix); color: var(--acc); }
.calc-time { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.calc-time .ico { width: 32px; height: 32px; }
.split { margin-top: 12px; }
.calc .row-cta { margin-top: 14px; }

/* ---------- 9. кейс ---------- */
.tape-screen { position: relative; aspect-ratio: 4 / 3; background: #050506; border: 3px solid var(--fg); overflow: hidden; }
.tape .small { margin-top: 10px; }
.talk { position: relative; background: #000; color: var(--fg); padding: 16px 16px 26px; border: 3px solid var(--fg); }
.talk-name { margin: 0 0 8px; color: var(--acc); font: 16px var(--f-pix); }
.talk-text { margin: 0; min-height: 9em; font: 500 16px/1.6 var(--f-read); }
.talk-next { position: absolute; right: 14px; bottom: 6px; font-size: 14px; color: var(--acc); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 10. достижения ---------- */
.achs { display: grid; gap: 10px; margin-top: 16px; }
.ach { display: flex; gap: 14px; align-items: center; padding: 14px; }

.ach b { display: block; font: 400 17px var(--f-pix); }
.ach .dim { font-size: 12px; }
.ach.locked { opacity: .5; border-style: dashed; }

/* ---------- 11. справка ---------- */
.faq details { margin-bottom: 6px; }
.faq details[open] { border-color: var(--fg); }
.faq summary { padding: 13px 14px; cursor: pointer; font: 500 15px/1.4 var(--f-mono); list-style: none; min-height: 48px; display: flex; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '+'; color: var(--acc); flex: none; font: 18px/1.1 var(--f-pix); }
.faq details[open] summary::before { content: '−'; }
.faq details p { margin: 0; padding: 0 14px 14px 36px; font: 500 15px/1.55 var(--f-read); color: var(--muted); }

/* ---------- 12. финал ---------- */
#final { padding: 96px 0 80px; }
.big-h { font-size: clamp(38px, 11vw, 72px); }
.foot-logo { flex: 1 1 100%; width: 176px; height: auto; max-width: 176px; image-rendering: pixelated; margin-bottom: 8px; }
.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 16px; font: 14px var(--f-pix); color: var(--muted); border-top: 2px dashed var(--line); }
.foot-legal { flex: 1 1 100%; margin-top: 10px; padding-top: 12px; border-top: 2px dashed var(--line); font: 500 15px/1.5 var(--f-read); }
.foot-legal p { margin: 0 0 4px; }
.foot-legal a { color: var(--fg); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; }
.foot-links a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.consent { margin: 4px 0 0; line-height: 1.45; }
.consent a, .faq details p a { color: var(--acc); }
.todo { background: var(--acc); color: #000; padding: 0 4px; }
main.crt-on { animation: crt-on .55s ease-out; }
main.crt-off { animation: crt-off .5s ease-in forwards; }
@keyframes crt-on { 0% { transform: scale(1, .004); filter: brightness(4); } 55% { transform: scale(1, 1); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
@keyframes crt-off { 0% { transform: none; filter: none; } 55% { transform: scale(1, .004); filter: brightness(4); } 100% { transform: scale(0, .004); filter: brightness(6); opacity: 0; } }
.off-screen { position: fixed; inset: 0; z-index: 50; background: #000; color: var(--fg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; font: 26px var(--f-pix); padding: 16px; }
.off-screen[hidden] { display: none; }

/* ---------- док ---------- */
.dock {
  position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); height: var(--dock-h);
  display: flex; align-items: center; justify-content: space-around; gap: 2px; padding: 0 6px;
  background: #000; border: 3px solid var(--fg);
}
.dock a, .dock button { display: grid; place-items: center; width: 44px; height: 44px; color: var(--fg); background: none; border: 0; cursor: pointer; }
.dock a:active, .dock button:active, .dock a:hover, .dock button:hover { background: var(--fg); color: #000; }
.dock-fx[aria-pressed=false] img { opacity: .3; }
.dock-prog { position: absolute; left: 0; right: 0; top: 0; height: 4px; }
.dock-prog div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--acc) 0 6px, transparent 6px 8px); }
.dock-save { display: none; font: 14px var(--f-pix); color: var(--muted); min-width: 5em; text-align: right; }
.dock.saved .dock-prog div { background: repeating-linear-gradient(90deg, var(--ok) 0 6px, transparent 6px 8px); }

/* ---------- планшет ---------- */
@media (min-width: 640px) {
  section { padding: 88px 0; }
  .win-body { padding: 18px; }
  .row-cta .btn { flex: 0 0 auto; }
  .steps { grid-template-columns: 1fr 1fr; }
  .inv button { font-size: 14px; }
  .packs { grid-template-columns: repeat(4, 1fr); }
  .achs { grid-template-columns: repeat(2, 1fr); }
  .modes { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); overflow: visible; padding: 0; margin: 0; align-items: start; }
  .swipe-hint { display: none; }
  .phone { justify-self: center; width: 300px; padding: 14px 12px 34px; background: #000; border: 3px solid var(--fg); --n: 9px; }
  .phone-screen { aspect-ratio: 9 / 18; border-width: 2px; }
  .calc-row .ico { width: 64px; height: 64px; }
  .calc-lab b { font-size: 17px; }
  .calc-lab span { font-size: 12.5px; }
  .dock { left: 50%; right: auto; translate: -50% 0; padding: 0 12px; gap: 6px; }
  .dock-save { display: block; }
  .hero-top { padding: 20px 28px; }
  .slogan { font-size: 20px; max-width: none; }
  .demo-bar span { flex: 1 1 auto; }
  .hero-cap { left: 28px; top: 70px; font-size: 15px; }
  .fold-dest { right: 28px; }
  .finder { right: 28px; }
}

/* ---------- ноутбук ---------- */
@media (min-width: 960px) {
  body { font-size: 16px; }
  section { padding: 110px 0; }
  .lead { font-size: 20px; }
  .two { grid-template-columns: 1fr 1fr; gap: 48px; }
  .intro { min-height: 86vh; display: flex; align-items: center; }
  .intro-grid { grid-template-columns: 1fr 1fr; gap: 48px; }
  .hello { font-size: 24px; }
  .accent { font-size: 30px; }
  .screen { aspect-ratio: 16 / 9; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .steps li { display: block; }
  .steps b { display: block; width: auto; margin-bottom: 4px; }
  .ba { max-height: 440px; }
  .pix-try { grid-template-columns: 320px 1fr; align-items: center; }
  .btn, .pill { min-height: 0; }
  .inv button:hover { border-color: var(--acc); }
  .achs { grid-template-columns: repeat(4, 1fr); }
  .dock { display: none; }
  body { padding-bottom: 0; }
  .calc-grid { grid-template-columns: 1.15fr .85fr; align-items: start; }
  .calc-side { position: sticky; top: 20px; }
  .wordmark { font: 16.4vw/1 var(--f-pix); bottom: -.2em; }
  .fold-dest { bottom: calc(16.4vw - 2px); right: 6vw; }
  .finder { bottom: calc(16.4vw + 130px); right: 6vw; }
  .fold-ico img { width: 96px; height: 96px; }
  .desk-icons { position: absolute; z-index: 6; left: 20px; top: 130px; display: grid; gap: 10px; }
  .save-bar { font-size: 15px; }
  .save-foot { font-size: 13px; padding: 10px 14px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
