/* ===== БАЗОВІ СТИЛІ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B9D;
    --secondary-color: #C44DFF;
    --accent-color: #4DCCFF;
    --yellow-color: #FFD93D;
    --green-color: #6BCB77;
    --text-color: #333;
    --text-light: #666;
    --white: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.15);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--white);
    color: var(--text-color);
    position: relative;
}

 .screen {
     min-height: 100dvh;
 }

/* ===== ГРАДІЄНТНІ ПЛЯМИ НА ФОНІ ===== */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #FFB6C1, #FFC0CB);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #87CEEB, #ADD8E6);
    top: 50%;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #FFFACD, #FFE4B5);
    bottom: -50px;
    left: 30%;
    animation-delay: -10s;
}

.blob-4 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #E6E6FA, #DDA0DD);
    top: 30%;
    left: 10%;
    animation-delay: -15s;
}

.blob-5 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #98FB98, #90EE90);
    bottom: 20%;
    right: 20%;
    animation-delay: -7s;
}

@keyframes blobFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(20px, 10px) scale(1.02);
    }
}

/* ===== ЧАСТИНКИ ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.6;
    animation: particleFloat 15s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ===== CANVAS КОНФЕТТІ ===== */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

/* ===== ПРОГРЕС БАР - APPLE LIQUID GLASS STYLE ===== */
.progress-container {
    position: fixed;
    bottom: calc(44px + env(safe-area-inset-bottom));
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 380px;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.5s ease;
    
    /* Liquid Glass основа */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.18) 100%
    );
    padding: 14px 16px;
    border-radius: 28px;
    
    /* Скляний ефект */
    backdrop-filter: blur(40px) saturate(180%) brightness(1.1);
    -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.1);
    
    /* Тіні для глибини */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.6),
        inset 0 -1px 1px rgba(255, 255, 255, 0.2);
    
    /* Скляна рамка */
    border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Верхній відблиск - імітація рефракції світла */
.progress-container::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 10%;
    right: 10%;
    height: 50%;
    border-radius: 28px 28px 100% 100%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.15) 40%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
}

/* Динамічний переливаючийся ефект */
.progress-container::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 28px;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255, 255, 255, 0.15) 35%,
        rgba(255, 255, 255, 0.25) 40%,
        rgba(255, 255, 255, 0.15) 45%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: liquidShimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes liquidShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.progress-container > * {
    position: relative;
    z-index: 1;
}

.progress-container.visible {
    opacity: 1;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar-background {
    flex-grow: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--primary-color) 0%,
        var(--secondary-color) 50%,
        var(--accent-color) 100%
    );
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease-out;
    box-shadow:
        0 0 12px rgba(255, 107, 157, 0.6),
        0 0 24px rgba(196, 77, 255, 0.4);
    position: relative;
    background-size: 200% 100%;
    animation: progressGradient 3s ease-in-out infinite;
}

@keyframes progressGradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Живий блиск на прогрес барі */
.progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6));
    border-radius: 3px;
    animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

.progress-timer {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
    width: 45px;
    text-align: right;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 4px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.step-dot.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 
        0 0 12px rgba(255, 107, 157, 0.7),
        0 0 20px rgba(196, 77, 255, 0.4);
    transform: scale(1.3);
}

.step-dot.completed {
    background: var(--green-color);
    box-shadow: 0 0 8px rgba(107, 203, 119, 0.5);
}

/* ===== КНОПКА ЗВУКУ ===== */
.sound-toggle {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top));
    right: calc(20px + env(safe-area-inset-right));
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    cursor: pointer;
    z-index: 100;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-strong);
}

.sound-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-color);
}

.sound-toggle .hidden {
    display: none;
}

/* ===== ЕКРАНИ ===== */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

.content {
    text-align: center;
    padding: 40px;
    max-width: 800px;
    position: relative;
}

/* ===== МУЗИЧНЕ СВІТІННЯ ПО КРАЯХ ===== */
.music-glow {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

.music-glow.visible {
    opacity: 1;
}

.glow-edge {
    position: fixed;
    background: linear-gradient(
        var(--glow-direction, to bottom),
        rgba(255, 107, 157, var(--glow-intensity, 0.15)),
        rgba(196, 77, 255, calc(var(--glow-intensity, 0.15) * 0.5)),
        transparent
    );
    transition: opacity 0.15s ease;
}

.glow-top {
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    --glow-direction: to bottom;
}

.glow-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    --glow-direction: to top;
}

