/* ===== Базовые стили ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    background-color: #fff9f9;
    text-align: center;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ===== Контейнеры экранов ===== */
.container {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.screen {
    display: none;
    padding: 30px 25px;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: translateY(10px);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    position: relative;
}

/* ===== Элементы интерфейса ===== */
h1, h2 {
    color: #d23669;
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 22px;
}

p {
    margin-bottom: 15px;
    color: #555;
}

/* ===== Кнопки ===== */
button {
    background: linear-gradient(135deg, #ff6b6b, #d23669);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin: 20px auto 0;
    width: 100%;
    max-width: 280px;
    box-shadow: 0 4px 12px rgba(210, 54, 105, 0.3);
    transition: all 0.3s ease;
    display: block;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(210, 54, 105, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #ddd;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

/* ===== Вопросы и ответы ===== */
#question-text {
    font-size: 20px;
    margin: 25px 0;
    color: #333;
    font-weight: 600;
}

#answers {
    margin: 25px 0;
}

.answer-option {
    background: #f8f8f8;
    padding: 16px;
    margin: 12px 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.answer-option:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.answer-option:active {
    transform: translateY(0);
}

input[type="text"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 16px;
    margin: 15px 0;
    transition: border 0.3s ease;
}

input[type="text"]:focus {
    border-color: #ff6b6b;
    outline: none;
}

/* ===== Прогресс-бар ===== */
.progress-bar {
    height: 8px;
    background: #f0f0f0;
    margin: 25px 0;
    border-radius: 4px;
    overflow: hidden;
}

#progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #d23669);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

/* ===== Информация об игроке ===== */
#player-info {
    font-size: 20px;
    margin-bottom: 15px;
    color: #666;
}

#player-name {
    font-weight: 700;
    margin-left: 5px;
}

/* ===== Экран результата ===== */
#code {
    font-size: 26px;
    font-weight: 800;
    color: #d23669;
    margin: 20px 0;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== Попап ===== */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup.active {
    display: flex;
    opacity: 1;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 350px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    text-align: center;
}

.popup.active .popup-content {
    transform: scale(1);
}

#popup-message {
    margin-bottom: 20px;
    font-size: 18px;
}

/* ===== Админ-панель ===== */
.admin-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

#admin-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    font-size: 20px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

#admin-menu {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    margin-top: 15px;
    width: 280px;
    display: none;
    position: absolute;
    right: 0;
    bottom: 100%;
}

#admin-menu input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
}

#jump-btn {
    background: #4a90e2;
    margin: 0;
    padding: 12px;
}

/* ===== Анимации ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* ===== Адаптация ===== */
@media (max-width: 480px) {
    body {
        font-size: 16px;
        padding: 15px;
    }

    .container {
        border-radius: 12px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 20px;
    }

    button {
        padding: 12px 20px;
        font-size: 16px;
    }

    #admin-menu {
        width: 250px;
    }
}
