/* =========================================================
   Тайный Санта Онлайн — общий стиль сайта
   Без CSS-фреймворков: быстрая загрузка и хорошие Core Web Vitals
   ========================================================= */

/* ---------- Цветовые токены ---------- */
:root {
    --bg: #fdf8f1;
    --bg-soft: #f9eee2;
    --surface: #ffffff;
    --surface-2: #f8f1e8;
    --ink: #2a1f1a;
    --ink-2: #54463e;
    --muted: #85766c;
    --line: #eee1d3;
    --line-strong: #e0cdbb;
    --red: #c8323b;
    --red-hover: #ad2730;
    --red-soft: #fbe6e3;
    --green: #2f7d4f;
    --green-hover: #25683f;
    --green-soft: #e4f1e6;
    --gold: #e9a23b;
    --gold-soft: #fdf0d9;
    --tg: #2aa3e0;
    --tg-hover: #1f8fc8;
    --tg-soft: #e6f4fc;
    --chat-bg: #dfe9d5;
    --bubble-in: #ffffff;
    --bubble-out: #e3f6cc;
    --focus: rgba(200, 50, 59, 0.35);
    --shadow-sm: 0 1px 2px rgba(42, 31, 26, 0.06);
    --shadow: 0 2px 4px rgba(42, 31, 26, 0.04), 0 12px 28px rgba(42, 31, 26, 0.08);
    --shadow-lg: 0 4px 10px rgba(42, 31, 26, 0.06), 0 24px 56px rgba(42, 31, 26, 0.14);
    --radius: 22px;
    --radius-sm: 14px;
    --header-h: 70px;

    /* Иллюстрация в первом экране (ночная сцена в шаре одинакова в обеих темах) */
    --art-arrow: #c8323b;
    --art-ring: #ffffff;
    --art-rim: #e3e8f8;
    --art-flake: #8db4f5;
}

:root[data-theme="dark"] {
    --bg: #14161b;
    --bg-soft: #1a1d24;
    --surface: #1c2028;
    --surface-2: #20242d;
    --ink: #f4eee8;
    --ink-2: #d6cdc5;
    --muted: #a0968e;
    --line: #2a2f3a;
    --line-strong: #383e4c;
    --red: #ff6b6b;
    --red-hover: #ff8585;
    --red-soft: #3a2024;
    --green: #5fcf8a;
    --green-hover: #7ddca1;
    --green-soft: #1b3326;
    --gold: #ffc35c;
    --gold-soft: #3a2f18;
    --tg: #4cb6ea;
    --tg-hover: #6cc4ef;
    --tg-soft: #18303f;
    --chat-bg: #1d2129;
    --bubble-in: #2b313c;
    --bubble-out: #2d4a33;
    --focus: rgba(255, 107, 107, 0.45);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.35), 0 24px 56px rgba(0, 0, 0, 0.5);

    --art-arrow: #ff6b6b;
    --art-ring: #1c2028;
    --art-rim: #2b3566;
    --art-flake: #6f8fd6;
}

/* Без JS тема следует системной */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #14161b;
        --bg-soft: #1a1d24;
        --surface: #1c2028;
        --surface-2: #20242d;
        --ink: #f4eee8;
        --ink-2: #d6cdc5;
        --muted: #a0968e;
        --line: #2a2f3a;
        --line-strong: #383e4c;
        --red: #ff6b6b;
        --red-hover: #ff8585;
        --red-soft: #3a2024;
        --green: #5fcf8a;
        --green-soft: #1b3326;
        --gold-soft: #3a2f18;
        --tg-soft: #18303f;
        --chat-bg: #1d2129;
        --bubble-in: #2b313c;
        --bubble-out: #2d4a33;
        --art-arrow: #ff6b6b;
        --art-ring: #1c2028;
        --art-rim: #2b3566;
    }
}

/* ---------- База ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img,
svg {
    max-width: 100%;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
    color: var(--ink);
    font-weight: 800;
}

/* Крупные заголовки — современный Onest, основной текст остается на Nunito */
h1,
h2 {
    font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--red);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--red-hover);
}

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

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.hand {
    font-family: "Caveat", "Segoe Print", cursive;
    font-weight: 700;
    letter-spacing: 0;
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    min-height: 50px;
    padding: 0.75em 1.5em;
    border: 2px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    font-size: 1.02rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--red);
    color: #fff;
}

.btn-primary:hover {
    background: var(--red-hover);
    color: #fff;
}

