* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(180deg, #0b1437 0%, #1a2a6c 40%, #2a1a5e 70%, #4a1a5e 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 70px 20px 20px;
}

body::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 40px 70px, #fff, transparent),
        radial-gradient(2px 2px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, #fff, transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    opacity: 0.4;
    animation: twinkle 4s infinite alternate;
    pointer-events: none;
}

@keyframes twinkle {
    from { opacity: 0.2; }
    to { opacity: 0.6; }
}

#snow {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.garland {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 0 10px;
    z-index: 5;
}

.garland span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff3b3b;
    box-shadow: 0 0 12px #ff3b3b, 0 0 20px #ff3b3b;
    animation: blink 1.5s infinite;
    position: relative;
}

.garland span::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: #333;
}

.garland span:nth-child(3n) { background: #3bff6d; box-shadow: 0 0 12px #3bff6d, 0 0 20px #3bff6d; }
.garland span:nth-child(3n+1) { background: #ffd93b; box-shadow: 0 0 12px #ffd93b, 0 0 20px #ffd93b; }
.garland span:nth-child(2n) { animation-delay: 0.3s; }
.garland span:nth-child(3n) { animation-delay: 0.6s; }
.garland span:nth-child(4n) { animation-delay: 0.9s; }

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.9); }
}

.controls {
    position: fixed;
    top: 70px;
    right: 15px;
    z-index: 20;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 217, 59, 0.6);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 217, 59, 0.2);
    transform: scale(1.1);
}

.control-btn.playing {
    animation: pulseBtn 1.5s infinite;
}

@keyframes pulseBtn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 217, 59, 0.7); }
    50% { box-shadow: 0 0 0 12px rgba(255, 217, 59, 0); }
}

.container {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 1000px;
    width: 100%;
    padding: 20px;
    animation: fadeIn 1.5s ease-out;
}

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

.title {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(2rem, 6vw, 4.5rem);
    color: #fff;
    text-shadow: 0 0 20px #ffd93b, 0 0 40px #ffd93b, 0 0 60px #ff8c00;
    margin-bottom: 5px;
    line-height: 1.2;
}

