/* Тайный Санта — тёплый зимний вечер.
 * Цвета задаются темой: <html data-theme="wine"> (вишнёвый вечер) или data-theme="pine" (хвойный).
 * Чтобы сменить тему, поменяйте значение в public/index.html. */
:root, [data-theme="wine"] {
  --sky-1: #5A2238;      /* верх неба */
  --sky-2: #34122A;      /* середина */
  --sky-3: #1A0915;      /* низ */
  --glow: 255, 170, 90;  /* тёплое свечение (RGB) */
  --text: #FFF3E6;
  --text-2: #EBD0C4;
  --text-3: #B8919D;
  --accent: #EDBB75;     /* золото: звёзды, цифры, мелкие акценты */
  --accent-rgb: 237, 187, 117;
  --red: #EE5A70;
  --red-rgb: 238, 90, 112;
  --green: #74C69D;
  --btn: #F8E6CB;        /* основная кнопка — тёплый крем */
  --btn-hi: #FFF2DE;
  --btn-text: #45152E;
  --surface: 255, 226, 208;  /* карточки (RGB) */
  --well: rgba(22, 6, 16, .5);
  --solid: #3A1530;      /* фон диалогов и чата */
  --solid-2: #250C1E;
  --placeholder: #9A7682;
}
[data-theme="pine"] {
  --sky-1: #1F4A3D;
  --sky-2: #123128;
  --sky-3: #08170F;
  --glow: 255, 176, 92;
  --text: #FFF6EA;
  --text-2: #D9DCC8;
  --text-3: #93A99A;
  --accent: #EDBB75;
  --accent-rgb: 237, 187, 117;
  --red: #EE5A70;
  --red-rgb: 238, 90, 112;
  --green: #8DD8AE;
  --btn: #F8E6CB;
  --btn-hi: #FFF2DE;
  --btn-text: #173B30;
  --surface: 232, 246, 230;
  --well: rgba(4, 16, 11, .5);
  --solid: #173F33;
  --solid-2: #0D271F;
  --placeholder: #7E9688;
}
:root {
  --paper: #F7EEDD;
  --paper-2: #EADCC2;
  --paper-3: #E1CFAF;
  --ink: #2A1A26;
  --ink-2: #6E5763;
  --panel: rgba(var(--surface), .065);
  --line: rgba(var(--surface), .15);
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-lg: 26px;
  --r-md: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--sky-3); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  font-family: var(--body); font-size: 17px; line-height: 1.55; color: var(--text);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.noscroll { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--accent); }
img, svg { display: block; }
button { font: inherit; color: inherit; }