.btn-telegram {
    background: var(--tg);
    color: #fff;
}

.btn-telegram:hover {
    background: var(--tg-hover);
    color: #fff;
}

:root[data-theme="dark"] .btn-telegram,
:root[data-theme="dark"] .btn-telegram:hover {
    color: #0d1b24;
}

.btn-green {
    background: var(--green);
    color: #fff;
}

.btn-green:hover {
    background: var(--green-hover);
    color: #fff;
}

:root[data-theme="dark"] .btn-green,
:root[data-theme="dark"] .btn-green:hover {
    color: #0d1f14;
}

.btn-outline {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn-outline:hover {
    color: var(--ink);
    border-color: var(--ink-2);
}

.btn-ghost {
    background: transparent;
    color: var(--ink-2);
    border-color: var(--line-strong);
}

.btn-ghost:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.btn-sm {
    min-height: 42px;
    padding: 0.5em 1.1em;
    font-size: 0.95rem;
}

.btn-lg {
    min-height: 58px;
    padding: 0.85em 1.8em;
    font-size: 1.1rem;
}

.btn svg {
    width: 1.2em;
    height: 1.2em;
    flex-shrink: 0;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    text-decoration: none;
}

.link-arrow:hover {
    text-decoration: underline;
}

/* ---------- Шапка ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: var(--header-h);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 900;
    font-size: 1.15rem;
    text-decoration: none;
    white-space: nowrap;
}

.logo:hover {
    color: var(--ink);
}

.logo-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: block;
}

.logo-accent {
    color: var(--red);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.site-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--ink-2);
    font-weight: 700;
    font-size: 0.98rem;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--ink);
    background: var(--surface-2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-switch {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
}

.theme-switch:hover {
    color: var(--ink);
}

.theme-switch svg {
    width: 20px;
    height: 20px;
}

.theme-switch .icon-sun {
    display: none;
}

:root[data-theme="dark"] .theme-switch .icon-sun {
    display: block;
}

:root[data-theme="dark"] .theme-switch .icon-moon {
    display: none;
}

/* ---------- Первый экран ---------- */
.hero {
    position: relative;
    padding: 48px 0 64px;
    /* Верхний слой плавно растворяет фон в цвет следующей секции */
    background:
        linear-gradient(to bottom, transparent 55%, var(--bg) 100%),
        radial-gradient(800px 460px at 85% 0%, var(--bg-soft), transparent 70%),
        var(--bg);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 36px;
}

.hero-note {
    display: inline-block;
    margin: 0 0 6px;
    color: var(--red);
    font-size: 1.7rem;
    line-height: 1.1;
    transform: rotate(-2deg);
}

.hero h1 {
    font-size: clamp(2.1rem, 2vw + 1.3rem, 3.2rem);
    line-height: 1.12;
    margin-bottom: 18px;
}

.hero h1 .accent {
    color: var(--red);
}

.lead {
    max-width: 34em;
    color: var(--ink-2);
    font-size: clamp(1.08rem, 0.4vw + 1rem, 1.25rem);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 22px;
    margin: 26px 0 18px;
}

.hero-free {
    position: relative;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 1.45rem;
    transform: rotate(-3deg);
}

.hero-alt {
    margin: 0 0 26px;
    color: var(--ink-2);
    font-size: 1rem;
}

.proof {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink-2);
    font-size: 0.98rem;
}

.proof strong {
    color: var(--ink);
}

.proof-faces {
    display: flex;
    flex-shrink: 0;
}

.proof-faces span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-left: -10px;
    border: 3px solid var(--bg);
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
}

.proof-faces span:first-child {
    margin-left: 0;
}

.hero-visual {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

.hero-art {
    display: block;
    width: 100%;
    height: auto;
}

/* Уведомления от бота поверх иллюстрации */
.tg-card {
    position: absolute;
    display: flex;
    gap: 10px;
    width: min(300px, 64%);
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    font-size: 0.92rem;
    line-height: 1.4;
    text-align: left;
}

.tg-card img {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--tg-soft);
}

.tg-card-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
    font-weight: 800;
    color: var(--ink);
}

.tg-card-head small {
    margin-left: auto;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
}

.tg-card p {
    margin: 0;
    color: var(--ink-2);
}

/* Карточки стоят по углам и почти не закрывают елку и участников */
.tg-card-1 {
    left: -8%;
    bottom: -9%;
    width: 260px;
    transform: rotate(-2deg);
}

