/* /home/amil8ka/bot/web_app/css/pages/dice-game.css */

/* Стиль для кнопки "Назад" в заголовке страницы дуэли (копия стиля со страницы кейса) */


#dice-game-page .page-header h1 {
    /* Стили наследуются из layout.css */
}



/* Стили для фильтра минимальной цены в модальном окне */
#dice-min-price-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background-color: var(--secondary-color);
    border-radius: 8px;
}

#dice-min-price-filter label {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

#dice-min-price-filter .text-input {
    width: 100px;
    text-align: center;
}

#dice-game-wrapper {
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px); /* Full height minus header */
    box-sizing: border-box;
}

/* Стили для лобби */
#dice-lobby-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    height: 100%;
}

.lobby-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: center;
}

#create-dice-room-btn, #dice-filter-btn {
    width: 100%;
    flex-shrink: 0;
    height: 42px; /* Ensure same height */
}

#dice-room-list {
    display: grid;
    grid-template-columns: 1fr; /* Одна колонка для списка */
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden; /* Предотвращаем горизонтальный скролл */
    padding: 5px;
    border-radius: 8px;
    background-color: var(--primary-color);
    flex-grow: 1;
}

.dice-room-card {
    background-color: var(--secondary-color);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent-color);
    cursor: pointer;
    transition: background-color 0.2s;
}
.dice-room-card:hover {
    background-color: #3a3a3a;
}

.room-info .room-id {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
}
.room-info .item-name {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.room-details .item-price {
    font-weight: bold;
    color: #FFCA5A;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Стили для игровой комнаты */
#dice-game-view {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    width: 100%;
}

.game-board {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    flex-grow: 1;
    position: relative;
}

.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 120px;
    transition: transform 0.3s;
}

.player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--secondary-color);
    background-color: var(--primary-color);
    transition: border-color 0.3s;
}

/* Стиль для готового игрока */
.player-area.ready .player-avatar {
    border-color: var(--success-color);
    box-shadow: 0 0 15px var(--success-color);
}

.player-name {
    font-weight: bold;
    font-size: 1rem;
    height: 24px; /* Give it a fixed height to prevent layout shifts */
    line-height: 24px;
    transition: opacity 0.2s;
}

/* New container for the Lottie animation */
.dice-animation-container {
    width: 100px;
    height: 100px;
    margin: -14px 0; /* Negative margin to pull it into the space of the name */
    display: none; /* Hidden by default */
}

/* When .animating is added to player-area, hide the name */
.player-area.animating .player-name {
    opacity: 0;
}

/* When .animating is added, show the animation container */
.player-area.animating .dice-animation-container {
    display: block;
}

.player-item-slot {
    width: 100%;
    height: 100px;
    background-color: var(--primary-color);
    border: 2px dashed var(--secondary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5px;
    font-size: 0.8rem;
    color: var(--text-color-secondary);
}
.player-item-slot.filled {
    border-style: solid;
    border-color: var(--accent-color);
}
.player-item-slot img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* Обертка для кнопки "Сменить" для сохранения симметрии */
.change-item-btn-wrapper {
    height: 36px; /* Примерная высота кнопки + отступы */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
}

/* Контейнер для анимации кубиков */
.dice-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 20px;
    z-index: 10;
}

.dice {
    width: 60px;
    height: 60px;
    background-color: #fff;
    color: #000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    border: 2px solid #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Анимация тряски */
.dice-container.shaking {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both infinite;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, -50%, 0); }
  20%, 80% { transform: translate3d(2px, -50%, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, -50%, 0); }
  40%, 60% { transform: translate3d(4px, -50%, 0); }
}


.game-controls {
    display: flex;
    flex-direction: column; /* Stack button and info text */
    align-items: center; /* Center them horizontally */
    gap: 8px; /* Space between button and text */
    padding: 15px 0;
}

/* New style for the game fee information text */
.game-fee-info {
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.game-fee-info .inventory-item-price-icon {
    width: 1em;
    height: 1em;
    position: relative;
    top: 1px;
}

/* Стили для кнопки "Готов" и ее состояний */
#diceGameReadyBtn {
    min-width: 150px;
    /* Base styles are inherited from .button-green in buttons.css */
}

/* Отключенное состояние (когда "Игра..." или оба готовы) */
#diceGameReadyBtn:disabled {
    background-image: none;
    background-color: var(--secondary-color);
    color: var(--text-color-secondary);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
/* Ensure hover doesn't affect disabled button */
#diceGameReadyBtn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Styles for the new Dice Game Create Room Modal */
#dice-create-room-modal .modal-content {
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Make the whole modal scrollable */
}

.dice-room-filters {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 5px; /* Reduced margin */
    padding: 10px;
    background-color: var(--primary-color);
    border-radius: 8px;
    flex-shrink: 0;
}

/* Container for input and attached button/control */
.input-group {
    display: flex;
    height: 42px;
}

.input-group .text-input {
    flex-grow: 1;
    height: 100%;
    margin: 0;
    border-radius: 8px 0 0 8px;
    border-right: none;
    min-width: 0;
}

.input-group .icon-button,
.input-group .stepper-buttons {
    height: 100%;
    flex-shrink: 0;
    border-radius: 0 8px 8px 0;
}

.icon-button {
    background: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    transition: background-color 0.2s, color 0.2s;
}

.icon-button:hover {
    background-color: #4a4a4a;
}

