/* ═══════════════════════════════════════════
   ПЕРЕМЕННЫЕ И СБРОС
   ═══════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

:root {
    --rose:      #E8A0B4;
    --rose-deep: #C4607A;
    --rose-pale: #F9EEF2;
    --lavender:  #C4A8D4;
    --sage:      #8DB87A;
    --sage-pale: #EEF5EC;
    --gold:      #D4A853;
    --gold-pale: #FBF5E6;
    --cream:     #FFF8F2;
    --paper:     #FFFDF9;
    --warm-dark: #3D2B35;
    --muted:     #9A8090;
    --border:    rgba(200,160,180,0.25);

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'Nunito', 'Segoe UI', sans-serif;
}

html, body {
    height: 100%; width: 100%;
    /* Плавный анимированный градиент фона */
    background: linear-gradient(135deg, #FFF0F5, #FFF8F2, #F5EEFF, #FFFDF5);
    background-size: 400% 400%;
    animation: bgShift 12s ease-in-out infinite;
    font-family: var(--font-body);
    color: var(--warm-dark);
    overflow: hidden;
}

@keyframes bgShift {
    0%   { background-position: 0% 50%; }
    33%  { background-position: 100% 0%; }
    66%  { background-position: 50% 100%; }
    100% { background-position: 0% 50%; }
}

/* Фоновые лепестки */
.bg-petals {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
/* .bg-petal больше не нужен — лепестки рисуются на Canvas (см. main.js) */
.bg-petal { will-change: transform; }

/* ═══════════════════════════════════════════
   КОНТЕЙНЕР ПРИЛОЖЕНИЯ
   ═══════════════════════════════════════════ */
.app-root {
    position: fixed; inset: 0; z-index: 1;
    overflow: hidden;
    /* Правильная высота под Telegram Mini App */
    height: 100%; height: 100dvh;
}

/* ═══════════════════════════════════════════
   ЭКРАНЫ
   ═══════════════════════════════════════════ */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%; height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    animation: screenIn 0.32s cubic-bezier(0.34,1.3,0.64,1) both;
    will-change: transform, opacity;
    background: transparent;
    /* Все экраны — от верха, контент центрируется внутри flex-зон */
    justify-content: flex-start;
    gap: 0;
}
.screen.active { display: flex; }

@keyframes screenIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Декоративный оверлей для глубины */
.screen::before {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
            radial-gradient(ellipse 70% 40% at 15% 8%, rgba(232,160,180,0.12) 0%, transparent 55%),
            radial-gradient(ellipse 50% 35% at 88% 92%, rgba(196,168,212,0.10) 0%, transparent 50%),
            radial-gradient(ellipse 40% 30% at 80% 15%, rgba(141,184,122,0.06) 0%, transparent 45%);
    animation: overlayShift 16s ease-in-out infinite;
}
@keyframes overlayShift {
    0%,100% { opacity: 1; }
    50%     { opacity: 0.6; }
}

/* ═══════════════════════════════════════════
   ШАПКА ЭКРАНОВ — всегда сверху, единое место
   ═══════════════════════════════════════════ */
.screen-header {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: max(env(safe-area-inset-top, 0px), 12px) 20px 8px;
    flex-shrink: 0;
    /* Гарантируем что шапка всегда первая */
    order: -1;
    min-height: 54px;
    margin-bottom: 0;
}
.btn-back {
    background: rgba(232,160,180,0.15); border: none;
    width: 38px; height: 38px; border-radius: 50%;
    font-size: 1.1rem; cursor: pointer; color: var(--rose-deep);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.btn-back:active { background: rgba(232,160,180,0.35); transform: scale(0.92); }

.step-dots { display: flex; gap: 6px; }
.sdot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(200,160,180,0.2);
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.45rem;
}
.sdot.active {
    background: var(--rose); width: 22px; border-radius: 4px;
    box-shadow: 0 0 8px rgba(232,160,180,0.5);
}
.sdot.done { background: var(--sage); color: white; font-size: 0.5rem; width: 22px; border-radius: 4px; }

.task-badge {
    font-family: var(--font-body); font-size: 0.75rem;
    font-weight: 700; letter-spacing: 0.5px;
    padding: 6px 14px; border-radius: 20px;
}
.task-badge.water  { background: #E8F4FF; color: #4080C0; }
.task-badge.sun    { background: #FFF8E0; color: #C08000; }
.task-badge.magic  { background: #F5EEFF; color: #8040C0; }

/* ═══════════════════════════════════════════
   ТИПОГРАФИЯ
   ═══════════════════════════════════════════ */
.screen-title {
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 6.5vw, 2rem);
    font-weight: 600; line-height: 1.15; text-align: center;
    color: var(--warm-dark); letter-spacing: 0.2px;
    padding: 0 20px; margin-bottom: 6px;
}
.screen-sub {
    font-size: 0.83rem; color: var(--muted);
    text-align: center; line-height: 1.55;
    padding: 0 24px; margin-bottom: 12px;
}

/* ═══════════════════════════════════════════
   КНОПКИ
   ═══════════════════════════════════════════ */
.btn-main {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: calc(100% - 32px); max-width: 400px;
    padding: 15px 20px; margin-top: 12px;
    background: linear-gradient(135deg, #E8A0B4 0%, #C4607A 50%, #E8A0B4 100%);
    background-size: 200% 200%;
    animation: btnGrad 5s ease-in-out infinite;
    color: white; border: none; border-radius: 18px;
    font-family: var(--font-body); font-size: 0.95rem; font-weight: 800;
    letter-spacing: 0.3px; cursor: pointer;
    box-shadow: 0 6px 22px rgba(196,96,122,0.30), 0 2px 6px rgba(0,0,0,0.07);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative; overflow: hidden;
    margin-bottom: 50px;
}
/* Только кнопка «Подарить в Telegram» имеет отступ снизу 50px */
#btn-share-gift {
    margin-bottom: 0px;
}
@keyframes btnGrad {
    0%,100% { background-position: 0% 50%; }
    50%     { background-position: 100% 50%; }
}
.btn-main::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transform: translateX(-100%); transition: transform 0.4s ease;
}
.btn-main:active::after { transform: translateX(100%); }
.btn-main:active { transform: scale(0.97); box-shadow: 0 3px 12px rgba(196,96,122,0.4); }
.btn-main:disabled { opacity: 0.42; pointer-events: none; animation: none; }

.btn-main.water-btn {
    background: linear-gradient(135deg, #7BB8E8 0%, #4080C0 50%, #7BB8E8 100%);
    background-size: 200% 200%;
    box-shadow: 0 6px 22px rgba(64,128,192,0.26);
}
.btn-main.water-btn:active { box-shadow: 0 3px 12px rgba(64,128,192,0.4); }

.btn-secondary {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: calc(100% - 48px); max-width: 380px;
    padding: 13px 20px; margin-top: 10px;
    background: white; color: var(--rose-deep);
    border: 1.5px solid rgba(232,160,180,0.5); border-radius: 16px;
    font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(232,160,180,0.15);
}
.btn-secondary:active { background: var(--rose-pale); transform: scale(0.97); }

.btn-ghost {
    background: none; border: none;
    font-family: var(--font-body); font-size: 0.82rem;
    color: var(--muted); cursor: pointer; padding: 8px 16px;
    text-decoration: underline; text-underline-offset: 3px;
}
.btn-ghost:active { color: var(--rose-deep); }

.btn-icon { font-size: 1.1rem; }

/* ═══════════════════════════════════════════
   ЭКРАН ПРИВЕТСТВИЯ
   ═══════════════════════════════════════════ */
#screen-welcome {
    justify-content: space-between;
    padding-top: max(env(safe-area-inset-top, 12px), 12px);
}

.welcome-bloom {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 8px 0 0;
}
#welcome-canvas { display: block; }

.welcome-text {
    text-align: center; padding: 0 20px;
}
.date-badge {
    display: inline-block;
    font-family: var(--font-body); font-size: 0.7rem;
    font-weight: 800; letter-spacing: 2.5px;
    color: var(--rose-deep); margin-bottom: 8px;
    background: rgba(249,238,242,0.85); padding: 5px 14px; border-radius: 20px;
    backdrop-filter: blur(6px);
}
.welcome-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 10vw, 3.2rem);
    font-weight: 700; line-height: 1.05;
    background: linear-gradient(135deg, #C4607A 0%, #8040A0 55%, #4080C0 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: gradText 6s ease-in-out infinite;
    margin-bottom: 12px; letter-spacing: 0.5px;
}
@keyframes gradText {
    0%,100% { background-position: 0% 50%; }
    50%     { background-position: 100% 50%; }
}
.welcome-sub {
    font-size: 0.87rem; color: var(--muted); line-height: 1.6;
}