.tg-card-2 {
    right: -12%;
    top: -3%;
    width: 220px;
    transform: rotate(2deg);
}

@media (max-width: 1240px) {
    .tg-card-1 {
        left: -4%;
    }

    .tg-card-2 {
        right: -2%;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .tg-card-1 {
        animation: card-in 0.6s 0.4s both ease-out;
    }

    .tg-card-2 {
        animation: card-in-2 0.6s 1.1s both ease-out;
    }
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(14px) rotate(-2deg); }
    to { opacity: 1; transform: rotate(-2deg); }
}

@keyframes card-in-2 {
    from { opacity: 0; transform: translateY(14px) rotate(2deg); }
    to { opacity: 1; transform: rotate(2deg); }
}

/* Цвета иллюстрации вокруг шара зависят от темы */
.ha-arrow { fill: none; stroke: var(--art-arrow); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 12; }
.ha-arrow-head { fill: var(--art-arrow); }
.ha-ring { fill: var(--art-ring); }
.ha-rim { fill: none; stroke: var(--art-rim); stroke-width: 8; }
.ha-sparkle { fill: var(--gold); }
.ha-flake-out { color: var(--art-flake); }

@media (prefers-reduced-motion: no-preference) {
    .ha-arrow {
        animation: ha-flow 2.4s linear infinite;
    }

    .ha-sparkle,
    .ha-bulb {
        animation: ha-twinkle 3s ease-in-out infinite;
        transform-box: fill-box;
        transform-origin: center;
    }

    .ha-sparkle:nth-of-type(2n),
    .ha-bulb:nth-of-type(2n) {
        animation-delay: -1.5s;
    }

    .ha-spin {
        animation: ha-spin 14s linear infinite;
        transform-box: fill-box;
        transform-origin: center;
    }

    .ha-star-glow {
        animation: ha-glow 2.6s ease-in-out infinite;
        transform-box: fill-box;
        transform-origin: center;
    }
}

@keyframes ha-flow {
    to { stroke-dashoffset: -44; }
}

@keyframes ha-twinkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.7); opacity: 0.6; }
}

@keyframes ha-spin {
    to { transform: rotate(360deg); }
}

@keyframes ha-glow {
    0%, 100% { transform: scale(1); opacity: 0.35; }
    50% { transform: scale(1.25); opacity: 0.6; }
}

/* ---------- Секции ---------- */
.section {
    padding: 76px 0;
}

.section-paper {
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-head {
    max-width: 720px;
    margin: 0 auto 40px;
    text-align: center;
}

.section-head h2 {
    font-size: clamp(1.75rem, 1.4vw + 1.25rem, 2.5rem);
}

.section-head p {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0;
}

.section-head .hand {
    display: block;
    margin-bottom: 4px;
    color: var(--red);
    font-size: 1.6rem;
}

/* ---------- Два способа: сайт и Telegram (без «минусов», оба варианта позитивно) ---------- */
.ways {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 24px;
    max-width: 980px;
    margin: 0 auto;
}

.way {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 30px 30px 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
}

.way-tg {
    border-color: transparent;
    background: var(--tg-soft);
}

.way h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
}

.way h3 svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.way p {
    color: var(--ink-2);
}

.way-list {
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
    color: var(--ink-2);
}

.way-list li {
    position: relative;
    padding: 5px 0 5px 28px;
}

.way-list li::before {
    content: "✓";
    position: absolute;
    left: 2px;
    top: 5px;
    color: var(--green);
    font-weight: 900;
}

.way .btn,
.way .link-arrow {
    align-self: flex-start;
    margin-top: auto;
}

.way-tag {
    position: absolute;
    top: -16px;
    right: 26px;
    padding: 2px 14px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--tg);
    font-size: 1.35rem;
    transform: rotate(2deg);
}

/* ---------- Истории с перепиской ---------- */
.stories {
    display: grid;
    gap: 56px;
    max-width: 980px;
    margin: 0 auto;
}

.story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.story:nth-child(even) .story-text {
    order: 2;
}

.story-num {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-weight: 900;
    font-size: 1.15rem;
}

.story h3 {
    font-size: clamp(1.35rem, 0.6vw + 1.15rem, 1.7rem);
}

.story p {
    color: var(--ink-2);
    margin: 0;
}

.chat {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 22px 18px;
    border-radius: var(--radius);
    background: var(--chat-bg);
}

