* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 25%, #c084fc 50%, #d8b4fe 75%, #e9d5ff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: clamp(1rem, 4vw, 2rem);
    width: 100%;
    box-sizing: border-box;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #ffffff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #ffffff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 20s linear infinite;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

@keyframes sparkle {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

.main-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    min-height: 70vh;
    padding: clamp(1rem, 3vw, 2rem);
    box-sizing: border-box;
}

.birthday-message {
    font-size: clamp(1.8rem, 8vw, 4rem);
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 3rem;
    animation: glow 2s ease-in-out infinite alternate;
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.2;
    text-shadow:
        0 0 20px rgba(139, 92, 246, 0.6),
        0 0 40px rgba(167, 139, 250, 0.4),
        0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(139, 92, 246, 0.5), 0 0 30px rgba(167, 139, 250, 0.4);
    }
    to {
        text-shadow: 0 0 30px rgba(139, 92, 246, 0.8), 0 0 40px rgba(167, 139, 250, 0.6), 0 0 50px rgba(192, 132, 252, 0.4);
    }
}

.secret-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    transform: none;
    background: linear-gradient(145deg, #a78bfa, #8b5cf6);
    color: white;
    border: none;
    padding: clamp(12px, 3vw, 16px) clamp(24px, 5vw, 33px);
    border-radius: 999px;
    font-size: clamp(0.9rem, 2.8vw, 1.1rem);
    font-weight: 800;
    cursor: pointer;
    box-shadow:
        0 18px 40px rgba(139, 92, 246, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.25s ease;
    opacity: 0;
    animation: bounceInUp 1.2s ease-out 0.8s forwards;
    min-width: 170px;
    max-width: 260px;
    margin-top: 0;
    z-index: 300;
}

.secret-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 24px 45px rgba(139, 92, 246, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
}

.secret-button:active {
    transform: translateY(0) scale(0.99);
}


.secret-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 2rem);
    max-width: 700px;
    z-index: 200;
    display: none;
    background: linear-gradient(145deg, #fff1f2, #fce7f3);
    padding: clamp(2rem, 6vw, 4rem);
    border-radius: 30px;
    border: 4px solid #fbb6ce;
    box-shadow: 0 25px 50px rgba(251, 182, 206, 0.4);
    animation: reveal 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

@keyframes bounceInUp {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(50px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.secret-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow:
        0 20px 45px rgba(139, 92, 246, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
}

.secret-button:active {
    transform: translateY(-2px) scale(1);
}

/* Music Control - Spotify Style Player */
.music-player {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: clamp(12px, 3vw, 16px);
    width: clamp(250px, 30vw, 280px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: calc(100vw - 40px);
}

.music-player.minimized {
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 10px;
    right: 10px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.player-title {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.player-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-close:hover {
    color: rgba(255, 255, 255, 1);
    transform: rotate(90deg);
}

.music-player.minimized .player-header,
.music-player.minimized .player-info,
.music-player.minimized .progress-container,
.music-player.minimized .player-controls,
.music-player.minimized .volume-container {
    display: none;
}

.player-info {
    margin-bottom: 12px;
    text-align: center;
}

.song-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-artist {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-container {
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1DB954, #1ed760);
    border-radius: 1px;
    width: 0%;
    transition: width 0.1s linear;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 6px;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.08);
}

.play-btn {
    background: linear-gradient(135deg, #1DB954, #1ed760);
    border: none;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
}

.play-btn:hover {
    background: linear-gradient(135deg, #1ed760, #2ee870);
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.35);
}

.play-btn:active {
    transform: scale(0.93);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

.volume-icon {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    min-width: 18px;
}

.volume-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1DB954, #1ed760);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1DB954, #1ed760);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.4);
}

/* Responsive Design */

/* Large tablets and small laptops */
@media (max-width: 1024px) {
    .music-player {
        width: 260px;
        top: 15px;
        right: 15px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .main-container {
        min-height: 60vh;
        padding: 1rem;
    }

    .birthday-message {
        font-size: clamp(1.5rem, 6vw, 3rem);
        margin-bottom: 2rem;
    }

    .music-player {
        width: 240px;
        top: 10px;
        right: 10px;
        padding: 12px;
    }

    .secret-button {
        margin-top: 2rem;
        padding: 16px 30px;
        font-size: 1.1rem;
        max-width: 280px;
    }

    .modal-content {
        padding: 2rem;
        width: 90%;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Mobile phones - fixed position in lower right */
@media (max-width: 480px) {
    .secret-button {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        margin-top: 0 !important;
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
        min-width: 180px !important;
        z-index: 300 !important;
    }
}

/* Small mobile phones */
@media (max-width: 360px) {
    .birthday-message {
        font-size: clamp(1rem, 9vw, 2rem);
    }

    .music-player {
        width: calc(100vw - 10px);
        padding: 8px;
    }

    .secret-button {
        position: fixed !important;
        bottom: 15px !important;
        right: 15px !important;
        left: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        margin-top: 0 !important;
        padding: 10px 18px !important;
        font-size: 0.85rem !important;
        min-width: 160px !important;
        z-index: 300 !important;
    }

    .modal-content {
        padding: 1rem;
    }

    .secret-message {
        padding: 1rem;
    }
}

/* Password Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: clamp(1rem, 4vw, 2rem);
    box-sizing: border-box;
}

.modal-content {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    padding: clamp(2rem, 6vw, 4rem);
    border-radius: 25px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid rgba(139, 92, 246, 0.4);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal h2 {
    color: #6b46c1;
    margin-bottom: 1.5rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input {
    width: 100%;
    padding: clamp(14px, 3vw, 18px);
    font-size: clamp(1rem, 3vw, 1.3rem);
    border: 3px solid #d8b4fe;
    border-radius: 25px;
    margin-bottom: 1.5rem;
    text-align: center;
    transition: all 0.25s ease;
    background: linear-gradient(145deg, #ffffff, #f5f3ff);
    box-shadow: inset 0 0 15px rgba(143, 70, 255, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

.password-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.45), inset 0 0 6px rgba(124, 58, 237, 0.1);
    transform: scale(1.01);
}

#togglePassword {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(124, 58, 237, 0.45);
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(124, 58, 237, 0.35));
    color: #4c1d95;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    min-width: 64px;
}

#togglePassword:hover {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.35), rgba(124, 58, 237, 0.55));
    color: #fff;
}

#togglePassword:active {
    transform: translateY(-50%) scale(0.96);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 35px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: 140px;
}

.btn-primary {
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.5);
    transform: translateY(-3px);
}

.btn-secondary {
    background: linear-gradient(145deg, #e2e8f0, #cbd5e0);
    color: #4a5568;
}

.btn-secondary:hover {
    background: linear-gradient(145deg, #cbd5e0, #a0aec0);
    transform: translateY(-3px);
}

/* Secret Message */
.secret-message {
    display: none;
    background: linear-gradient(145deg, #fff1f2, #fce7f3);
    padding: clamp(2rem, 6vw, 4rem);
    border-radius: 30px;
    margin: 2rem 0;
    border: 4px solid #fbb6ce;
    box-shadow: 0 25px 50px rgba(251, 182, 206, 0.4);
    animation: reveal 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 700px;
    width: 100%;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.secret-message h3 {
    color: #be185d;
    font-size: clamp(1.4rem, 4vw, 2rem);
    margin-bottom: 1.5rem;
}

.secret-message p {
    color: #4c1d95;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hearts {
    font-size: clamp(2rem, 6vw, 3rem);
    animation: heartbeat 1.5s ease-in-out infinite;
    margin: 1.5rem 0;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Additional responsive adjustments for existing elements */
@media (max-width: 768px) {
    .modal-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .birthday-message {
        margin-bottom: 1.5rem;
    }

    .secret-button {
        padding: 14px 25px;
        font-size: 1rem;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
        max-width: 180px;
        padding: 12px 25px;
        font-size: 1rem;
    }

    .secret-message h3 {
        font-size: 1.2rem;
    }

    .secret-message p {
        font-size: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .secret-button, .btn-primary {
        border: 3px solid #ffffff;
    }

    .password-input {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.secret-button:focus,
.btn:focus,
.password-input:focus,
.music-control:focus {
    outline: 4px solid #ffffff;
    outline-offset: 4px;
}

/* Ensure proper viewport handling */
html {
    height: 100%;
    overflow-x: hidden;
}

/* Handle landscape orientation on mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 0.5rem;
    }

    .main-container {
        min-height: 80vh;
        padding: 0.5rem;
    }

    .birthday-message {
        font-size: clamp(1rem, 5vw, 2rem);
        margin-bottom: 1rem;
    }

    .music-player {
        top: 2px;
        right: 2px;
        width: calc(100vw - 4px);
        max-width: 250px;
    }

    .secret-button {
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        margin-top: 0 !important;
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
        min-width: 140px !important;
        z-index: 300 !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .secret-button:hover,
    .btn:hover,
    .control-btn:hover {
        transform: none;
    }

    .secret-button:active,
    .btn:active,
    .control-btn:active {
        transform: scale(0.98);
    }
}

/* High resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body::before {
        background-size: 150px 75px;
    }
}