:root {
    --bg-dark: #05070a;
    --bg-gradient: radial-gradient(circle at 50% 0%, #1a2a44 0%, #05070a 100%);
    
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    
    --glass-bg: rgba(20, 30, 50, 0.4);
    --glass-border: rgba(100, 200, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --accent-blue: #00f2fe;
    --accent-purple: #4facfe;
    --accent-pink: #ff4757;
    --accent-glow: 0 0 20px rgba(0, 242, 254, 0.5);
    
    --btn-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --card-hover: rgba(40, 60, 90, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #020305;
}
::-webkit-scrollbar-thumb {
    background: #2a4a70;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#fireworks-canvas {
    z-index: 2;
}

.bg-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at bottom right, rgba(79, 172, 254, 0.1), transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.bg-icons {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-icons i {
    position: absolute;
    color: rgba(255, 255, 255, 0.03);
    transition: transform 0.1s linear;
}

.layer-1 { font-size: 4rem; filter: blur(3px); z-index: 3; }
.layer-2 { font-size: 2.5rem; filter: blur(1px); z-index: 2; }
.layer-3 { font-size: 1.5rem; opacity: 0.5; z-index: 1; }


#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #05070a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.preloader-content {
    text-align: center;
    position: relative;
}

.preloader-content i {
    font-size: 5rem;
    background: var(--btn-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.3));
}

.preloader-content h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.preloader-content p {
    color: var(--text-muted);
    font-size: 1rem;
    animation: blink 2s infinite;
}

@keyframes blink { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

.container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 20px 60px;
}

.music-player {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 100;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 380px;
}

.music-player:hover {
    box-shadow: 0 10px 40px rgba(0, 242, 254, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.player-icon {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-size: 1.2rem;
}

.player-info {
    flex-grow: 1;
    overflow: hidden;
}

#track-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.player-controls {
    display: flex;
    gap: 15px;
}

.player-controls button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.player-controls button:hover {
    color: var(--accent-blue);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

#mute-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.volume-slider-wrapper {
    width: 60px;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: var(--accent-blue);
    margin-top: -4px;
    box-shadow: 0 0 10px var(--accent-blue);
    cursor: pointer;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.hero-section {
    text-align: center;
    margin-bottom: 60px;
}

.main-title {
    font-family: 'Oswald', sans-serif;
    font-size: 3.5rem;
    text-transform: uppercase;
    background: linear-gradient(to bottom, #ffffff 0%, #b0c4de 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
    filter: drop-shadow(0 0 20px rgba(176, 196, 222, 0.3));
}

.countdown-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 30px 60px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.time-block span {
    font-family: 'Oswald', sans-serif;
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-blue);
    text-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
}

.time-block small {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 10px;
}

.separator {
    font-size: 3rem;
    color: rgba(255,255,255,0.2);
    margin-top: -30px;
}

.online-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-radius: 50px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #2ed573;
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(46, 213, 115, 0.4);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(46, 213, 115, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0); }
}

.glow-text {
    font-family: 'Oswald', sans-serif;
    font-size: 5rem;
    color: #fff;
    text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 40px #00f2fe, 0 0 80px #00f2fe;
    animation: neon-pulse 1.5s infinite alternate;
}

@keyframes neon-pulse {
    from { text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 40px #00f2fe; }
    to { text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #00f2fe; }
}

.fun-section {
    max-width: 900px;
    margin: 0 auto 80px;
}

.fun-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.fun-card {
    padding: 30px;
    text-align: center;
    transition: transform 0.3s, background 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fun-card:hover {
    transform: translateY(-5px);
    background: rgba(40, 60, 90, 0.5);
    border-color: var(--accent-blue);
}

.fun-icon {
    font-size: 3rem;
    color: var(--accent-blue);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.4));
}

.fun-card h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.fun-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
}

.action-btn {
    padding: 10px 25px;
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.action-btn:hover {
    background: var(--accent-blue);
    color: #000;
    box-shadow: 0 0 15px var(--accent-blue);
}

.wishes-section {
    max-width: 700px;
    margin: 0 auto 80px;
}

.section-title {
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem;
    margin-bottom: 30px;
    color: var(--text-main);
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.glass-form {
    padding: 30px;
}

.form-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.avatar-upload {
    position: relative;
    text-align: center;
}

.avatar-preview {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2px dashed rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview i {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.upload-btn {
    font-size: 0.75rem;
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: underline;
}

.user-info {
    flex-grow: 1;
}

input[type="text"], textarea {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
    background: rgba(0,0,0,0.5);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    margin-top: 20px;
    border: none;
    border-radius: 12px;
    background: var(--btn-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 242, 254, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 242, 254, 0.5);
}

.wishes-feed {
    padding-bottom: 50px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.wish-card {
    background: rgba(30, 40, 60, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
    padding-bottom: 60px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.wish-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.wish-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: var(--card-hover);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
}

.wish-card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid var(--accent-purple);
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.3);
}

.card-nickname {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
}

.card-message {
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.card-date {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    text-align: right;
    font-style: italic;
    margin-top: auto;
}

.wish-actions {
    position: absolute;
    bottom: 20px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.like-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-btn:hover {
    transform: scale(1.1);
    color: #fff;
}

.like-btn.liked {
    color: var(--accent-pink);
    animation: like-bounce 0.4s;
}

.like-btn.liked i {
    font-weight: 900;
}

@keyframes like-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.like-count {
    font-size: 1rem;
    font-weight: 600;
}

.pagination-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px 25px;
    margin: 0 auto;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.page-btn {
    background: none;
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

#page-info {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent-blue);
}

.share-section {
    max-width: 600px;
    margin: 0 auto 60px;
    text-align: center;
}

.share-panel {
    padding: 30px;
}

.share-panel h3 {
    font-family: 'Oswald', sans-serif;
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: transform 0.2s, opacity 0.2s;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-btn.tg { background: #0088cc; }
.share-btn.copy { background: #34495e; }

.main-footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 250px;
    padding: 15px 20px;
    background: rgba(20, 30, 40, 0.95);
    border-left: 4px solid var(--accent-blue);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease forwards;
    backdrop-filter: blur(10px);
}

.toast.error {
    border-color: #ff4757;
}

.toast.success {
    border-color: #2ed573;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    to { transform: translateX(100%); opacity: 0; }
}

@media (max-width: 768px) {
    .container {
        padding-top: 20px;
        padding-bottom: 120px;
    }

    .music-player {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 40px);
        padding: 15px;
        z-index: 900;
    }
    
    .music-player:hover {
        transform: translateX(-50%) scale(1.02);
    }

    .main-title {
        font-size: 2.5rem;
    }

    .countdown-container {
        padding: 20px 10px;
        gap: 5px;
    }

    .time-block span {
        font-size: 2.8rem;
    }
    
    .separator {
        font-size: 2rem;
        margin-top: -15px;
    }

    .wishes-section {
        margin-bottom: 40px;
    }
    
    .fun-grid {
        grid-template-columns: 1fr;
    }
}