.msg {
    position: relative;
    max-width: 88%;
    padding: 9px 13px 18px;
    border-radius: 16px;
    background: var(--bubble-in);
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.45;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.msg-in {
    justify-self: start;
    border-bottom-left-radius: 5px;
}

.msg-out {
    justify-self: end;
    background: var(--bubble-out);
    border-bottom-right-radius: 5px;
}

.msg b {
    font-weight: 800;
}

.msg-name {
    display: block;
    margin-bottom: 2px;
    color: var(--tg);
    font-weight: 800;
    font-size: 0.85rem;
}

.msg time {
    position: absolute;
    right: 10px;
    bottom: 4px;
    color: var(--muted);
    font-size: 0.72rem;
}

.msg-btn {
    display: block;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--tg) 12%, transparent);
    color: var(--tg);
    font-weight: 800;
    font-size: 0.88rem;
    text-align: center;
}

/* ---------- Быстрая жеребьевка ---------- */
.quick-draw {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: center;
    max-width: 980px;
    margin: 0 auto;
    padding: 34px 38px;
    border-radius: var(--radius);
    background: var(--gold-soft);
}

.quick-draw h2 {
    font-size: clamp(1.5rem, 1vw + 1.2rem, 2rem);
}

.quick-draw p {
    margin: 0;
    color: var(--ink-2);
}

/* ---------- Для кого ---------- */
.people {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
    max-width: 980px;
    margin: 0 auto;
}

.people > div {
    text-align: center;
}

.people .emoji {
    display: block;
    margin-bottom: 10px;
    font-size: 2.6rem;
    line-height: 1;
}

.people h3 {
    font-size: 1.15rem;
}

.people p {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.98rem;
}

/* ---------- Правила ---------- */
.rules {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 44px;
    align-items: start;
    max-width: 980px;
    margin: 0 auto;
}

.rules h2 {
    font-size: clamp(1.75rem, 1.4vw + 1.25rem, 2.5rem);
}

.rules-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: rule;
}

.rules-list li {
    position: relative;
    padding: 0 0 16px 50px;
    counter-increment: rule;
    color: var(--ink-2);
}

.rules-list li::before {
    content: counter(rule);
    position: absolute;
    left: 0;
    top: -1px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--red);
    color: var(--red);
    font-weight: 900;
}

.tip {
    padding: 26px 28px;
    border-radius: var(--radius);
    background: var(--green-soft);
    color: var(--ink-2);
}

.tip h3 {
    font-size: 1.2rem;
}

.tip p:last-child {
    margin: 0;
}

/* ---------- Второстепенный формат: обмен подарками с незнакомцами ---------- */
.strangers {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
    max-width: 980px;
}

.strangers .hand {
    display: block;
    margin-bottom: 4px;
    color: var(--green);
    font-size: 1.6rem;
}

/* Чуть меньше основных разделов: формат второстепенный */
.strangers h2 {
    font-size: clamp(1.6rem, 1vw + 1.2rem, 2.1rem);
}

.strangers-text > p {
    color: var(--ink-2);
}

.strangers-steps {
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.strangers-steps li {
    position: relative;
    padding: 0 0 12px 44px;
    counter-increment: step;
    color: var(--ink-2);
}

.strangers-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    font-weight: 900;
    font-size: 0.95rem;
}