.subtitle {
    font-size: clamp(1.4rem, 4vw, 2.5rem);
    font-weight: 900;
    background: linear-gradient(90deg, #ffd93b, #fff, #ffd93b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
    letter-spacing: 4px;
    animation: shine 3s linear infinite;
    background-size: 200% auto;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.countdown {
    display: flex;
    justify-content: center;
    gap: clamp(8px, 2vw, 25px);
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.time-box {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 217, 59, 0.5);
    border-radius: 18px;
    padding: clamp(12px, 3vw, 28px) clamp(8px, 2.5vw, 22px);
    min-width: clamp(70px, 20vw, 130px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 30px rgba(255, 217, 59, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.time-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(255, 217, 59, 0.3), inset 0 0 30px rgba(255, 217, 59, 0.2);
}

.time-value {
    font-size: clamp(1.7rem, 5.5vw, 3.5rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 15px #ffd93b;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-bottom: 6px;
}

.time-label {
    font-size: clamp(0.65rem, 1.8vw, 1rem);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffd93b;
    font-weight: 700;
}

.tree-wrap {
    display: flex;
    justify-content: center;
    margin: 20px 0 25px;
    perspective: 800px;
}

.tree {
    position: relative;
    width: 120px;
    height: 160px;
    animation: treeFloat 3s ease-in-out infinite;
}

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

.star {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    filter: drop-shadow(0 0 12px #ffd93b);
    animation: starPulse 1.5s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.25); }
}

.tree-layer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 55px solid transparent;
    border-right: 55px solid transparent;
    border-bottom: 55px solid #0e7a3a;
    filter: drop-shadow(0 0 8px rgba(59, 255, 109, 0.4));
}

.layer-1 {
    top: 5px;
    border-left-width: 45px;
    border-right-width: 45px;
    border-bottom-width: 48px;
    border-bottom-color: #12a04d;
}

.layer-2 {
    top: 40px;
    border-left-width: 55px;
    border-right-width: 55px;
    border-bottom-width: 55px;
    border-bottom-color: #0e7a3a;
}

.layer-3 {
    top: 80px;
    border-left-width: 65px;
    border-right-width: 65px;
    border-bottom-width: 60px;
    border-bottom-color: #0a5f2c;
}

.tree-layer::before,
.tree-layer::after {
    content: '🔴';
    position: absolute;
    font-size: 0.7rem;
    top: -30px;
}

.tree-layer::before { left: -40px; }
.tree-layer::after { right: -40px; }

.layer-2::before { content: '🟡'; left: -45px; top: -35px; }
.layer-2::after { content: '🔵'; right: -45px; top: -35px; }

.layer-3::before { content: '🟢'; left: -55px; top: -40px; }
.layer-3::after { content: '🟣'; right: -55px; top: -40px; }

.tree-trunk {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 20px;
    background: #5a3a1a;
    border-radius: 0 0 4px 4px;
}

.greeting {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: #fff;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(255, 217, 59, 0.5);
    animation: pulse 2s ease-in-out infinite;
    margin-bottom: 25px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.wish-box {
    background: rgba(255, 255, 255, 0.06);
    border: 2px dashed rgba(255, 217, 59, 0.4);
    border-radius: 18px;
    padding: 20px 18px;
    margin: 0 auto 25px;
    max-width: 560px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.wish-label {
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffd93b;
    margin-bottom: 12px;
    font-weight: 700;
}

.wish-text {
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    line-height: 1.5;
    margin-bottom: 15px;
    min-height: 50px;
    transition: opacity 0.4s ease;
}

.wish-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(90deg, #ff3b3b, #ffd93b);
    color: #1a1a1a;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 217, 59, 0.4);
    transition: all 0.3s ease;
}

.wish-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 217, 59, 0.6);
}

.wish-btn:active {
    transform: translateY(0);
}

.share {
    margin-top: 10px;
}

.share-label {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.08);
}

.share-btn.vk { background: #0077ff; }
.share-btn.tg { background: #229ed9; }
.share-btn.wa { background: #25d366; }
.share-btn.copy { background: rgba(255, 255, 255, 0.15); border: 2px solid rgba(255, 217, 59, 0.6); font-size: 1.2rem; }

.share-btn.copy.copied {
    background: #3bff6d;
    color: #1a1a1a;
}

.footer {
    position: relative;
    z-index: 10;
    padding: 15px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

body.happy-new-year .title {
    animation: celebrate 1s ease-in-out infinite alternate;
}

@keyframes celebrate {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(59, 255, 109, 0.95);
    color: #1a1a1a;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: transform 0.4s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ===== Блок поздравления ===== */
.congrats-block {
    animation: fadeIn 1s ease-out;
}

.congrats-card {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 59, 59, 0.15), rgba(255, 217, 59, 0.15), rgba(59, 184, 255, 0.15));
    border: 2px solid rgba(255, 217, 59, 0.6);
    border-radius: 24px;
    padding: clamp(25px, 5vw, 45px) clamp(20px, 4vw, 40px);
    margin: 0 auto 30px;
    max-width: 680px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 60px rgba(255, 217, 59, 0.1);
    overflow: hidden;
}

.congrats-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 217, 59, 0.15),
        transparent,
        rgba(255, 59, 59, 0.15),
        transparent,
        rgba(59, 184, 255, 0.15),
        transparent
    );
    animation: rotateGlow 8s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotateGlow {
    to { transform: rotate(360deg); }
}

.congrats-content {
    position: relative;
    z-index: 2;
}

.congrats-badge {
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ffd93b, #fff, #ff3b3b, #ffd93b);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(255, 217, 59, 0.5));
}

.congrats-text {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(1.6rem, 4.5vw, 2.8rem);
    line-height: 1.35;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 217, 59, 0.6), 0 0 40px rgba(255, 59, 59, 0.3);
    transition: opacity 0.6s ease, transform 0.6s ease;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.congrats-text.fade-out {
    opacity: 0;
    transform: translateY(-15px) scale(0.95);
}

.congrats-text.fade-in {
    animation: textAppear 0.7s ease-out;
}

@keyframes textAppear {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.congrats-decor {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    opacity: 0.7;
    animation: decorFloat 3s ease-in-out infinite;
    z-index: 2;
}

@keyframes decorFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
    50% { transform: translateY(-8px) rotate(15deg); opacity: 1; }
}

.congrats-hint {
    font-size: 0.85rem;
    opacity: 0.6;
    letter-spacing: 1.5px;
    margin-top: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@media (max-width: 480px) {
    body { padding: 65px 12px 15px; }
    .countdown { gap: 6px; }
    .time-box {
        min-width: 68px;
        padding: 12px 8px;
        border-radius: 14px;
    }
    .garland span { width: 10px; height: 10px; }
    .controls { top: 62px; right: 10px; }
    .control-btn { width: 42px; height: 42px; font-size: 1.1rem; }
    .tree { transform: scale(0.85); }
    .share-btn { width: 44px; height: 44px; font-size: 0.8rem; }
    .congrats-card {
        border-radius: 18px;
        padding: 25px 18px;
    }
    .congrats-text {
        min-height: 3em;
        font-size: 1.4rem;
    }
    .congrats-decor {
        font-size: 1.1rem;
        top: 10px;
        right: 12px;
    }
}

@media (min-width: 481px) and (max-width: 1024px) {
    .time-box { min-width: 100px; }
}