/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    overflow-x: hidden;
}

/* Animowane tło kosmiczne */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #FF6B35, transparent),
        radial-gradient(2px 2px at 40px 70px, #F7931E, transparent),
        radial-gradient(1px 1px at 90px 40px, #FFFFFF, transparent),
        radial-gradient(1px 1px at 130px 80px, #FF6B35, transparent),
        radial-gradient(2px 2px at 160px 30px, #F7931E, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: stars 20s linear infinite;
    z-index: -1;
}

@keyframes stars {
    from { transform: translateY(0px); }
    to { transform: translateY(-100px); }
}

.container {
    background: rgba(22, 33, 62, 0.9);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #FF6B35;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255, 107, 53, 0.5); }
    to { text-shadow: 0 0 30px rgba(255, 107, 53, 0.8); }
}

.instruction {
    font-size: 1.1rem;
    color: #FFFFFF;
    margin-bottom: 30px;
    line-height: 1.6;
}

.attempts-counter {
    font-size: 1.3rem;
    font-weight: bold;
    color: #F7931E;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(247, 147, 30, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(247, 147, 30, 0.3);
}

.input-container {
    margin-bottom: 30px;
}

#numberInput {
    width: 100%;
    height: 60px;
    font-size: 1.2rem;
    text-align: center;
    background: rgba(22, 33, 62, 0.8);
    border: 2px solid #FF6B35;
    border-radius: 15px;
    color: #FFFFFF;
    padding: 0 20px;
    transition: all 0.3s ease;
}

#numberInput:focus {
    outline: none;
    border-color: #F7931E;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    transform: scale(1.02);
}

#numberInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    height: 60px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
    background: linear-gradient(45deg, #FF6B35, #F7931E);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #F7931E, #FF6B35);
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #FF6B35;
    border: 2px solid #FF6B35;
}

.btn-secondary:hover {
    background: #FF6B35;
    color: white;
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.3);
}

.message {
    min-height: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.message.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.message.error {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border: 2px solid rgba(244, 67, 54, 0.3);
}

.message.info {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    border: 2px solid rgba(33, 150, 243, 0.3);
}

.history {
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.history-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item.correct {
    color: #4CAF50;
    font-weight: bold;
}

.history-item.incorrect {
    color: #F44336;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1A1A2E, #16213E);
    margin: 15% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 2px solid #FF6B35;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    color: #FF6B35;
    margin-bottom: 20px;
    font-size: 2rem;
}

.modal-content p {
    color: #FFFFFF;
    margin-bottom: 30px;
    line-height: 1.6;
    font-size: 1.1rem;
}

/* Responsywność */
@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .btn {
        font-size: 1rem;
        height: 50px;
    }
    
    #numberInput {
        height: 50px;
        font-size: 1rem;
    }
}

/* Animacje wejścia */
.container {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Efekty hover dla elementów interaktywnych */
.btn, #numberInput {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar styling */
.history::-webkit-scrollbar {
    width: 8px;
}

.history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.history::-webkit-scrollbar-thumb {
    background: #FF6B35;
    border-radius: 4px;
}

.history::-webkit-scrollbar-thumb:hover {
    background: #F7931E;
}