.strangers-text > .strangers-note {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.strangers .chat {
    width: 100%;
    max-width: 440px;
    justify-self: end;
    /* На «бумажном» фоне раздела переписке нужна тонкая рамка, особенно в темной теме */
    border: 1px solid var(--line);
}

.nowrap {
    white-space: nowrap;
}

/* Тихие упоминания обмена с незнакомцами рядом с призывами в Telegram */
.way-extra {
    margin: -10px 0 22px;
    color: var(--muted);
    font-size: 0.95rem;
}

.bot-promo-extra {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* ---------- Вопросы и ответы ---------- */
.faq {
    max-width: 820px;
    margin: 0 auto;
}

.faq details {
    border-bottom: 1px solid var(--line-strong);
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 4px;
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.faq summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--red);
    font-weight: 900;
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 0.2s;
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq .answer {
    padding: 0 4px 20px;
    color: var(--ink-2);
}

.faq .answer p:last-child {
    margin: 0;
}

/* ---------- Финальный призыв ---------- */
.cta-final {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 52px 32px;
    border-radius: 28px;
    background-color: #b8323a;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.18) 1.6px, transparent 1.8px),
        radial-gradient(rgba(255, 255, 255, 0.12) 1.2px, transparent 1.4px);
    background-size: 34px 34px, 22px 22px;
    background-position: 0 0, 11px 17px;
    color: #fff;
    text-align: center;
}

.cta-final h2 {
    color: #fff;
    font-size: clamp(1.75rem, 1.4vw + 1.25rem, 2.5rem);
}

.cta-final p {
    max-width: 600px;
    margin: 0 auto 26px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.12rem;
}

.cta-final .btn-light {
    background: #fff;
    color: #a52a32;
}

.cta-final .btn-light:hover {
    color: #7f1d24;
}

.cta-final .alt {
    display: block;
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

.cta-final .alt:hover {
    color: #fff;
}

/* ---------- Подвал ---------- */
.site-footer {
    margin-top: 76px;
    padding: 52px 0 30px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 0.97rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-grid h2 {
    margin-bottom: 12px;
    font-family: inherit;
    font-weight: 800;
    font-size: 1rem;
}

.footer-grid ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-grid li {
    margin-bottom: 8px;
}

.footer-grid a {
    color: var(--ink-2);
    text-decoration: none;
}

.footer-grid a:hover {
    color: var(--red);
}

.footer-about p {
    max-width: 28em;
    margin-top: 12px;
    color: var(--muted);
}

.footer-bottom {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.breadcrumbs li + li::before {
    content: "/";
    margin-right: 6px;
    color: var(--line-strong);
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--red);
}

/* ---------- Страница жеребьевки ---------- */
.page-head {
    padding: 40px 0 26px;
    text-align: center;
}

.page-head .breadcrumbs {
    justify-content: center;
}

.page-head h1 {
    font-size: clamp(2rem, 2vw + 1.3rem, 3rem);
}

.page-head .lead {
    margin: 0 auto;
}

.tool {
    max-width: 860px;
    margin: 0 auto;
}

.panel {
    padding: 30px;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.panel-title h2 {
    margin: 0;
    font-size: 1.45rem;
}

.counter-pill {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
}

.participants {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.participant-num {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
}

.participant-input {
    flex: 1;
    min-width: 0;
    height: 54px;
    padding: 0 16px;
    border: 2px solid var(--line-strong);
    border-radius: 14px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: 1.08rem;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.participant-input::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

.participant-input:focus {
    outline: none;
    border-color: var(--red);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--focus);
}

.remove-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.remove-btn:hover {
    color: var(--red);
    border-color: var(--red);
    background: var(--red-soft);
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tool-actions .grow {
    flex: 1;
}

.tool-hint {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.info-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.icon-bubble {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--surface-2);
    font-size: 1.35rem;
    line-height: 1;
}

.info-item h3 {
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.info-item p {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.97rem;
}

.bot-promo {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 26px 28px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    background: var(--tg-soft);
}

.bot-promo h2 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.bot-promo ul {
    margin: 0;
    padding-left: 1.1em;
    color: var(--ink-2);
    font-size: 0.98rem;
}

.result-center {
    text-align: center;
}

.result-center h2 {
    font-size: 1.5rem;
}

.result-center .muted {
    color: var(--ink-2);
    font-size: 1.08rem;
}

.player-name {
    color: var(--red);
    font-weight: 800;
}

.gift-result {
    margin-top: 24px;
    padding: 30px 24px;
    border-radius: var(--radius);
    background: var(--gold-soft);
    text-align: center;
    animation: pop-in 0.35s ease;
}

.gift-result .gift-emoji {
    font-size: 3.4rem;
    line-height: 1;
    margin-bottom: 12px;
}

.gift-result h3 {
    font-size: 1.45rem;
}

.gift-result .receiver {
    color: var(--red);
}

.finished-promo {
    max-width: 560px;
    margin: 22px auto 0;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    background: var(--tg-soft);
    color: var(--ink-2);
    font-size: 0.98rem;
}

.finished-promo p {
    margin: 0 0 12px;
}

.pairs {
    display: grid;
    gap: 10px;
}

.pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 18px;
    border-left: 4px solid var(--red);
    border-radius: 12px;
    background: var(--surface-2);
    font-weight: 700;
}

.pair .to {
    color: var(--red);
}

.pair .arrow {
    color: var(--muted);
}

.history-entry {
    padding: 20px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.history-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.history-entry-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.history-meta {
    color: var(--muted);
    font-size: 0.87rem;
}

.history-pairs {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--surface);
    font-size: 0.95rem;
}

.history-pairs div {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
}

.icon-btn {
    padding: 6px 10px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}

.icon-btn:hover {
    color: var(--red);
    border-color: var(--red);
}

.empty-state {
    padding: 32px 0;
    text-align: center;
    color: var(--muted);
}

.info-callout {
    padding: 14px 18px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 0.95rem;
}

.content {
    max-width: 860px;
    margin: 0 auto;
}

.content h2 {
    margin-top: 1.6em;
    font-size: clamp(1.5rem, 1vw + 1.2rem, 2rem);
}

.content h3 {
    font-size: 1.15rem;
}

.content p,
.content li {
    color: var(--ink-2);
}

.content ol,
.content ul {
    padding-left: 1.3em;
}

.content li {
    margin-bottom: 8px;
}

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

/* ---------- Документы (оферта, политика, контакты) ---------- */
.legal-page {
    padding: 40px 0 0;
}

.legal-wrap {
    max-width: 860px;
}

.legal-card {
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink-2);
}

.legal-card h1 {
    font-size: clamp(1.8rem, 1.2vw + 1.3rem, 2.4rem);
    color: var(--ink);
}

.legal-card h2 {
    margin-top: 1.6em;
    font-size: 1.35rem;
}

.legal-card section {
    margin-bottom: 1.4em;
}

.legal-card ul,
.legal-card ol {
    padding-left: 1.3em;
}

.legal-card ul {
    list-style: disc;
}

.legal-card li {
    margin-bottom: 6px;
}

.legal-card strong {
    color: var(--ink);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 24px 0 0;
    font-weight: 800;
    text-decoration: none;
}

.back-link svg {
    width: 18px;
    height: 18px;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.contact-cards > div {
    padding: 24px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.contact-cards h2 {
    margin-top: 0;
}

/* ---------- Снег (только украшение) ---------- */
.snowfall {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.snowflake {
    position: absolute;
    top: -24px;
    color: #a9c4ef;
    font-size: 14px;
    line-height: 1;
    user-select: none;
    animation: snow-fall linear infinite;
}

:root[data-theme="dark"] .snowflake {
    color: rgba(255, 255, 255, 0.5);
}

@keyframes snow-fall {
    from { transform: translate3d(0, -24px, 0) rotate(0deg); }
    to { transform: translate3d(30px, 105vh, 0) rotate(240deg); }
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1020px) {
    .people {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .hero {
        padding: 28px 0 52px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .hero-visual {
        max-width: 400px;
    }

    .site-nav {
        display: none;
    }

    .header-actions {
        margin-left: auto;
    }

    .story,
    .rules,
    .quick-draw,
    .bot-promo,
    .ways,
    .strangers {
        grid-template-columns: 1fr;
    }

    .strangers {
        gap: 28px;
    }

    .strangers .chat {
        max-width: none;
        justify-self: stretch;
    }

    /* На узком экране переписка короче: блок второстепенный */
    .strangers .msg-optional {
        display: none;
    }

    .story {
        gap: 20px;
    }

    .story:nth-child(even) .story-text {
        order: 0;
    }

    .hero-visual {
        margin-bottom: 40px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 17px;
    }

    .section {
        padding: 56px 0;
    }

    .section-head {
        margin-bottom: 30px;
    }

    .people,
    .info-grid,
    .contact-cards {
        grid-template-columns: 1fr;
    }

    .panel,
    .legal-card,
    .quick-draw {
        padding: 22px;
    }

    .hero-actions .btn,
    .quick-draw .btn {
        width: 100%;
    }

    .header-cta {
        display: none;
    }

    .logo {
        font-size: 1.05rem;
    }

    .tool-actions .btn {
        flex: 1 1 100%;
    }

    .pair {
        grid-template-columns: 1fr auto 1fr;
    }

    .pair .gift {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cta-final {
        padding: 40px 20px;
        border-radius: 22px;
    }

    .participant-num {
        display: none;
    }

    .tg-card {
        font-size: 0.84rem;
        padding: 10px 12px;
    }

    .tg-card img {
        width: 32px;
        height: 32px;
    }

    /* На телефоне оставляем одно уведомление — под иллюстрацией */
    .tg-card-2 {
        display: none;
    }

    .tg-card-1 {
        position: relative;
        left: auto;
        bottom: auto;
        width: 92%;
        margin: -34px auto 0;
    }

    .hero-visual {
        margin-bottom: 0;
    }

    .way {
        padding: 24px 22px 26px;
    }

    .way .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