.welcome-actions {
    display: flex; flex-direction: column; align-items: center;
    padding: 0 20px calc(12px + env(safe-area-inset-bottom, 0px));
    width: 100%;
}
.welcome-hint {
    font-size: 0.72rem; color: var(--muted); margin-top: 7px;
}

/* ═══════════════════════════════════════════
   ЭКРАН ПОЛУЧАТЕЛЯ
   ═══════════════════════════════════════════ */
.recipient-grid {
    display: grid;
    /* 2 колонки всегда, но компактные */
    grid-template-columns: 1fr 1fr;
    gap: 8px; padding: 4px 16px; width: 100%;
    margin-bottom: 4px;
}

.rcpt-card {
    background: rgba(255,255,255,0.82);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    /* Уменьшенный padding для мобильного */
    padding: 12px 8px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; transition: all 0.2s ease;
    text-align: center;
    /* Стеклянный эффект */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.rcpt-card:active { transform: scale(0.96); }
.rcpt-card.selected {
    border-color: var(--rose);
    background: rgba(249,238,242,0.95);
    box-shadow: 0 0 0 3px rgba(232,160,180,0.22);
    transform: scale(1.02);
}
.rcpt-other { grid-column: span 1; }

.rcpt-emoji { font-size: 1.65rem; line-height: 1; }
.rcpt-name  { font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; color: var(--warm-dark); }
.rcpt-hint  { font-size: 0.65rem; color: var(--muted); }

.custom-name-wrap { width: calc(100% - 40px); margin-top: 2px; }
.custom-name-input {
    width: 100%; padding: 12px 16px;
    border: 1.5px solid rgba(232,160,180,0.45);
    border-radius: 12px; font-family: var(--font-body); font-size: 0.9rem;
    background: white; color: var(--warm-dark); outline: none;
    transition: border-color 0.2s;
}
.custom-name-input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(232,160,180,0.2); }


/* ═══════════════════════════════════════════
   ЭКРАНЫ 2–7: ЦЕНТРИРОВАНИЕ КОНТЕНТА
   Заголовок всегда сверху (order:-1 у .screen-header),
   контент прижат к центру через margin: auto
   ═══════════════════════════════════════════ */
#screen-recipient,
#screen-plant,
#screen-task-water,
#screen-task-bugs,
#screen-task-magic,
#screen-bloom {
    padding-top: 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

/* Экран расцветания центрирован */
#screen-bloom {
    justify-content: center;
}

/* Экран посадки: flex-start, горшок занимает гибкое пространство */
#screen-plant {
    justify-content: flex-start;
}
#screen-plant .pot-scene {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 8px 0;
}

/* Убираем лишние отступы у title/sub на task-экранах */
#screen-task-water .screen-title,
#screen-task-bugs  .screen-title,
#screen-task-magic .screen-title {
    margin-top: 6px;
}

/* Экраны с прокруткой — выравниваем через padding */
#screen-recipient {
    padding-top: 0;
}
#screen-recipient .recipient-grid {
    margin-top: 10px;
}
#screen-task-water .task-visual { margin-top: 4px; }
#screen-task-magic .magic-options { margin-top: 4px; }

/* ═══════════════════════════════════════════
   ЭКРАН ПОСАДКИ — равномерное распределение
   ═══════════════════════════════════════════ */
#screen-plant {
    /* justify-content: space-evenly; */
    padding-top: 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.pot-scene {
    width: 100%; display: flex; justify-content: center;
    padding: 0;
}
.plant-stage {
    position: relative; width: 140px; height: 160px;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}

