/* === БАЗОВЫЕ НАСТРОЙКИ === */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a2e; /* Темно-синий фон */
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
    overflow: hidden; /* Убираем скроллбары страницы */
}

/* === ГЛАВНАЯ ОБЕРТКА (Flexbox) === */
.main-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* --- ЛЕВАЯ ЧАСТЬ (ИГРА) --- */
.game-area {
    flex: 3;
    display: flex;
    flex-direction: column;
    padding: 40px;
    /* Важно: relative задает систему координат для абсолютных элементов внутри */
    position: relative; 
    background: radial-gradient(circle at center, #252540 0%, #1a1a2e 70%);
}

/* Хедер (Банк и Цена) */
.stats-header {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Выравнивание по верху, чтобы badge не ломал сетку */
    gap: 60px;
    margin-bottom: 20px;
}

.stat-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрируем бейдж */
}

.vertical-divider {
    width: 2px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
}

.label {
    font-size: 14px;
    font-weight: 600;
    color: #8f8fbc;
    letter-spacing: 2px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.value {
    font-size: 4rem; 
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.money-value {
    color: #00ffc8; /* Тиффани / Неон зеленый */
    text-shadow: 0 0 30px rgba(0, 255, 200, 0.3);
}

.cost-value {
    color: #d866ff; /* Неон фиолетовый */
    font-size: 3rem; /* Чуть меньше банка */
}

/* Центральная сцена */
.center-stage {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 50px;
    /* Добавляем отступ снизу, чтобы таймер не наезжал на рекламу */
    padding-bottom: 120px; 
}

/* Карточка игрока */
.player-card {
    display: flex;
    align-items: center;
    gap: 25px;
    background-color: rgba(255, 255, 255, 0.05); /* Полупрозрачный фон */
    padding: 15px 40px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px); /* Эффект стекла */
}

.avatar-wrapper img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #ffcc00;
    object-fit: cover;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

.player-info {
    display: flex;
    flex-direction: column;
}

.label-small {
    font-size: 12px;
    color: #8f8fbc;
    font-weight: 700;
    letter-spacing: 1px;
}

.player-name {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
}

/* Таймер */
.timer-container {
    text-align: center;
}

.timer-value {
    font-size: 12vw; /* Огромный размер, зависит от ширины экрана */
    font-weight: 900;
    color: #ffcc00;
    line-height: 1;
    font-variant-numeric: tabular-nums; /* Чтобы цифры не скакали */
    text-shadow: 0 0 40px rgba(255, 204, 0, 0.4);
    transition: color 0.2s ease;
}

/* Состояния таймера */
.timer-value.idle-mode {
    color: #ffffff; /* Белый для ожидания */
    opacity: 0.5;
    animation: breath 3s infinite ease-in-out;
    text-shadow: none;
}

.timer-value.timer-critical {
    color: #ff3333; /* Красный */
    animation: shake 0.5s infinite;
}

.timer-value.timer-win {
    color: #00ff00; /* Ярко зеленый */
    font-size: 14vw;
}

/* Рекламный блок */
#ad-block {
    /* Абсолютное позиционирование вырывает блок из потока */
    position: absolute; 
    bottom: 30px; /* Отступ от нижнего края экрана */
    left: 0;
    width: 100%;  /* Растягиваем на всю ширину левой секции */
    display: flex;
    justify-content: center;
    z-index: 10; /* Гарантируем, что он будет ПОВЕРХ всего */
}

.ad-content {
    background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(255, 204, 0, 0.15) 50%, rgba(0,0,0,0) 100%);
    padding: 15px 40px;
    border-top: 1px solid rgba(255, 204, 0, 0.3);
    border-bottom: 1px solid rgba(255, 204, 0, 0.3);
    text-align: center;
    width: 90%;
    /* Добавим легкий блюр фона, чтобы текст читался даже поверх элементов игры */
    backdrop-filter: blur(5px); 
    animation: adGlow 3s infinite ease-in-out;
}

.ad-title {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #ffcc00;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ad-subtitle {
    font-size: 13px;
    color: #ddd;
    font-weight: 500;
}

/* --- ПРАВАЯ ЧАСТЬ (САЙДБАР) --- */
.sidebar {
    flex: 1; /* Занимает 25% ширины */
    background-color: rgba(0, 0, 0, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #8f8fbc;
    letter-spacing: 1px;
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    margin-top: 15px;
}

.winners-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto; /* Скролл если много победителей */
}

.winner-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideIn 0.5s ease;
}

.winner-item:first-child {
    background: rgba(255, 204, 0, 0.05); /* Подсветка последнего победителя */
    padding: 15px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 0, 0.2);
}

.winner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #00ffc8;
}

.winner-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.w-name {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.w-amount {
    font-weight: 600;
    font-size: 14px;
    color: #00ffc8;
}

/* --- АНИМАЦИИ --- */
@keyframes breath {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

@keyframes adGlow {
    0%, 100% { border-color: rgba(255, 204, 0, 0.3); }
    50% { border-color: rgba(255, 204, 0, 0.8); }
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.timer-value.long-text {
    font-size: 5vw !important; /* Уменьшаем с 12vw до 5vw (в 2.5 раза меньше) */
    line-height: 1.2;          /* Увеличиваем межстрочный интервал для читаемости */
    white-space: pre-wrap;     /* Разрешаем перенос строк если нужно */
    color: #ffffff !important; /* Белый цвет */
    text-shadow: none;
    animation: none;           /* Убираем тряску/пульсацию, чтобы было читаемо */
}