/* bot_app/web_app/css/pages/upgrade-game.css */


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

.upgrade-game-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto; /* Rows for roulette, button, controls */
    grid-template-areas:
        "roulette-area"
        "button-area"
        "controls-area";
    align-items: center;
    padding: 20px;
    gap: 15px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-sizing: border-box;
}



.upgrade-roulette-container {
    grid-area: roulette-area;
    width: clamp(250px, 80vw, 320px);
    height: clamp(250px, 80vw, 320px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto; /* Center horizontally within its grid area */
}

.roulette-pointer {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #28a745; /* Зеленый цвет в тематике проекта */
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(40, 167, 69, 0.5));
}

#upgrade-roulette-canvas {
    width: 100%;
    height: 100%;
    transition: transform 5s cubic-bezier(0.25, 0.1, 0.25, 1);
    border-radius: 50%;
    /* Современный дизайн с градиентной рамкой */
    border: 4px solid transparent;
    background: linear-gradient(45deg, #28a745, #20c997, #17a2b8, #6f42c1) border-box;
    background-clip: padding-box;
    box-shadow: 
        0 8px 32px rgba(40, 167, 69, 0.3),
        0 4px 16px rgba(32, 201, 151, 0.2),
        inset 0 0 30px rgba(0,0,0,0.4);
    position: relative;
}

#upgrade-roulette-canvas::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: linear-gradient(45deg, #28a745, #20c997, #17a2b8, #6f42c1);
    z-index: -1;
    animation: rotate-border 3s linear infinite;
}

@keyframes rotate-border {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.roulette-center-image {
    width: 28%;
    height: 28%;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    position: absolute;
    border: 3px solid #28a745;
    box-shadow: 
        0 0 20px rgba(40, 167, 69, 0.6),
        0 0 40px rgba(40, 167, 69, 0.3),
        inset 0 0 15px rgba(0,0,0,0.5);
    object-fit: cover;
    z-index: 15;
    display: none;
    transition: all 0.3s ease;
}

.roulette-center-image.visible {
    display: block;
    animation: center-glow 2s ease-in-out infinite alternate;
}

@keyframes center-glow {
    0% { 
        box-shadow: 
            0 0 20px rgba(40, 167, 69, 0.6),
            0 0 40px rgba(40, 167, 69, 0.3),
            inset 0 0 15px rgba(0,0,0,0.5);
    }
    100% { 
        box-shadow: 
            0 0 30px rgba(40, 167, 69, 0.8),
            0 0 60px rgba(40, 167, 69, 0.5),
            inset 0 0 15px rgba(0,0,0,0.5);
    }
}

.upgrade-button-area {
    grid-area: button-area;
    justify-self: center; /* Center the button horizontally */
    margin-top: 15px; /* Small offset below the roulette */
    width: 100%; /* Ensure it takes full width for centering */
    display: flex;
    justify-content: center;
    z-index: 1;
}

#upgrade-button {
    width: 80%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.1rem;
}

#upgrade-button:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.upgrade-controls {
    grid-area: controls-area;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin-top: 15px; /* Add some space below the button area */
}

.item-selection-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.item-slot {
    flex: 1; /* Allow slots to grow and shrink */
    max-width: 150px; /* Set a max-width to prevent them from becoming too large */
    height: 130px;
    background-color: var(--primary-color);
    border: 2px dashed var(--secondary-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    color: var(--text-color-secondary);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.item-slot.filled {
    border-style: solid;
    border-color: var(--accent-color);
    background-color: #2a2a2a; /* Немного светлее фон при заполнении */
}

.slot-placeholder {
    font-size: 0.9rem;
}

.item-slot-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 5px;
}

.item-slot-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.item-slot-price {
    font-size: 0.75rem;
    color: var(--text-color-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-buttons-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    gap: 10px;
}

.item-buttons-container .button-secondary {
    flex: 1; /* Make buttons take equal width */
    max-width: 150px; /* Match max-width of item-slot */
}

.scrollable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 320px; /* Уменьшили высоту для двух строк */
    overflow-y: auto;
    padding: 0;
    width: 100%;
}

/* Стили для карточек предметов инвентаря в модальном окне апгрейда */
#upgrade-inventory-grid .inventory-item {
    background-color: var(--primary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 150px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#upgrade-inventory-grid .inventory-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#upgrade-inventory-grid .inventory-item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 4px;
}

#upgrade-inventory-grid .inventory-item-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#upgrade-inventory-grid .inventory-item-name {
    font-size: 13px;
    font-weight: 500;
    word-break: break-word;
    margin-bottom: 4px;
}

#upgrade-inventory-grid .inventory-item-price {
    font-size: 12px;
    color: #FFCA5A;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Стили для карточек наград в модальном окне апгрейда */
#upgrade-target-grid .reward-card {
    background-color: var(--bg-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(50% - 10px);
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#upgrade-target-grid .reward-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#upgrade-target-grid .reward-card .reward-card-image-placeholder {
    font-size: 55px;
    width: 90px;
    height: 90px;
    background: none;
}

#upgrade-target-grid .reward-card .reward-card-name {
    font-size: clamp(12px, 3vw, 18px);
    font-weight: bold;
    margin: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
}

#upgrade-target-grid .reward-card .reward-card-price {
    font-size: 14px;
    color: #FFCA5A;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

#upgrade-target-grid .reward-card .reward-card-price svg {
    width: 14px;
    height: 14px;
}

/* Стили для модального окна результата */
#upgrade-result-modal .modal-content {
    text-align: center;
}

#upgrade-result-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

#upgrade-result-title.win {
    color: #4CAF50; /* Зеленый для победы */
}

#upgrade-result-title.lose {
    color: #F44336; /* Красный для поражения */
}

#upgrade-result-item-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

#upgrade-result-item-display img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

#upgrade-result-item-display p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color-primary);
}

#upgrade-result-close-btn {
    width: 100%;
}

/* Стили для модальных окон выбора предметов/призов в игре "Апгрейд" */
#upgrade-inventory-modal .modal-content,
#upgrade-target-modal .modal-content {
    width: 90%; /* Чуть шире, чем 85% по умолчанию, но все еще ограничено */
    max-width: 350px; /* Уменьшим максимальную ширину для более компактного вида */
    max-height: 70vh; /* Уменьшим максимальную высоту модального окна */
    padding: 0; /* Уберем внутренние отступы, чтобы содержимое занимало больше места */
    display: flex;
    flex-direction: column;
}

#upgrade-inventory-modal .modal-header,
#upgrade-target-modal .modal-header {
    padding: 15px 20px; /* Отступы для заголовка */
}

#upgrade-inventory-modal .modal-body,
#upgrade-target-modal .modal-body {
    flex-grow: 1; /* Позволит телу модального окна занимать все доступное пространство */
    overflow-y: auto; /* Прокрутка для содержимого */
    padding: 15px; /* Отступы внутри тела */
}

#upgrade-inventory-grid,
#upgrade-target-grid {
    width: 100%; /* Убедимся, что сетка занимает всю доступную ширину */
    box-sizing: border-box; /* Включаем padding и border в общую ширину */
    padding: 0; /* Уберем padding, так как он уже есть в modal-body */
}
