/* ========================================================
   БЛОК «НАШИ ЗВЁЗДОЧКИ»
   Файл: zvezdochki.css
   Интерактивный игровой блок личных успехов воспитанников.
   Все цвета/тексты/фото управляются из Кастомайзера —
   этот файл отвечает только за внешний вид.
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&display=swap');

/* ── Секция ── */
.zvezdochki-section.section {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 38px 0 46px;
    text-align: center;
    background: transparent !important;
    box-shadow: none !important;
}

/* Убираем белый фон/тень у родительских блоков внутри секции,
   чтобы небо страницы было видно сквозь блок — как в «Наших достижениях» */
.zvezdochki-section * {
    box-shadow: none;
}

/* ── Декоративные мигающие звёздочки на фоне ── */
.zv-bg-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.zv-bg-star {
    position: absolute;
    line-height: 1;
    opacity: .25;
    filter: drop-shadow(0 0 5px rgba(255,255,255,.7));
    animation: zvTwinkle 3.4s ease-in-out infinite;
}
@keyframes zvTwinkle {
    0%, 100% { opacity: .15; transform: scale(.8) rotate(0deg); }
    50%      { opacity: .65; transform: scale(1.2) rotate(18deg); }
}

/* ── Искры за курсором (интерактивный фон) ── */
.zv-cursor-spark {
    position: fixed;
    z-index: 5;
    pointer-events: none;
    line-height: 1;
    animation: zvSparkRise .9s ease-out forwards;
    will-change: transform, opacity;
}
@keyframes zvSparkRise {
    0%   { opacity: 1;  transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { opacity: 0;  transform: translate(var(--sx, 0px), -46px) scale(.35) rotate(var(--srot, 40deg)); }
}

/* ── Заголовок со звёздочками-маскотами ── */
.zv-title-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.zv-title-star {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.16));
    animation: zvStarWiggle 3.2s ease-in-out infinite;
}
.zv-title-star svg { width: 100%; height: 100%; display: block; }
.zv-title-star--left  { animation-delay: .2s; }
.zv-title-star--right { animation-name: zvStarWiggleRight; animation-delay: 1s; }

@keyframes zvStarWiggle {
    0%, 100% { transform: rotate(-10deg) translateY(0); }
    50%      { transform: rotate(4deg) translateY(-5px); }
}
@keyframes zvStarWiggleRight {
    0%, 100% { transform: rotate(10deg) translateY(0); }
    50%      { transform: rotate(-4deg) translateY(-5px); }
}

