@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    padding: 0;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Модерни фонови елементи */
body::before {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 218, 220, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: -300px;
    right: -200px;
    animation: floatSlow 25s infinite ease-in-out;
    filter: blur(60px);
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 183, 197, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -250px;
    left: -150px;
    animation: floatSlow 20s infinite ease-in-out reverse;
    filter: blur(60px);
    pointer-events: none;
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translate(30px, 30px) scale(1.05);
        opacity: 0.8;
    }
}

.container {
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 20px;
}

/* Header - Неоморфичен стил */
.header {
    background: #f5f7fa;
    border-radius: 24px;
    padding: 24px 32px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow:
        8px 8px 16px rgba(163, 177, 198, 0.3),
        -8px -8px 16px rgba(255, 255, 255, 0.9);
}

.level-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    padding: 12px 24px;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
    box-shadow:
        4px 4px 8px rgba(69, 123, 157, 0.3),
        -2px -2px 6px rgba(255, 255, 255, 0.5);
}

.level-icon {
    font-size: 1.4rem;
    animation: gentlePulse 3s infinite ease-in-out;
}

@keyframes gentlePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.level-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #457b9d;
    letter-spacing: 0.5px;
}

.reset-btn {
    background: #f5f7fa;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.4),
        -4px -4px 8px rgba(255, 255, 255, 0.9);
}

.reset-btn:hover {
    transform: rotate(180deg) scale(1.05);
    box-shadow:
        6px 6px 12px rgba(163, 177, 198, 0.5),
        -6px -6px 12px rgba(255, 255, 255, 1);
}

.reset-btn:active {
    box-shadow:
        inset 3px 3px 6px rgba(163, 177, 198, 0.4),
        inset -3px -3px 6px rgba(255, 255, 255, 0.9);
}

/* Избор на нива */
.level-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
}

.level-btn {
    flex: 1;
    background: #f5f7fa;
    border: none;
    border-radius: 16px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        6px 6px 12px rgba(163, 177, 198, 0.3),
        -6px -6px 12px rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.level-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        8px 8px 16px rgba(163, 177, 198, 0.35),
        -8px -8px 16px rgba(255, 255, 255, 1);
}

.level-btn:active {
    transform: translateY(0);
    box-shadow:
        inset 4px 4px 8px rgba(163, 177, 198, 0.3),
        inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}

.level-btn.active {
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    box-shadow:
        4px 4px 12px rgba(69, 123, 157, 0.4),
        -2px -2px 8px rgba(255, 255, 255, 0.6);
}

.level-btn.active .level-btn-number,
.level-btn.active .level-btn-name {
    color: white;
}

.level-btn-number {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #457b9d 0%, #a8dadc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.level-btn-name {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}


/* Прогрес бар */
.progress-container {
    background: #f5f7fa;
    border-radius: 20px;
    padding: 20px 28px;
    margin-bottom: 20px;
    box-shadow:
        8px 8px 16px rgba(163, 177, 198, 0.3),
        -8px -8px 16px rgba(255, 255, 255, 0.9);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.progress-bar {
    height: 28px;
    background: #e4e9f2;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    box-shadow:
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.5);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #69d2e7 0%, #a7dbd8 50%, #69d2e7 100%);
    background-size: 200% 100%;
    border-radius: 50px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Основна карта */
.card {
    background: #f5f7fa;
    border-radius: 28px;
    padding: 48px;
    box-shadow:
        12px 12px 24px rgba(163, 177, 198, 0.4),
        -12px -12px 24px rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.question-container {
    text-align: center;
    margin-bottom: 36px;
}

.question {
    font-size: 3.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #457b9d 0%, #a8dadc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -1px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.answer-input {
    width: 100%;
    padding: 24px;
    font-size: 2.8rem;
    text-align: center;
    border: none;
    background: #f5f7fa;
    border-radius: 18px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    color: #2d3748;
    font-family: 'Inter', sans-serif;
    box-shadow:
        inset 6px 6px 12px rgba(163, 177, 198, 0.3),
        inset -6px -6px 12px rgba(255, 255, 255, 0.9);
}

.answer-input:focus {
    box-shadow:
        inset 8px 8px 16px rgba(163, 177, 198, 0.4),
        inset -8px -8px 16px rgba(255, 255, 255, 1),
        0 0 0 4px rgba(168, 218, 220, 0.2);
    transform: scale(1.01);
}

.submit-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    color: white;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        6px 6px 12px rgba(69, 123, 157, 0.3),
        -3px -3px 8px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        8px 8px 16px rgba(69, 123, 157, 0.4),
        -4px -4px 10px rgba(255, 255, 255, 0.6);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow:
        4px 4px 8px rgba(69, 123, 157, 0.3),
        -2px -2px 6px rgba(255, 255, 255, 0.5);
}

.btn-icon {
    font-size: 1.6rem;
}

/* Съобщения за резултат */
.result-message {
    margin-top: 24px;
    padding: 18px;
    border-radius: 16px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-message.show {
    opacity: 1;
    transform: scale(1);
}

.result-message.correct {
    background: linear-gradient(135deg, #69d2e7 0%, #a7dbd8 100%);
    color: white;
    animation: bounce 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        4px 4px 12px rgba(105, 210, 231, 0.3),
        -2px -2px 8px rgba(255, 255, 255, 0.5);
}

.result-message.wrong {
    background: linear-gradient(135deg, #ffb7b2 0%, #ffa69e 100%);
    color: white;
    animation: shake 0.5s ease;
    box-shadow:
        4px 4px 12px rgba(255, 166, 158, 0.3),
        -2px -2px 8px rgba(255, 255, 255, 0.5);
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

/* Статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-item {
    background: #f5f7fa;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow:
        6px 6px 12px rgba(163, 177, 198, 0.3),
        -6px -6px 12px rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow:
        8px 8px 16px rgba(163, 177, 198, 0.35),
        -8px -8px 16px rgba(255, 255, 255, 1);
}

.stat-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #457b9d 0%, #a8dadc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Конфети canvas */
#confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 600px) {
    .question {
        font-size: 2.8rem;
    }

    .answer-input {
        font-size: 2.2rem;
        padding: 18px;
    }

    .submit-btn {
        font-size: 1.2rem;
        padding: 16px;
    }

    .card {
        padding: 32px;
    }

    .level-badge {
        font-size: 0.9rem;
        padding: 10px 18px;
    }

    .level-name {
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.8rem;
    }
}

/* Хедър на приложението */
.app-header {
    width: 100%;
    background: #f5f7fa;
    padding: 32px 20px;
    text-align: center;
    box-shadow:
        0 8px 16px rgba(163, 177, 198, 0.2),
        0 -4px 8px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 10;
}

.app-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #457b9d 0%, #a8dadc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Футър на приложението */
.app-footer {
    width: 100%;
    background: #f5f7fa;
    padding: 32px 20px;
    text-align: center;
    box-shadow:
        0 -8px 16px rgba(163, 177, 198, 0.2),
        0 4px 8px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 10;
    margin-top: auto;
}

.footer-text {
    font-size: 1rem;
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 8px;
}

.footer-link {
    color: #457b9d;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
}

.footer-link:hover {
    color: #a8dadc;
}

.footer-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #457b9d 0%, #a8dadc 100%);
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #a0aec0;
    font-weight: 500;
}

/* Responsive за хедър и футър */
@media (max-width: 600px) {
    .app-title {
        font-size: 1.6rem;
    }

    .app-subtitle {
        font-size: 0.95rem;
    }

    .app-header,
    .app-footer {
        padding: 24px 16px;
    }
}