/* --- Цветовая палитра Темная с синими акцентами (Winbet-like) --- */
:root {
    /* Темные фоны */
    --dice-theme-bg: #1c1f30; /* Основной фон контейнера (очень темный сине-серый) */
    --dice-theme-bg-secondary: #20273a; /* Фон для элементов управления, правой колонки (чуть светлее) */
    --dice-theme-bg-tertiary: #20273a; /* Фон для инпутов, кнопок по умолчанию */

    /* Светло-синие акценты */
    --dice-theme-primary: #4a90e2; /* Основной синий для активных кнопок, акцентов (ярче) */
    --dice-theme-primary-hover: #5dade2; /* Синий при наведении */
    --dice-theme-primary-active: #3498db; /* Синий при нажатии */

    /* Текст */
    --dice-theme-text-primary: #e1e4e8; /* Основной светлый текст */
    --dice-theme-text-secondary: #909db1; /* Вторичный, более тусклый текст (лейблы) */
    --dice-theme-text-on-primary: #ffffff; /* Текст на синих кнопках */

    /* Границы и разделители */
    --dice-theme-border: #3a3f50; /* Цвет границ */
    --dice-theme-border-focus: var(--dice-theme-primary); /* Цвет границы при фокусе */

    /* Статусы */
    --dice-theme-win: #2ecc71; /* Цвет выигрыша (зеленый) */
    --dice-theme-win-bg: rgba(46, 204, 113, 0.15); /* Фон для выигрыша */
    --dice-theme-win-border: rgba(46, 204, 113, 0.3);
    --dice-theme-lose: #e74c3c; /* Цвет проигрыша (красный) */
    --dice-theme-lose-bg: rgba(231, 76, 60, 0.15); /* Фон для проигрыша */
    --dice-theme-lose-border: rgba(231, 76, 60, 0.3);

    /* Отключенные состояния */
    --dice-theme-disabled-bg: #313543;
    --dice-theme-disabled-text: #6a7383;
    --dice-theme-disabled-border: #404557;

    /* Бананы (если используются) */
    --dice-theme-banana-glow: rgba(74, 144, 226, 0.2); /* Свечение банана */
}

/* --- Общий контейнер --- */
.dice-game-container-lb {
    display: flex;
    gap: 30px;
    background-color: var(--dice-theme-bg);
    padding: 30px;
    border-radius: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 900px;
    margin: 35px auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--dice-theme-border);
}