/* CSS горшочек из документа — без единой картинки */
.pot-svg {
    position: relative;
    width: 80px; height: 66px; flex-shrink: 0;
    animation: potFloat 4s ease-in-out infinite;
}
@keyframes potFloat {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* Тело горшка */
.pot-svg::before {
    content: '';
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 70px; height: 54px;
    background: linear-gradient(145deg, #D9A882, #B87550, #9B5E3A);
    border-radius: 28% 28% 22% 22% / 55% 55% 22% 22%;
    box-shadow: 0 8px 0 #7A4028, 0 10px 18px rgba(0,0,0,0.18),
    inset 0 2px 6px rgba(255,200,160,0.35);
}
/* Ободок горшка */
.pot-svg::after {
    content: '';
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 76px; height: 18px;
    background: linear-gradient(145deg, #C99060, #A86840);
    border-radius: 50%;
    box-shadow: 0 3px 0 #7A4028, inset 0 2px 4px rgba(255,200,160,0.3);
}

/* Земля */
.pot-dirt {
    position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
    width: 62px; height: 14px;
    background: linear-gradient(180deg, #6B4226 0%, #4A2C18 100%);
    border-radius: 50%;
    z-index: 1;
}

/* Росток / растение — позиционируется над горшком */
.pot-plant {
    position: absolute; bottom: 54px; left: 50%; transform: translateX(-50%);
    font-size: 3rem; line-height: 1;
    transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
    animation: plantSway 3s ease-in-out infinite;
    z-index: 2;
}
@keyframes plantSway {
    0%,100% { transform: translateX(-50%) rotate(-3deg); }
    50%     { transform: translateX(-50%) rotate(3deg); }
}


/* ═══════════════════════════════════════════
   ВЫБОР СЕМЕЧКА
   ═══════════════════════════════════════════ */
.seed-choice {
    width: 100%; padding: 0 16px 4px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.seed-choice-label {
    font-family: var(--font-body); font-size: 0.72rem; font-weight: 700;
    color: var(--muted); letter-spacing: 0.3px; margin: 0;
}
.seed-options {
    display: flex; gap: 8px; width: 100%; justify-content: center; margin-bottom: 30px;
}
.seed-option {
    flex: 1; max-width: 108px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 6px 8px;
    background: rgba(255,255,255,0.72);
    border: 2px solid rgba(232,160,180,0.28);
    border-radius: 16px; cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 2px 8px rgba(196,96,122,0.06);
}
.seed-option:not(.seed-locked):active { transform: scale(0.95); }
.seed-option.seed-selected {
    border-color: var(--rose-mid);
    background: rgba(255,228,238,0.95);
    box-shadow: 0 0 0 3px rgba(232,160,180,0.22), 0 4px 14px rgba(196,96,122,0.14);
    transform: scale(1.05);
}

/* Заблокированная карточка */
.seed-option.seed-locked {
    opacity: 0.58;
    filter: grayscale(0.35);
    cursor: default;
    border-style: dashed;
    border-color: rgba(200,170,180,0.35);
    background: rgba(240,235,238,0.6);
}
.seed-option.seed-locked .seed-emoji { filter: grayscale(0.5); }

/* Значок замка */
.seed-lock-badge {
    position: absolute; top: 5px; right: 7px;
    font-size: 0.75rem; line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}
.seed-option.seed-locked .seed-lock-badge { opacity: 1; }

/* Стоимость */
.seed-cost {
    font-family: var(--font-body); font-size: 0.58rem; font-weight: 700;
    color: var(--rose-mid);
    background: rgba(232,160,180,0.14);
    padding: 2px 6px; border-radius: 8px;
    margin-top: 1px;
}
.seed-cost-free {
    color: #6aaa72;
    background: rgba(106,170,114,0.12);
}
.seed-option { position: relative; }

.seed-emoji { font-size: 1.55rem; line-height: 1; }
.seed-name  { font-family: var(--font-body); font-size: 0.71rem; font-weight: 800; color: var(--rose-deep); }
.seed-desc  { font-family: var(--font-body); font-size: 0.6rem;  color: var(--muted); }

/* Кнопка заблокирована / разблокирована */
.btn-main.btn-disabled {
    opacity: 0.4 !important;
    pointer-events: none !important;
    animation: none !important;
}

/* Поле подписи на экране подарка */
.gift-signature-wrap {
    width: calc(100% - 48px); max-width: 380px;
    margin: 6px auto 0;
    display: flex; flex-direction: column; gap: 4px;
}
.gift-sig-label {
    font-family: var(--font-body); font-size: 0.72rem; font-weight: 700;
    color: var(--muted); padding-left: 4px;
}
.gift-sig-row {
    display: flex; align-items: center; gap: 6px; width: 100%;
}
.gift-sig-input {
    flex: 1; padding: 10px 14px; box-sizing: border-box;
    border: 1.5px solid rgba(232,160,180,0.45);
    border-radius: 12px;
    background: rgba(255,255,255,0.88);
    font-family: var(--font-body); font-size: 0.88rem; color: var(--text);
    outline: none; transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(196,96,122,0.06);
    min-width: 0;
}
.gift-sig-input:focus {
    border-color: var(--rose-mid);
    box-shadow: 0 0 0 3px rgba(232,160,180,0.18);
}
.gift-sig-input::placeholder { color: rgba(170,130,145,0.55); }
.btn-sig-action {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1.5px solid rgba(232,160,180,0.4);
    background: rgba(255,255,255,0.85);
    color: var(--rose-deep);
    font-size: 0.95rem; font-weight: 800;
    cursor: pointer; transition: all 0.18s;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(196,96,122,0.07);
}
.btn-sig-action:not(:disabled):active { transform: scale(0.93); }
.btn-sig-action:disabled { opacity: 0.3; pointer-events: none; }
.btn-sig-action:not(:disabled):hover { background: var(--rose-pale); }
.btn-sig-clear {
    color: rgba(180,80,100,0.75);
}


.task-slots {
    display: flex; gap: 14px; padding: 12px 24px;
    width: 100%;
}
.task-slot {
    flex: 1;
    background: white; border: 1.5px solid var(--border);
    border-radius: 14px; padding: 14px 8px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: all 0.3s;
}
.task-slot.done {
    border-color: var(--sage);
    background: var(--sage-pale);
    box-shadow: 0 0 0 3px rgba(141,184,122,0.2);
}
.slot-icon {
    font-size: 1.6rem; transition: all 0.3s;
    filter: grayscale(0.7); opacity: 0.5;
}
.task-slot.done .slot-icon { filter: none; opacity: 1; animation: slotPop 0.4s ease; }
@keyframes slotPop {
    0% { transform: scale(0.5); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.slot-name { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-align: center; }
.task-slot.done .slot-name { color: var(--sage); }

/* ═══════════════════════════════════════════
   ЗАДАНИЕ 1 — ПОЛИВ
   ═══════════════════════════════════════════ */
.task-visual { display: flex; justify-content: center; padding: 8px 0; }
.big-icon { font-size: 4rem; line-height: 1; }
.watering-icon { animation: sway 2s ease-in-out infinite; }
@keyframes sway { 0%,100%{transform:rotate(-5deg)} 50%{transform:rotate(5deg)} }

.preset-phrases {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 4px 20px 4px; width: 100%;
}
.phrase-btn {
    background: var(--rose-pale); border: 1px solid rgba(232,160,180,0.35);
    border-radius: 20px; padding: 7px 14px;
    font-family: var(--font-body); font-size: 0.78rem; font-weight: 600;
    color: var(--rose-deep); cursor: pointer; transition: all 0.18s;
}
.phrase-btn:active, .phrase-btn.selected {
    background: var(--rose); color: white; border-color: var(--rose);
    transform: scale(0.97);
}

.wish-input-wrap {
    width: calc(100% - 40px); position: relative; margin-top: 10px;
}
.wish-input {
    width: 100%; padding: 14px 16px; padding-bottom: 28px;
    border: 1.5px solid rgba(232,160,180,0.35); border-radius: 14px;
    font-family: var(--font-body); font-size: 0.9rem; line-height: 1.5;
    background: white; color: var(--warm-dark); resize: none; outline: none;
    transition: border-color 0.2s;
}
.wish-input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(232,160,180,0.18); }
.char-counter {
    position: absolute; right: 12px; bottom: 10px;
    font-size: 0.68rem; color: var(--muted);
}

/* ═══════════════════════════════════════════
   ЗАДАНИЕ 2 — ЖУЧКИ (волновая система)
   ═══════════════════════════════════════════ */
#screen-task-bugs {
    justify-content: flex-start;
    gap: 0;
    padding-top: 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

/* Шкала солнечного прогресса */
.sun-progress-wrap {
    display: flex; align-items: center; gap: 8px;
    width: calc(100% - 40px); flex-shrink: 0;
    margin: 4px 0;
}
.sun-progress-icon { font-size: 1.3rem; }
.sun-progress-track {
    flex: 1; height: 10px; border-radius: 5px;
    background: rgba(255,200,80,0.18);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.sun-progress-fill {
    height: 100%; border-radius: 5px; width: 0%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transition: width 0.5s cubic-bezier(0.34,1.3,0.64,1);
    box-shadow: 0 0 8px rgba(255,180,0,0.5);
}

/* Лейбл волны */
.wave-label {
    font-family: var(--font-body); font-size: 0.72rem;
    font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--gold); background: rgba(212,168,83,0.12);
    border-radius: 20px; padding: 4px 14px;
    flex-shrink: 0; margin-bottom: 2px;
}
.wave-label.wave-flash { animation: waveFlash 0.5s ease; }
@keyframes waveFlash {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.12); background: rgba(212,168,83,0.28); }
}

.bugs-arena {
    width: 100%;
    flex: 1 1 auto;
    min-height: 180px;
    max-height: 380px;
    position: relative;
}

/* Базовый стиль жука */
.bug {
    position: absolute;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer;
    animation: bugWiggle 1.8s ease-in-out infinite;
    user-select: none;
    min-width: 72px; min-height: 72px;
    justify-content: center;
    will-change: transform;
    transition: left 0.4s ease, top 0.4s ease;
}
@keyframes bugWiggle {
    0%,100% { transform: rotate(-4deg) scale(1); }
    50%     { transform: rotate(4deg) scale(1.06); }
}

/* Типы жуков */
.bug-normal  { animation-duration: 1.8s; }
.bug-fast    { animation-duration: 0.9s; animation-name: bugShake; }
.bug-armor   { animation-duration: 2.5s; }
.bug-boss    { animation-duration: 1.2s; animation-name: bossWiggle; }

@keyframes bugShake {
    0%,100% { transform: rotate(-6deg) scale(1); }
    25%     { transform: rotate(6deg) scale(1.08); }
    75%     { transform: rotate(-3deg) scale(0.96); }
}
@keyframes bossWiggle {
    0%,100% { transform: rotate(-3deg) scale(1.1); }
    50%     { transform: rotate(3deg) scale(1.2); }
}

.bug-body {
    font-size: 2.8rem;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.14));
    transition: transform 0.15s ease;
}
.bug-fast  .bug-body { font-size: 2.4rem; }
.bug-armor .bug-body { font-size: 3rem; }
.bug-boss  .bug-body { font-size: 3.4rem; filter: drop-shadow(0 4px 10px rgba(200,0,0,0.3)); }

.bug-text {
    font-size: 0.68rem; font-weight: 700; color: #7A4E2A;
    background: rgba(255,242,220,0.95); border-radius: 10px; padding: 3px 9px;
    white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    max-width: 120px; overflow: hidden; text-overflow: ellipsis;
}

/* Попадание */
.bug-hit { animation: hitFlash 0.2s ease !important; }
@keyframes hitFlash {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.35) rotate(10deg); filter: brightness(1.8); }
}

