body {
    font-family: 'Arial', sans-serif;
    color: #fff; /* Белый текст */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* ИЗМЕНЕНИЕ: Анимированный фон */
    background: linear-gradient(-45deg, #0b0c1a, #121827, #1a233a, #0b0c1a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

/* ИЗМЕНЕНИЕ: Анимация для фона */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-container {
    flex-grow: 1;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 15px;
}

.avatar {
    width: 35px;
    height: 35px;
    background-color: transparent;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #5faee3;
}

.username {
    font-weight: bold;
    font-size: 1.1em;
}

.balance {
    display: flex;
    align-items: center;
}

.add-balance {
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
    margin-right: 8px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
    transition: background-color 0.2s, transform 0.1s;
}

.add-balance:hover {
    background-color: #2980b9;
}
/* ИЗМЕНЕНИЕ: Реакция на нажатие */
.add-balance:active {
    transform: scale(0.9);
}

.star-balance, .gem-balance {
    background-color: #1e273a;
    padding: 8px 12px;
    border-radius: 8px;
    margin-left: 5px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #2c3e50;
}
.star-balance { color: #f39c12; }
.gem-balance { color: #9b59b6; }


.cases-section { margin-bottom: 30px; }
.section-title {
    color: #eee;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.6em;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #3498db;
    margin: 10px auto 0;
    border-radius: 2px;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.case-item {
    background-color: #1e273a;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #2c3e50;
}
.case-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
/* ИЗМЕНЕНИЕ: Реакция на нажатие */
.case-item:active {
    transform: translateY(-2px) scale(0.97);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* ИЗМЕНЕНИЕ: Анимация пульсации */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); }
    50% { transform: scale(1.02); box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3); }
    100% { transform: scale(1); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); }
}
/* ИЗМЕНЕНИЕ: Применяем анимацию к самому дорогому кейсу */
.case-item[data-case="director"] {
    animation: pulse 2.5s infinite ease-in-out;
}

.case-image {
    background-color: #2c3e50;
    height: 100px;
    margin-bottom: 10px;
    border-radius: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.case-item[data-case="bombzh"] .case-image { background-image: url('images/case_bombzh.png'); }
.case-item[data-case="rabotyaga"] .case-image { background-image: url('images/case_rabotyaga.png'); }
.case-item[data-case="office-clerk"] .case-image { background-image: url('images/case_clerk.png'); }
.case-item[data-case="director"] .case-image { background-image: url('images/case_director.png'); }

.case-info { display: flex; flex-direction: column; align-items: center; }
.case-name { font-weight: bold; margin-bottom: 8px; font-size: 1.2em; color: #eee; }
.case-price { font-size: 1.1em; color: #f39c12; font-weight: bold; }

/* Модальное окно */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.8); justify-content: center; align-items: center; }
.modal-content { background-color: #1e273a; padding: 30px; border-radius: 20px; width: 90%; max-width: 450px; text-align: center; position: relative; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); border: 1px solid #2c3e50; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.close-button { position: absolute; top: 15px; right: 15px; color: #ccc; font-size: 28px; font-weight: bold; cursor: pointer; transition: color 0.2s; }
.close-button:hover, .close-button:focus { color: #fff; }
#modal-title { color: #eee; margin-bottom: 25px; font-size: 1.8em; text-shadow: 0 0 5px rgba(255, 255, 255, 0.2); }
#modal-result { background-color: #121827; border: 2px dashed #3498db; padding: 25px; margin-top: 20px; border-radius: 12px; min-height: 100px; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 1.2em; font-weight: bold; color: #fff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.3); word-break: break-word; }
#modal-result p { margin: 5px 0; }
#modal-result strong { font-size: 1.4em; color: #f39c12; }
#modal-result em { font-size: 0.9em; color: #bbb; font-weight: normal; }
#modal-result.win { color: #2ecc71; border-color: #2ecc71; text-shadow: 0 0 10px rgba(46, 204, 113, 0.5); }
#modal-result.win strong { color: #2ecc71; }

/* ИЗМЕНЕНИЕ: Стили для анимации рулетки и результата */
.roulette-container {
    overflow: hidden;
    height: 50px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.roulette-item {
    animation: slideDown 0.075s linear;
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.prize-reveal {
    animation: prizeReveal 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
@keyframes prizeReveal {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
/* --- Конец новых стилей для модального окна --- */


/* Нижняя навигация */
.bottom-navigation { background-color: #121827; display: flex; justify-content: space-around; padding: 15px 0; border-top: 1px solid #1e273a; position: sticky; bottom: 0; width: 100%; box-sizing: border-box; box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3); }
.nav-item { background: none; color: #8892a0; border: none; padding: 10px 15px; cursor: pointer; font-size: 0.9em; font-weight: bold; transition: color 0.2s, transform 0.1s; }
.nav-item.active { color: #3498db; }
.nav-item:hover:not(.active) { color: #ccc; }
/* ИЗМЕНЕНИЕ: Реакция на нажатие */
.nav-item:active { transform: scale(0.95); }

/* Медиа-запросы */
@media (max-width: 480px) {
    .app-header { flex-direction: column; gap: 15px; }
    .user-info, .balance { width: 100%; justify-content: center; }
    .cases-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .case-item { padding: 10px; }
    .case-image { height: 80px; }
    .case-name { font-size: 1em; }
    .case-price { font-size: 0.9em; }
    .modal-content { padding: 20px; }
    #modal-title { font-size: 1.5em; }
    #modal-result { font-size: 1em; padding: 15px; }
    #modal-result strong { font-size: 1.2em; }
}