/* ========== Токены ========== */
:root {
  --f-head: Unbounded, system-ui, sans-serif;
  --f-body: Manrope, system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  --film: #1A120D;
}
.theme-pult {
  --bg: #F4ECDF; --card: #FFFBF4; --line: #E6D9C6; --ink: #2B201B; --muted: #7A6A5E; --muted2: #5E5047;
  --light: #CDBBA6; --accent: #E5604A; --accent-hover: #B8432F; --accent-shadow: #9E3B2B; --gold: #F2C14E;
  --sage: #8DA67E; --ok: #5F7F52; --bad: #B8432F; --dark: #2B201B; --pad: 22px; --h2: 18px;
}
.theme-dash {
  --bg: #F3E4CF; --card: #FBF2E4; --line: #E6CFAE; --ink: #3A2418; --muted: #7D6350; --muted2: #5F4636;
  --light: #D2B48E; --accent: #C4562A; --accent-hover: #8E3324; --gold: #DDA23C; --olive: #8F9A4E; --ok: #5E6B2E;
  --wine: #7A2E2A; --bad: #8E3324; --wine-shadow: #4E1C19; --dark: #3A2418; --pad: 28px; --h2: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg, var(--film)); color: var(--ink); font-family: var(--f-body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); } a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ========== Общие элементы ========== */
.page-pult { min-height: 100vh; padding: 24px 18px 48px; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page-dash { min-height: 100vh; padding: 28px clamp(16px, 4vw, 48px) 56px; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.row > * { min-width: 0; }
.w2 { flex: 2 1 420px; } .w1 { flex: 1 1 280px; } .w1b { flex: 1 1 340px; }

.card { background: var(--card); border: 1.5px solid var(--line); border-radius: 24px; padding: var(--pad); display: flex; flex-direction: column; gap: 12px; }
.card--dark { background: var(--dark); color: var(--bg); border: none; }
.card--gold { background: var(--gold); border: none; }
.card--wine { background: #7A2E2A; color: #FBF2E4; border: none; }
.card--fine { background: var(--card); border: 2px dashed var(--bad); }
.gap6 { gap: 6px; } .gap10 { gap: 10px; } .gap14 { gap: 14px; } .gap16 { gap: 16px; } .gap18 { gap: 18px; }

.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.eyebrow--light { color: var(--light); }
.h2 { margin: 0; font: 700 var(--h2)/1.2 var(--f-head); }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.split { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.pretty { text-wrap: pretty; }

.chip {
  font: 600 14px var(--f-body); padding: 12px 16px; min-height: 44px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer;
  transition: transform .08s, background .15s, color .15s;
}
.chip:active { transform: scale(.96); }
.chip--on { background: var(--ink); color: var(--card); }
.chip--ghost-light { border-color: var(--light); background: transparent; color: var(--bg); }
.chip--ghost-light:hover { background: var(--gold); color: var(--dark); border-color: var(--gold); }
.chip--fine { border: 2px dashed var(--bad); background: var(--bg); }

.btn {
  font: 700 16px var(--f-head); padding: 16px; min-height: 52px; border-radius: 999px; border: none;
  background: var(--accent); color: var(--card); cursor: pointer; transition: transform .08s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--sm { font: 600 14px var(--f-body); padding: 10px 14px; min-height: 44px; }
.btn--md { font: 700 15px var(--f-head); padding: 14px; min-height: 48px; }
.btn--dark { background: var(--dark); color: var(--card); }
.btn--outline { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }
.btn--sage { background: var(--sage); color: #1F2A1A; }

.big-press {
  font: 800 24px var(--f-head); padding: 20px; min-height: 68px; border-radius: 20px; border: none;
  background: var(--accent); color: #FFFBF4; cursor: pointer; box-shadow: 0 6px 0 var(--shadow, #9E3B2B);
  transition: transform .06s, box-shadow .06s;
}
.big-press:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--shadow, #9E3B2B); }

input[type=range] { width: 100%; accent-color: var(--accent); height: 32px; cursor: pointer; margin: 0; }
.field {
  font: 500 15px var(--f-body); padding: 12px 14px; min-height: 44px; width: 100%; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); outline-color: var(--accent);
}
.slider-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; }
.slider-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.bar { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; transition: width .4s; }

.list-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(92vw, 520px); background: var(--dark, #2B201B); color: var(--bg, #F4ECDF); padding: 12px 18px;
  border-radius: 999px; font: 600 14px var(--f-body); z-index: 80; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  animation: toastIn .25s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

.offline { font-family: var(--f-mono); font-size: 12px; color: var(--bad); }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ========== Кинематографичный лоадер ========== */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--film); color: #F3E4CF; overflow: hidden; cursor: pointer;
  clip-path: circle(150% at 50% 50%); transition: clip-path .95s cubic-bezier(.7, 0, .25, 1);
  --t0: 0s;
}
.loader--full { --t0: 1.8s; }
.loader::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(196, 86, 42, .2), transparent 55%),
              radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .7) 100%);
}
.loader--out { clip-path: circle(0% at 50% 50%); pointer-events: none; }
.loader--gone { display: none; }
html:has(.loader:not(.loader--gone)) { overflow: hidden; }