/* Уничтожение */
.bug.popped {
    animation: bugPop 0.42s ease forwards !important;
    pointer-events: none;
}
@keyframes bugPop {
    0%  { transform: scale(1); opacity: 1; }
    45% { transform: scale(1.5) rotate(20deg); opacity: 0.7; }
    100%{ transform: scale(0) rotate(45deg); opacity: 0; }
}

.sun-appear {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 16px 24px; animation: sunRise 0.6s ease; flex-shrink: 0;
}
@keyframes sunRise { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:none} }
.sun-big { font-size: 3.5rem; animation: sunSpin 5s linear infinite; }
@keyframes sunSpin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
.sun-appear p { font-size: 0.85rem; color: #9A7010; text-align: center; }

/* ═══════════════════════════════════════════
   ЗАДАНИЕ 3 — МАГИЯ (новый расширяемый дизайн)
   ═══════════════════════════════════════════ */
.magic-options {
    display: flex; flex-direction: column; gap: 10px;
    padding: 4px 16px; width: 100%;
}

/* Карточка варианта */
.magic-option-card {
    background: rgba(255,255,255,0.88);
    border: 1.5px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s;
    cursor: pointer;
}
.magic-option-card.selected {
    border-color: #8040C0;
    box-shadow: 0 0 0 3px rgba(128,64,192,0.18);
}

/* Шапка карточки */
.moc-header {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    user-select: none;
}
.magic-option-card:active .moc-header { opacity: 0.8; }

.magic-info { flex: 1; }
.magic-name { font-size: 0.92rem; font-weight: 700; color: var(--warm-dark); margin-bottom: 2px; }
.magic-desc { font-size: 0.74rem; color: var(--muted); }

.moc-arrow {
    font-size: 1.3rem; color: var(--muted);
    transition: transform 0.22s;
    line-height: 1;
}
.magic-option-card.expanded .moc-arrow { transform: rotate(90deg); }

/* Иконка-превью */
.magic-preview {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
.fun-preview    { background: #FFF3DC; }
.music-preview  { background: #EEF5FF; }
.hearts-preview { background: #FFEEF4; }

/* Расширяемая панель */
.moc-sub {
    padding: 0 16px 14px;
    border-top: 1px solid rgba(200,160,180,0.15);
    background: rgba(248,244,252,0.7);
}

/* ── Мелодии ── */
.melody-choices {
    display: flex; gap: 8px; padding-top: 12px; flex-wrap: wrap;
}
.sub-btn {
    padding: 8px 16px; border: 1.5px solid rgba(128,64,192,0.3);
    border-radius: 20px; background: white;
    font-family: var(--font-body); font-size: 0.8rem; font-weight: 700;
    color: #6030A0; cursor: pointer; transition: all 0.18s;
    white-space: nowrap;
}
.sub-btn:active  { transform: scale(0.95); }
.sub-btn.selected {
    background: #8040C0; color: white; border-color: #8040C0;
    box-shadow: 0 3px 10px rgba(128,64,192,0.32);
}
/* Анимация «играет» */
.melody-btn.playing::after { content: ' ♪'; animation: noteFloat 0.5s ease-in-out infinite alternate; display: inline-block; }
@keyframes noteFloat { from{transform:translateY(0)} to{transform:translateY(-3px)} }

/* ── Мемы ── */
.meme-choices {
    display: flex; gap: 10px; padding-top: 12px; justify-content: space-around;
}
.meme-choice-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.meme-prev-canvas {
    width: 64px; height: 64px; border-radius: 10px;
    border: 1.5px solid rgba(200,160,180,0.3);
    display: block;
}
.meme-btn {
    font-size: 0.72rem; padding: 5px 10px;
}

/* ── Рисунок пальцем ── */
.draw-area { padding: 12px 0 0; }
.draw-canvas-wrap {
    position: relative; width: 100%;
    border: 2px dashed rgba(232,160,180,0.55);
    border-radius: 14px; overflow: hidden;
    background: rgba(255,255,255,0.8);
    margin-bottom: 8px;
    touch-action: none;
}
#draw-canvas {
    display: block; width: 100%; height: auto;
    cursor: crosshair;
}
.draw-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; color: rgba(154,128,144,0.6);
    pointer-events: none; font-weight: 600;
}
.draw-btns {
    display: flex; gap: 8px; align-items: center; justify-content: flex-end;
}
.done-draw-btn { font-size: 0.82rem; padding: 7px 18px; }



/* ═══════════════════════════════════════════
   ЭКРАН РАСЦВЕТАНИЯ
   ═══════════════════════════════════════════ */
#screen-bloom {
    justify-content: center; align-items: center; gap: 14px;
    background: linear-gradient(160deg, #FFF0F5 0%, #F5EEFF 60%, #FAFFF0 100%);
}
.bloom-fireworks {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.bloom-title {
    font-family: var(--font-display); font-size: clamp(2rem, 9vw, 2.8rem);
    font-weight: 700; text-align: center; line-height: 1.1;
    background: linear-gradient(135deg, #C4607A, #8040A0, #4080C0);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    z-index: 1;
}
.flower-canvas-wrap {
    position: relative; z-index: 1;
    filter: drop-shadow(0 12px 30px rgba(196,96,122,0.22));
}
#flower-canvas { display: block; }
.flower-for-label {
    font-family: var(--font-display); font-size: 1.3rem;
    color: var(--muted); z-index: 1; letter-spacing: 0.5px;
}
.bloom-loading {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.82rem; color: var(--muted); z-index: 1;
}
.bloom-spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid rgba(196,96,122,0.2);
    border-top-color: var(--rose);
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Конфетти */
.confetti-piece {
    position: absolute; width: 8px; height: 8px; border-radius: 50%;
    animation: confettiFall linear forwards;
    pointer-events: none;
}
@keyframes confettiFall {
    0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}


/* ═══════════════════════════════════════════
   ЭКРАН РАСЦВЕТАНИЯ — центрирование
   ═══════════════════════════════════════════ */
#screen-bloom {
    justify-content: center;
    gap: 8px;
}
.bloom-title {
    margin-bottom: 4px;
    margin-top: 0;
}

/* ═══════════════════════════════════════════
   ЭКРАН ПОДАРКА
   ═══════════════════════════════════════════ */
#screen-gift { align-items: center; padding-top: 12px; justify-content: flex-start; gap: 6px; }
.gift-flower-mini {
    filter: drop-shadow(0 8px 20px rgba(196,96,122,0.2));
}
#gift-canvas { display: block; }
.gift-for-badge {
    font-family: var(--font-display); font-size: 1.3rem; font-weight: 600;
    color: var(--rose-deep); letter-spacing: 0.5px;
    background: var(--rose-pale); padding: 5px 18px; border-radius: 20px;
    margin-top: 2px;
}

.wish-preview-card {
    width: calc(100% - 48px); max-width: 380px; margin-top: 12px;
    background: white; border: 1.5px solid var(--border);
    border-radius: 16px; padding: 16px 18px;
}
.wpc-label { font-size: 0.65rem; letter-spacing: 2px; font-weight: 800; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.wpc-text   { font-family: var(--font-display); font-size: 1.05rem; color: var(--warm-dark); line-height: 1.5; }

.gift-hint {
    font-size: 0.8rem; color: var(--muted); text-align: center;
    padding: 8px 28px 0; line-height: 1.55;
}
.gift-btns { display: flex; flex-direction: column; align-items: center; width: 100%; }
.gift-btns  { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 2px; }
.gift-footer { display: flex; flex-direction: row; justify-content: center; gap: 10px; width: 100%; padding: 4px 20px 0; margin-top: 4px; }
.gift-footer .btn-ghost {
    flex: 1; max-width: 172px;
    background: rgba(255,255,255,0.75);
    border: 1.5px solid rgba(232,160,180,0.38);
    border-radius: 14px; padding: 10px 10px;
    font-family: var(--font-body); font-size: 0.82rem; font-weight: 700;
    color: var(--rose-deep); text-decoration: none;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(196,96,122,0.07);
}
.gift-footer .btn-ghost:active { background: var(--rose-pale); transform: scale(0.97); }

/* ═══════════════════════════════════════════
   ЭКРАН ПОЛУЧАТЕЛЯ
   ═══════════════════════════════════════════ */
#screen-received { align-items: center; padding-top: 20px; }
.received-header { width: 100%; display: flex; justify-content: center; padding: 4px 0 8px; }
.received-badge {
    font-family: var(--font-body); font-size: 0.78rem; font-weight: 800;
    letter-spacing: 0.5px; color: var(--rose-deep);
    background: var(--rose-pale); padding: 6px 18px; border-radius: 20px;
}
.received-flower-wrap {
    filter: drop-shadow(0 12px 28px rgba(196,96,122,0.22));
    margin: 4px 0;
}
#received-canvas { display: block; }

.received-from {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    text-align: center; padding: 0 24px;
}
.rf-name  { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--rose-deep); }
.rf-text  { font-size: 0.82rem; color: var(--muted); }

.received-wish-card {
    width: calc(100% - 48px); max-width: 380px; margin-top: 12px;
    background: white; border: 1.5px solid var(--border);
    border-radius: 18px; padding: 16px 18px;
    display: flex; gap: 12px; align-items: flex-start;
}
.rwc-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.rwc-text { font-family: var(--font-display); font-size: 1.05rem; color: var(--warm-dark); line-height: 1.55; }

.received-hint {
    font-size: 0.8rem; color: var(--muted); text-align: center;
    padding: 8px 28px 0; line-height: 1.55;
}
.received-btns { display: flex; flex-direction: column; align-items: center; width: 100%; }

.bonus-banner {
    width: calc(100% - 48px); max-width: 380px;
    background: linear-gradient(135deg, #FFF8E0, #FFF0F5);
    border: 1.5px solid rgba(212,168,83,0.4); border-radius: 16px;
    padding: 14px 18px; margin-top: 12px;
    display: flex; align-items: center; gap: 12px;
    animation: bannerPop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes bannerPop { from{transform:scale(0.85);opacity:0} to{transform:scale(1);opacity:1} }
.bb-icon { font-size: 1.8rem; }
.bb-text { font-size: 0.82rem; color: #7A5010; line-height: 1.4; }

/* ═══════════════════════════════════════════
   ЗАГРУЗКА
   ═══════════════════════════════════════════ */
#screen-loading {
    justify-content: center; align-items: center; gap: 16px;
    background: linear-gradient(160deg, #FFF0F5, #F5EEFF);
}
.loading-flower { font-size: 3.5rem; animation: heartbeat 1.2s ease-in-out infinite; }
@keyframes heartbeat {
    0%,100%{ transform: scale(1); }
    40%    { transform: scale(1.14); }
    60%    { transform: scale(0.96); }
}
.loading-text { font-family: var(--font-display); font-size: 1.1rem; color: var(--muted); }
.loading-dots { display: flex; gap: 6px; }
.loading-dots span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--rose);
    animation: dotBounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
    0%,100%{ transform: translateY(0); opacity: 0.4; }
    50%    { transform: translateY(-8px); opacity: 1; }
}

/* ═══════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════ */
.toast {
    position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: rgba(40,108,72,0.93);
    color: white; padding: 11px 22px; border-radius: 50px;
    font-family: var(--font-body); font-size: 0.8rem; font-weight: 700;
    z-index: 9999; opacity: 0; pointer-events: none;
    transition: all 0.26s ease; white-space: nowrap;
    box-shadow: 0 6px 24px rgba(40,108,72,0.35);
    backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════
   ПРОИЗВОДИТЕЛЬНОСТЬ (из документа)
   ═══════════════════════════════════════════ */
.flower-canvas-wrap canvas,
.plant-stage,
.bug,
.fairy-body,
.confetti-piece,
.bug-particle,
.pollen-particle { will-change: transform; }

/* ═══════════════════════════════════════════
   АДАПТИВ — МОБИЛЬНЫЙ (основной таргет)
   ═══════════════════════════════════════════ */

/* Все телефоны < 430px — основной случай */
@media (max-width: 430px) {
    #welcome-canvas       { width: 200px; height: 200px; }
    .welcome-title        { font-size: 2rem; }
    .welcome-sub          { font-size: 0.82rem; }
    .recipient-grid       { gap: 7px; padding: 2px 12px; }
    .rcpt-card            { padding: 10px 6px; border-radius: 14px; }
    .rcpt-emoji           { font-size: 1.5rem; }
    .rcpt-name            { font-size: 0.75rem; }
    .task-slots           { padding: 8px 16px; gap: 10px; }
    .task-slot            { padding: 12px 6px; }
    .magic-options        { gap: 8px; padding: 4px 14px; }
    .magic-card           { padding: 13px 14px; gap: 12px; }
    .magic-preview        { width: 44px; height: 44px; border-radius: 12px; }
    .btn-main             { width: calc(100% - 24px); }
    .btn-secondary        { width: calc(100% - 24px); }
    .wish-input-wrap      { width: calc(100% - 28px); }
    .preset-phrases       { padding: 4px 14px; gap: 7px; }
    .phrase-btn           { font-size: 0.74rem; padding: 6px 11px; }
    .screen-header        { padding: 12px 14px 6px; }
    /* bugs-arena is flex:1 — no fixed height needed */
    .bug-body             { font-size: 2.4rem; }
}

/* Маленькие телефоны < 360px */
@media (max-width: 360px) {
    #welcome-canvas       { width: 170px; height: 170px; }
    .recipient-grid       { grid-template-columns: 1fr 1fr; gap: 6px; padding: 2px 10px; }
    .rcpt-emoji           { font-size: 1.35rem; }
    .rcpt-name            { font-size: 0.7rem; }
    .screen-title         { font-size: 1.35rem; padding: 0 16px; }
    /* bugs-arena is flex:1 — no fixed height needed */
}

/* Низкие экраны — компактнее по вертикали */
@media (max-height: 680px) {
    #welcome-canvas       { width: 180px; height: 180px; }
    .welcome-title        { font-size: 1.9rem; }
    .welcome-sub          { font-size: 0.8rem; }
    .pot-scene            { padding: 4px 0; }
    .pot-svg              { font-size: 3.5rem; }
    .plant-stage          { width: 110px; height: 110px; }
    /* bugs-arena is flex:1 — no fixed height needed */
    .magic-card           { padding: 11px 14px; }
    .magic-preview        { width: 40px; height: 40px; font-size: 0.95rem; }
    .screen-title         { margin-bottom: 4px; }
    .screen-sub           { margin-bottom: 8px; }
    .btn-main             { padding: 13px 16px; margin-top: 10px; }
}

/* Очень низкие экраны */
@media (max-height: 580px) {
    #welcome-canvas       { width: 150px; height: 150px; }
    .task-slots           { padding: 6px 14px; }
    /* bugs-arena is flex:1 — no fixed height needed */
}

/* ═══════════════════════════════════════════
   НАВИГАЦИЯ НА СТАРТОВОМ ЭКРАНЕ
   ═══════════════════════════════════════════ */
.welcome-nav {
    display: flex; gap: 8px;
    padding: max(env(safe-area-inset-top, 12px), 14px) 16px 0;
    width: 100%;
}
.nav-pill {
    flex: 1;
    background: rgba(255,255,255,0.65);
    border: 1.5px solid rgba(232,160,180,0.3);
    border-radius: 20px; padding: 8px 10px;
    font-family: var(--font-body); font-size: 0.78rem; font-weight: 700;
    color: var(--rose-deep); cursor: pointer;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s;
}
.nav-pill:active { background: rgba(249,238,242,0.9); transform: scale(0.97); }

.header-title {
    font-family: var(--font-body); font-size: 0.88rem; font-weight: 800;
    color: var(--warm-dark);
}

/* ═══════════════════════════════════════════
   ЭКРАН РЕЙТИНГА
   ═══════════════════════════════════════════ */
.my-score-card {
    width: calc(100% - 32px); max-width: 400px;
    background: linear-gradient(135deg, rgba(232,160,180,0.18), rgba(196,168,212,0.15));
    border: 1.5px solid rgba(232,160,180,0.3);
    border-radius: 20px; padding: 16px 20px; margin-top: 4px;
    backdrop-filter: blur(8px);
}
.msc-label { font-size: 0.62rem; letter-spacing: 2px; font-weight: 800; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.msc-row { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; }
.msc-val  { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--rose-deep); }
.msc-badge {
    background: linear-gradient(135deg, #E8A0B4, #C4A8D4);
    color: white; padding: 4px 12px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 700;
}
.msc-sub { font-size: 0.75rem; color: var(--muted); }

.lb-section-label {
    font-size: 0.62rem; letter-spacing: 2.5px; font-weight: 800;
    color: var(--muted); text-transform: uppercase;
    padding: 14px 20px 4px; width: 100%;
}
.leaderboard {
    width: calc(100% - 32px); max-width: 400px;
    display: flex; flex-direction: column; gap: 6px;
}
.lb-loading {
    display: flex; align-items: center; gap: 10px;
    padding: 20px; color: var(--muted); font-size: 0.8rem;
}
.lb-spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid rgba(232,160,180,0.2); border-top-color: var(--rose);
    animation: spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lb-row {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.7); border: 1px solid var(--border);
    border-radius: 14px; padding: 12px 14px;
    backdrop-filter: blur(6px);
    transition: all 0.2s;
}
.lb-row.lb-me {
    background: linear-gradient(135deg, rgba(232,160,180,0.2), rgba(196,168,212,0.15));
    border-color: rgba(232,160,180,0.45);
    box-shadow: 0 2px 10px rgba(232,160,180,0.15);
}
.lb-place  { font-size: 1.2rem; min-width: 28px; text-align: center; }
.lb-info   { flex: 1; min-width: 0; }
.lb-name   { font-size: 0.85rem; font-weight: 700; color: var(--warm-dark); display: flex; align-items: center; gap: 6px; }
.lb-meta   { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.lb-flowers { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--rose-deep); }
.lb-you    { background: var(--rose); color: white; font-size: 0.55rem; font-weight: 800; padding: 2px 6px; border-radius: 8px; letter-spacing: 0.5px; }
.lb-empty  { padding: 24px; text-align: center; color: var(--muted); font-size: 0.82rem; }

/* Позиция пользователя в рейтинге */
#msc-my-pos {
    font-size: 0.72rem; color: var(--rose-deep);
    margin-top: 2px; font-weight: 700;
}

/* ═══════════════════════════════════════════
   ЭКРАН КОЛЛЕКЦИИ
   ═══════════════════════════════════════════ */
.seeds-panel {
    display: flex; gap: 10px;
    width: calc(100% - 32px); max-width: 400px; margin-top: 4px;
}
.seed-item {
    flex: 1; display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.7); border: 1.5px solid var(--border);
    border-radius: 16px; padding: 13px 14px;
    backdrop-filter: blur(6px);
}
.seed-icon { font-size: 1.6rem; }
.seed-val  { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--warm-dark); line-height: 1; }
.seed-name { font-size: 0.65rem; color: var(--muted); margin-top: 2px; }

.progress-card {
    width: calc(100% - 32px); max-width: 400px; margin-top: 10px;
    background: rgba(255,255,255,0.7); border: 1.5px solid var(--border);
    border-radius: 18px; padding: 14px 16px;
    backdrop-filter: blur(6px);
}
.pc-label { font-size: 0.62rem; letter-spacing: 2px; font-weight: 800; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.pc-rank-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pc-current-rank { font-size: 0.85rem; font-weight: 700; color: var(--warm-dark); }
.pc-next { font-size: 0.75rem; color: var(--muted); }
.pc-bar-wrap { height: 8px; background: rgba(232,160,180,0.15); border-radius: 4px; overflow: hidden; margin-bottom: 7px; }
.pc-bar {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, #E8A0B4, #C4607A);
    background-size: 200% 100%;
    animation: barShimmer 2.5s linear infinite;
    transition: width 0.6s cubic-bezier(0.34,1.3,0.64,1);
}
@keyframes barShimmer { 0%{background-position:0%} 100%{background-position:200%} }
.pc-hint { font-size: 0.72rem; color: var(--muted); }

.coll-section-label {
    font-size: 0.62rem; letter-spacing: 2.5px; font-weight: 800;
    color: var(--muted); text-transform: uppercase;
    padding: 14px 20px 6px; width: 100%;
}
.flowers-grid {
    width: calc(100% - 32px); max-width: 400px;
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.flower-card {
    background: rgba(255,255,255,0.75); border: 1.5px solid var(--border);
    border-radius: 14px; padding: 8px 6px; text-align: center;
    cursor: pointer; transition: all 0.2s;
    backdrop-filter: blur(6px);
}
.flower-card:active { transform: scale(0.96); }
.flower-card.special {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(212,168,83,0.12), rgba(249,238,242,0.8));
}
.fc-canvas { display: block; margin: 0 auto; }
.fc-label { font-size: 0.6rem; color: var(--muted); margin-top: 4px; font-weight: 600; }
.fc-for   { font-size: 0.58rem; color: var(--rose-deep); }

.fg-empty {
    grid-column: span 3; text-align: center;
    padding: 32px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.fge-icon { font-size: 2.5rem; }
.fg-empty p { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* Звания */
.rank-title-🌱 { color: #5A8050; }
.rank-title-🌿 { color: #3A9050; }
.rank-title-🌺 { color: #C04070; }
.rank-title-🌹 { color: #900030; }
.rank-title-👑 { color: #C08000; }

/* ═══════════════════════════════════════════
   АКВАРЕЛЬНАЯ ТЕКСТУРА БУМАГИ
   ═══════════════════════════════════════════ */
.paper-overlay {
    position: fixed; inset: 0; z-index: 9998; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
    opacity: 0.6;
    mix-blend-mode: multiply;
}

/* ═══════════════════════════════════════════
   ДЕНЬ / НОЧЬ
   ═══════════════════════════════════════════ */
.daynight-layer {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    transition: background 3s ease, opacity 3s ease;
    opacity: 0;
}
.daynight-layer.night {
    background: radial-gradient(ellipse at 80% 10%, rgba(80,60,120,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 90%, rgba(40,40,80,0.12) 0%, transparent 50%);
    opacity: 1;
}
.daynight-layer.evening {
    background: radial-gradient(ellipse at 70% 0%, rgba(255,140,80,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 30% 100%, rgba(200,100,100,0.08) 0%, transparent 50%);
    opacity: 1;
}
/* Звёзды (только ночью) */
.star {
    position: fixed; border-radius: 50%;
    background: white; pointer-events: none;
    animation: twinkle ease-in-out infinite;
    z-index: 1;
}
@keyframes twinkle {
    0%,100% { opacity: 0.1; transform: scale(0.8); }
    50%     { opacity: 0.9; transform: scale(1.2); }
}

/* ═══════════════════════════════════════════
   ФЕЯ-ПОМОЩНИК — СЛЕВА
   ═══════════════════════════════════════════ */
.fairy {
    position: fixed; left: 12px; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 9990; cursor: pointer;
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.fairy-body {
    font-size: 1.8rem;
    animation: fairyFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(232,160,180,0.5));
    transition: transform 0.2s;
}
.fairy-body:active { transform: scale(0.85); }
@keyframes fairyFloat {
    0%,100% { transform: translateY(0) rotate(5deg); }
    33%     { transform: translateY(-8px) rotate(-3deg); }
    66%     { transform: translateY(-4px) rotate(2deg); }
}
.fairy-bubble {
    background: rgba(255,255,255,0.92); border: 1.5px solid rgba(232,160,180,0.4);
    border-radius: 14px 14px 14px 4px; /* хвостик справа-снизу для левого пузыря */
    padding: 8px 12px; font-size: 0.72rem; color: var(--warm-dark);
    max-width: 160px; text-align: left; line-height: 1.4;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(232,160,180,0.2);
    display: none;
    animation: bubblePop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
.fairy-bubble.show { display: block; }
@keyframes bubblePop {
    from { transform: scale(0.6) translateY(10px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ═══════════════════════════════════════════
   ЭФФЕКТ МОКРОЙ КРАСКИ
   ═══════════════════════════════════════════ */
.wet-paint-overlay {
    position: fixed; inset: 0; z-index: 9990; pointer-events: none;
    /* Многослойный акварельный эффект без filter:blur (ломает position:fixed в WebView) */
    background:
            radial-gradient(ellipse 70% 60% at 30% 40%, rgba(120,190,255,0.28) 0%, transparent 65%),
            radial-gradient(ellipse 50% 40% at 70% 60%, rgba(180,160,255,0.18) 0%, transparent 55%),
            radial-gradient(ellipse 40% 50% at 50% 20%, rgba(160,220,255,0.22) 0%, transparent 60%);
    opacity: 0;
}
.wet-paint-overlay.active {
    animation: wetPulse 0.7s ease-out forwards;
}
@keyframes wetPulse {
    0%   { opacity: 0;   transform: scale(0.95); }
    25%  { opacity: 0.9; transform: scale(1.02); }
    70%  { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0;   transform: scale(1.04); }
}

/* ═══════════════════════════════════════════
   СТЕБЕЛЬ-ПРОГРЕСС
   ═══════════════════════════════════════════ */
.stem-progress {
    display: flex; align-items: center; gap: 12px;
    padding: 0 20px; width: 100%;
}
.stem-svg { width: 80px; height: 50px; flex-shrink: 0; overflow: visible; }
.stem-line {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    transition: stroke-dashoffset 0.6s ease;
}
.stem-line.grow-1 { stroke-dashoffset: 80; }
.stem-line.grow-2 { stroke-dashoffset: 40; }
.stem-line.grow-3 { stroke-dashoffset: 0; }

.stem-leaf {
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
    transform-origin: center;
    transform-box: fill-box;
}
.stem-leaf.bloom {
    opacity: 1 !important;
    animation: leafWave 1.5s ease-in-out infinite;
}
@keyframes leafWave {
    0%,100% { transform: rotate(0deg); }
    50%     { transform: rotate(6deg); }
}

.stem-labels { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.stem-lbl {
    display: flex; align-items: center; gap: 8px;
    opacity: 0.4; transition: all 0.4s ease;
}
.stem-lbl.done { opacity: 1; }
.stem-lbl.done .sl-dot { animation: dotPop 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes dotPop { from{transform:scale(0.3)} to{transform:scale(1)} }
.sl-dot { font-size: 1.3rem; }
.sl-name { font-size: 0.78rem; font-weight: 700; color: var(--warm-dark); }
.stem-lbl.done .sl-name { color: var(--sage); }

/* ═══════════════════════════════════════════
   INK TRAIL (ЧЕРНИЛЬНЫЙ СЛЕД)
   ═══════════════════════════════════════════ */
.ink-trail-wrap {
    position: relative; width: 100%;
}
.ink-canvas {
    position: absolute; inset: 0; pointer-events: none;
    border-radius: 14px; opacity: 0.55;
}

/* ═══════════════════════════════════════════
   СВЕЧЕНИЕ ЦВЕТКА
   ═══════════════════════════════════════════ */
.flower-canvas-wrap { position: relative; }
.flower-glow-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 260px; height: 260px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(232,160,180,0.0) 30%, rgba(232,160,180,0.35) 60%, rgba(196,168,212,0.2) 80%, transparent 100%);
    pointer-events: none; z-index: -1;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.flower-glow-ring.active {
    opacity: 1;
    animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse {
    0%,100% { transform: translate(-50%,-50%) scale(1); opacity: 0.7; }
    50%     { transform: translate(-50%,-50%) scale(1.12); opacity: 1; }
}
/* Цвет свечения зависит от magic */
.flower-glow-ring.fun    { background: radial-gradient(ellipse, transparent 30%, rgba(255,200,80,0.35) 60%, rgba(255,160,80,0.15) 80%, transparent 100%); }
.flower-glow-ring.music  { background: radial-gradient(ellipse, transparent 30%, rgba(120,180,255,0.3) 60%, rgba(160,120,255,0.15) 80%, transparent 100%); }
.flower-glow-ring.hearts { background: radial-gradient(ellipse, transparent 30%, rgba(232,160,180,0.35) 60%, rgba(196,168,212,0.2) 80%, transparent 100%); }

/* Живой цветок у получателя */
.received-flower-wrap canvas {
    animation: flowerBreathe 4s ease-in-out infinite;
}
@keyframes flowerBreathe {
    0%,100% { transform: scale(1) rotate(-1deg); }
    50%     { transform: scale(1.04) rotate(1deg); }
}

/* ═══════════════════════════════════════════
   ОРГАНИЧЕСКИЕ КНОПКИ (форма лепестка)
   ═══════════════════════════════════════════ */
.btn-main {
    border-radius: 50px 18px 50px 18px !important;
}
.btn-main.water-btn {
    border-radius: 18px 50px 18px 50px !important;
}
.btn-secondary {
    border-radius: 18px 40px 18px 40px !important;
}
.phrase-btn {
    border-radius: 20px 8px 20px 8px;
}

/* ═══════════════════════════════════════════
   ЧАСТИЦЫ ОТ ЖУЧКОВ (DOM-частицы)
   ═══════════════════════════════════════════ */
.bug-particle {
    position: fixed; pointer-events: none; z-index: 9995;
    font-size: 0.7rem; will-change: transform, opacity;
    animation: particleFly linear forwards;
}
@keyframes particleFly {
    0%   { opacity: 1; transform: translate(0,0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: var(--fly-to) rotate(540deg) scale(0.3); }
}

/* Пыльца при цветении */
.pollen-particle {
    position: fixed; pointer-events: none; z-index: 9995;
    width: 6px; height: 6px; border-radius: 50%;
    animation: pollenDrift ease-out forwards;
}
@keyframes pollenDrift {
    0%   { opacity: 0.9; transform: translate(0,0) scale(1); }
    100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0.2); }
}

/* ═══════════════════════════════════════════
   ПАРАЛЛАКС ЛЕПЕСТКОВ (усиленный)
   ═══════════════════════════════════════════ */
.bg-petal { will-change: transform; }

/* ═══════════════════════════════════════════
   ПЛАВНОЕ ПОЯВЛЕНИЕ ТЕКСТА ПОЖЕЛАНИЯ
   ═══════════════════════════════════════════ */
@keyframes inkWrite {
    from { opacity: 0; transform: translateX(-4px); filter: blur(2px); }
    to   { opacity: 1; transform: none; filter: none; }
}
.wpc-text, .rwc-text { animation: inkWrite 0.6s ease both; }


/* ═══════════════════════════════════════════
   СОСТАВНАЯ ОТКРЫТКА (gift / received)
   ═══════════════════════════════════════════ */
.gift-card-wrap {
    display: flex; justify-content: center; align-items: center;
    padding: 6px 12px 0;
    width: 100%;
    max-height: min(260px, 42vh);
    overflow: hidden;
    flex-shrink: 0;
}
.gift-card-img {
    width: auto; height: 100%; max-width: 100%; max-height: min(260px, 42vh);
    object-fit: contain; border-radius: 18px;
    box-shadow: 0 6px 28px rgba(196,96,122,0.22);
    display: block;
    animation: cardReveal 0.55s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes cardReveal {
    from { opacity: 0; transform: scale(0.88) translateY(12px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.received-card-wrap {
    display: flex; justify-content: center; align-items: center;
    padding: 10px 12px;
}
.received-card-img {
    width: 100%; max-width: 340px; border-radius: 20px;
    box-shadow: 0 8px 32px rgba(196,96,122,0.28);
    display: block;
    animation: cardReveal 0.65s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* ═══════════════════════════════════════════
   ДНЕВНОЙ ЛИМИТ
   ═══════════════════════════════════════════ */
.limit-bar {
    margin: 8px 16px 0;
    background: rgba(255,255,255,0.8);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
}
.limit-top {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 7px;
    font-size: 0.8rem; color: var(--muted);
}
.limit-track {
    height: 7px; background: rgba(200,160,180,0.18);
    border-radius: 4px; overflow: hidden;
}
.limit-slots {
    height: 100%; background: linear-gradient(90deg, #C4607A, #E8A0B4);
    border-radius: 4px; transition: width 0.4s ease;
}

/* ═══════════════════════════════════════════
   СЕКЦИЯ ТРАТ БОНУСОВ
   ═══════════════════════════════════════════ */
.spend-section {
    margin: 8px 16px;
    background: linear-gradient(135deg, #FFF5E8, #FFF0F4);
    border: 1.5px solid #F0B070;
    border-radius: 16px;
    padding: 12px 14px;
}
.spend-title {
    font-size: 0.8rem; font-weight: 700;
    color: #C06030; margin-bottom: 8px; text-align: center;
}
.spend-btn {
    display: block; width: 100%;
    padding: 9px 14px; margin-bottom: 7px;
    border-radius: 20px; border: none; cursor: pointer;
    font-family: var(--font-body); font-size: 0.78rem; font-weight: 700;
    transition: all 0.18s;
}
.spend-btn:last-child { margin-bottom: 0; }
.spend-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.seed-btn  { background: #FFF0D0; color: #8B5010; border: 1.5px solid #D4A060; }
.petal-btn { background: #FFF0F8; color: #8B2060; border: 1.5px solid #D46090; }
.spend-btn:not(:disabled):active { transform: scale(0.97); }

/* ═══════════════════════════════════════════
   КАРТОЧКИ В КОЛЛЕКЦИИ — обновлённые
   ═══════════════════════════════════════════ */
.flower-card.opened {
    border-color: #D4A853;
    box-shadow: 0 0 0 2px rgba(212,168,83,0.25);
}
.fc-card-img {
    width: 100%; border-radius: 10px; display: block;
    margin-bottom: 4px;
}
.fc-opened-badge {
    font-size: 0.62rem; font-weight: 700; color: #8B6020;
    background: #FFF3D0; border-radius: 8px;
    padding: 2px 6px; margin-top: 2px; text-align: center;
}

/* ═══════════════════════════════════════════
   ЛАЙТБОКС ДЛЯ КОЛЛЕКЦИИ
   ═══════════════════════════════════════════ */
.card-lightbox {
    position: fixed; inset: 0; z-index: 9997;
    background: rgba(40, 22, 32, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity 0.28s ease;
    padding: 20px;
}
.card-lightbox.visible { opacity: 1; }

.cl-img {
    width: auto; height: auto;
    max-width: min(92vw, 440px);
    max-height: 88vh;
    border-radius: 22px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.45);
    transform: scale(0.88);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block;
}
.card-lightbox.visible .cl-img { transform: scale(1); }

.cl-close {
    position: absolute; top: max(env(safe-area-inset-top, 0px), 16px); right: 16px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.18); border: 1.5px solid rgba(255,255,255,0.3);
    color: white; font-size: 1.1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    z-index: 1;
}
.cl-close:active { background: rgba(255,255,255,0.35); }


/* ═══════════════════════════════════════════
   КНОПКА МЕЛОДИИ (экран получателя)
   ═══════════════════════════════════════════ */
.btn-melody-play {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #E8F0FF, #D8E8FF);
    border: 2px solid rgba(120,160,255,0.45);
    border-radius: 50px 18px 50px 18px;
    color: #4060C0; font-family: var(--font-body);
    font-size: 0.88rem; font-weight: 800;
    cursor: pointer; transition: all 0.22s;
    box-shadow: 0 4px 14px rgba(100,140,255,0.15);
    margin: 4px auto 0;
    animation: melodyPulse 2.5s ease-in-out infinite;
}
@keyframes melodyPulse {
    0%,100% { box-shadow: 0 4px 14px rgba(100,140,255,0.15); }
    50%      { box-shadow: 0 4px 20px rgba(100,140,255,0.38); }
}
.btn-melody-play:active { transform: scale(0.96); }
.btn-melody-play.playing {
    background: linear-gradient(135deg, #E0FFE8, #C8F8D8);
    border-color: rgba(80,180,100,0.5); color: #306840;
    animation: playingPulse 0.8s ease-in-out infinite;
}
@keyframes playingPulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.02); }
}

/* ═══════════════════════════════════════════
   КНОПКА МЕЛОДИИ В ЛАЙТБОКСЕ
   ═══════════════════════════════════════════ */
.cl-melody-btn {
    position: absolute;
    bottom: max(env(safe-area-inset-bottom, 0px), 22px);
    left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 8px;
    padding: 11px 28px;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.38);
    border-radius: 50px; color: white;
    font-family: var(--font-body); font-size: 0.9rem; font-weight: 800;
    cursor: pointer; backdrop-filter: blur(8px);
    transition: all 0.2s; white-space: nowrap;
    z-index: 2;
}
.cl-melody-btn:active { transform: translateX(-50%) scale(0.96); }
.cl-melody-btn.playing {
    background: rgba(120,220,140,0.28);
    border-color: rgba(120,220,140,0.55);
    animation: playingPulse 0.8s ease-in-out infinite;
}