.zvezdochki-title {
    position: relative;
    z-index: 1;
    font-family: 'Baloo 2', 'Nunito', sans-serif;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
    background: linear-gradient(90deg, #FF6FA5, #FFC107, #4FC3F7, #9C7BFF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #FF6FA5; /* fallback */
}
.zvezdochki-subtitle {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #3d6580;
    font-size: .98rem;
    line-height: 1.6;
}

/* ── Облако-подпись на всю ширину блока ── */
.zv-cloud-bubble {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 22px auto 36px;
    background: #E3F4FF;
    border-radius: 46px;
    padding: 28px 36px 26px;
    filter: drop-shadow(0 12px 22px rgba(54,127,189,.18));
}
.zv-cloud-bumps {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.zv-bump {
    position: absolute;
    background: #E3F4FF;
    border-radius: 50%;
}

/* ── Цветовые акценты карточек ── */
.zv-card[data-color="yellow"] { --zv-accent: #FFC107; }
.zv-card[data-color="orange"] { --zv-accent: #FF9F43; }
.zv-card[data-color="pink"]   { --zv-accent: #FF6FA5; }
.zv-card[data-color="blue"]   { --zv-accent: #4FC3F7; }
.zv-card[data-color="green"]  { --zv-accent: #66BB6A; }
.zv-card[data-color="violet"] { --zv-accent: #9C7BFF; }

/* ── Карусель карточек-секретов: нативный скролл/свайп ── */
.zv-carousel-viewport {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 6px 2px 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.zv-carousel-viewport::-webkit-scrollbar { display: none; }

.zv-carousel-track {
    display: flex;
    gap: 22px;
}

/* Точки */
.zv-dots {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 6px 0 8px;
}
.zv-dot-btn {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #FFC107;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background .25s, transform .25s;
}
.zv-dot-btn.active,
.zv-dot-btn:hover {
    background: #FF6FA5;
    border-color: #FF6FA5;
    transform: scale(1.3);
}

.zv-card {
    perspective: 1400px;
    cursor: pointer;
    flex: 0 0 calc(25% - 17px);
    min-width: 190px;
    scroll-snap-align: start;
    animation: zvFloat 5s ease-in-out infinite;
}
/* «Парение» — у каждой карточки своя фаза, чтобы не двигались синхронно */
.zv-card:nth-child(1) { animation-delay: 0s; }
.zv-card:nth-child(2) { animation-delay: .6s; }
.zv-card:nth-child(3) { animation-delay: 1.2s; }
.zv-card:nth-child(4) { animation-delay: 1.8s; }
.zv-card:nth-child(5) { animation-delay: .3s; }
.zv-card:nth-child(6) { animation-delay: .9s; }
.zv-card:nth-child(7) { animation-delay: 1.5s; }
.zv-card:nth-child(8) { animation-delay: 2.1s; }
@keyframes zvFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}
.zv-card.flipped { animation-play-state: paused; }
.zv-card:focus-visible .zv-card-front,
.zv-card:focus-visible .zv-card-back {
    outline: 3px solid var(--zv-accent, #FFC107);
    outline-offset: 2px;
}
.zv-card-inner {
    position: relative;
    min-height: 270px;
    aspect-ratio: 3 / 4;
    border-radius: 24px;
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.22,1,.36,1);
}
.zv-card.flipped .zv-card-inner { transform: rotateY(180deg); }

.zv-card-front, .zv-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 18px;
    text-align: center;
}
.zv-card-front {
    background: #fff;
    border: 3px solid color-mix(in srgb, var(--zv-accent, #FFC107) 35%, transparent);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    transition: transform .3s, box-shadow .3s;
}
.zv-card:not(.flipped):hover .zv-card-front {
    transform: translateY(-6px) rotate(-1deg);
    box-shadow: 0 14px 32px rgba(0,0,0,.14);
}
.zv-card-back {
    background: linear-gradient(150deg, var(--zv-accent, #FFC107), color-mix(in srgb, var(--zv-accent, #FFC107) 50%, #fff));
    color: #fff;
    transform: rotateY(180deg);
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
}

/* Аватар */
/* ── Передняя сторона: диплом на весь блок ── */
.zv-card-front--photo {
    padding: 0;
    overflow: hidden;
    border: 3px solid color-mix(in srgb, var(--zv-accent, #FFC107) 45%, transparent);
}
.zv-diploma-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform .45s ease, filter .45s ease;
}
.zv-card:not(.flipped):hover .zv-diploma-img {
    transform: scale(1.06);
}
.zv-diploma-sticker {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.22);
    z-index: 2;
    transition: transform .3s;
}
.zv-card:not(.flipped):hover .zv-diploma-sticker {
    transform: rotate(-12deg) scale(1.1);
}
.zv-diploma-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: 28px 16px 14px;
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.78) 65%);
}
.zv-diploma-caption .zv-card-name {
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
    margin-bottom: 6px;
}
.zv-diploma-caption .zv-skill-badge {
    background: rgba(255,255,255,.92);
}
.zv-hint--photo {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: rgba(255,255,255,.92);
    color: #6b6478;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 100px;
    box-shadow: 0 3px 8px rgba(0,0,0,.16);
}

.zv-avatar {
    position: relative;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    margin-bottom: 12px;
    background: color-mix(in srgb, var(--zv-accent, #FFC107) 16%, #fff);
    border: 3px solid color-mix(in srgb, var(--zv-accent, #FFC107) 45%, transparent);
}
.zv-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.zv-sticker {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    box-shadow: 0 3px 8px rgba(0,0,0,.18);
}

.zv-card-name {
    font-family: 'Baloo 2', 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #333;
    margin: 0 0 6px;
}
.zv-skill-badge {
    background: color-mix(in srgb, var(--zv-accent, #FFC107) 18%, #fff);
    color: var(--zv-accent, #FFC107);
    font-weight: 700;
    font-size: .78rem;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
}
.zv-hint {
    font-size: .74rem;
    color: #b3aac0;
    margin-top: auto;
}

.zv-back-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    animation: zvPop .45s ease;
}
.zv-back-message {
    font-size: .92rem;
    line-height: 1.55;
    font-weight: 600;
    margin: 0;
}
.zv-back-hint {
    font-size: .7rem;
    opacity: .85;
    margin-top: 12px;
}
@keyframes zvPop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* «Подбадривающий» прыжок при «Удиви меня» */
@keyframes zvBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    30%      { transform: translateY(-14px) rotate(-4deg); }
    60%      { transform: translateY(0) rotate(3deg); }
    80%      { transform: translateY(-4px) rotate(0deg); }
}
.zv-card.zv-bounce .zv-card-inner { animation: zvBounce .6s ease; }

/* ── Баннер «всё открыто» ── */
.zv-complete-banner {
    display: none;
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 28px auto 0;
    background: #fff;
    border: 3px dashed #FFC107;
    border-radius: 22px;
    padding: 20px 26px;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
}
.zv-complete-banner.zv-show {
    display: block;
    animation: zvPopIn .5s cubic-bezier(.22,1.4,.36,1);
}
.zv-complete-emoji { font-size: 2rem; margin-bottom: 8px; }
.zv-complete-banner p { font-weight: 700; color: #444; margin: 0; line-height: 1.5; }
@keyframes zvPopIn {
    0%   { opacity: 0; transform: scale(.7) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Пустое состояние (если не заполнено) ── */
.zv-empty {
    position: relative;
    z-index: 1;
    color: #998fae;
    font-size: 1rem;
    padding: 30px 0 6px;
}

/* ── Конфетти ── */
.zv-confetti-piece {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 99999;
    animation-name: zvConfettiFall;
    animation-timing-function: cubic-bezier(.25,.46,.45,.94);
    animation-fill-mode: forwards;
}
@keyframes zvConfettiFall {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--dx, 0px), calc(var(--dy, 0px) + 180px)) rotate(var(--rot, 360deg)); opacity: 0; }
}

/* ── Адаптивность ── */
@media (max-width: 1023px) {
    .zv-card { flex: 0 0 calc(50% - 11px); }
}

@media (max-width: 768px) {
    .zvezdochki-title { font-size: 26px; }
    .zv-title-star { width: 36px; height: 36px; }
}

@media (max-width: 640px) {
    .zvezdochki-section.section { padding: 32px 12px 38px; }
    .zvezdochki-title { font-size: 21px; }
    .zvezdochki-subtitle { font-size: .88rem; }
    .zv-title-star { width: 28px; height: 28px; }
    .zv-title-row { gap: 8px; }

    .zv-cloud-bubble { padding: 24px 20px 22px; border-radius: 32px; }
    .zv-bump { transform: scale(.7); }
    .zv-bump-top    { transform-origin: top center; }
    .zv-bump-bottom { transform-origin: bottom center; }

    .zv-card { flex: 0 0 100%; }
    .zv-card-inner { min-height: 220px; }
}