.loader__stage {
  position: absolute; inset: 0; display: grid; place-items: center; animation: flicker 2.7s steps(1) infinite;
  padding: calc(clamp(40px, 10vh, 92px) + 12px) 0;
}
.loader__stage > * { grid-area: 1 / 1; }

.loader__grain {
  position: absolute; inset: -50%; z-index: 2; pointer-events: none; opacity: .13;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .6s steps(5) infinite;
}

.loader__bar {
  position: absolute; left: 0; right: 0; z-index: 3; height: 0; background: #000; overflow: hidden;
  display: flex; justify-content: space-between; align-items: center; padding: 0 clamp(14px, 4vw, 32px);
  gap: 16px; font: 500 11px var(--f-mono); letter-spacing: .16em; color: #7D6350; white-space: nowrap;
  animation: bars .7s cubic-bezier(.2, .8, .2, 1) forwards;
}
.loader__bar--top { top: 0; padding-top: env(safe-area-inset-top); }
.loader__bar--bottom { bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
.loader__bar--top span:first-child { color: #C4562A; animation: blink 1s steps(1) infinite; }
.loader__skip { opacity: .7; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.loader__leader { display: none; position: relative; width: min(58vw, 260px); aspect-ratio: 1; }
.loader--full .loader__leader { display: block; animation: leaderOut .35s ease-in 1.4s forwards; }
.loader__leader svg { position: absolute; inset: 0; fill: none; stroke: #F3E4CF; stroke-width: 1.5; opacity: .45; }
.loader__sweep {
  position: absolute; inset: 14%; border-radius: 50%;
  background: conic-gradient(rgba(221, 162, 60, .28) var(--sweep), transparent 0);
  animation: sweep .45s linear infinite;
}
.loader__count span {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0;
  font: 800 clamp(84px, 24vw, 128px)/1 var(--f-head); color: #F3E4CF;
}
.loader__count span:nth-child(1) { animation: count .45s .05s both; }
.loader__count span:nth-child(2) { animation: count .45s .5s both; }
.loader__count span:nth-child(3) { animation: count .45s .95s both; }

.loader__title { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 22px; text-align: center; }
.loader__presents {
  font: 500 11px/1.6 var(--f-mono); letter-spacing: .32em; text-transform: uppercase; color: #D2B48E;
  text-wrap: balance; max-width: 34ch; opacity: 0; animation: rise .8s calc(var(--t0) + .05s) forwards;
}
.loader__name {
  margin: 0; font: 800 clamp(30px, 7.6vw, 76px)/1.04 var(--f-head); letter-spacing: -.02em;
  display: flex; flex-wrap: wrap; justify-content: center; column-gap: .28em; max-width: 14ch;
}
.loader__name span { display: inline-block; opacity: 0; animation: reveal 1.1s cubic-bezier(.2, .7, .2, 1) forwards; }
.loader__name span:nth-child(1) { animation-delay: calc(var(--t0) + .15s); }
.loader__name span:nth-child(2) { animation-delay: calc(var(--t0) + .32s); }
.loader__name span:nth-child(3) { animation-delay: calc(var(--t0) + .5s); }
.loader__laura { position: relative; color: #E5604A; }
.loader__laura::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -.08em; height: .07em; border-radius: 9px;
  background: #DDA23C; transform: scaleX(0); transform-origin: left;
  animation: underline .6s cubic-bezier(.6, 0, .2, 1) calc(var(--t0) + 1.1s) forwards;
}
.loader__progress {
  width: min(300px, 62vw); height: 2px; background: rgba(243, 228, 207, .15); overflow: hidden;
  opacity: 0; animation: rise .5s calc(var(--t0) + .7s) forwards;
}
.loader__progress i { display: block; height: 100%; width: 0; background: #DDA23C; animation: load 2.6s calc(var(--t0) + .7s) cubic-bezier(.3, .7, .3, 1) forwards; }
.loader--done .loader__progress i { animation: none; width: 100%; transition: width .25s ease-out; }
.loader__status { min-height: 1.5em; font: 500 12px var(--f-mono); color: #D2B48E; opacity: 0; animation: rise .5s calc(var(--t0) + .8s) forwards; }

@keyframes bars { to { height: clamp(40px, 10vh, 92px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes sweep { to { --sweep: 360deg; } }
@keyframes count { 0% { opacity: 0; transform: scale(1.3); } 18% { opacity: 1; transform: scale(1); } 82% { opacity: 1; } 100% { opacity: 0; transform: scale(.94); } }
@keyframes leaderOut { to { opacity: 0; transform: scale(1.7); filter: blur(8px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; filter: blur(14px); transform: translateY(12px) scale(1.12); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes underline { to { transform: scaleX(1); } }
@keyframes load { to { width: 86%; } }
@keyframes flicker { 0% { opacity: 1; } 4% { opacity: .9; } 7% { opacity: 1; } 51% { opacity: .95; } 53% { opacity: 1; } }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); } 60% { transform: translate(-3%, -3%); } 80% { transform: translate(3%, 6%); } 100% { transform: translate(0, 0); } }

/* ========== Выбор входа ========== */
.doors { min-height: 100svh; background: var(--film); color: #F3E4CF; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 40px clamp(18px, 5vw, 56px); }
.doors__title { margin: 0; font: 800 clamp(34px, 8vw, 72px)/1 var(--f-head); letter-spacing: -.02em; }
.doors__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 980px; }
.door {
  text-align: left; border: none; border-radius: 28px; padding: 26px; min-height: 220px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.door:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.door:active { transform: scale(.98); }
.door--laura { background: #E5604A; color: #FFFBF4; }
.door--husband { background: #DDA23C; color: #3A2418; }
.door__name { font: 800 clamp(28px, 5vw, 40px)/1.05 var(--f-head); }
.door__sub { font: 500 15px/1.45 var(--f-body); opacity: .9; }

/* ========== Ритуал Лауры ========== */
.gate {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 32px 20px; text-align: center; color: #F4ECDF;
  background: radial-gradient(circle at 50% 30%, #3B2A22, #2B201B 60%, #1F1612);
}
.gate__eyebrow { font: 500 11px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: #CDBBA6; }
.gate__title { margin: 0; font: 800 clamp(26px, 7vw, 40px)/1.08 var(--f-head); letter-spacing: -.02em; max-width: 16ch; }
.gate__hint { font: 500 15px/1.5 var(--f-body); color: #CDBBA6; max-width: 34ch; min-height: 3em; }
.gate__steps { display: flex; gap: 6px; }
.gate__steps i { width: 28px; height: 4px; border-radius: 9px; background: #4A3A31; transition: background .3s; }
.gate__steps i.on { background: #E5604A; }
.gate__back { background: none; border: none; color: #7A6A5E; font: 500 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }

.scan {
  position: relative; width: 210px; height: 210px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle, #3A2B24, #241A16); border: 1.5px solid #4A3A31;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: box-shadow .3s, transform .2s;
}
.scan--hold { box-shadow: 0 0 0 10px rgba(229, 96, 74, .12), 0 0 70px rgba(229, 96, 74, .4); transform: scale(.98); }
.scan--ok { box-shadow: 0 0 0 10px rgba(141, 166, 126, .18), 0 0 70px rgba(141, 166, 126, .5); }
.scan__ring { position: absolute; inset: -9px; transform: rotate(-90deg); }
.scan__ring circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.scan__print { width: 58%; height: 58%; fill: none; stroke: #E5604A; stroke-width: 2.4; stroke-linecap: round; opacity: .9; }
.scan--ok .scan__print { stroke: #8DA67E; }
.scan__line {
  position: absolute; left: 16%; right: 16%; height: 2px; top: 20%; border-radius: 2px; display: none;
  background: linear-gradient(90deg, transparent, #F2C14E, transparent); box-shadow: 0 0 14px #F2C14E;
  animation: scanline 1s ease-in-out infinite alternate;
}
.scan--hold .scan__line { display: block; }
@keyframes scanline { to { top: 78%; } }

.checks { list-style: none; margin: 0; padding: 0; width: min(100%, 380px); display: flex; flex-direction: column; gap: 10px; font: 500 13px var(--f-mono); text-align: left; }
.checks li { display: flex; gap: 8px; align-items: baseline; animation: rise .35s both; }
.checks li::after { content: ''; order: 1; flex: 1; border-bottom: 1.5px dotted #5E5047; transform: translateY(-3px); }
.checks b { order: 2; color: #8DA67E; font-weight: 700; }

.answers { position: relative; width: min(100%, 420px); min-height: 180px; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 10px; }
.answers .chip { background: transparent; color: #F4ECDF; border-color: #CDBBA6; min-width: 96px; transition: transform .28s cubic-bezier(.3, 1.4, .5, 1), background .15s; }
.answers .chip:hover { background: #F4ECDF; color: #2B201B; }
.answers .chip--me { background: #E5604A; border-color: #E5604A; color: #FFFBF4; }

.pin { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.pin__dots { display: flex; gap: 12px; min-height: 30px; font-size: 26px; line-height: 1; }
.pin__dots span { color: #4A3A31; transition: color .15s, transform .15s; }
.pin__dots span.on { color: #E5604A; transform: scale(1.15); }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; }
.keypad button {
  width: 72px; height: 72px; border-radius: 50%; border: 1.5px solid #4A3A31; background: rgba(255, 251, 244, .04);
  color: #F4ECDF; font: 700 24px var(--f-head); cursor: pointer; transition: background .12s, transform .08s;
}
.keypad button:active { background: rgba(229, 96, 74, .3); transform: scale(.94); }
.keypad .keypad__go { background: #E5604A; border-color: #E5604A; font-size: 20px; }
.keypad .keypad__fn { border-color: transparent; font: 600 14px var(--f-body); }

/* Дверь сейфа после успешного входа */
.vault { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.vault__door {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background: repeating-linear-gradient(90deg, #2B201B 0 22px, #30241E 22px 23px), #2B201B;
  animation: doorL 1.05s .95s cubic-bezier(.7, 0, .2, 1) forwards;
}
.vault__door--r { right: 0; animation-name: doorR; }
.vault__door--l { left: 0; box-shadow: inset -2px 0 0 #4A3A31; }
.vault__center { position: absolute; inset: 0; display: grid; place-items: center; animation: fadeOut .3s .9s forwards; }
.vault__wheel {
  width: 130px; height: 130px; border-radius: 50%; border: 6px solid #F2C14E; position: relative;
  animation: wheel .85s cubic-bezier(.5, 0, .3, 1) forwards;
}
.vault__wheel::before, .vault__wheel::after { content: ''; position: absolute; left: 50%; top: -18px; bottom: -18px; width: 6px; margin-left: -3px; background: #F2C14E; border-radius: 3px; }
.vault__wheel::after { transform: rotate(90deg); }
.vault__text { position: absolute; bottom: 18vh; left: 0; right: 0; text-align: center; color: #F4ECDF; font: 800 clamp(20px, 5vw, 30px)/1.2 var(--f-head); padding: 0 20px; animation: rise .4s both; }
@keyframes wheel { to { transform: rotate(270deg); } }
@keyframes doorL { to { transform: translateX(-101%); } }
@keyframes doorR { to { transform: translateX(101%); } }
@keyframes fadeOut { to { opacity: 0; } }

/* ========== КПП мужа ========== */
.checkpoint {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 32px 20px; text-align: center; background: #3A2418; color: #FBF2E4; position: relative; overflow: hidden;
}
.checkpoint::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: repeating-linear-gradient(-45deg, #DDA23C 0 14px, #3A2418 14px 28px); }
.checkpoint .gate__eyebrow, .checkpoint .gate__hint { color: #D2B48E; }
.checkpoint .pin__dots span { color: #5F4636; }
.checkpoint .pin__dots span.on { color: #DDA23C; }
.checkpoint .keypad button { border-color: #5F4636; }
.checkpoint .keypad .keypad__go { background: #DDA23C; border-color: #DDA23C; color: #3A2418; }
.checkpoint .keypad .keypad__fn { border-color: transparent; }
.barrier { position: relative; width: min(300px, 78vw); height: 46px; flex: none; }
.barrier__post { position: absolute; left: 0; bottom: 0; width: 22px; height: 46px; border-radius: 6px 6px 0 0; background: #5F4636; }
.barrier__arm {
  position: absolute; left: 11px; bottom: 30px; right: 0; height: 12px; border-radius: 6px; transform-origin: 0 50%;
  background: repeating-linear-gradient(90deg, #C4562A 0 26px, #FBF2E4 26px 52px);
  transition: transform .9s cubic-bezier(.5, -0.3, .3, 1.3);
}
.barrier--up .barrier__arm { transform: rotate(-78deg); }
.pin-wrap { transition: opacity .35s, visibility .35s; }
.pin-wrap--gone { opacity: 0; visibility: hidden; }

/* ========== Сирена: муж в пульте ========== */
.alarm {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 32px 22px; text-align: center; color: #FBF2E4; background: #7A2E2A; animation: alarmBg 1.1s infinite; overflow: hidden;
}
.alarm__siren { width: 96px; height: 52px; border-radius: 48px 48px 8px 8px; background: #C4562A; position: relative; box-shadow: 0 0 60px 20px rgba(229, 96, 74, .6); animation: siren .55s infinite alternate; }
.alarm__siren::after { content: ''; position: absolute; left: -18px; right: -18px; bottom: -10px; height: 12px; border-radius: 4px; background: #3A2418; }
.alarm__title { margin: 0; font: 800 clamp(30px, 9vw, 64px)/1 var(--f-head); letter-spacing: -.02em; }
.alarm__text { font: 500 16px/1.5 var(--f-body); max-width: 36ch; }
.alarm .btn { background: #FBF2E4; color: #3A2418; }
@keyframes alarmBg { 50% { background: #8E3324; } }
@keyframes siren { to { box-shadow: 0 0 120px 46px rgba(229, 96, 74, .85); background: #E5604A; } }

/* ========== Дашборд ========== */
.ticker { display: flex; gap: 8px; align-items: baseline; padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: 999px; font: 500 13px var(--f-mono); background: var(--card); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px #C4562A33; animation: blink 2s steps(1) infinite; }
.ping-banner { background: var(--accent); color: var(--card); border-radius: 20px; padding: 18px 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; animation: pingPulse 1.4s infinite; }
@keyframes pingPulse { 50% { box-shadow: 0 0 0 8px #C4562A33; } }
.drama-badge { font: 700 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; background: var(--wine); color: #FBF2E4; }
.ach { border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.ach--on { background: var(--gold); }
.ach--off { opacity: .75; }
.ach--anti.ach--on { background: var(--wine); color: #FBF2E4; }
.ach--anti.ach--on .ach__desc { color: #E6CFAE; }
.ach__desc { font-size: 13px; color: var(--muted2); line-height: 1.4; }
.grid-fill { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(var(--min, 210px), 1fr)); }

@media (max-width: 380px) {
  .loader__bar { letter-spacing: .08em; font-size: 10px; }
  .loader__presents { letter-spacing: .2em; }
  .gate__eyebrow { letter-spacing: .12em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .loader { transition: opacity .3s !important; }
  .loader--out { clip-path: none; opacity: 0; }
}

/* ========== Милое: «Скучаю», счётчик любви, сказка ========== */
.miss { align-items: stretch; }
.miss__btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, #F08A8A, #E5604A); color: #FFFBF4; font: 800 20px var(--f-head); cursor: pointer;
  box-shadow: 0 8px 24px rgba(229, 96, 74, .3); transition: transform .1s;
}
.miss__btn:active { transform: scale(.97); }
.miss__heart { display: inline-block; font-size: 28px; animation: heartPop .6s cubic-bezier(.3, 1.6, .5, 1); }
.miss__heart, .miss__btn:hover .miss__heart { animation-name: heartPop; }
.miss__btn:hover .miss__heart { animation: heartBeat 1s infinite; }
.miss__line { font: 600 15px var(--f-body); text-align: center; color: var(--muted2); }
@keyframes heartPop { 0% { transform: scale(.4); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes heartBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.2); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }

.hearts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 85; }
.hearts span { position: absolute; bottom: -60px; color: #E5604A; opacity: 0; animation: heartFloat 3s ease-in forwards; text-shadow: 0 2px 8px rgba(229, 96, 74, .35); }
.hearts span:nth-child(3n) { color: #F08A8A; } .hearts span:nth-child(4n) { color: #F2C14E; }
@keyframes heartFloat {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), -110vh) scale(1.1) rotate(15deg); }
}
.miss-rain { position: fixed; inset: 0; z-index: 86; display: grid; place-items: center; padding: 20px; background: rgba(43, 32, 27, .35); animation: toastIn .3s; }
.miss-rain__card {
  position: relative; z-index: 87; background: #FFFBF4; color: #2B201B; border-radius: 28px; padding: 26px 24px; text-align: center;
  display: flex; flex-direction: column; gap: 14px; min-width: min(320px, 90vw); box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  animation: heartPop .5s cubic-bezier(.3, 1.6, .5, 1);
}
.miss-rain__card .btn { background: #E5604A; color: #FFFBF4; }
.miss-rain__title { font: 800 26px/1.15 var(--f-head); }
.miss-rain__close { background: none; border: none; color: #7A6A5E; font: 500 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }

.love { background: linear-gradient(160deg, #FFF3EC, var(--card) 60%); }
.love__since { color: var(--muted); }
.love__days { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.love__days b { font: 800 clamp(52px, 13vw, 84px)/.9 var(--f-head); letter-spacing: -.03em; color: #E5604A; }
.love__days span { font: 700 18px var(--f-head); }
.love__note { font: 600 15px/1.45 var(--f-body); }
.love__note--party { font: 800 20px/1.3 var(--f-head); color: #E5604A; }
.love__totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; padding-top: 6px; }
.love__totals div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 16px; background: var(--bg); }
.love__totals b { font: 800 24px var(--f-head); }
.love__totals span { font-size: 13px; color: var(--muted); }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 88; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; animation: confettiFall 4s linear forwards; }
@keyframes confettiFall { to { transform: translateY(110vh) rotate(var(--rot)); } }

.story { background: linear-gradient(170deg, #1F2440, #2B201B); color: #F4ECDF; border: none; gap: 10px; position: relative; overflow: hidden; }
.story::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: radial-gradient(1.5px 1.5px at 12% 20%, #fff, transparent), radial-gradient(1px 1px at 70% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 40%, #fff, transparent), radial-gradient(1px 1px at 35% 8%, #fff, transparent),
    radial-gradient(1px 1px at 55% 30%, #fff, transparent);
  animation: twinkle 3s ease-in-out infinite alternate;
}
.story > * { position: relative; } /* ::before — псевдоэлемент, его это не задевает */
.story__moon { color: #F2C14E; }
.story p { margin: 0; font: 500 16px/1.6 var(--f-body); text-wrap: pretty; color: #E6D9C6; }
.story p.story__first::first-letter { font: 800 2.4em/1 var(--f-head); float: left; margin: 4px 8px 0 0; color: #F2C14E; }
@keyframes twinkle { to { opacity: .25; } }

/* ========== «За что я тебя люблю» ========== */
:root { --f-hand: Caveat, 'Segoe Script', cursive; }
.hand { font-family: var(--f-hand); font-weight: 700; line-height: 1.15; }
.hand-input { font: 600 22px/1.3 var(--f-hand); resize: vertical; min-height: 96px; }

.love-card { position: relative; overflow: hidden; background: linear-gradient(150deg, #FFE9E2, #FFFBF4 55%, #FFF4DA); }
.love-card--dash { background: linear-gradient(150deg, #FBE3D6, var(--card) 55%); }
.love-card > :not(.love-card__sparkles) { position: relative; }
.love-card__sparkles { position: absolute; inset: 0; pointer-events: none; }
.love-card__sparkles i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #F2C14E; opacity: 0; animation: sparkle 3.2s ease-in-out infinite; }
.love-card__sparkles i:nth-child(1) { left: 12%; top: 22%; }
.love-card__sparkles i:nth-child(2) { left: 82%; top: 16%; animation-delay: .7s; background: #E5604A; }
.love-card__sparkles i:nth-child(3) { left: 64%; top: 70%; animation-delay: 1.4s; }
.love-card__sparkles i:nth-child(4) { left: 28%; top: 82%; animation-delay: 2.1s; background: #F08A8A; }
.love-card__sparkles i:nth-child(5) { left: 92%; top: 56%; animation-delay: 2.6s; }
@keyframes sparkle { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: .9; transform: scale(1.3); } }
.love-card__new { font: 700 12px var(--f-mono); letter-spacing: .08em; padding: 6px 10px; border-radius: 999px; background: #E5604A; color: #FFFBF4; animation: heartBeat 1.6s infinite; }
.love-card__today { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.love-card__today blockquote { margin: 0; font: 600 18px/1.45 var(--f-body); color: var(--ink); animation: rise .8s both; }
.love-card__today blockquote.hand { font: 700 28px/1.15 var(--f-hand); }
.love-card__open {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #7A2E4A, #E5604A); color: #FFFBF4; font: 800 17px var(--f-head);
  box-shadow: 0 10px 28px rgba(122, 46, 74, .3); transition: transform .12s;
}
.love-card__open:active { transform: scale(.97); }
.love-card__env { font-size: 24px; animation: heartBeat 2.4s infinite; }

/* Полноэкранный просмотр */
.lv {
  position: fixed; inset: 0; z-index: 95; display: grid; grid-template-rows: auto 1fr auto auto; color: #FFF4EC;
  padding: max(14px, env(safe-area-inset-top)) clamp(14px, 4vw, 40px) max(14px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 20% 15%, #7A2E4A 0, transparent 55%), radial-gradient(circle at 85% 90%, #C4562A 0, transparent 50%), #3A1A26;
  animation: lvIn .45s ease-out; overflow: hidden;
}
@keyframes lvIn { from { opacity: 0; } }
.lv__bg { position: absolute; inset: 0; pointer-events: none; }
.lv__bg span { position: absolute; bottom: -40px; color: #F08A8A; opacity: .35; animation: lvFloat linear infinite; }
.lv__bg span:nth-child(3n) { color: #F2C14E; opacity: .25; }
@keyframes lvFloat { from { transform: translateY(0) rotate(-10deg); } to { transform: translateY(-115vh) rotate(20deg); } }
.lv > :not(.lv__bg) { position: relative; }
.lv__top { display: flex; justify-content: space-between; align-items: center; }
.lv__eyebrow { font: 500 12px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: #F2C9B8; }
.lv__close { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid #F2C9B866; background: transparent; color: #FFF4EC; font-size: 26px; cursor: pointer; }

.lv__stage {
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center;
  perspective: 1400px; touch-action: pan-y; min-height: 0; padding: 12px 0;
}
.lv-card {
  position: relative; width: min(640px, 100%); box-sizing: border-box;
  padding: clamp(26px, 4.5vw, 48px); border-radius: 30px; color: #2B201B; cursor: grab; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 100% 0, #FFE3D8, transparent 45%), #FFFBF4;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .5) inset;
  display: flex; flex-direction: column; gap: 18px; transition: transform .25s;
}
.lv-card::after { content: '♥'; position: absolute; right: 22px; bottom: 10px; font-size: 90px; line-height: 1; color: #E5604A; opacity: .07; pointer-events: none; }
.lv-in-next { animation: lvFlipNext .7s cubic-bezier(.2, .8, .2, 1) both; }
.lv-in-prev { animation: lvFlipPrev .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes lvFlipNext { from { opacity: 0; transform: translateX(60px) rotateY(-55deg) scale(.9); } to { opacity: 1; transform: rotate(-1deg); } }
@keyframes lvFlipPrev { from { opacity: 0; transform: translateX(-60px) rotateY(55deg) scale(.9); } to { opacity: 1; transform: rotate(1deg); } }
.lv-card__no { font: 700 12px var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: #C4562A; display: flex; gap: 10px; align-items: center; }
.lv-new { font: 700 11px var(--f-mono); letter-spacing: .1em; padding: 4px 8px; border-radius: 999px; background: #F2C14E; color: #2B201B; }
.lv-card__text { margin: 0; font: 700 clamp(24px, 3.4vw, 38px)/1.28 var(--f-head); letter-spacing: -.01em; text-wrap: pretty; }
.lv-card--mine .lv-card__text { font: 700 clamp(34px, 5vw, 56px)/1.12 var(--f-hand); letter-spacing: 0; color: #5A1F33; }
/* Длинные причины — мельче, чтобы открытка всегда помещалась без прокрутки */
.lv-card--long .lv-card__text { font-size: clamp(20px, 2.6vw, 28px); }
.lv-card--long.lv-card--mine .lv-card__text { font-size: clamp(26px, 3.6vw, 40px); }
.lv-word { display: inline-block; white-space: pre; opacity: 0; animation: lvWord .5s ease-out forwards; }
@keyframes lvWord { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.lv-card__stamp {
  align-self: flex-start; font: 700 13px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: #E5604A;
  border: 2px solid #E5604A; border-radius: 10px; padding: 6px 10px; transform: rotate(-4deg); animation: stamp .5s 1.2s both cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes stamp { from { opacity: 0; transform: rotate(-4deg) scale(2.2); } }
.lv-card__sign { font: 600 16px var(--f-body); color: #7A6A5E; }
.lv-card__liked { position: absolute; top: 18px; right: 22px; font-size: 30px; color: #E5604A; animation: heartPop .5s both; }
.lv-burst { position: absolute; inset: 0; display: grid; place-items: center; font-size: 180px; color: #E5604A; pointer-events: none; animation: lvBurst .9s ease-out forwards; }
@keyframes lvBurst { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: .95; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.6); } }
.lv-again { align-self: flex-start; background: #E5604A; }

.lv__nav { display: flex; justify-content: center; align-items: center; gap: clamp(18px, 5vw, 48px); padding-top: 4px; }
.lv__arrow, .lv__like {
  width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid #F2C9B866; background: rgba(255, 244, 236, .08);
  color: #FFF4EC; font: 700 32px/1 var(--f-body); cursor: pointer; transition: transform .1s, background .2s;
}
.lv__arrow:active, .lv__like:active { transform: scale(.92); }
.lv__arrow:disabled, .lv__like:disabled { opacity: .3; cursor: default; }
.lv__like { width: 76px; height: 76px; font-size: 34px; border-color: #E5604A; }
.lv__like--on { background: #E5604A; animation: heartPop .4s; }
.lv__mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lv__count { font: 500 12px var(--f-mono); color: #F2C9B8; }
.lv__hint { text-align: center; font: 500 11px var(--f-mono); letter-spacing: .12em; color: #F2C9B888; padding-top: 6px; }

@media (min-width: 1000px) and (orientation: landscape) {
  .lv-card { width: min(820px, 100%); }
}
@media (max-height: 700px) and (orientation: landscape) {
  .lv__hint { display: none; }
  .lv__arrow { width: 52px; height: 52px; }
  .lv__like { width: 60px; height: 60px; }
}

/* ========== Планшет (iPad 11": 834×1194 и 1194×834) ========== */
/* Портрет: пульт шире, но в одну колонку. */
@media (min-width: 760px) {
  .page-pult { max-width: 720px; padding: 32px 28px 56px; gap: 20px; }
}
/* Альбом: пульт в две колонки, шапка, индекс и подвал — на всю ширину. */
@media (min-width: 1000px) {
  .page-pult { display: block; max-width: 1160px; column-count: 2; column-gap: 20px; }
  .page-pult > * { break-inside: avoid; margin-bottom: 20px; }
  .page-pult > header, .page-pult > footer, .page-pult > .pult-wide { column-span: all; }
}
/* На тач-экранах :hover «залипает» после тапа — эффекты наведения только для мыши. */
@media (hover: none) {
  .door:hover { transform: none; box-shadow: none; }
  .chip--ghost-light:hover { background: transparent; color: var(--bg); border-color: var(--light); }
  .answers .chip:hover { background: transparent; color: #F4ECDF; }
  .answers .chip--me:hover { background: #E5604A; color: #FFFBF4; }
}

/* ---------- Сенсорные экраны: цели касания не меньше 44 px ---------- */
@media (pointer: coarse) {
  header a { display: inline-flex; align-items: center; min-height: 44px; }
  .gate__back { min-height: 44px; padding: 0 12px; }
  button[aria-label="отменить желание"], button[aria-label="удалить причину"] { min-width: 44px; min-height: 44px; }
  .page-dash .chip { min-height: 44px !important; }
  input[type=range] { height: 44px; }
  .love-card__open, .miss__btn { min-height: 64px; }
}

/* ---------- Планшет: экраны входа крупнее (высота отсекает телефоны в альбомной ориентации) ---------- */
@media (min-width: 760px) and (min-height: 600px) {
  .doors { align-items: center; }
  .doors > * { width: min(980px, 100%); }
  .doors__title { font-size: clamp(56px, 8vw, 88px); }
  .door { min-height: 280px; padding: 34px; border-radius: 34px; }
  .door__name { font-size: clamp(40px, 5vw, 56px); }
  .door__sub { font-size: 18px; max-width: 30ch; }

  .gate, .checkpoint, .alarm { gap: 28px; }
  .gate__title { font-size: clamp(34px, 5vw, 52px); }
  .gate__hint { font-size: 17px; }
  .scan { width: 260px; height: 260px; }
  .scan__ring { inset: -11px; }
  .checks { width: min(100%, 460px); font-size: 15px; gap: 14px; }
  .answers { width: min(100%, 520px); min-height: 220px; }
  .answers .chip { font-size: 18px; min-height: 56px; padding: 14px 26px; }
  .keypad { grid-template-columns: repeat(3, 88px); gap: 18px; }
  .keypad button { width: 88px; height: 88px; font-size: 30px; }
  .pin__dots { font-size: 32px; gap: 16px; }
  .barrier { width: min(380px, 70vw); }
  .vault__wheel { width: 170px; height: 170px; }
  .vault__text { font-size: clamp(28px, 4vw, 40px); }
  .alarm__siren { transform: scale(1.3); }
  .miss-rain__card { min-width: 420px; padding: 34px; }
  .miss-rain__title { font-size: 32px; }
}
/* Портрет планшета: двери друг под другом, во всю ширину */
@media (min-width: 760px) and (min-height: 600px) and (orientation: portrait) {
  .doors__grid { grid-template-columns: 1fr; }
  .door { min-height: 300px; }
}
/* Альбом планшета (834 по высоте): ритуал и КПП должны влезать без прокрутки */
@media (min-width: 1000px) and (max-height: 900px) and (orientation: landscape) {
  .gate, .checkpoint { gap: 18px; padding-top: 20px; padding-bottom: 20px; }
  .keypad { gap: 12px; }
  .keypad button { width: 76px; height: 76px; font-size: 26px; }
  .scan { width: 230px; height: 230px; }
}
