* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c, #4ecdc4);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    background-size: 50px 50px;
    animation: twinkle 4s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

.floating-shape:nth-child(1) {
    width: 20px;
    height: 20px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-shape:nth-child(2) {
    width: 30px;
    height: 30px;
    top: 20%;
    right: 15%;
    animation-delay: 2s;
    background: rgba(255, 255, 255, 0.15);
}

.floating-shape:nth-child(3) {
    width: 15px;
    height: 15px;
    bottom: 25%;
    left: 20%;
    animation-delay: 4s;
}

.floating-shape:nth-child(4) {
    width: 25px;
    height: 25px;
    bottom: 15%;
    right: 10%;
    animation-delay: 1s;
    background: rgba(255, 255, 255, 0.12);
}

.floating-shape:nth-child(5) {
    width: 18px;
    height: 18px;
    top: 40%;
    left: 70%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1 {
    font-size: 2.8rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 400;
}

.difficulty-container {
    margin-bottom: 25px;
}

#difficulty {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

#difficulty:focus {
    border-color: #667eea;
    outline: none;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 35px;
    justify-content: center;
    flex-wrap: wrap;
}

#guess-input {
    flex: 1;
    min-width: 200px;
    padding: 18px;
    font-size: 1.3rem;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.8);
}

#guess-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: scale(1.02);
}

#guess-input:hover {
    border-color: #5a67d8;
}

#guess-btn {
    padding: 18px 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

#guess-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#guess-btn:hover::before {
    left: 100%;
}

#guess-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

#guess-btn:active {
    transform: translateY(-1px);
}

#guess-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.message {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 15px;
    padding: 15px;
}

.message.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.message.too-high {
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.message.too-low {
    color: #fff;
    background: linear-gradient(135deg, #ffd93d, #ffb347);
    box-shadow: 0 8px 20px rgba(255, 217, 61, 0.3);
}

.message.correct {
    color: #fff;
    background: linear-gradient(135deg, #6bcf7f, #4ecdc4);
    box-shadow: 0 8px 20px rgba(107, 207, 127, 0.3);
    animation: celebrate 0.8s ease;
}

.message.error {
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

@keyframes celebrate {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-10px) scale(1.05); }
    50% { transform: translateY(-5px) scale(1.02); }
    75% { transform: translateY(-15px) scale(1.08); }
}

.attempts {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 35px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.attempts::before {
    content: '🎯';
    font-size: 1.5rem;
}

#reset-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 237, 234, 0.3);
}

#reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 237, 234, 0.4);
}

#reset-btn:active {
    transform: translateY(0);
}

@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
        margin: 10px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .input-group {
        flex-direction: column;
        gap: 12px;
    }

    #guess-input {
        font-size: 1.1rem;
        min-width: auto;
    }

    #guess-btn {
        font-size: 1rem;
        padding: 15px 25px;
    }

    .message {
        font-size: 1.2rem;
        min-height: 60px;
    }

    .attempts {
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 25px 15px;
    }
}