/* Глобальные стили */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #F2F3F5;
    color: #1C1C28;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* overflow: hidden;  <-- УБРАНО */
}

#app {
    width: 100%;
    max-width: 400px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #F2F3F5;
    position: relative;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    z-index: 10;
    background-color: #F2F3F5; /* Добавим фон, чтобы контент под ним не просвечивал при скролле */
}

.progress-bar-container {
    flex-grow: 1;
    height: 8px;
    background-color: #E0E0E0;
    border-radius: 4px;
    margin-right: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #C6A664;
    border-radius: 4px;
    transition: width 0.3s ease-in-out;
}

.balance {
    font-weight: bold;
}

/* Основной контент */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ИЗМЕНЕНО: контент начинается сверху */
    align-items: center;
    padding: 20px;
    padding-top: 80px;  /* Отступ от фиксированной шапки */
    padding-bottom: 100px; /* Отступ от фиксированного меню */
    box-sizing: border-box;
    overflow-y: auto; /* ДОБАВЛЕНО: Включаем скролл, если нужно */
}

.question-card {
    background-color: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 350px;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0; /* Предотвращает сжатие карточки на маленьких экранах */
}

.question-text {
    font-size: 1.2em;
    line-height: 1.5;
    margin: 0;
}

.answer-options {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 350px;
    flex-shrink: 0; /* Предотвращает сжатие кнопок */
}

.answer-button {
    background-color: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.2s ease, background-color 0.2s ease;
    text-align: left;
}

/* Убираем кнопку "Отправить" */
.submit-button {
    display: none;
}

/* Стили для анимации ответа */
.answer-button.correct {
    background-color: #28a745; /* Зеленый */
    border-color: #28a745;
    color: white;
    transform: scale(1.03); /* Эффект "выделения" */
}

.answer-button.incorrect {
    background-color: #dc3545; /* Красный */
    border-color: #dc3545;
    color: white;
    transform: scale(1.03);
}


/* Нижнее меню */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    background-color: #FFFFFF;
    border-top: 1px solid #E0E0E0;
    padding: 10px 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    z-index: 10;
}

.nav-item {
    background: none;
    border: none;
    font-size: 0.8em;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.nav-item span {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.nav-item.active {
    color: #C6A664;
}

/* ======================================================= */
/* БЛОК: Попап с пояснением                                */
/* ======================================================= */
#explanation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
    box-sizing: border-box;
}

.explanation-popup {
    background-color: #FFFFFF;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 350px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

#explanation-text {
    font-size: 1em;
    line-height: 1.6;
    margin: 0 0 20px 0;
    color: #1C1C28;
}

#explanation-ok-btn {
    background-color: #C6A664;
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 12px 40px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

#explanation-ok-btn:hover {
    background-color: #b3955a;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ======================================================= */
/* БЛОК: Уведомление об ошибке                             */
/* ======================================================= */
#error-toast {
    position: fixed;
    bottom: 90px; 
    left: 50%;
    transform: translateX(-50%);
    background-color: #dc3545; 
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 101;
    font-weight: 500;
    pointer-events: none; 
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ======================================================= */
/* БЛОК: Стили для ИТОГОВ ДНЯ (Геймификация)               */
/* ======================================================= */

/* Оверлей (фон) - Добавлен start-screen */
#summary-screen, #promo-screen, #start-screen, #achievement-popup, #congrats-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 102;
    padding: 20px;
    box-sizing: border-box;
}

.summary-container {
    background: #ffffff;
    padding: 24px;
    border-radius: 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUpFade 0.4s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

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

.summary-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 20px 0;
    color: #d946ef; 
}