/* --- Колонки --- */
.dice-left-column-lb,
.dice-right-column-lb {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dice-right-column-lb {
    align-items: center;
    justify-content: center;
    background-color: var(--dice-theme-bg-secondary);
    padding: 30px 30px 0 30px;
    border-radius: 12px;
    position: relative;
}

/* --- Группы контролов --- */
.dice-control-group-lb {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --- Лейблы --- */
.dice-input-label-lb {
    font-size: 14px;
    color: var(--dice-theme-text-secondary);
    font-weight: 500;
    margin-left: 5px;
}

/* --- Инпуты --- */
.dice-input-wrapper-lb {
    position: relative;
}

.dice-input-lb {
    width: 100%;
    padding: 12px 15px;
    padding-right: 40px;
    background-color: var(--dice-theme-bg-tertiary); /* Используем указанный цвет */
    border: 1px solid var(--dice-theme-border);
    border-radius: 8px;
    font-size: 16px;
    color: var(--dice-theme-text-primary);
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dice-input-lb:focus {
    outline: none;
    border-color: var(--dice-theme-border-focus);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
.dice-input-lb[readonly] {
    /* background-color: #2a2e3b; */ /* Можно сделать чуть другим, если нужно */
    cursor: default;
}
.dice-input-lb:disabled {
    background-color: var(--dice-theme-disabled-bg);
    color: var(--dice-theme-disabled-text);
    border-color: var(--dice-theme-disabled-border);
    cursor: not-allowed;
}

.dice-input-suffix-lb {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dice-theme-text-secondary);
    font-size: 16px;
}

/* --- Кнопки-помощники (ставки и шансы) --- */
.dice-helpers-lb {
    display: grid;
    gap: 8px;
}
.dice-helpers-lb--bet {
     grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
}
.dice-helpers-lb--chance {
    grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
}

.dice-helpers-lb button {
    padding: 8px 5px;
    font-size: 13px;
    font-weight: 600;
    background-color: var(--dice-theme-bg-tertiary); /* Используем указанный цвет */
    color: var(--dice-theme-text-secondary);
    border: 1px solid var(--dice-theme-border);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease, color 0.2s ease;
    text-align: center;
}

.dice-helpers-lb button:hover:not(:disabled) {
    background-color: #2a2e3b; /* Чуть светлее */
    border-color: var(--dice-theme-primary);
    color: var(--dice-theme-text-primary);
}

.dice-helpers-lb button:active:not(:disabled) {
    transform: scale(0.96);
    background-color: #313543;
}

/* Активная кнопка шанса */
.dice-helpers-lb--chance button.active {
    background-color: var(--dice-theme-primary);
    color: var(--dice-theme-text-on-primary);
    border-color: var(--dice-theme-primary);
    font-weight: 700;
}

.dice-helpers-lb button:disabled {
    background-color: var(--dice-theme-disabled-bg);
    color: var(--dice-theme-disabled-text);
    border-color: var(--dice-theme-disabled-border);
    cursor: not-allowed;
}


/* --- Правая колонка: Возможный выигрыш --- */
.dice-potential-win-lb {
    text-align: center;
    margin-bottom: 30px;
}

.dice-potential-win-amount-lb {
    font-size: 48px;
    font-weight: 700;
    color: var(--dice-theme-text-primary);
    line-height: 1.1;
}

.dice-currency-symbol-lb {
    font-weight: 500;
    color: var(--dice-theme-text-secondary);
}

.dice-potential-win-label-lb {
    font-size: 14px;
    color: var(--dice-theme-text-secondary);
    margin-top: 5px;
}

/* --- Правая колонка: Кнопки Играть --- */
.dice-play-buttons-lb {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.dice-play-button-wrapper-lb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 200px;
}

.dice-play-button-lb {
    width: 100%;
    padding: 18px 20px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    background-color: var(--dice-theme-primary);
    color: var(--dice-theme-text-on-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.dice-play-button-lb:hover:not(:disabled) {
    background-color: var(--dice-theme-primary-hover);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2), 0 0 10px rgba(74, 144, 226, 0.3);
}
.dice-play-button-lb:active:not(:disabled) {
    background-color: var(--dice-theme-primary-active);
    transform: scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.dice-play-button--less,
.dice-play-button--more { /* Стили наследуются */ }

.dice-play-button-lb:disabled {
    background-color: var(--dice-theme-disabled-bg);
    color: var(--dice-theme-disabled-text);
    cursor: not-allowed;
    box-shadow: none;
}

/* Индикатор загрузки на кнопке */
.dice-play-button-lb.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--dice-theme-text-on-primary);
    border-radius: 50%;
    animation: dice-spin 0.8s linear infinite;
}

@keyframes dice-spin {
    to { transform: rotate(360deg); }
}


.dice-range-label-lb {
    font-size: 13px;
    color: var(--dice-theme-text-secondary);
}

/* --- Область результата последней игры --- */
.dice-last-result-lb {
    /* margin-top: 25px; */
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    min-height: 40px; /* Предотвращает "прыжок" макета */
    width: 85%;
    max-width: 350px;
    box-sizing: border-box;
    /* Начальное состояние для анимации */
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    /* Плавный переход для СКРЫТИЯ через класс .hiding */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    /* Важно: НЕ ИСПОЛЬЗОВАТЬ display: none; здесь */
}

/* Анимация появления */
@keyframes diceResultEnterAnimation {
  0% {
    opacity: 0;
    transform: translateY(25px) scale(0.9);
  }
  60% {
      opacity: 1;
      transform: translateY(-5px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Применение анимации появления при добавлении классов .win или .lose */
.dice-last-result-lb.win,
.dice-last-result-lb.lose {
    /* animation запускает появление и удерживает конечное состояние */
    animation: diceResultEnterAnimation 0.45s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
}

/* Стили состояний */
.dice-last-result-lb.win {
    background-color: var(--dice-theme-win-bg);
    color: var(--dice-theme-win);
    border: 1px solid var(--dice-theme-win-border);
}
.dice-last-result-lb.lose {
    background-color: var(--dice-theme-lose-bg);
    color: var(--dice-theme-lose);
    border: 1px solid var(--dice-theme-lose-border);
}

/* Состояние для плавного скрытия через JS + CSS transition */
.dice-last-result-lb.hiding {
    opacity: 0;
    transform: translateY(10px) scale(0.95); /* Эффект ухода */
    /* transition уже задан в базовом .dice-last-result-lb */
}


/* --- Кнопка Проверить игру --- */
.dice-check-button-wrapper-lb {
    margin-botton: 15px;
}
.dice-footer-button-lb {
    background: none;
    border: none;
    color: var(--dice-theme-text-secondary);
    cursor: pointer;
    padding: 5px;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}
.dice-footer-button-lb:hover {
    color: var(--dice-theme-primary);
    text-decoration: underline;
}

/* --- Декоративные бананы (если используются) --- */
.dice-banana-deco {
    position: absolute;
    width: 100px;
    height: auto;
    opacity: 0.6;
    pointer-events: none;
    filter: drop-shadow(0 5px 15px var(--dice-theme-banana-glow));
}
.dice-banana-deco--top-left {
    top: -20px;
    left: -20px;
    transform: rotate(-30deg);
}
.dice-banana-deco--bottom-right {
    bottom: -20px;
    right: -15px;
    transform: rotate(20deg) scaleX(-1);
     width: 80px;
}

/* --- Адаптивность --- */
@media (max-width: 768px) {
    .dice-game-container-lb {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    .dice-right-column-lb {
        padding: 20px;
    }
    .dice-potential-win-amount-lb {
        font-size: 36px;
    }
    .dice-play-buttons-lb {
        gap: 15px;
    }
     .dice-play-button-lb {
        padding: 15px;
        font-size: 16px;
    }
    .dice-helpers-lb--bet,
    .dice-helpers-lb--chance {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    }
     .dice-banana-deco {
        width: 60px;
        opacity: 0.5;
    }
    .dice-banana-deco--top-left {
        top: -15px; left: -15px;
    }
     .dice-banana-deco--bottom-right {
        bottom: -15px; right: -15px; width: 50px;
    }
    .dice-last-result-lb {
        width: 95%;
    }
}