.glow-left {
    top: 0;
    left: 0;
    bottom: 0;
    width: 40px;
    --glow-direction: to right;
}

.glow-right {
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    --glow-direction: to left;
}

/* Кутові акценти */
.glow-corner {
    position: fixed;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: var(--corner-intensity, 0.2);
    transition: opacity 0.2s ease;
}

.glow-tl {
    top: -30px;
    left: -30px;
    background: radial-gradient(circle, rgba(255, 107, 157, 0.6), transparent 70%);
}

.glow-tr {
    top: -30px;
    right: -30px;
    background: radial-gradient(circle, rgba(77, 204, 255, 0.6), transparent 70%);
}

.glow-bl {
    bottom: -30px;
    left: -30px;
    background: radial-gradient(circle, rgba(77, 204, 255, 0.6), transparent 70%);
}

.glow-br {
    bottom: -30px;
    right: -30px;
    background: radial-gradient(circle, rgba(196, 77, 255, 0.6), transparent 70%);
}

/* ===== ЕКРАН 0: СТАРТ ===== */
.avatar-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 3;
    border: 4px solid white;
    box-shadow: 
        0 10px 40px rgba(255, 107, 157, 0.3),
        0 5px 20px rgba(0, 0, 0, 0.1);
    animation: avatarFloat 4s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.avatar-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    filter: blur(25px);
    opacity: 0.6;
    z-index: 1;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.avatar-ring {
    position: absolute;
    width: 145px;
    height: 145px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color)) border-box;
    -webkit-mask: 
        linear-gradient(#fff 0 0) padding-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) padding-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 2;
    animation: ringRotate 8s linear infinite;
}

@keyframes ringRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.avatar-sparkle {
    position: absolute;
    font-size: 20px;
    z-index: 4;
    animation: sparkleFloat 2s ease-in-out infinite;
}

.sparkle-1 {
    top: 0;
    right: 10px;
    animation-delay: 0s;
}

.sparkle-2 {
    bottom: 10px;
    left: 5px;
    animation-delay: 0.5s;
}

.sparkle-3 {
    top: 30%;
    left: 0;
    animation-delay: 1s;
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-5px) scale(1.2);
        opacity: 0.7;
    }
}

.greeting-emoji {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

.main-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease-in-out infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.highlight {
    font-family: 'Pacifico', cursive;
    display: inline-block;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.date-text {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 40px;
}

.start-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.4);
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 107, 157, 0.5);
}

.start-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.start-btn:hover svg {
    transform: translateX(5px);
}

.hint-text {
    margin-top: 30px;
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.8;
}

/* ===== ЕКРАН 1: ДЕНЬ НАРОДЖЕННЯ ===== */
.cake-container {
    position: relative;
    margin-bottom: 30px;
}

.cake-emoji {
    font-size: 120px;
    animation: cakeWobble 3s ease-in-out infinite;
}