/* ---------- небо, огни на фоне, снег */
.sky {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1.2px 1.2px at 12% 14%, rgba(255,240,220,.7), transparent 60%),
    radial-gradient(1px 1px at 31% 7%, rgba(255,240,220,.5), transparent 60%),
    radial-gradient(1.3px 1.3px at 58% 17%, rgba(255,240,220,.6), transparent 60%),
    radial-gradient(1px 1px at 82% 9%, rgba(255,240,220,.5), transparent 60%),
    radial-gradient(1px 1px at 93% 24%, rgba(255,240,220,.45), transparent 60%),
    radial-gradient(900px 520px at 50% 108%, rgba(var(--glow), .30), transparent 70%),
    radial-gradient(600px 420px at 100% 0%, rgba(var(--glow), .12), transparent 70%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 50%, var(--sky-3) 100%);
}
.bokeh { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bokeh i {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--c), .9) 0%, rgba(var(--c), .45) 32%, rgba(var(--c), 0) 70%);
  opacity: var(--o); animation: breathe var(--d) ease-in-out var(--delay) infinite alternate;
}
@keyframes breathe { from { opacity: var(--o); transform: scale(1); } to { opacity: calc(var(--o) * .35); transform: scale(.88); } }
.strands { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.strands .s-wire { fill: none; stroke: rgba(var(--surface), .1); stroke-width: 1.1; }
.strands .s-bulb { animation: twinkle 3.2s ease-in-out infinite; }
.snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ---------- гирлянда сверху */
.garland { position: absolute; top: 0; left: 0; right: 0; height: 74px; z-index: 3; pointer-events: none; overflow: hidden; }
.garland .wire { fill: none; stroke: rgba(var(--surface), .28); stroke-width: 1.6; }
.garland .bulb { pointer-events: auto; cursor: pointer; transform-box: fill-box; transform-origin: 50% 0; animation: twinkle 3.6s ease-in-out infinite; }
.garland .cap { fill: #6E5A60; }
.garland .glass { fill: currentColor; filter: drop-shadow(0 0 6px currentColor); }
.garland .shine { fill: #fff; opacity: .55; }
.garland .c-gold { color: #FFC56E; }
.garland .c-berry { color: #FF6B7E; }
.garland .c-frost { color: #FFE9B8; }
.garland .c-pine { color: #7FE0AE; }
.garland .bulb.ring { animation: swing 1.2s ease-out, twinkle 3.6s ease-in-out infinite; }
.garland .bulb.ring .glass { filter: drop-shadow(0 0 13px currentColor) brightness(1.35); }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes swing {
  0% { transform: rotate(0); } 15% { transform: rotate(22deg); } 35% { transform: rotate(-15deg); }
  55% { transform: rotate(9deg); } 75% { transform: rotate(-4deg); } 100% { transform: rotate(0); }
}

/* ---------- каркас */
.topbar { position: relative; z-index: 2; padding: 64px 20px 0; display: flex; justify-content: center; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 500; font-size: 14px; letter-spacing: .01em;
  color: var(--text-2); text-decoration: none; padding: 6px 10px; border-radius: 999px;
}
.brand:hover { color: var(--text); }
.brand { font-size: 16px; font-weight: 700; color: var(--text); }
.brand-logo { width: 26px; height: 26px; }

.app { position: relative; z-index: 1; flex: 1; width: 100%; padding: 18px 18px 48px; outline: none; }
.narrow { max-width: 600px; margin: 0 auto; }
.center { text-align: center; }
.block { margin-top: 64px; }

.footer { position: relative; z-index: 1; text-align: center; padding: 24px 20px calc(28px + var(--safe-b)); color: var(--text-3); font-size: 14px; }
.footer p { margin: 0 0 4px; }
.linklike { background: none; border: 0; padding: 4px 6px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: 6px; }
.linklike:hover { color: var(--text); }

/* ---------- типографика */
.hero-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(58px, 18vw, 132px); line-height: .9; letter-spacing: -.035em;
  margin: 0 0 22px; display: flex; flex-direction: column;
  text-shadow: 0 0 46px rgba(var(--glow), .28);
}
.hero-title span:last-child { padding-left: .62em; color: var(--paper); }
.h-page { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 7vw, 40px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 12px; overflow-wrap: anywhere; }
.h-sec { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 10px; overflow-wrap: anywhere; }
.lead { font-size: 18px; color: var(--text-2); max-width: 34em; margin: 0 0 24px; }
.kicker { color: var(--accent); font-weight: 600; margin: 0 0 6px; }
.hint { color: var(--text-3); font-size: 15px; margin: 6px 0 0; }
.muted { color: var(--text-2); margin: 0 0 18px; }
.count { color: var(--text-3); font-weight: 500; }
.prose p { margin: 0 0 12px; color: var(--text-2); font-size: 16px; }

/* ---------- кнопки */
.btn {
  --bg: transparent; --fg: var(--text); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .2s, border-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-gold { --bg: var(--btn); --fg: var(--btn-text); --bd: var(--btn); box-shadow: 0 10px 30px -14px rgba(var(--glow), .55); }
.btn-gold:hover:not(:disabled) { --bg: var(--btn-hi); --bd: var(--btn-hi); }
.btn-ghost:hover:not(:disabled) { --bd: var(--text-2); background: rgba(var(--surface), .07); }
.btn-danger { --bg: var(--red); --fg: #fff; --bd: var(--red); }
.btn-text { --bd: transparent; min-height: 40px; padding: 8px 12px; color: var(--text-2); font-weight: 600; font-size: 15px; }
.btn-text:hover { color: var(--text); }
.btn-lg { min-height: 56px; padding: 16px 28px; font-size: 17px; }
.btn-wide { width: 100%; }
.btn .icon { width: 19px; height: 19px; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--btn-text); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-ghost.busy::after { border-color: var(--text); border-right-color: transparent; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: rgba(var(--surface), .09); color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- карточки и формы */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; margin-top: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.form fieldset { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
.form legend { font-family: var(--display); font-weight: 600; font-size: 19px; padding: 0; margin-bottom: 4px; }
.field { margin-top: 16px; min-width: 0; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 7px; color: var(--text); }
.field .hint { margin-top: 6px; font-size: 14px; }
.row2 { display: grid; gap: 0 14px; }
@media (min-width: 520px) { .row2 { grid-template-columns: 1fr 1fr; } }
.input {
  width: 100%; display: block; font: inherit; font-size: 17px; color: var(--text);
  background: var(--well); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 16px; min-height: 50px; transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--placeholder); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.5; }
.input.pin { letter-spacing: .3em; font-weight: 700; }
.callout {
  margin-top: 16px; padding: 13px 16px; border-radius: var(--r-md);
  background: rgba(var(--accent-rgb), .09); border: 1px solid rgba(var(--accent-rgb), .3);
  color: var(--text-2); font-size: 15px;
}
.callout strong { color: var(--accent); }
.form-error { margin: 16px 0 0; padding: 11px 14px; border-radius: var(--r-md); background: rgba(var(--red-rgb), .15); border: 1px solid rgba(var(--red-rgb), .45); color: #FFD0D7; font-size: 15px; }
.form > .btn, .form > .form-error + .btn { margin-top: 20px; }

/* ---------- вкладки */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--well); border: 1px solid var(--line); margin-bottom: 6px; }
.tab { border: 0; background: transparent; padding: 10px 8px; border-radius: 999px; font-weight: 700; font-size: 15px; color: var(--text-2); cursor: pointer; transition: background-color .2s, color .2s; }
.tab[aria-selected="true"] { background: rgba(var(--surface), .16); color: var(--text); }

/* ---------- главная */
.hero { max-width: 1080px; margin: 0 auto; display: grid; gap: 8px; padding-top: 8px; }
.hero-copy .lead { font-size: 19px; }
.hero-env { display: flex; flex-direction: column; align-items: center; padding-top: 150px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px; padding-top: 12px; min-height: 62vh; }
  .hero-env { padding-top: 120px; }
}
.steps { list-style: none; counter-reset: s; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 52px 1fr; column-gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); grid-row: span 2; font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--accent); }
.steps h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.steps p { margin: 0; color: var(--text-2); font-size: 16px; }
.room-links { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.room-link { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 18px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.room-link:hover { border-color: rgba(var(--accent-rgb), .6); }
.room-link-name { font-weight: 700; overflow-wrap: anywhere; }
.room-link-me { color: var(--text-3); font-size: 14px; white-space: nowrap; }

/* ---------- конверт */
.envelope {
  position: relative; width: min(330px, 84vw); aspect-ratio: 1.45; padding: 0; border: 0; background: none;
  cursor: pointer; perspective: 900px; -webkit-tap-highlight-color: transparent;
  transition: transform .3s ease; filter: drop-shadow(0 26px 30px rgba(10, 2, 8, .55));
}
.envelope:not(.open):hover { transform: translateY(-4px) rotate(-1.2deg); }
.envelope:focus-visible { outline-offset: 10px; border-radius: 14px; }
.envelope > span { position: absolute; display: block; }
.env-back { inset: 0; border-radius: 12px; background: linear-gradient(180deg, var(--paper-3), var(--paper-2)); z-index: 1; }
.env-card {
  left: 7%; right: 7%; top: 5%; height: 90%; z-index: 2; border-radius: 9px; background: #FFFCF6;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 10px 24px -12px rgba(30, 20, 0, .35);
  display: flex !important; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 16% 16px 12px; text-align: center; color: var(--ink);
}
.env-kicker { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.env-name { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1.08; letter-spacing: -.02em; overflow-wrap: anywhere; color: var(--ink); }
.env-name.long { font-size: 24px; }
.env-name.xlong { font-size: 18px; }
.env-rule { width: 56px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--red), var(--accent)); }
.env-pocket {
  inset: 0; z-index: 3; border-radius: 12px;
  background:
    linear-gradient(to top right, transparent 49.6%, rgba(160, 120, 60, .1) 50%, transparent 50.6%),
    linear-gradient(to top left, transparent 49.6%, rgba(160, 120, 60, .1) 50%, transparent 50.6%),
    linear-gradient(180deg, #F9F1E3, var(--paper));
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}
.env-flap {
  left: 0; right: 0; top: 0; height: 60%; z-index: 4;
  background: linear-gradient(180deg, #EFE0C4, #E6D3B1);
  clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 12px 12px 0 0;
  transform-origin: 50% 0; transition: transform .45s ease .5s, z-index 0s .5s;
}
.env-seal {
  left: 50%; top: 56%; z-index: 5; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F27B90, #D9475F 55%, #9E2C44);
  box-shadow: inset 0 -3px 6px rgba(80, 0, 20, .35), 0 4px 10px rgba(110, 20, 40, .35);
  display: grid !important; place-items: center;
  transition: transform .3s ease .9s, opacity .3s ease .9s;
}
.env-seal svg { width: 28px; height: 28px; fill: #FFD9A6; filter: drop-shadow(0 1px 0 rgba(90, 0, 20, .5)); }
.envelope:not(.open) .env-seal { animation: sealGlow 2.6s ease-in-out infinite; }
@keyframes sealGlow { 0%, 100% { box-shadow: inset 0 -3px 6px rgba(80,0,20,.35), 0 4px 10px rgba(110,20,40,.35), 0 0 0 0 rgba(var(--glow),0); } 50% { box-shadow: inset 0 -3px 6px rgba(80,0,20,.35), 0 4px 10px rgba(110,20,40,.35), 0 0 0 10px rgba(var(--glow),.18); } }
.envelope.open { cursor: default; }
.envelope.open .env-seal { transform: scale(.3) rotate(-30deg); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 1; transition: transform .5s ease .15s, z-index 0s .42s; }
.envelope.open .env-card { animation: cardOut 1s cubic-bezier(.3, .7, .3, 1) .6s both; }
.envelope.closing .env-card { animation: cardIn .6s ease both; }
.envelope.open.static .env-card { animation: none; transform: translateY(-42%) scale(1.06); z-index: 6; }
.envelope.open.static .env-flap, .envelope.open.static .env-seal { transition: none; }
@keyframes cardOut {
  0% { transform: translateY(0); z-index: 2; }
  58% { transform: translateY(-66%); z-index: 2; }
  59% { z-index: 6; }
  100% { transform: translateY(-42%) scale(1.06); z-index: 6; }
}
@keyframes cardIn {
  0% { transform: translateY(-42%) scale(1.06); z-index: 6; }
  40% { transform: translateY(-66%); z-index: 6; }
  41% { z-index: 2; }
  100% { transform: translateY(0); z-index: 2; }
}
.env-hint { margin: 26px 0 0; color: var(--text-2); font-size: 15px; text-align: center; min-height: 1.5em; }

.sparks { position: fixed; z-index: 70; pointer-events: none; width: 0; height: 0; }
.sparks i {
  position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; background: var(--c);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: spark 1.15s cubic-bezier(.15, .7, .3, 1) both;
}
@keyframes spark {
  0% { transform: translate(0, 0) scale(var(--s)) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0) rotate(200deg); opacity: 0; }
}

/* ---------- комната */
.meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 4px 0 14px; }
.meta li { padding: 5px 12px; border-radius: 999px; background: rgba(var(--surface), .08); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.meta b { color: var(--text); font-weight: 700; }
.room-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.room-head .btn-text { margin-top: 2px; flex: none; }

.invite.fresh { border-color: rgba(var(--accent-rgb), .55); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .08), 0 18px 50px -20px rgba(var(--glow), .45); }
.invite-url { margin-top: 14px; font-size: 15px; color: var(--accent); }

.people { list-style: none; margin: 8px 0 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.people li:last-child { border-bottom: 0; }
.person-name { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; flex: none; }
.av-gold { background: rgba(255, 197, 110, .17); color: #FFD49A; }
.av-berry { background: rgba(255, 107, 126, .18); color: #FFA9B6; }
.av-frost { background: rgba(255, 233, 184, .13); color: #FFE9C4; }
.av-pine { background: rgba(127, 224, 174, .16); color: #A6EBC6; }
.tag { font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.tag-me { border-color: rgba(var(--accent-rgb), .5); color: var(--accent); }
.draw-box { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.draw-box .hint { margin: 0 0 14px; }
.waiting { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 7px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .5); } 50% { box-shadow: 0 0 0 7px rgba(var(--accent-rgb), 0); } }

.reveal { display: flex; flex-direction: column; align-items: center; padding: 116px 0 10px; }
.after-reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; pointer-events: none; }
.after-reveal.shown { opacity: 1; transform: none; pointer-events: auto; }
.wish { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; font-size: 17px; line-height: 1.6; }

.chat-btns { display: grid; gap: 10px; margin-top: 12px; }
.chat-btn {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  width: 100%; text-align: left; padding: 14px 16px; border-radius: 20px; cursor: pointer;
  background: var(--well); border: 1px solid var(--line); transition: border-color .2s;
}
.chat-btn:hover { border-color: rgba(var(--accent-rgb), .55); }
.chat-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb), .15); color: var(--accent); }
.chat-btn + .chat-btn .chat-ic { background: rgba(var(--red-rgb), .16); color: #FFA9B6; }
.chat-txt { display: flex; flex-direction: column; min-width: 0; }
.chat-txt b { font-size: 16px; }
.chat-txt span { font-size: 14px; color: var(--text-3); overflow-wrap: anywhere; }
.badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }

.details summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 17px; list-style: none; display: flex; align-items: center; gap: 6px; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); margin-left: auto; transition: transform .2s; }
.details[open] summary::after { transform: rotate(-135deg); }

/* ---------- чат */
.sheet {
  position: fixed; z-index: 60; top: 0; bottom: 0; left: 50%; width: min(680px, 100%);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--solid), var(--solid-2));
  box-shadow: 0 0 0 100vmax rgba(10, 3, 8, .7);
  transform: translate(-50%, 100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
.sheet.in { transform: translate(-50%, 0); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: rgba(var(--surface), .05); }
.sheet-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sheet-title b { font-family: var(--display); font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-title span { font-size: 13px; color: var(--text-3); }
.sheet-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb), .14); color: var(--accent); flex: none; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.msgs-empty { margin: auto; max-width: 300px; text-align: center; color: var(--text-3); font-size: 15px; }
.day { align-self: center; font-size: 12.5px; color: var(--text-3); padding: 3px 10px; border-radius: 999px; background: rgba(var(--surface), .07); margin: 10px 0 4px; }
.msg { max-width: 82%; padding: 9px 13px 6px; border-radius: 20px; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.45; }
.msg time { display: block; text-align: right; font-size: 11.5px; opacity: .6; margin-top: 2px; }
.msg.mine { align-self: flex-end; background: var(--btn); color: var(--btn-text); border-bottom-right-radius: 6px; }
.msg.theirs { align-self: flex-start; background: rgba(var(--surface), .11); border-bottom-left-radius: 6px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: rgba(0, 0, 0, .18); }
.composer-input { flex: 1; resize: none; font: inherit; font-size: 16px; color: var(--text); background: var(--well); border: 1px solid var(--line); border-radius: 24px; padding: 12px 16px; min-height: 48px; max-height: 140px; line-height: 1.4; }
.composer-input::placeholder { color: var(--placeholder); }
.composer-input:focus { outline: none; border-color: var(--accent); }
.send { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--btn); color: var(--btn-text); display: grid; place-items: center; cursor: pointer; flex: none; }
.send:disabled { opacity: .5; }
.send .icon { width: 21px; height: 21px; margin-left: -2px; }

/* ---------- диалоги и уведомления */
.dialog {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0;
  background: var(--solid); color: var(--text); width: min(440px, calc(100% - 32px));
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
}
.dialog::backdrop { background: rgba(10, 3, 8, .7); backdrop-filter: blur(3px); }
.dialog-body { padding: 24px; }
.dialog-body h2 { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 0 0 10px; overflow-wrap: anywhere; }
.dialog-body > p { color: var(--text-2); margin: 0 0 8px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 999px; background: var(--btn); color: var(--btn-text); font-weight: 700; font-size: 15px; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; text-align: center; }
.toast-err { background: var(--red); color: #fff; border-radius: 18px; }
.toast.in { opacity: 1; transform: none; }

.loader { display: grid; place-items: center; padding: 120px 0; }
.loader span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(var(--accent-rgb), .25); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 700px) {
  .app { padding-top: 28px; }
  .panel { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .garland .bulb, .strands .s-bulb, .bokeh i { animation: none !important; }
}

.whoami { margin: -4px 0 6px; font-size: 15px; color: var(--text-2); }
.whoami b { color: var(--text); }

.faq { margin-top: 18px; }
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 0; font-weight: 700; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); margin-left: auto; flex: none; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq p { margin: 0 0 14px; color: var(--text-2); font-size: 16px; }

/* ---------- «Угостить пряником» */
.donate { display: grid; gap: 12px; margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--well); color: var(--text); border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 16px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }
.promo {
  position: fixed; z-index: 75; left: 50%; bottom: calc(18px + var(--safe-b)); width: min(520px, calc(100% - 24px));
  display: grid; grid-template-columns: 38px 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 10px 12px 14px; border-radius: 999px; overflow: hidden;
  background: var(--solid); border: 1px solid rgba(var(--accent-rgb), .35);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .6);
  transform: translate(-50%, 140%); opacity: 0; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .35s;
}
.promo.in { transform: translate(-50%, 0); opacity: 1; }
.promo p { margin: 0; font-size: 14.5px; line-height: 1.35; color: var(--text); }
.promo-ic { width: 38px; height: 38px; }
.promo-go { border: 0; border-radius: 999px; padding: 9px 14px; background: var(--btn); color: var(--btn-text); font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; }
.promo-x { border: 0; background: transparent; color: var(--text-3); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.promo-x:hover { color: var(--text); background: rgba(var(--surface), .08); }
.promo-x .icon { width: 18px; height: 18px; }
.promo-bar { position: absolute; left: 22px; right: 22px; bottom: 4px; height: 2px; border-radius: 2px; background: rgba(var(--accent-rgb), .75); transform-origin: left; animation: promoBar linear forwards; }
.promo.paused .promo-bar { animation-play-state: paused; }
@keyframes promoBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 420px) { .promo { grid-template-columns: 34px 1fr auto; border-radius: 26px; } .promo-x { grid-column: 3; grid-row: 1; } .promo-go { grid-column: 2 / 4; justify-self: start; } .promo-ic { width: 34px; height: 34px; grid-row: span 2; } }
@media (prefers-reduced-motion: reduce) { .promo-bar { display: none; } }

/* ---------- Золотой пряник */
.gold-name { display: inline-flex; align-items: center; gap: 6px; }
.gold-name .pn-text {
  font-weight: 800; font-style: italic; letter-spacing: .005em;
  background: linear-gradient(90deg, #FFB347, #FF7A45, #FF4F8B, #FFB347);
  background-size: 220% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: goldShine 4.5s linear infinite; padding-right: 2px;
}
@keyframes goldShine { to { background-position: 220% center; } }
.gold-badge { display: inline-flex; flex: none; }
.gold-badge-ic { width: 20px; height: 20px; filter: drop-shadow(0 0 6px rgba(255, 160, 80, .55)); }
.avatar-gold { background: linear-gradient(135deg, rgba(255, 179, 71, .25), rgba(255, 79, 139, .25)); color: #FFD9A0; box-shadow: 0 0 0 2px #FFB347, 0 0 16px rgba(255, 122, 69, .45); }
.avatar-emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 20px; }
.people li .person-name.gold-name { flex: 1; }
.perk { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-md); background: rgba(255, 179, 71, .08); border: 1px solid rgba(255, 179, 71, .3); }
.perk p { margin: 0; font-size: 14.5px; color: var(--text-2); }
.perk b { color: var(--text); }
.perk-preview { display: flex; align-items: center; gap: 10px; }
.gold-teaser { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(255, 179, 71, .07); border: 1px dashed rgba(255, 179, 71, .4); }
.gold-teaser .perk-preview { grid-column: 1 / -1; }
.gold-teaser p { margin: 0; font-size: 14.5px; color: var(--text-2); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: 14.5px; }
.linklike.small { font-size: 14px; justify-self: start; padding: 2px 0; }
.gold-panel { border-color: rgba(255, 179, 71, .45); background: linear-gradient(160deg, rgba(255, 179, 71, .1), rgba(255, 79, 139, .06) 60%, var(--panel)); }
.gold-head { display: flex; gap: 14px; align-items: flex-start; }
.gold-head .avatar { width: 46px; height: 46px; font-size: 22px; }
.gold-head .hint { margin-top: 0; }
.gp-label { font-weight: 700; font-size: 15px; margin: 18px 0 8px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.avatar-opt { aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line); background: var(--well); color: var(--text); font-size: 22px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--display); cursor: pointer; display: grid; place-items: center; transition: transform .15s, box-shadow .2s; }
.avatar-opt:hover { transform: scale(1.08); }
.avatar-opt[aria-checked="true"] { box-shadow: 0 0 0 2px #FFB347, 0 0 14px rgba(255, 122, 69, .5); border-color: transparent; }
.gold-code { font: inherit; font-weight: 800; letter-spacing: .04em; color: #FFC979; background: rgba(255, 179, 71, .12); border: 1px solid rgba(255, 179, 71, .4); border-radius: 8px; padding: 1px 8px; cursor: pointer; }
/* золотой конверт */
.envelope.gold .env-seal { background: radial-gradient(circle at 35% 30%, #FFE7A8, #F2B34A 55%, #B8741C); box-shadow: inset 0 -3px 6px rgba(110, 60, 0, .35), 0 4px 12px rgba(200, 120, 20, .45); }
.envelope.gold .env-seal svg { fill: #7A3F10; filter: none; }
.envelope.gold .env-card { box-shadow: inset 0 0 0 2px #EFC06A, inset 0 0 0 5px #FFFCF6, inset 0 0 0 6px rgba(239, 192, 106, .5), 0 10px 24px -12px rgba(30, 20, 0, .35); }
.envelope.gold .env-rule { background: linear-gradient(90deg, #FFB347, #FF4F8B); }
.envelope.gold .env-back { background: linear-gradient(180deg, #E9C98E, #E2C084); }
@media (prefers-reduced-motion: reduce) { .gold-name .pn-text { animation: none; } }
.perk-warn { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; color: #FFD9A0; background: rgba(255, 179, 71, .1); border: 1px solid rgba(255, 179, 71, .4); }