.summary-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card, .monthly-goal {
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    padding: 12px 16px;
    background: #fff;
    text-align: left;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 700;
    color: #4B5563; 
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icon {
    font-size: 20px;
}

.progress-track {
    background: #E5E7EB;
    height: 16px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.progress-track.large {
    height: 24px;
    border-radius: 12px;
}

.progress-fill {
    height: 100%;
    border-radius: 8px;
    width: 0%; 
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    z-index: 2;
}

/* Цвета прогресс-баров */
.purple { background: #d946ef; } 
.blue { background: #3b82f6; }   
.green { background: #58cc02; }  
.gold { background: #f59e0b; }   


/* ======================================================= */
/* СТИЛИ ДЛЯ ЭКРАНА "АНОНС" И СТАРТА                       */
/* ======================================================= */

.summary-score-title {
    font-size: 26px;
    font-weight: 800;
    color: #28a745; 
    text-align: center;
    margin-bottom: 24px;
    margin-top: 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.promo-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 20px; 
}

.promo-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 20px;
    color: #1C1C28;
}

/* --- НОВЫЕ СТИЛИ ДЛЯ START-SCREEN --- */
.start-title {
    font-size: 1.25rem;
    line-height: 1.3;
    margin-bottom: 10px;
    font-weight: 800;
    color: #1C1C28;
    text-align: center;
}

.start-subtitle {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.4;
    text-align: center;
}
/* ------------------------------------ */

/* Стиль для картинок (Финал и Старт) */
#promo-image, #metacard-image {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    object-fit: cover;
}

.promo-quote {
    font-size: 18px;
    font-style: italic;
    color: #4B5563;
    margin-bottom: 20px;
    line-height: 1.5;
    background-color: #F9FAFB;
    padding: 15px;
    border-radius: 12px;
    border-left: 5px solid #3b82f6;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    
    /* --- НОВЫЕ СТИЛИ ДЛЯ АНИМАЦИИ --- */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.promo-quote.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* ------------------------------------ */

/* Кнопки */
.promo-action-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    color: white;
    margin-top: 10px; 
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.promo-action-btn:active {
    transform: translateY(4px);
    box-shadow: none !important;
}

.promo-action-btn:disabled {
    background-color: #ccc !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

.btn-blue {
    background-color: #3b82f6 !important;
    box-shadow: 0 4px 0 #2563eb !important; 
}

.btn-purple {
    background-color: #8b5cf6 !important;
    box-shadow: 0 4px 0 #7c3aed !important; 
}

.btn-green {
    background-color: #58cc02 !important;
    box-shadow: 0 4px 0 #46a302 !important;
}

/* ======================================================= */
/* 3D СТИЛИ ДЛЯ КАРТЫ (HEARTHSTONE FLIP)                   */
/* ======================================================= */

/* Сцена для 3D */
.card-scene {
    width: 300px;  /* КВАДРАТ */
    height: 300px; /* КВАДРАТ */
    perspective: 1000px;
    margin-bottom: 20px;
}

/* Сама карточка (контейнер для front и back) */
.card-object {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Пружинный эффект */
    
    /* Анимация "парения" в воздухе */
    animation: floating 3s ease-in-out infinite;
}

/* Класс для переворота */
.card-object.flipped {
    transform: rotateY(180deg);
}

/* Стороны карты */
.card-face {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden; /* Скрываем заднюю сторону */
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
}

.card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Лицевая сторона (сначала скрыта) */
.card-front {
    transform: rotateY(180deg);
}

/* Обратная сторона (рубашка) */
.card-back {
    background-color: #1C1C28; /* Темная подложка */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Анимация парения */
@keyframes floating {
    0% { transform: translateY(0px) rotateY(0deg); }
    50% { transform: translateY(-10px) rotateY(0deg); }
    100% { transform: translateY(0px) rotateY(0deg); }
}

/* Парение для перевернутой карты (чтобы не сбрасывался поворот) */
.card-object.flipped {
    animation: floating-flipped 3s ease-in-out infinite;
}

@keyframes floating-flipped {
    0% { transform: translateY(0px) rotateY(180deg); }
    50% { transform: translateY(-10px) rotateY(180deg); }
    100% { transform: translateY(0px) rotateY(180deg); }
}

/* ======================================================= */
/* --- СТИЛИ ДЛЯ ЭКРАНА "РЕЙТИНГ" ---                      */
/* ======================================================= */

.tabs-container {
    display: flex;
    background-color: #E0E0E0; /* Немного темнее основного фона */
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
}

.tab-button {
    flex: 1;
    padding: 12px 10px;
    border: none;
    background-color: transparent;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    color: #6d7885;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.tab-button.active {
    background-color: #ffffff;
    color: #C6A664; /* Адаптированный цвет */
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.leaderboard-description {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    padding: 0 10px;
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 350px;
}

.leaderboard-list li {
    animation: fadeIn 0.4s ease-out forwards;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    background-color: #FFFFFF;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.leaderboard-item .rank {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    width: 40px;
    text-align: center;
}

.leaderboard-item .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #E0E0E0;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}
        
.leaderboard-item.top-1 .avatar { background-color: #fef3c7; color: #f59e0b; }
.leaderboard-item.top-2 .avatar { background-color: #e5e7eb; color: #6b7280; }
.leaderboard-item.top-3 .avatar { background-color: #fde68a; color: #a16207; }

.leaderboard-item .username {
    font-size: 16px;
    font-weight: 500;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-item .score {
    font-size: 16px;
    font-weight: 700;
    color: #C6A664; /* Адаптированный цвет */
}
        
.leaderboard-item .score-label {
    font-size: 14px;
    font-weight: 400;
    margin-left: 4px;
    color: #666;
}

.user-position-container {
    position: sticky;
    bottom: 0;
    width: 100%;
    max-width: 350px;
    padding: 15px 0 5px 0;
    margin-top: 15px;
    background: linear-gradient(to top, #F2F3F5 80%, rgba(242,243,245,0)); /* Адаптированный фон */
    pointer-events: none;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform: translateY(0);
    opacity: 1;
}

.user-position-container.hidden {
    transform: translateY(150%);
    opacity: 0;
}

/* Класс для подсветки пользователя в общем списке и в плашке */
.user-position, .in-list-highlight {
    border: 2px solid #C6A664; /* Адаптированный цвет */
    background-color: #fffbe6; /* Адаптированный цвет */
}

.in-list-highlight {
     transform: scale(1.02);
}

#loading-indicator {
    text-align: center;
    padding: 15px;
    font-size: 14px;
    color: #888;
    display: none;
    width: 100%;
}

/* ======================================================= */
/* --- СТИЛИ ДЛЯ ЭКРАНА "ИСТОРИЯ" ---                      */
/* ======================================================= */

.history-stats-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 350px;
    margin-bottom: 25px;
    gap: 15px;
    flex-shrink: 0;
}

.history-stat-card {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 15px;
    flex: 1;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #C6A664; /* Золотой акцент */
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
}

.history-subtitle {
    width: 100%;
    max-width: 350px;
    text-align: left;
    margin-bottom: 15px;
    font-size: 18px;
    color: #1C1C28;
    font-weight: 700;
    flex-shrink: 0;
}

.history-list {
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
}

/* Карточка одного ответа */
.history-card {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 5px solid transparent; /* Цветная полоска статуса */
    position: relative;
    overflow: hidden;
}

.history-card:active {
    transform: scale(0.98);
}

/* Статусы (Цвета полоски) */
.history-card.correct {
    border-left-color: #28a745; /* Зеленый */
}

.history-card.incorrect {
    border-left-color: #dc3545; /* Красный */
}

/* Заголовок карточки (видимая часть) */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-question-preview {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Троеточие для длинного текста */
    margin-right: 10px;
    text-align: left;
}

.history-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Раскрывающаяся часть (Аккордеон) */
.history-details {
    display: none; /* Скрыто по умолчанию */
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    text-align: left;
    animation: fadeIn 0.3s ease;
}

/* Состояние: РАСКРЫТО */
.history-card.expanded .history-details {
    display: block;
}

.history-card.expanded .history-question-preview {
    white-space: normal; /* Показываем полный текст */
    font-weight: 700;
}

.history-card.expanded {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Внутренние блоки подробностей */
.detail-block {
    margin-bottom: 12px;
}

.detail-label {
    font-weight: 700;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.detail-text {
    color: #333;
}

.detail-text.correct-answer {
    color: #28a745;
    font-weight: 600;
}

/* ======================================================= */
/* --- СТИЛИ ДЛЯ ЭКРАНА "ПРОФИЛЬ" (ACHIEVEMENTS) ---       */
/* ======================================================= */

.profile-header-card {
    display: flex;
    align-items: center;
    background-color: #FFFFFF;
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #e6f3ff;
    color: #C6A664;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 30px;
    margin-right: 20px;
    border: 3px solid #F0F2F5;
}

.profile-info h2 {
    margin: 0;
    font-size: 20px;
    color: #1C1C28;
    line-height: 1.2;
}

.profile-level {
    display: inline-block;
    margin-top: 5px;
    background-color: #F0F2F5;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

/* Блок Стрика */
.streak-card {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #FF9F43 0%, #FF6B6B 100%);
    border-radius: 20px;
    padding: 15px 20px;
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.streak-icon {
    font-size: 36px;
    margin-right: 15px;
}

.streak-count {
    font-size: 20px;
    font-weight: 800;
}

.streak-label {
    font-size: 13px;
    opacity: 0.9;
}

/* Сетка достижений */
.achievements-title {
    width: 100%;
    max-width: 350px;
    text-align: left;
    margin-bottom: 15px;
    font-size: 18px;
    color: #1C1C28;
    font-weight: 700;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 в ряд */
    gap: 15px;
    width: 100%;
    max-width: 350px;
}

.achievement-item {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    cursor: pointer;
    transition: transform 0.2s;
}

.achievement-item:active {
    transform: scale(0.95);
}

.ach-icon-wrapper {
    width: 50px;
    height: 50px;
    background-color: #F8F9FA;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.ach-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

/* Состояние: ЗАКРЫТО */
.achievement-item.locked .ach-icon-wrapper {
    filter: grayscale(100%);
    opacity: 0.5;
}

.achievement-item.locked .ach-icon-wrapper::after {
    content: '🔒';
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 14px;
    filter: grayscale(0); /* Замок цветной? Нет, пусть тоже будет серым */
}

/* Состояние: ОТКРЫТО */
.achievement-item.unlocked .ach-icon-wrapper {
    background-color: #fffbe6; /* Золотистый фон */
    box-shadow: 0 4px 10px rgba(198, 166, 100, 0.2);
}

/* Модальное окно ачивки */
.achievement-modal {
    background: #ffffff;
    padding: 30px 20px;
    border-radius: 24px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.ach-modal-icon {
    font-size: 60px;
    margin-bottom: 15px;
    background: #F8F9FA;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.ach-modal-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 10px;
    color: #1C1C28;
}

.ach-modal-status {
    font-size: 14px;
    font-weight: 700;
    color: #dc3545; /* Красный по дефолту */
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.unlocked-status {
    color: #28a745 !important;
}

.ach-modal-desc {
    font-size: 15px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 25px;
}

/* Попап ПОЗДРАВЛЕНИЯ */
.congrats-theme {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    border: 4px solid #C6A664;
}

.congrats-header {
    font-size: 14px;
    font-weight: 800;
    color: #C6A664;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.pulse-anim {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(198, 166, 100, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(198, 166, 100, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(198, 166, 100, 0); }
}
/* ======================================================= */
/* --- НОВЫЕ СТИЛИ ДЛЯ ЗОЛОТОЙ АЧИВКИ (REWARD) ---         */
/* ======================================================= */

/* Золотая тема для модального окна (добавляется через JS) */
.achievement-modal.gold-theme {
    border: 4px solid #C6A664; /* Золотая рамка */
    background: linear-gradient(160deg, #ffffff 60%, #fff4d1 100%); /* Легкий золотистый градиент */
    box-shadow: 0 20px 60px rgba(198, 166, 100, 0.5); /* Золотое свечение */
}

/* Спецэффект для иконки внутри золотого окна */
.achievement-modal.gold-theme .ach-modal-icon {
    background-color: #fff9e6;
    color: #C6A664;
    border: 2px solid #C6A664;
}

/* Пульсация для кнопки "Забрать награду" */
#ach-modal-action {
    margin-top: 15px;
    width: 100%;
    animation: pulse-btn 2s infinite;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4); /* Зеленое свечение кнопки */
}

@keyframes pulse-btn {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}