@keyframes cakeWobble {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

.candles {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.candle {
    font-size: 30px;
    animation: candleFlicker 0.5s ease-in-out infinite alternate;
}

.candle:nth-child(2) {
    animation-delay: 0.1s;
}

.candle:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes candleFlicker {
    0% {
        transform: scale(1) rotate(-2deg);
        filter: brightness(1);
    }
    100% {
        transform: scale(1.1) rotate(2deg);
        filter: brightness(1.2);
    }
}

.screen-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.screen-text {
    font-size: 1.3rem;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.balloons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.balloon {
    font-size: 50px;
    animation: balloonFloat 3s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes balloonFloat {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* ===== ЕКРАН 2: ПОБАЖАННЯ ЗДОРОВ'Я ===== */
.wish-icon {
    font-size: 100px;
    margin-bottom: 30px;
    display: inline-block;
}

.wish-icon.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.wish-cards {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.wish-card {
    background: var(--white);
    padding: 30px 25px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    animation: cardAppear 0.8s ease forwards;
    animation-delay: var(--delay);
    opacity: 0;
    transform: translateY(30px);
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wish-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-strong);
}

.card-icon {
    font-size: 50px;
    display: block;
    margin-bottom: 15px;
}

.wish-card p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* ===== ЕКРАН 3: УСПІХ ===== */
.wish-icon.bounce {
    animation: rocketBounce 2s ease-in-out infinite;
}

@keyframes rocketBounce {
    0%, 100% {
        transform: translateY(0) rotate(-10deg);
    }
    50% {
        transform: translateY(-30px) rotate(10deg);
    }
}

.success-path {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.path-item {
    background: var(--white);
    padding: 25px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    animation: pathAppear 0.6s ease forwards;
    animation-delay: var(--delay);
    opacity: 0;
    transform: scale(0.8);
}

@keyframes pathAppear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.path-icon {
    font-size: 45px;
    display: block;
    margin-bottom: 10px;
}

.path-text {
    font-weight: 600;
    color: var(--text-color);
}

.path-arrow {
    font-size: 30px;
    color: var(--primary-color);
    animation: arrowPulse 1s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        transform: translateX(0);
        opacity: 1;
    }
    50% {
        transform: translateX(10px);
        opacity: 0.5;
    }
}

/* ===== ЕКРАН 4: ЩАСТЯ ===== */
.wish-icon.float {
    animation: heartFloat 3s ease-in-out infinite;
}

@keyframes heartFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.1);
    }
}

.hearts-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 30px 0;
}

.heart {
    font-size: 50px;
    animation: heartBeat 1.5s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.15);
    }
}

.sparkles {
    font-size: 40px;
    margin-top: 30px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* ===== ЕКРАН 5: ПОДАРУНОК ===== */
.gift-container {
    margin-bottom: 30px;
}

.gift-box {
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gift-box:hover {
    transform: scale(1.05);
}

.gift-base {
    font-size: 150px;
    display: block;
    animation: giftShake 0.5s ease-in-out infinite;
}

@keyframes giftShake {
    0%, 100% {
        transform: rotate(-2deg);
    }
    50% {
        transform: rotate(2deg);
    }
}

.gift-lid {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.5s ease;
}

.gift-bow {
    font-size: 60px;
}

.gift-box.opened .gift-lid {
    transform: translateX(-50%) translateY(-50px) rotate(20deg);
    opacity: 0;
}

.gift-box.opened .gift-base {
    animation: none;
}

.gift-title {
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
    }
    50% {
        text-shadow: 0 0 40px rgba(255, 107, 157, 0.8);
    }
}

.gift-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 20px 50px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, var(--yellow-color), #FFA500);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 217, 61, 0.4);
    margin-top: 20px;
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(255, 217, 61, 0.4);
    }
    50% {
        box-shadow: 0 15px 50px rgba(255, 217, 61, 0.6);
    }
}

.gift-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 50px rgba(255, 217, 61, 0.5);
}

.gift-btn-icon {
    font-size: 1.5rem;
    animation: iconShake 0.5s ease-in-out infinite;
}

@keyframes iconShake {
    0%, 100% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

/* До відкриття подарунка */
.gift-before {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.gift-before.hidden {
    display: none;
}

/* Після відкриття подарунка */
.gift-revealed {
    animation: revealFadeIn 0.6s ease forwards;
}

.gift-revealed.hidden {
    display: none;
}

@keyframes revealFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.gift-opened-icon {
    font-size: 70px;
    margin-bottom: 20px;
    animation: giftBounce 1s ease infinite;
}

@keyframes giftBounce {
    0%, 100% {
        transform: translateY(0) rotate(-3deg);
    }
    50% {
        transform: translateY(-10px) rotate(3deg);
    }
}

#screen-5 .gift-message {
    padding: 25px 30px;
    max-width: 400px;
    margin: 0 auto;
}

.congrats-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.congrats-header h3 {
    margin-bottom: 0;
}

.congrats-emoji {
    font-size: 2rem;
    animation: emojiPop 0.8s ease-out;
}

.gift-main-text {
    font-size: 1.15rem !important;
    font-weight: 600;
    margin-bottom: 10px !important;
}

.gift-note {
    font-size: 1rem !important;
    margin-bottom: 15px !important;
}

.final-wish {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #eee;
    font-family: 'Pacifico', cursive;
    font-size: 1.2rem;
    color: var(--primary-color);
}


.gift-message {
    background: var(--white);
    padding: 40px;
    border-radius: 30px;
    box-shadow: var(--shadow-strong);
    animation: messageAppear 0.8s ease forwards;
}

@keyframes messageAppear {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.gift-message h3 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--yellow-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.congrats-emoji {
    font-size: 2.5rem;
    display: inline-block;
    margin: 0 10px;
    vertical-align: middle;
    animation: emojiPop 1s ease-out;
}

@keyframes emojiPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.gift-message p {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.gift-main-text {
    font-size: 1.3rem !important;
    font-weight: 600;
    margin-top: 15px;
}


/* ===== ЗАГАЛЬНІ АНІМАЦІЇ ===== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== НАВІГАЦІЯ ВПЕРЕД/НАЗАД ===== */
.nav-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 35px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.35);
    animation: navHintPulse 3s ease-in-out infinite;
}

.nav-back, .nav-forward {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 20px;
}

.nav-back:hover, .nav-forward:hover {
    color: rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.05);
}