.icon-button.active {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.icon-button svg {
    width: 22px;
    height: 22px;
}

.stepper-buttons {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 42px;
    background: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    padding: 2px;
    box-sizing: border-box;
}

.stepper-btn {
    background: #4f4f4f;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    width: 100%;
    height: calc(50% - 1px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1;
    transition: background-color 0.2s;
}

.stepper-btn:hover {
    background-color: #5a5a5a;
}

/* Hide default number input arrows */
#dice-min-bet-input {
    -moz-appearance: textfield;
}
#dice-min-bet-input::-webkit-outer-spin-button,
#dice-min-bet-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* New styles for password container and input */
.password-container {
    transition: max-height 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

.password-container.visible {
    max-height: 42px; /* Height of the input */
}

#dice-room-password-input {
    height: 42px;
    width: calc(100% - 42px); /* Match width of name input (full width - button width) */
    border-radius: 8px;
    box-sizing: border-box;
}

.inventory-select-prompt {
    text-align: center;
    margin-bottom: 5px; /* Reduced margin */
    font-weight: bold;
    color: var(--text-color-secondary);
    flex-shrink: 0;
}

#dice-create-room-inventory-grid {
    overflow-y: auto;
    /* flex-grow: 1; Removed to allow whole modal to scroll */
    min-height: 150px; /* Increased height */
    padding-right: 5px;
    border-top: 1px solid var(--secondary-color);
    border-bottom: 1px solid var(--secondary-color);
    margin-bottom: 15px;
}

/* Style for selected item in the creation grid */
#dice-create-room-inventory-grid .inventory-item.selected {
    border-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
    transform: none; /* Removed scaling effect */
}

/* Style for the price icon in the inventory grid */
.room-info .room-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* Adjust as needed */
    display: flex;
    align-items: center;
}

.room-info .item-name {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.room-name .lock-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.9em; /* Make it slightly smaller than text */
    position: relative;
    top: -1px; /* Adjust vertical alignment */
    color: var(--text-color-secondary);
}

/* Style for the price icon in the inventory grid */
.inventory-item-price {
    display: flex;
    align-items: center;
    gap: 2px; /* Space between price number and icon */
    color: #FFCA5A;
    font-weight: bold;
}

.inventory-item-price-icon {
    width: 1em;
    height: 1em;
    position: relative;
    top: 1px; /* Adjust vertical alignment */
}

/* Lock icon in the lobby list */
.room-details .lock-icon {
    margin-left: 8px;
    font-size: 1rem;
    color: var(--text-color-secondary);
}

.room-info .room-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* Adjust as needed */
}

.room-info .item-name {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

/* Styles for the new Dice Game Filter Modal */
#dice-filter-modal .modal-content {
    max-width: 400px;
    max-height: 80vh; /* Match create room modal */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Make the whole modal scrollable */
}

#dice-filter-modal .dice-room-filters {
    padding-bottom: 15px;
}

/* Ensure form groups in filter have consistent spacing */
#dice-filter-modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduced gap */
}

#dice-filter-modal .dice-room-filters {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reduced gap between all filter elements */
    margin-bottom: 5px;
    padding: 10px;
    background-color: var(--primary-color);
    border-radius: 8px;
    flex-shrink: 0;
}

/* Hide default number input arrows for filter input */
#dice-filter-min-bet-input {
    -moz-appearance: textfield;
}
#dice-filter-min-bet-input::-webkit-outer-spin-button,
#dice-filter-min-bet-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#dice-filter-modal .modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-top: auto; /* Push buttons to the bottom */
    padding-top: 15px; /* Add some space above buttons */
}

#dice-filter-modal #dice-filter-modal-close-btn {
    grid-column: 1 / -1; /* Кнопка "Закрыть" занимает всю ширину */
}

#dice-filter-gift-select {
    width: 100%;
    height: 42px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    padding: 0 10px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}
#dice-game-ready-btn.button-disabled,
.button-disabled {
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a) !important;
    background-image: linear-gradient(135deg, #4a4a4a, #3a3a3a) !important;
    color: #888 !important;
    cursor: not-allowed !important;
    border: 2px solid #555 !important;
    border-radius: 12px !important;
    padding: 15px 25px !important;
    font-weight: bold !important;
    font-size: 18px !important;
    text-transform: none !important;
    letter-spacing: 0px !important;
    transition: none !important;
    box-shadow: 0 0 15px rgba(74, 74, 74, 0.3) !important;
    width: 100% !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    transform: none !important;
    gap: 5px !important;
}

#dice-game-ready-btn.button-disabled:hover,
.button-disabled:hover {
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a) !important;
    background-image: linear-gradient(135deg, #4a4a4a, #3a3a3a) !important;
    transform: none !important;
    box-shadow: 0 0 15px rgba(74, 74, 74, 0.3) !important;
    scale: 1 !important;
}

#dice-game-ready-btn.button-disabled:focus,
.button-disabled:focus {
    outline: none !important;
    box-shadow: 0 0 15px rgba(74, 74, 74, 0.3) !important;
}

#dice-game-ready-btn.button-disabled:active,
.button-disabled:active {
    transform: none !important;
    scale: 1 !important;
    box-shadow: 0 0 15px rgba(74, 74, 74, 0.3) !important;
}
/* CSS Updated Sat Aug 16 21:15:53 MSK 2025 */

/* Принудительное обновление кеша для кнопки Ждем ставки */
button.button-disabled,
#dice-game-ready-btn.button-disabled {
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a) !important;
    background-image: linear-gradient(135deg, #4a4a4a, #3a3a3a) !important;
    border: 2px solid #555 !important;
    color: #888 !important;
    font-size: 18px !important;
    font-weight: bold !important;
    padding: 15px 25px !important;
    border-radius: 12px !important;
    cursor: not-allowed !important;
    box-shadow: 0 0 15px rgba(74, 74, 74, 0.3) !important;
    text-transform: none !important;
    width: 100% !important;
    gap: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