.nav-divider {
    color: rgba(0, 0, 0, 0.2);
}

/* Приховуємо "Назад" на першому екрані */
#screen-1 .nav-back {
    visibility: hidden;
}

@keyframes navHintPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Зони кліку по боках екрану */
.tap-zone {
    position: fixed;
    top: 0;
    height: 100%;
    width: 30%;
    z-index: 15;
    cursor: pointer;
}

.tap-zone-left {
    left: 0;
}

.tap-zone-right {
    right: 0;
}

/* Візуальний фідбек при натисканні */
.tap-zone::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.tap-zone-left::after {
    left: 20px;
}

.tap-zone-right::after {
    right: 20px;
}

.tap-zone:active::after {
    opacity: 1;
}

/* ===== ЗІРКИ (ЕКРАН 4) ===== */
.stars-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 30px 0;
}

.star {
    font-size: 50px;
    animation: starTwinkle 2s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes starTwinkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    25% {
        transform: scale(1.15) rotate(5deg);
        filter: brightness(1.3);
    }
    50% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    75% {
        transform: scale(1.1) rotate(-5deg);
        filter: brightness(1.2);
    }
}

/* ===== АДАПТИВНІСТЬ ===== */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.2rem;
    }
    
    .screen-title {
        font-size: 1.8rem;
    }
    
    .screen-text {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .date-text {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .greeting-emoji {
        font-size: 60px;
    }
    
    .avatar-container {
        width: 110px;
        height: 110px;
        margin-bottom: 15px;
    }
    
    .avatar-img {
        width: 90px;
        height: 90px;
        border-width: 3px;
    }
    
    .avatar-glow {
        width: 120px;
        height: 120px;
    }
    
    .avatar-ring {
        width: 105px;
        height: 105px;
    }
    
    .avatar-sparkle {
        font-size: 14px;
    }
    
    .content {
        padding: 15px;
        padding-top: calc(10px + env(safe-area-inset-top));
    }
    
    .screen {
        padding-top: env(safe-area-inset-top);
    }
    
    .glow-top, .glow-bottom {
        height: 45px;
    }
    
    .glow-left, .glow-right {
        width: 30px;
    }
    
    .glow-corner {
        width: 80px;
        height: 80px;
        filter: blur(30px);
    }
    
    .wish-icon {
        font-size: 70px;
        margin-bottom: 20px;
    }
    
    .wish-cards {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin: 25px 0;
    }
    
    .wish-card {
        width: 100%;
        max-width: 260px;
        padding: 20px 18px;
    }
    
    .card-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }
    
    .wish-card p {
        font-size: 1rem;
    }
    
    .success-path {
        flex-direction: column;
        gap: 12px;
        margin: 25px 0;
    }
    
    .path-item {
        padding: 18px 22px;
        width: 100%;
        max-width: 200px;
    }
    
    .path-icon {
        font-size: 35px;
    }
    
    .path-arrow {
        transform: rotate(90deg);
        font-size: 24px;
    }
    
    .start-btn, .gift-btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .cake-emoji {
        font-size: 80px;
    }
    
    .gift-base {
        font-size: 100px;
    }
    
    .blob {
        filter: blur(60px);
        opacity: 0.35;
    }
    
    .blob-1 {
        width: 300px;
        height: 300px;
    }
    
    .blob-2 {
        width: 250px;
        height: 250px;
    }
    
    .blob-3, .blob-4, .blob-5 {
        width: 200px;
        height: 200px;
    }
    
    .progress-container {
        width: calc(100% - 28px);
        max-width: 360px;
        bottom: calc(36px + env(safe-area-inset-bottom));
        padding: 9px 11px;
    }
    
    .sound-toggle {
        top: calc(16px + env(safe-area-inset-top));
        right: calc(16px + env(safe-area-inset-right));
        width: 44px;
        height: 44px;
    }
    
    .sound-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    .screen {
        padding: 0 0 calc(130px + env(safe-area-inset-bottom)) 0;
        overflow-y: auto;
    }
    
    .content {
        padding: 15px;
        max-width: 100%;
    }
    
    .hearts-container {
        gap: 12px;
        margin: 20px 0;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .heart {
        font-size: 38px;
    }
    
    .balloons {
        gap: 15px;
        margin-top: 25px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .balloon {
        font-size: 40px;
    }
    
    .sparkles {
        font-size: 30px;
        margin-top: 20px;
    }
    
    .gift-message {
        padding: 25px 20px;
        border-radius: 20px;
    }
    
    .gift-opened-icon {
        font-size: 55px;
        margin-bottom: 15px;
    }
    
    .gift-message h3 {
        font-size: 1.5rem;
    }
    
    .congrats-emoji {
        font-size: 1.6rem;
    }
    
    .congrats-header {
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .gift-message p {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .gift-main-text {
        font-size: 1rem !important;
    }
    
    #screen-5 .gift-message {
        padding: 20px 18px;
        max-width: 340px;
    }
    
    .final-wish {
        font-size: 1.1rem;
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .nav-hint {
        font-size: 0.85rem;
        margin-top: 25px;
        gap: 10px;
    }
    
    .nav-back, .nav-forward {
        padding: 6px 10px;
    }
    
    .hint-text {
        font-size: 0.85rem;
        margin-top: 25px;
    }
    
    .stars-container {
        gap: 15px;
        margin: 20px 0;
    }
    
    .star {
        font-size: 38px;
    }
    
    .progress-container {
        padding: 12px 14px;
        border-radius: 22px;
    }
    
    .progress-container::before {
        border-radius: 22px 22px 100% 100%;
    }
    
    .progress-container::after {
        border-radius: 22px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }
    
    .screen-title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1.05rem;
    }
    
    .greeting-emoji {
        font-size: 50px;
        margin-bottom: 15px;
    }
    
    .avatar-container {
        width: 100px;
        height: 100px;
        margin-bottom: 15px;
    }
    
    .avatar-img {
        width: 85px;
        height: 85px;
    }
    
    .avatar-glow {
        width: 110px;
        height: 110px;
    }
    
    .avatar-ring {
        width: 95px;
        height: 95px;
    }
    
    .avatar-sparkle {
        font-size: 14px;
    }
    
    .glow-top, .glow-bottom {
        height: 35px;
    }
    
    .glow-left, .glow-right {
        width: 25px;
    }
    
    .glow-corner {
        width: 60px;
        height: 60px;
        filter: blur(25px);
    }
    
    .wish-icon {
        font-size: 55px;
        margin-bottom: 15px;
    }
    
    .cake-emoji {
        font-size: 65px;
    }
    
    .gift-base {
        font-size: 80px;
    }
    
    .balloons, .hearts-container {
        gap: 10px;
    }
    
    .balloon, .heart {
        font-size: 32px;
    }
    
    .wish-card {
        max-width: 240px;
        padding: 16px 14px;
    }
    
    .card-icon {
        font-size: 35px;
    }
    
    .path-item {
        padding: 14px 18px;
        max-width: 180px;
    }
    
    .path-icon {
        font-size: 30px;
    }
    
    .path-text {
        font-size: 0.9rem;
    }

    .progress-container {
        width: calc(100% - 22px);
        padding: 8px 10px;
        max-width: 340px;
    }

    .progress-bar-background {
        height: 7px;
    }

    .progress-timer {
        font-size: 0.9rem;
        width: 50px;
    }
    
    .start-btn, .gift-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .nav-hint {
        font-size: 0.8rem;
        margin-top: 20px;
        gap: 8px;
    }
    
    .nav-back, .nav-forward {
        padding: 5px 8px;
    }
    
    .star {
        font-size: 32px;
    }
    
    .gift-message {
        padding: 20px 15px;
    }
    
    .gift-opened-icon {
        font-size: 45px;
        margin-bottom: 12px;
    }
    
    .gift-message h3 {
        font-size: 1.3rem;
    }
    
    .congrats-emoji {
        font-size: 1.4rem;
    }
    
    .gift-message p {
        font-size: 0.9rem;
    }
    
    .gift-main-text {
        font-size: 0.95rem !important;
    }
    
    #screen-5 .gift-message {
        padding: 18px 15px;
        max-width: 300px;
    }
    
    .final-wish {
        font-size: 1rem;
    }
    
    .money {
        font-size: 38px;
    }
    
    .sparkles {
        font-size: 26px;
    }
}

@media (max-width: 360px) {
    .main-title {
        font-size: 1.6rem;
    }
    
    .screen-title {
        font-size: 1.35rem;
    }
    
    .screen-text {
        font-size: 0.9rem;
    }
    
    .content {
        padding: 12px;
    }
    
    .wish-card {
        max-width: 220px;
    }
}

/* ===== iPhone 15 Pro / Pro Max оптимізація ===== */
@media (max-width: 440px) and (max-height: 950px) {
    .screen {
        padding-top: env(safe-area-inset-top);
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }
    
    .content {
        padding: 12px 15px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: auto;
    }
    
    .avatar-container {
        width: 95px;
        height: 95px;
        margin-bottom: 12px;
    }
    
    .avatar-img {
        width: 80px;
        height: 80px;
    }
    
    .avatar-glow {
        width: 105px;
        height: 105px;
        filter: blur(20px);
    }
    
    .avatar-ring {
        width: 90px;
        height: 90px;
    }
    
    .avatar-sparkle {
        font-size: 12px;
    }
    
    .main-title {
        font-size: 1.9rem;
        margin-bottom: 12px;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .date-text {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .start-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .hint-text {
        margin-top: 20px;
        font-size: 0.8rem;
    }
    
    .screen-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .wish-icon {
        font-size: 50px;
        margin-bottom: 12px;
    }
    
    .cake-emoji {
        font-size: 60px;
    }
    
    .cake-container {
        margin-bottom: 15px;
    }
    
    .screen-text {
        font-size: 0.95rem;
        margin-bottom: 0;
    }
    
    .balloons {
        margin-top: 20px;
        gap: 12px;
    }
    
    .balloon {
        font-size: 30px;
    }
    
    .wish-cards {
        gap: 10px;
        margin: 15px 0;
    }
    
    .wish-card {
        padding: 14px 12px;
        max-width: 230px;
    }
    
    .card-icon {
        font-size: 30px;
        margin-bottom: 6px;
    }
    
    .wish-card p {
        font-size: 0.9rem;
    }
    
    .success-path {
        gap: 8px;
        margin: 15px 0;
    }
    
    .path-item {
        padding: 12px 16px;
        max-width: 160px;
    }
    
    .path-icon {
        font-size: 28px;
        margin-bottom: 6px;
    }
    
    .path-text {
        font-size: 0.85rem;
    }
    
    .path-arrow {
        font-size: 20px;
    }
    
    .stars-container {
        gap: 12px;
        margin: 15px 0;
    }
    
    .star {
        font-size: 32px;
    }
    
    .sparkles {
        font-size: 24px;
        margin-top: 15px;
    }
    
    .nav-hint {
        margin-top: 20px;
        font-size: 0.8rem;
        gap: 10px;
    }
    
    .nav-back, .nav-forward {
        padding: 5px 8px;
    }
    
    .gift-base {
        font-size: 70px;
    }
    
    .gift-container {
        margin-bottom: 15px;
    }
    
    .gift-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .gift-opened-icon {
        font-size: 45px;
        margin-bottom: 12px;
    }
    
    #screen-5 .gift-message {
        padding: 16px 14px;
        max-width: 280px;
    }
    
    .congrats-header {
        margin-bottom: 10px;
        gap: 5px;
    }
    
    .congrats-header h3 {
        font-size: 1.3rem;
    }
    
    .congrats-emoji {
        font-size: 1.3rem;
    }
    
    .gift-main-text {
        font-size: 0.9rem !important;
    }
    
    .gift-note {
        font-size: 0.85rem !important;
        margin-bottom: 10px !important;
    }
    
    .final-wish {
        font-size: 0.95rem;
        margin-top: 10px;
        padding-top: 10px;
    }
}
